/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import e from"../request.js";import{join as o}from"../core/urlUtils.js";import{parseUrl as t}from"./utils.js";import m from"../symbols/CIMSymbol.js";async function a(a,s,n){const r=t(a),g=s.svgImage,i=new FormData;if("FormData"in globalThis&&"HTMLFormElement"in globalThis)if(g instanceof FormData){const e=g.get("svgImage");i.append("svgImage",e,e.name)}else if(g instanceof HTMLFormElement){const e=new FormData(g).get("svgImage");i.append("svgImage",e,e.name)}if("string"==typeof g){const e=new Blob([g.trim()],{type:"image/svg+xml"});i.append("svgImage",e,"symbol.svg")}i.append("f","json");const l={...n,method:"post",body:i},p=o(r.path,"generateSymbol"),{data:f}=await e(p,l);return{symbol:new m({data:{type:"CIMSymbolReference",symbol:f}})}}export{a as generateSymbol};
