svgedit/dist/editor/extensions/ext-imagelib/ext-imagelib.js

13 lines
78 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var check=function(t){return t&&t.Math==Math&&t},e=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof t&&t)||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},r=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i={f:o&&!n.call({1:2},1)?function propertyIsEnumerable(t){var e=o(this,t);return!!e&&e.enumerable}:n},createPropertyDescriptor=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},a={}.toString,classofRaw=function(t){return a.call(t).slice(8,-1)},c="".split,u=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?c.call(t,""):Object(t)}:Object,requireObjectCoercible=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},toIndexedObject=function(t){return u(requireObjectCoercible(t))},isObject=function(t){return"object"==typeof t?null!==t:"function"==typeof t},toPrimitive=function(t,e){if(!isObject(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!isObject(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},s={}.hasOwnProperty,has=function(t,e){return s.call(t,e)},l=e.document,f=isObject(l)&&isObject(l.createElement),documentCreateElement=function(t){return f?l.createElement(t):{}},h=!r&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),p=Object.getOwnPropertyDescriptor,d={f:r?p:function getOwnPropertyDescriptor(t,e){if(t=toIndexedObject(t),e=toPrimitive(e,!0),h)try{return p(t,e)}catch(t){}if(has(t,e))return createPropertyDescriptor(!i.f.call(t,e),t[e])}},anObject=function(t){if(!isObject(t))throw TypeError(String(t)+" is not an object");return t},g=Object.defineProperty,v={f:r?g:function defineProperty(t,e,r){if(anObject(t),e=toPrimitive(e,!0),anObject(r),h)try{return g(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},y=r?function(t,e,r){return v.f(t,e,createPropertyDescriptor(1,r))}:function(t,e,r){return t[e]=r,t},setGlobal=function(t,r){try{y(e,t,r)}catch(n){e[t]=r}return r},m=e["__core-js_shared__"]||setGlobal("__core-js_shared__",{}),b=Function.toString;"function"!=typeof m.inspectSource&&(m.inspectSource=function(t){return b.call(t)});var w,x,S,E=m.inspectSource,O=e.WeakMap,k="function"==typeof O&&/native code/.test(E(O)),j=createCommonjsModule((function(t){(t.exports=function(t,e){return m[t]||(m[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),A=0,L=Math.random(),uid=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++A+L).toString(36)},R=j("keys"),sharedKey=function(t){return R[t]||(R[t]=uid(t))},P={},_=e.WeakMap;if(k){var I=new _,T=I.get,U=I.has,C=I.set;w=function(t,e){return C.call(I,t,e),e},x=function(t){return T.call(I,t)||{}},S=function(t){return U.call(I,t)}}else{var M=sharedKey("state");P[M]=!0,w=function(t,e){return y(t,M,e),e},x=function(t){return has(t,M)?t[M]:{}},S=function(t){return has(t,M)}}var G,N={set:w,get:x,has:S,enforce:function(t){return S(t)?x(t):w(t,{})},getterFor:function(t){return function(e){var r;if(!isObject(e)||(r=x(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},B=createCommonjsModule((function(t){var r=N.get,n=N.enforce,o=String(String).split("String");(t.exports=function(t,r,i,a){var c=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,s=!!a&&!!a.noTargetGet;"function"==typeof i&&("string"!=typeof r||has(i,"name")||y(i,"name",r),n(i).source=o.join("string"==typeof r?r:"")),t!==e?(c?!s&&t[r]&&(u=!0):delete t[r],u?t[r]=i:y(t,r,i)):u?t[r]=i:setGlobal(r,i)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&r(this).source||E(this)}))})),q=e,aFunction=function(t){return"function"==typeof t?t:void 0},getBuiltIn=function(t,r){return arguments.length<2?aFunction(q[t])||aFunction(e[t]):q[t]&&q[t][r]||e[t]&&e[t][r]},D=Math.ceil,$=Math.floor,toInteger=function(t){return isNaN(t=+t)?0:(t>0?$:D)(t)},W=Math.min,toLength=function(t){return t>0?W(toInteger(t),9007199254740991):0},z=Math.max,V=Math.min,toAbsoluteIndex=function(t,e){var r=toInteger(t);return r<0?z(r+e,0):V(r,e)},createMethod=function(t){return function(e,r,n){var o,i=toIndexedObject(e),a=toLength(i.length),c=toAbsoluteIndex(n,a);if(t&&r!=r){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((t||c in i)&&i[c]===r)return t||c||0;return!t&&-1}},J={includes:createMethod(!0),indexOf:createMethod(!1)},Y=J.indexOf,objectKeysInternal=function(t,e){var r,n=toIndexedObject(t),o=0,i=[];for(r in n)!has(P,r)&&has(n,r)&&i.push(r);for(;e.length>o;)has(n,r=e[o++])&&(~Y(i,r)||i.push(r));return i},K=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],H=K.concat("length","prototype"),X={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,H)}},Q={f:Object.getOwnPropertySymbols},Z=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var e=X.f(anObject(t)),r=Q.f;return r?e.concat(r(t)):e},copyConstructorProperties=function(t,e){for(var r=Z(e),n=v.f,o=d.f,i=0;i<r.length;i++){var a=r[i];has(t,a)||n(t,a,o(e,a))}},tt=/#|\.prototype\./,isForced=function(t,e){var r=rt[et(t)];return r==ot||r!=nt&&("function"==typeof e?fails(e):!!e)},et=isForced.normalize=function(t){return String(t).replace(tt,".").toLowerCase()},rt=isForced.data={},nt=isForced.NATIVE="N",ot=isForced.POLYFILL="P",it=isForced,at=d.f,_export=function(t,r){var n,o,i,a,c,u=t.target,s=t.global,l=t.stat;if(n=s?e:l?e[u]||setGlobal(u,{}):(e[u]||{}).prototype)for(o in r){if(a=r[o],i=t.noTargetGet?(c=at(n,o))&&c.value:n[o],!it(s?o:u+(l?".":"#")+o,t.forced)&&void 0!==i){if(typeof a==typeof i)continue;copyConstructorProperties(a,i)}(t.sham||i&&i.sham)&&y(a,"sham",!0),B(n,o,a,t)}},ct=!!Object.getOwnPropertySymbols&&!fails((function(){return!String(Symbol())})),ut=ct&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,st=Array.isArray||function isArray(t){return"Array"==classofRaw(t)},toObject=function(t){return Object(requireObjectCoercible(t))},lt=Object.keys||function keys(t){return objectKeysInternal(t,K)},ft=r?Object.defineProperties:function defineProperties(t,e){anObject(t);for(var r,n=lt(e),o=n.length,i=0;o>i;)v.f(t,r=n[i++],e[r]);return t},ht=getBuiltIn("document","documentElement"),pt=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"<\/script>"},NullProtoObject=function(){try{G=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;NullProtoObject=G?function(t){t.write(scriptTag("")),t.close();var e=t.parentWindow.Object;return t=null,e}(G):((e=documentCreateElement("iframe")).style.display="none",ht.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F);for(var r=K.length;r--;)delete NullProtoObject.prototype[K[r]];return NullProtoObject()};P[pt]=!0;var dt=Object.create||function create(t,e){var r;return null!==t?(EmptyConstructor.prototype=anObject(t),r=new EmptyConstructor,EmptyConstructor.prototype=null,r[pt]=t):r=NullProtoObject(),void 0===e?r:ft(r,e)},gt=X.f,vt={}.toString,yt="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],mt={f:function getOwnPropertyNames(t){return yt&&"[object Window]"==vt.call(t)?function(t){try{return gt(t)}catch(t){return yt.slice()}}(t):gt(toIndexedObject(t))}},bt=j("wks"),wt=e.Symbol,xt=ut?wt:wt&&wt.withoutSetter||uid,wellKnownSymbol=function(t){return has(bt,t)||(ct&&has(wt,t)?bt[t]=wt[t]:bt[t]=xt("Symbol."+t)),bt[t]},St={f:wellKnownSymbol},Et=v.f,defineWellKnownSymbol=function(t){var e=q.Symbol||(q.Symbol={});has(e,t)||Et(e,t,{value:St.f(t)})},Ot=v.f,kt=wellKnownSymbol("toStringTag"),setToStringTag=function(t,e,r){t&&!has(t=r?t:t.prototype,kt)&&Ot(t,kt,{configurable:!0,value:e})},aFunction$1=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},functionBindContext=function(t,e,r){if(aFunction$1(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}},jt=wellKnownSymbol("species"),arraySpeciesCreate=function(t,e){var r;return st(t)&&("function"!=typeof(r=t.constructor)||r!==Array&&!st(r.prototype)?isObject(r)&&null===(r=r[jt])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===e?0:e)},At=[].push,createMethod$1=function(t){var e=1==t,r=2==t,n=3==t,o=4==t,i=6==t,a=5==t||i;return function(c,s,l,f){for(var h,p,d=toObject(c),g=u(d),v=functionBindContext(s,l,3),y=toLength(g.length),m=0,b=f||arraySpeciesCreate,w=e?b(c,y):r?b(c,0):void 0;y>m;m++)if((a||m in g)&&(p=v(h=g[m],m,d),t))if(e)w[m]=p;else if(p)switch(t){case 3:return!0;case 5:return h;case 6:return m;case 2:At.call(w,h)}else if(o)return!1;return i?-1:n||o?o:w}},Lt={forEach:createMethod$1(0),map:createMethod$1(1),filter:createMethod$1(2),some:createMethod$1(3),every:createMethod$1(4),find:createMethod$1(5),findIndex:createMethod$1(6)},Rt=Lt.forEach,Pt=sharedKey("hidden"),_t=wellKnownSymbol("toPrimitive"),It=N.set,Tt=N.getterFor("Symbol"),Ut=Object.prototype,Ct=e.Symbol,Mt=getBuiltIn("JSON","stringify"),Ft=d.f,Gt=v.f,Nt=mt.f,Bt=i.f,qt=j("symbols"),Dt=j("op-symbols"),$t=j("string-to-symbol-registry"),Wt=j("symbol-to-string-registry"),zt=j("wks"),Vt=e.QObject,Jt=!Vt||!Vt.prototype||!Vt.prototype.findChild,Yt=r&&fails((function(){return 7!=dt(Gt({},"a",{get:function(){return Gt(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=Ft(Ut,e);n&&delete Ut[e],Gt(t,e,r),n&&t!==Ut&&Gt(Ut,e,n)}:Gt,wrap=function(t,e){var n=qt[t]=dt(Ct.prototype);return It(n,{type:"Symbol",tag:t,description:e}),r||(n.description=e),n},Kt=ut?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof Ct},Ht=function defineProperty(t,e,r){t===Ut&&Ht(Dt,e,r),anObject(t);var n=toPrimitive(e,!0);return anObject(r),has(qt,n)?(r.enumerable?(has(t,Pt)&&t[Pt][n]&&(t[Pt][n]=!1),r=dt(r,{enumerable:createPropertyDescriptor(0,!1)})):(has(t,Pt)||Gt(t,Pt,createPropertyDescriptor(1,{})),t[Pt][n]=!0),Yt(t,n,r)):Gt(t,n,r)},Xt=function defineProperties(t,e){anObject(t);var n=toIndexedObject(e),o=lt(n).concat(ee(n));return Rt(o,(function(e){r&&!Qt.call(n,e)||Ht(t,e,n[e])})),t},Qt=function propertyIsEnumerable(t){var e=toPrimitive(t,!0),r=Bt.call(this,e);return!(this===Ut&&has(qt,e)&&!has(Dt,e))&&(!(r||!has(this,e)||!has(qt,e)||has(this,Pt)&&this[Pt][e])||r)},Zt=function getOwnPropertyDescriptor(t,e){var r=toIndexedObject(t),n=toPrimitive(e,!0);if(r!==Ut||!has(qt,n)||has(Dt,n)){var o=Ft(r,n);return!o||!has(qt,n)||has(r,Pt)&&r[Pt][n]||(o.enumerable=!0),o}},te=function getOwnPropertyNames(t){var e=Nt(toIndexedObject(t)),r=[];return Rt(e,(function(t){has(qt,t)||has(P,t)||r.push(t)})),r},ee=function getOwnPropertySymbols(t){var e=t===Ut,r=Nt(e?Dt:toIndexedObject(t)),n=[];return Rt(r,(function(t){!has(qt,t)||e&&!has(Ut,t)||n.push(qt[t])})),n};if(ct||(B((Ct=function Symbol(){if(this instanceof Ct)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=uid(t),setter=function(t){this===Ut&&setter.call(Dt,t),has(this,Pt)&&has(this[Pt],e)&&(this[Pt][e]=!1),Yt(this,e,createPropertyDescriptor(1,t))};return r&&Jt&&Yt(Ut,e,{configurable:!0,set:setter}),wrap(e,t)}).prototype,"toString",(function toString(){return Tt(this).tag})),B(Ct,"withoutSetter",(function(t){return wrap(uid(t),t)})),i.f=Qt,v.f=Ht,d.f=Zt,X.f=mt.f=te,Q.f=ee,St.f=function(t){return wrap(wellKnownSymbol(t),t)},r&&(Gt(Ct.prototype,"description",{configurable:!0,get:function description(){return Tt(this).description}}),B(Ut,"propertyIsEnumerable",Qt,{unsafe:!0}))),_export({global:!0,wrap:!0,forced:!ct,sham:!ct},{Symbol:Ct}),Rt(lt(zt),(function(t){defineWellKnownSymbol(t)})),_export({target:"Symbol",stat:!0,forced:!ct},{for:function(t){var e=String(t);if(has($t,e))return $t[e];var r=Ct(e);return $t[e]=r,Wt[r]=e,r},keyFor:function keyFor(t){if(!Kt(t))throw TypeError(t+" is not a symbol");if(has(Wt,t))return Wt[t]},useSetter:function(){Jt=!0},useSimple:function(){Jt=!1}}),_export({target:"Object",stat:!0,forced:!ct,sham:!r},{create:function create(t,e){return void 0===e?dt(t):Xt(dt(t),e)},defineProperty:Ht,defineProperties:Xt,getOwnPropertyDescriptor:Zt}),_export({target:"Object",stat:!0,forced:!ct},{getOwnPropertyNames:te,getOwnPropertySymbols:ee}),_export({target:"Object",stat:!0,forced:fails((function(){Q.f(1)}))},{getOwnPropertySymbols:function getOwnPropertySymbols(t){return Q.f(toObject(t))}}),Mt){var re=!ct||fails((function(){var t=Ct();return"[null]"!=Mt([t])||"{}"!=Mt({a:t})||"{}"!=Mt(Object(t))}));_export({target:"JSON",stat:!0,forced:re},{stringify:function stringify(t,e,r){for(var n,o=[t],i=1;arguments.length>i;)o.push(arguments[i++]);if(n=e,(isObject(e)||void 0!==t)&&!Kt(t))return st(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!Kt(e))return e}),o[1]=e,Mt.apply(null,o)}})}Ct.prototype[_t]||y(Ct.prototype,_t,Ct.prototype.valueOf),setToStringTag(Ct,"Symbol"),P[Pt]=!0;var ne=v.f,oe=e.Symbol;if(r&&"function"==typeof oe&&(!("description"in oe.prototype)||void 0!==oe().description)){var ie={},ae=function Symbol(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof ae?new oe(t):void 0===t?oe():oe(t);return""===t&&(ie[e]=!0),e};copyConstructorProperties(ae,oe);var ce=ae.prototype=oe.prototype;ce.constructor=ae;var ue=ce.toString,se="Symbol(test)"==String(oe("test")),le=/^Symbol\((.*)\)[^)]+$/;ne(ce,"description",{configurable:!0,get:function description(){var t=isObject(this)?this.valueOf():this,e=ue.call(t);if(has(ie,t))return"";var r=se?e.slice(7,-1):e.replace(le,"$1");return""===r?void 0:r}}),_export({global:!0,forced:!0},{Symbol:ae})}var fe,he,createProperty=function(t,e,r){var n=toPrimitive(e);n in t?v.f(t,n,createPropertyDescriptor(0,r)):t[n]=r},pe=getBuiltIn("navigator","userAgent")||"",de=e.process,ge=de&&de.versions,ve=ge&&ge.v8;ve?he=(fe=ve.split("."))[0]+fe[1]:pe&&(!(fe=pe.match(/Edge\/(\d+)/))||fe[1]>=74)&&(fe=pe.match(/Chrome\/(\d+)/))&&(he=fe[1]);var ye=he&&+he,me=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(t){return ye>=51||!fails((function(){var e=[];return(e.constructor={})[me]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},be=wellKnownSymbol("isConcatSpreadable"),we=ye>=51||!fails((function(){var t=[];return t[be]=!1,t.concat()[0]!==t})),xe=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(t){if(!isObject(t))return!1;var e=t[be];return void 0!==e?!!e:st(t)};_export({target:"Array",proto:!0,forced:!we||!xe},{concat:function concat(t){var e,r,n,o,i,a=toObject(this),c=arraySpeciesCreate(a,0),u=0;for(e=-1,n=arguments.length;e<n;e++)if(isConcatSpreadable(i=-1===e?a:arguments[e])){if(u+(o=toLength(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(r=0;r<o;r++,u++)r in i&&createProperty(c,u,i[r])}else{if(u>=9007199254740991)throw TypeError("Maximum allowed index exceeded");createProperty(c,u++,i)}return c.length=u,c}});var arrayMethodIsStrict=function(t,e){var r=[][t];return!!r&&fails((function(){r.call(null,e||function(){throw 1},1)}))},Se=Object.defineProperty,Ee={},thrower=function(t){throw t},arrayMethodUsesToLength=function(t,e){if(has(Ee,t))return Ee[t];e||(e={});var n=[][t],o=!!has(e,"ACCESSORS")&&e.ACCESSORS,i=has(e,0)?e[0]:thrower,a=has(e,1)?e[1]:void 0;return Ee[t]=!!n&&!fails((function(){if(o&&!r)return!0;var t={length:-1};o?Se(t,1,{enumerable:!0,get:thrower}):t[1]=1,n.call(t,i,a)}))},Oe=Lt.forEach,ke=arrayMethodIsStrict("forEach"),je=arrayMethodUsesToLength("forEach"),Ae=ke&&je?[].forEach:function forEach(t){return Oe(this,t,arguments.length>1?arguments[1]:void 0)};_export({target:"Array",proto:!0,forced:[].forEach!=Ae},{forEach:Ae});var Le=wellKnownSymbol("unscopables"),Re=Array.prototype;null==Re[Le]&&v.f(Re,Le,{configurable:!0,value:dt(null)});var addToUnscopables=function(t){Re[Le][t]=!0},Pe=J.includes,_e=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:!_e},{includes:function includes(t){return Pe(this,t,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("includes");var Ie=J.indexOf,Te=[].indexOf,Ue=!!Te&&1/[1].indexOf(1,-0)<0,Ce=arrayMethodIsStrict("indexOf"),Me=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:Ue||!Ce||!Me},{indexOf:function indexOf(t){return Ue?Te.apply(this,arguments)||0:Ie(this,t,arguments.length>1?arguments[1]:void 0)}});var Fe,Ge,Ne,Be={},qe=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})),De=sharedKey("IE_PROTO"),$e=Object.prototype,We=qe?Object.getPrototypeOf:function(t){return t=toObject(t),has(t,De)?t[De]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?$e:null},ze=wellKnownSymbol("iterator"),Ve=!1;[].keys&&("next"in(Ne=[].keys())?(Ge=We(We(Ne)))!==Object.prototype&&(Fe=Ge):Ve=!0),null==Fe&&(Fe={}),has(Fe,ze)||y(Fe,ze,(function(){return this}));var Je={IteratorPrototype:Fe,BUGGY_SAFARI_ITERATORS:Ve},Ye=Je.IteratorPrototype,returnThis$1=function(){return this},createIteratorConstructor=function(t,e,r){var n=e+" Iterator";return t.prototype=dt(Ye,{next:createPropertyDescriptor(1,r)}),setToStringTag(t,n,!1),Be[n]=returnThis$1,t},Ke=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function setPrototypeOf(r,n){return anObject(r),function(t){if(!isObject(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(n),e?t.call(r,n):r.__proto__=n,r}}():void 0),He=Je.IteratorPrototype,Xe=Je.BUGGY_SAFARI_ITERATORS,Qe=wellKnownSymbol("iterator"),returnThis$2=function(){return this},defineIterator=function(t,e,r,n,o,i,a){createIteratorConstructor(r,e,n);var c,u,s,getIterationMethod=function(t){if(t===o&&d)return d;if(!Xe&&t in h)return h[t];switch(t){case"keys":return function keys(){return new r(this,t)};case"values":return function values(){return new r(this,t)};case"entries":return function entries(){return new r(this,t)}}return function(){return new r(this)}},l=e+" Iterator",f=!1,h=t.prototype,p=h[Qe]||h["@@iterator"]||o&&h[o],d=!Xe&&p||getIterationMethod(o),g="Array"==e&&h.entries||p;if(g&&(c=We(g.call(new t)),He!==Object.prototype&&c.next&&(We(c)!==He&&(Ke?Ke(c,He):"function"!=typeof c[Qe]&&y(c,Qe,returnThis$2)),setToStringTag(c,l,!0))),"values"==o&&p&&"values"!==p.name&&(f=!0,d=function values(){return p.call(this)}),h[Qe]!==d&&y(h,Qe,d),Be[e]=d,o)if(u={values:getIterationMethod("values"),keys:i?d:getIterationMethod("keys"),entries:getIterationMethod("entries")},a)for(s in u)(Xe||f||!(s in h))&&B(h,s,u[s]);else _export({target:e,proto:!0,forced:Xe||f},u);return u},Ze=N.set,tr=N.getterFor("Array Iterator"),er=defineIterator(Array,"Array",(function(t,e){Ze(this,{type:"Array Iterator",target:toIndexedObject(t),index:0,kind:e})}),(function(){var t=tr(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values");Be.Arguments=Be.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries");var rr=Lt.map,nr=arrayMethodHasSpeciesSupport("map"),or=arrayMethodUsesToLength("map");_export({target:"Array",proto:!0,forced:!nr||!or},{map:function map(t){return rr(this,t,arguments.length>1?arguments[1]:void 0)}});var ir=v.f,ar=Function.prototype,cr=ar.toString,ur=/^\s*function ([^ (]*)/;r&&!("name"in ar)&&ir(ar,"name",{configurable:!0,get:function(){try{return cr.call(this).match(ur)[1]}catch(t){return""}}});var sr=Object.assign,lr=Object.defineProperty,fr=!sr||fails((function(){if(r&&1!==sr({b:1},sr(lr({},"a",{enumerable:!0,get:function(){lr(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),o="abcdefghijklmnopqrst";return t[n]=7,o.split("").forEach((function(t){e[t]=t})),7!=sr({},t)[n]||lt(sr({},e)).join("")!=o}))?function assign(t,e){for(var n=toObject(t),o=arguments.length,a=1,c=Q.f,s=i.f;o>a;)for(var l,f=u(arguments[a++]),h=c?lt(f).concat(c(f)):lt(f),p=h.length,d=0;p>d;)l=h[d++],r&&!s.call(f,l)||(n[l]=f[l]);return n}:sr;_export({target:"Object",stat:!0,forced:Object.assign!==fr},{assign:fr});var hr={};hr[wellKnownSymbol("toStringTag")]="z";var pr="[object z]"===String(hr),dr=wellKnownSymbol("toStringTag"),gr="Arguments"==classofRaw(function(){return arguments}()),vr=pr?classofRaw:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),dr))?r:gr?classofRaw(e):"Object"==(n=classofRaw(e))&&"function"==typeof e.callee?"Arguments":n},yr=pr?{}.toString:function toString(){return"[object "+vr(this)+"]"};pr||B(Object.prototype,"toString",yr,{unsafe:!0});var regexpFlags=function(){var t=anObject(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e};function RE(t,e){return RegExp(t,e)}var mr,br,wr={UNSUPPORTED_Y:fails((function(){var t=RE("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),BROKEN_CARET:fails((function(){var t=RE("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},xr=RegExp.prototype.exec,Sr=String.prototype.replace,Er=xr,Or=(mr=/a/,br=/b*/g,xr.call(mr,"a"),xr.call(br,"a"),0!==mr.lastIndex||0!==br.lastIndex),kr=wr.UNSUPPORTED_Y||wr.BROKEN_CARET,jr=void 0!==/()??/.exec("")[1];(Or||jr||kr)&&(Er=function exec(t){var e,r,n,o,i=this,a=kr&&i.sticky,c=regexpFlags.call(i),u=i.source,s=0,l=t;return a&&(-1===(c=c.replace("y","")).indexOf("g")&&(c+="g"),l=String(t).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==t[i.lastIndex-1])&&(u="(?: "+u+")",l=" "+l,s++),r=new RegExp("^(?:"+u+")",c)),jr&&(r=new RegExp("^"+u+"$(?!\\s)",c)),Or&&(e=i.lastIndex),n=xr.call(a?r:i,l),a?n?(n.input=n.input.slice(s),n[0]=n[0].slice(s),n.index=i.lastIndex,i.lastIndex+=n[0].length):i.lastIndex=0:Or&&n&&(i.lastIndex=i.global?n.index+n[0].length:e),jr&&n&&n.length>1&&Sr.call(n[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)})),n});var Ar=Er;_export({target:"RegExp",proto:!0,forced:/./.exec!==Ar},{exec:Ar});var Lr=wellKnownSymbol("match"),isRegexp=function(t){var e;return isObject(t)&&(void 0!==(e=t[Lr])?!!e:"RegExp"==classofRaw(t))},notARegexp=function(t){if(isRegexp(t))throw TypeError("The method doesn't accept regular expressions");return t},Rr=wellKnownSymbol("match"),correctIsRegexpLogic=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[Rr]=!1,"/./"[t](e)}catch(t){}}return!1};_export({target:"String",proto:!0,forced:!correctIsRegexpLogic("includes")},{includes:function includes(t){return!!~String(requireObjectCoercible(this)).indexOf(notARegexp(t),arguments.length>1?arguments[1]:void 0)}});var createMethod$2=function(t){return function(e,r){var n,o,i=String(requireObjectCoercible(e)),a=toInteger(r),c=i.length;return a<0||a>=c?t?"":void 0:(n=i.charCodeAt(a))<55296||n>56319||a+1===c||(o=i.charCodeAt(a+1))<56320||o>57343?t?i.charAt(a):n:t?i.slice(a,a+2):o-56320+(n-55296<<10)+65536}},Pr={codeAt:createMethod$2(!1),charAt:createMethod$2(!0)},_r=Pr.charAt,Ir=N.set,Tr=N.getterFor("String Iterator");defineIterator(String,"String",(function(t){Ir(this,{type:"String Iterator",string:String(t),index:0})}),(function next(){var t,e=Tr(this),r=e.string,n=e.index;return n>=r.length?{value:void 0,done:!0}:(t=_r(r,n),e.index+=t.length,{value:t,done:!1})}));var Ur=wellKnownSymbol("species"),Cr=!fails((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),Mr="$0"==="a".replace(/./,"$0"),Fr=wellKnownSymbol("replace"),Gr=!!/./[Fr]&&""===/./[Fr]("a","$0"),Nr=!fails((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),fixRegexpWellKnownSymbolLogic=function(t,e,r,n){var o=wellKnownSymbol(t),i=!fails((function(){var e={};return e[o]=function(){return 7},7!=""[t](e)})),a=i&&!fails((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[Ur]=function(){return r},r.flags="",r[o]=/./[o]),r.exec=function(){return e=!0,null},r[o](""),!e}));if(!i||!a||"replace"===t&&(!Cr||!Mr||Gr)||"split"===t&&!Nr){var c=/./[o],u=r(o,""[t],(function(t,e,r,n,o){return e.exec===Ar?i&&!o?{done:!0,value:c.call(e,r,n)}:{done:!0,value:t.call(r,e,n)}:{done:!1}}),{REPLACE_KEEPS_$0:Mr,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Gr}),s=u[0],l=u[1];B(String.prototype,t,s),B(RegExp.prototype,o,2==e?function(t,e){return l.call(t,this,e)}:function(t){return l.call(t,this)})}n&&y(RegExp.prototype[o],"sham",!0)},Br=Pr.charAt,advanceStringIndex=function(t,e,r){return e+(r?Br(t,e).length:1)},regexpExecAbstract=function(t,e){var r=t.exec;if("function"==typeof r){var n=r.call(t,e);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==classofRaw(t))throw TypeError("RegExp#exec called on incompatible receiver");return Ar.call(t,e)},qr=Math.max,Dr=Math.min,$r=Math.floor,Wr=/\$([$&'`]|\d\d?|<[^>]*>)/g,zr=/\$([$&'`]|\d\d?)/g;fixRegexpWellKnownSymbolLogic("replace",2,(function(t,e,r,n){var o=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=n.REPLACE_KEEPS_$0,a=o?"$":"$0";return[function replace(r,n){var o=requireObjectCoercible(this),i=null==r?void 0:r[t];return void 0!==i?i.call(r,o,n):e.call(String(o),r,n)},function(t,n){if(!o&&i||"string"==typeof n&&-1===n.indexOf(a)){var c=r(e,t,this,n);if(c.done)return c.value}var u=anObject(t),s=String(this),l="function"==typeof n;l||(n=String(n));var f=u.global;if(f){var h=u.unicode;u.lastIndex=0}for(var p=[];;){var d=regexpExecAbstract(u,s);if(null===d)break;if(p.push(d),!f)break;""===String(d[0])&&(u.lastIndex=advanceStringIndex(s,toLength(u.lastIndex),h))}for(var g,v="",y=0,m=0;m<p.length;m++){d=p[m];for(var b=String(d[0]),w=qr(Dr(toInteger(d.index),s.length),0),x=[],S=1;S<d.length;S++)x.push(void 0===(g=d[S])?g:String(g));var E=d.groups;if(l){var O=[b].concat(x,w,s);void 0!==E&&O.push(E);var k=String(n.apply(void 0,O))}else k=getSubstitution(b,s,w,x,E,n);w>=y&&(v+=s.slice(y,w)+k,y=w+b.length)}return v+s.slice(y)}];function getSubstitution(t,r,n,o,i,a){var c=n+t.length,u=o.length,s=zr;return void 0!==i&&(i=toObject(i),s=Wr),e.call(a,s,(function(e,a){var s;switch(a.charAt(0)){case"$":return"$";case"&":return t;case"`":return r.slice(0,n);case"'":return r.slice(c);case"<":s=i[a.slice(1,-1)];break;default:var l=+a;if(0===l)return e;if(l>u){var f=$r(l/10);return 0===f?e:f<=u?void 0===o[f-1]?a.charAt(1):o[f-1]+a.charAt(1):e}s=o[l-1]}return void 0===s?"":s}))}}));var Vr,Jr=d.f,Yr="".startsWith,Kr=Math.min,Hr=correctIsRegexpLogic("startsWith"),Xr=!(Hr||(Vr=Jr(String.prototype,"startsWith"),!Vr||Vr.writable));_export({target:"String",proto:!0,forced:!Xr&&!Hr},{startsWith:function startsWith(t){var e=String(requireObjectCoercible(this));notARegexp(t);var r=toLength(Kr(arguments.length>1?arguments[1]:void 0,e.length)),n=String(t);return Yr?Yr.call(e,n,r):e.slice(r,r+n.length)===n}});var Qr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var Zr in Qr){var tn=e[Zr],en=tn&&tn.prototype;if(en&&en.forEach!==Ae)try{y(en,"forEach",Ae)}catch(t){en.forEach=Ae}}var rn=wellKnownSymbol("iterator"),nn=wellKnownSymbol("toStringTag"),on=er.values;for(var an in Qr){var cn=e[an],un=cn&&cn.prototype;if(un){if(un[rn]!==on)try{y(un,rn,on)}catch(t){un[rn]=on}if(un[nn]||y(un,nn,an),Qr[an])for(var sn in er)if(un[sn]!==er[sn])try{y(un,sn,er[sn])}catch(t){un[sn]=er[sn]}}}var ln=wellKnownSymbol("iterator"),fn=!fails((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,r="";return t.pathname="c%20d",e.forEach((function(t,n){e.delete("b"),r+=n+t})),!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[ln]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host})),anInstance=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t},callWithSafeIterationClosing=function(t,e,r,n){try{return n?e(anObject(r)[0],r[1]):e(r)}catch(e){var o=t.return;throw void 0!==o&&anObject(o.call(t)),e}},hn=wellKnownSymbol("iterator"),pn=Array.prototype,isArrayIteratorMethod=function(t){return void 0!==t&&(Be.Array===t||pn[hn]===t)},dn=wellKnownSymbol("iterator"),getIteratorMethod=function(t){if(null!=t)return t[dn]||t["@@iterator"]||Be[vr(t)]},gn=function from(t){var e,r,n,o,i,a,c=toObject(t),u="function"==typeof this?this:Array,s=arguments.length,l=s>1?arguments[1]:void 0,f=void 0!==l,h=getIteratorMethod(c),p=0;if(f&&(l=functionBindContext(l,s>2?arguments[2]:void 0,2)),null==h||u==Array&&isArrayIteratorMethod(h))for(r=new u(e=toLength(c.length));e>p;p++)a=f?l(c[p],p):c[p],createProperty(r,p,a);else for(i=(o=h.call(c)).next,r=new u;!(n=i.call(o)).done;p++)a=f?callWithSafeIterationClosing(o,l,[n.value,p],!0):n.value,createProperty(r,p,a);return r.length=p,r},vn=/[^\0-\u007E]/,yn=/[.\u3002\uFF0E\uFF61]/g,mn="Overflow: input needs wider integers to process",bn=Math.floor,wn=String.fromCharCode,digitToBasic=function(t){return t+22+75*(t<26)},adapt=function(t,e,r){var n=0;for(t=r?bn(t/700):t>>1,t+=bn(t/e);t>455;n+=36)t=bn(t/35);return bn(n+36*t/(t+38))},encode=function(t){var e,r,n=[],o=(t=function(t){for(var e=[],r=0,n=t.length;r<n;){var o=t.charCodeAt(r++);if(o>=55296&&o<=56319&&r<n){var i=t.charCodeAt(r++);56320==(64512&i)?e.push(((1023&o)<<10)+(1023&i)+65536):(e.push(o),r--)}else e.push(o)}return e}(t)).length,i=128,a=0,c=72;for(e=0;e<t.length;e++)(r=t[e])<128&&n.push(wn(r));var u=n.length,s=u;for(u&&n.push("-");s<o;){var l=2147483647;for(e=0;e<t.length;e++)(r=t[e])>=i&&r<l&&(l=r);var f=s+1;if(l-i>bn((2147483647-a)/f))throw RangeError(mn);for(a+=(l-i)*f,i=l,e=0;e<t.length;e++){if((r=t[e])<i&&++a>2147483647)throw RangeError(mn);if(r==i){for(var h=a,p=36;;p+=36){var d=p<=c?1:p>=c+26?26:p-c;if(h<d)break;var g=h-d,v=36-d;n.push(wn(digitToBasic(d+g%v))),h=bn(g/v)}n.push(wn(digitToBasic(h))),c=adapt(a,f,s==u),a=0,++s}}++a,++i}return n.join("")},redefineAll=function(t,e,r){for(var n in e)B(t,n,e[n],r);return t},getIterator=function(t){var e=getIteratorMethod(t);if("function"!=typeof e)throw TypeError(String(t)+" is not iterable");return anObject(e.call(t))},xn=getBuiltIn("fetch"),Sn=getBuiltIn("Headers"),En=wellKnownSymbol("iterator"),On=N.set,kn=N.getterFor("URLSearchParams"),jn=N.getterFor("URLSearchParamsIterator"),An=/\+/g,Ln=Array(4),percentSequence=function(t){return Ln[t-1]||(Ln[t-1]=RegExp("((?:%[\\da-f]{2}){"+t+"})","gi"))},percentDecode=function(t){try{return decodeURIComponent(t)}catch(e){return t}},deserialize=function(t){var e=t.replace(An," "),r=4;try{return decodeURIComponent(e)}catch(t){for(;r;)e=e.replace(percentSequence(r--),percentDecode);return e}},Rn=/[!'()~]|%20/g,Pn={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(t){return Pn[t]},serialize=function(t){return encodeURIComponent(t).replace(Rn,replacer)},parseSearchParams=function(t,e){if(e)for(var r,n,o=e.split("&"),i=0;i<o.length;)(r=o[i++]).length&&(n=r.split("="),t.push({key:deserialize(n.shift()),value:deserialize(n.join("="))}))},updateSearchParams=function(t){this.entries.length=0,parseSearchParams(this.entries,t)},validateArgumentsLength=function(t,e){if(t<e)throw TypeError("Not enough arguments")},_n=createIteratorConstructor((function Iterator(t,e){On(this,{type:"URLSearchParamsIterator",iterator:getIterator(kn(t).entries),kind:e})}),"Iterator",(function next(){var t=jn(this),e=t.kind,r=t.iterator.next(),n=r.value;return r.done||(r.value="keys"===e?n.key:"values"===e?n.value:[n.key,n.value]),r})),In=function URLSearchParams(){anInstance(this,In,"URLSearchParams");var t,e,r,n,o,i,a,c,u,s=arguments.length>0?arguments[0]:void 0,l=this,f=[];if(On(l,{type:"URLSearchParams",entries:f,updateURL:function(){},updateSearchParams:updateSearchParams}),void 0!==s)if(isObject(s))if("function"==typeof(t=getIteratorMethod(s)))for(r=(e=t.call(s)).next;!(n=r.call(e)).done;){if((a=(i=(o=getIterator(anObject(n.value))).next).call(o)).done||(c=i.call(o)).done||!i.call(o).done)throw TypeError("Expected sequence with length 2");f.push({key:a.value+"",value:c.value+""})}else for(u in s)has(s,u)&&f.push({key:u,value:s[u]+""});else parseSearchParams(f,"string"==typeof s?"?"===s.charAt(0)?s.slice(1):s:s+"")},Tn=In.prototype;redefineAll(Tn,{append:function append(t,e){validateArgumentsLength(arguments.length,2);var r=kn(this);r.entries.push({key:t+"",value:e+""}),r.updateURL()},delete:function(t){validateArgumentsLength(arguments.length,1);for(var e=kn(this),r=e.entries,n=t+"",o=0;o<r.length;)r[o].key===n?r.splice(o,1):o++;e.updateURL()},get:function get(t){validateArgumentsLength(arguments.length,1);for(var e=kn(this).entries,r=t+"",n=0;n<e.length;n++)if(e[n].key===r)return e[n].value;return null},getAll:function getAll(t){validateArgumentsLength(arguments.length,1);for(var e=kn(this).entries,r=t+"",n=[],o=0;o<e.length;o++)e[o].key===r&&n.push(e[o].value);return n},has:function has(t){validateArgumentsLength(arguments.length,1);for(var e=kn(this).entries,r=t+"",n=0;n<e.length;)if(e[n++].key===r)return!0;return!1},set:function set(t,e){validateArgumentsLength(arguments.length,1);for(var r,n=kn(this),o=n.entries,i=!1,a=t+"",c=e+"",u=0;u<o.length;u++)(r=o[u]).key===a&&(i?o.splice(u--,1):(i=!0,r.value=c));i||o.push({key:a,value:c}),n.updateURL()},sort:function sort(){var t,e,r,n=kn(this),o=n.entries,i=o.slice();for(o.length=0,r=0;r<i.length;r++){for(t=i[r],e=0;e<r;e++)if(o[e].key>t.key){o.splice(e,0,t);break}e===r&&o.push(t)}n.updateURL()},forEach:function forEach(t){for(var e,r=kn(this).entries,n=functionBindContext(t,arguments.length>1?arguments[1]:void 0,3),o=0;o<r.length;)n((e=r[o++]).value,e.key,this)},keys:function keys(){return new _n(this,"keys")},values:function values(){return new _n(this,"values")},entries:function entries(){return new _n(this,"entries")}},{enumerable:!0}),B(Tn,En,Tn.entries),B(Tn,"toString",(function toString(){for(var t,e=kn(this).entries,r=[],n=0;n<e.length;)t=e[n++],r.push(serialize(t.key)+"="+serialize(t.value));return r.join("&")}),{enumerable:!0}),setToStringTag(In,"URLSearchParams"),_export({global:!0,forced:!fn},{URLSearchParams:In}),fn||"function"!=typeof xn||"function"!=typeof Sn||_export({global:!0,enumerable:!0,forced:!0},{fetch:function fetch(t){var e,r,n,o=[t];return arguments.length>1&&(isObject(e=arguments[1])&&(r=e.body,"URLSearchParams"===vr(r)&&((n=e.headers?new Sn(e.headers):new Sn).has("content-type")||n.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),e=dt(e,{body:createPropertyDescriptor(0,String(r)),headers:createPropertyDescriptor(0,n)}))),o.push(e)),xn.apply(this,o)}});var Un,Cn={URLSearchParams:In,getState:kn},Mn=Pr.codeAt,Fn=e.URL,Gn=Cn.URLSearchParams,Nn=Cn.getState,Bn=N.set,qn=N.getterFor("URL"),Dn=Math.floor,$n=Math.pow,Wn=/[A-Za-z]/,zn=/[\d+-.A-Za-z]/,Vn=/\d/,Jn=/^(0x|0X)/,Yn=/^[0-7]+$/,Kn=/^\d+$/,Hn=/^[\dA-Fa-f]+$/,Xn=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,Qn=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,Zn=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,to=/[\u0009\u000A\u000D]/g,parseHost=function(t,e){var r,n,o;if("["==e.charAt(0)){if("]"!=e.charAt(e.length-1))return"Invalid host";if(!(r=parseIPv6(e.slice(1,-1))))return"Invalid host";t.host=r}else if(isSpecial(t)){if(e=function(t){var e,r,n=[],o=t.toLowerCase().replace(yn,".").split(".");for(e=0;e<o.length;e++)r=o[e],n.push(vn.test(r)?"xn--"+encode(r):r);return n.join(".")}(e),Xn.test(e))return"Invalid host";if(null===(r=parseIPv4(e)))return"Invalid host";t.host=r}else{if(Qn.test(e))return"Invalid host";for(r="",n=gn(e),o=0;o<n.length;o++)r+=percentEncode(n[o],eo);t.host=r}},parseIPv4=function(t){var e,r,n,o,i,a,c,u=t.split(".");if(u.length&&""==u[u.length-1]&&u.pop(),(e=u.length)>4)return t;for(r=[],n=0;n<e;n++){if(""==(o=u[n]))return t;if(i=10,o.length>1&&"0"==o.charAt(0)&&(i=Jn.test(o)?16:8,o=o.slice(8==i?1:2)),""===o)a=0;else{if(!(10==i?Kn:8==i?Yn:Hn).test(o))return t;a=parseInt(o,i)}r.push(a)}for(n=0;n<e;n++)if(a=r[n],n==e-1){if(a>=$n(256,5-e))return null}else if(a>255)return null;for(c=r.pop(),n=0;n<r.length;n++)c+=r[n]*$n(256,3-n);return c},parseIPv6=function(t){var e,r,n,o,i,a,c,u=[0,0,0,0,0,0,0,0],s=0,l=null,f=0,char=function(){return t.charAt(f)};if(":"==char()){if(":"!=t.charAt(1))return;f+=2,l=++s}for(;char();){if(8==s)return;if(":"!=char()){for(e=r=0;r<4&&Hn.test(char());)e=16*e+parseInt(char(),16),f++,r++;if("."==char()){if(0==r)return;if(f-=r,s>6)return;for(n=0;char();){if(o=null,n>0){if(!("."==char()&&n<4))return;f++}if(!Vn.test(char()))return;for(;Vn.test(char());){if(i=parseInt(char(),10),null===o)o=i;else{if(0==o)return;o=10*o+i}if(o>255)return;f++}u[s]=256*u[s]+o,2!=++n&&4!=n||s++}if(4!=n)return;break}if(":"==char()){if(f++,!char())return}else if(char())return;u[s++]=e}else{if(null!==l)return;f++,l=++s}}if(null!==l)for(a=s-l,s=7;0!=s&&a>0;)c=u[s],u[s--]=u[l+a-1],u[l+--a]=c;else if(8!=s)return;return u},serializeHost=function(t){var e,r,n,o;if("number"==typeof t){for(e=[],r=0;r<4;r++)e.unshift(t%256),t=Dn(t/256);return e.join(".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>r&&(e=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r&&(e=n,r=o),e}(t),r=0;r<8;r++)o&&0===t[r]||(o&&(o=!1),n===r?(e+=r?":":"::",o=!0):(e+=t[r].toString(16),r<7&&(e+=":")));return"["+e+"]"}return t},eo={},ro=fr({},eo,{" ":1,'"':1,"<":1,">":1,"`":1}),no=fr({},ro,{"#":1,"?":1,"{":1,"}":1}),oo=fr({},no,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(t,e){var r=Mn(t,0);return r>32&&r<127&&!has(e,t)?t:encodeURIComponent(t)},io={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isSpecial=function(t){return has(io,t.scheme)},includesCredentials=function(t){return""!=t.username||""!=t.password},cannotHaveUsernamePasswordPort=function(t){return!t.host||t.cannotBeABaseURL||"file"==t.scheme},isWindowsDriveLetter=function(t,e){var r;return 2==t.length&&Wn.test(t.charAt(0))&&(":"==(r=t.charAt(1))||!e&&"|"==r)},startsWithWindowsDriveLetter=function(t){var e;return t.length>1&&isWindowsDriveLetter(t.slice(0,2))&&(2==t.length||"/"===(e=t.charAt(2))||"\\"===e||"?"===e||"#"===e)},shortenURLsPath=function(t){var e=t.path,r=e.length;!r||"file"==t.scheme&&1==r&&isWindowsDriveLetter(e[0],!0)||e.pop()},isSingleDot=function(t){return"."===t||"%2e"===t.toLowerCase()},ao={},co={},uo={},so={},lo={},fo={},ho={},po={},go={},vo={},yo={},mo={},bo={},wo={},xo={},So={},Eo={},Oo={},ko={},jo={},Ao={},parseURL=function(t,e,r,n){var o,i,a,c,u,s=r||ao,l=0,f="",h=!1,p=!1,d=!1;for(r||(t.scheme="",t.username="",t.password="",t.host=null,t.port=null,t.path=[],t.query=null,t.fragment=null,t.cannotBeABaseURL=!1,e=e.replace(Zn,"")),e=e.replace(to,""),o=gn(e);l<=o.length;){switch(i=o[l],s){case ao:if(!i||!Wn.test(i)){if(r)return"Invalid scheme";s=uo;continue}f+=i.toLowerCase(),s=co;break;case co:if(i&&(zn.test(i)||"+"==i||"-"==i||"."==i))f+=i.toLowerCase();else{if(":"!=i){if(r)return"Invalid scheme";f="",s=uo,l=0;continue}if(r&&(isSpecial(t)!=has(io,f)||"file"==f&&(includesCredentials(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;if(t.scheme=f,r)return void(isSpecial(t)&&io[t.scheme]==t.port&&(t.port=null));f="","file"==t.scheme?s=wo:isSpecial(t)&&n&&n.scheme==t.scheme?s=so:isSpecial(t)?s=po:"/"==o[l+1]?(s=lo,l++):(t.cannotBeABaseURL=!0,t.path.push(""),s=ko)}break;case uo:if(!n||n.cannotBeABaseURL&&"#"!=i)return"Invalid scheme";if(n.cannotBeABaseURL&&"#"==i){t.scheme=n.scheme,t.path=n.path.slice(),t.query=n.query,t.fragment="",t.cannotBeABaseURL=!0,s=Ao;break}s="file"==n.scheme?wo:fo;continue;case so:if("/"!=i||"/"!=o[l+1]){s=fo;continue}s=go,l++;break;case lo:if("/"==i){s=vo;break}s=Oo;continue;case fo:if(t.scheme=n.scheme,i==Un)t.username=n.username,t.password=n.password,t.host=n.host,t.port=n.port,t.path=n.path.slice(),t.query=n.query;else if("/"==i||"\\"==i&&isSpecial(t))s=ho;else if("?"==i)t.username=n.username,t.password=n.password,t.host=n.host,t.port=n.port,t.path=n.path.slice(),t.query="",s=jo;else{if("#"!=i){t.username=n.username,t.password=n.password,t.host=n.host,t.port=n.port,t.path=n.path.slice(),t.path.pop(),s=Oo;continue}t.username=n.username,t.password=n.password,t.host=n.host,t.port=n.port,t.path=n.path.slice(),t.query=n.query,t.fragment="",s=Ao}break;case ho:if(!isSpecial(t)||"/"!=i&&"\\"!=i){if("/"!=i){t.username=n.username,t.password=n.password,t.host=n.host,t.port=n.port,s=Oo;continue}s=vo}else s=go;break;case po:if(s=go,"/"!=i||"/"!=f.charAt(l+1))continue;l++;break;case go:if("/"!=i&&"\\"!=i){s=vo;continue}break;case vo:if("@"==i){h&&(f="%40"+f),h=!0,a=gn(f);for(var g=0;g<a.length;g++){var v=a[g];if(":"!=v||d){var y=percentEncode(v,oo);d?t.password+=y:t.username+=y}else d=!0}f=""}else if(i==Un||"/"==i||"?"==i||"#"==i||"\\"==i&&isSpecial(t)){if(h&&""==f)return"Invalid authority";l-=gn(f).length+1,f="",s=yo}else f+=i;break;case yo:case mo:if(r&&"file"==t.scheme){s=So;continue}if(":"!=i||p){if(i==Un||"/"==i||"?"==i||"#"==i||"\\"==i&&isSpecial(t)){if(isSpecial(t)&&""==f)return"Invalid host";if(r&&""==f&&(includesCredentials(t)||null!==t.port))return;if(c=parseHost(t,f))return c;if(f="",s=Eo,r)return;continue}"["==i?p=!0:"]"==i&&(p=!1),f+=i}else{if(""==f)return"Invalid host";if(c=parseHost(t,f))return c;if(f="",s=bo,r==mo)return}break;case bo:if(!Vn.test(i)){if(i==Un||"/"==i||"?"==i||"#"==i||"\\"==i&&isSpecial(t)||r){if(""!=f){var m=parseInt(f,10);if(m>65535)return"Invalid port";t.port=isSpecial(t)&&m===io[t.scheme]?null:m,f=""}if(r)return;s=Eo;continue}return"Invalid port"}f+=i;break;case wo:if(t.scheme="file","/"==i||"\\"==i)s=xo;else{if(!n||"file"!=n.scheme){s=Oo;continue}if(i==Un)t.host=n.host,t.path=n.path.slice(),t.query=n.query;else if("?"==i)t.host=n.host,t.path=n.path.slice(),t.query="",s=jo;else{if("#"!=i){startsWithWindowsDriveLetter(o.slice(l).join(""))||(t.host=n.host,t.path=n.path.slice(),shortenURLsPath(t)),s=Oo;continue}t.host=n.host,t.path=n.path.slice(),t.query=n.query,t.fragment="",s=Ao}}break;case xo:if("/"==i||"\\"==i){s=So;break}n&&"file"==n.scheme&&!startsWithWindowsDriveLetter(o.slice(l).join(""))&&(isWindowsDriveLetter(n.path[0],!0)?t.path.push(n.path[0]):t.host=n.host),s=Oo;continue;case So:if(i==Un||"/"==i||"\\"==i||"?"==i||"#"==i){if(!r&&isWindowsDriveLetter(f))s=Oo;else if(""==f){if(t.host="",r)return;s=Eo}else{if(c=parseHost(t,f))return c;if("localhost"==t.host&&(t.host=""),r)return;f="",s=Eo}continue}f+=i;break;case Eo:if(isSpecial(t)){if(s=Oo,"/"!=i&&"\\"!=i)continue}else if(r||"?"!=i)if(r||"#"!=i){if(i!=Un&&(s=Oo,"/"!=i))continue}else t.fragment="",s=Ao;else t.query="",s=jo;break;case Oo:if(i==Un||"/"==i||"\\"==i&&isSpecial(t)||!r&&("?"==i||"#"==i)){if(".."===(u=(u=f).toLowerCase())||"%2e."===u||".%2e"===u||"%2e%2e"===u?(shortenURLsPath(t),"/"==i||"\\"==i&&isSpecial(t)||t.path.push("")):isSingleDot(f)?"/"==i||"\\"==i&&isSpecial(t)||t.path.push(""):("file"==t.scheme&&!t.path.length&&isWindowsDriveLetter(f)&&(t.host&&(t.host=""),f=f.charAt(0)+":"),t.path.push(f)),f="","file"==t.scheme&&(i==Un||"?"==i||"#"==i))for(;t.path.length>1&&""===t.path[0];)t.path.shift();"?"==i?(t.query="",s=jo):"#"==i&&(t.fragment="",s=Ao)}else f+=percentEncode(i,no);break;case ko:"?"==i?(t.query="",s=jo):"#"==i?(t.fragment="",s=Ao):i!=Un&&(t.path[0]+=percentEncode(i,eo));break;case jo:r||"#"!=i?i!=Un&&("'"==i&&isSpecial(t)?t.query+="%27":t.query+="#"==i?"%23":percentEncode(i,eo)):(t.fragment="",s=Ao);break;case Ao:i!=Un&&(t.fragment+=percentEncode(i,ro))}l++}},Lo=function URL(t){var e,n,o=anInstance(this,Lo,"URL"),i=arguments.length>1?arguments[1]:void 0,a=String(t),c=Bn(o,{type:"URL"});if(void 0!==i)if(i instanceof Lo)e=qn(i);else if(n=parseURL(e={},String(i)))throw TypeError(n);if(n=parseURL(c,a,null,e))throw TypeError(n);var u=c.searchParams=new Gn,s=Nn(u);s.updateSearchParams(c.query),s.updateURL=function(){c.query=String(u)||null},r||(o.href=serializeURL.call(o),o.origin=getOrigin.call(o),o.protocol=getProtocol.call(o),o.username=getUsername.call(o),o.password=getPassword.call(o),o.host=getHost.call(o),o.hostname=getHostname.call(o),o.port=getPort.call(o),o.pathname=getPathname.call(o),o.search=getSearch.call(o),o.searchParams=getSearchParams.call(o),o.hash=getHash.call(o))},Ro=Lo.prototype,serializeURL=function(){var t=qn(this),e=t.scheme,r=t.username,n=t.password,o=t.host,i=t.port,a=t.path,c=t.query,u=t.fragment,s=e+":";return null!==o?(s+="//",includesCredentials(t)&&(s+=r+(n?":"+n:"")+"@"),s+=serializeHost(o),null!==i&&(s+=":"+i)):"file"==e&&(s+="//"),s+=t.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==c&&(s+="?"+c),null!==u&&(s+="#"+u),s},getOrigin=function(){var t=qn(this),e=t.scheme,r=t.port;if("blob"==e)try{return new URL(e.path[0]).origin}catch(t){return"null"}return"file"!=e&&isSpecial(t)?e+"://"+serializeHost(t.host)+(null!==r?":"+r:""):"null"},getProtocol=function(){return qn(this).scheme+":"},getUsername=function(){return qn(this).username},getPassword=function(){return qn(this).password},getHost=function(){var t=qn(this),e=t.host,r=t.port;return null===e?"":null===r?serializeHost(e):serializeHost(e)+":"+r},getHostname=function(){var t=qn(this).host;return null===t?"":serializeHost(t)},getPort=function(){var t=qn(this).port;return null===t?"":String(t)},getPathname=function(){var t=qn(this),e=t.path;return t.cannotBeABaseURL?e[0]:e.length?"/"+e.join("/"):""},getSearch=function(){var t=qn(this).query;return t?"?"+t:""},getSearchParams=function(){return qn(this).searchParams},getHash=function(){var t=qn(this).fragment;return t?"#"+t:""},accessorDescriptor=function(t,e){return{get:t,set:e,configurable:!0,enumerable:!0}};if(r&&ft(Ro,{href:accessorDescriptor(serializeURL,(function(t){var e=qn(this),r=String(t),n=parseURL(e,r);if(n)throw TypeError(n);Nn(e.searchParams).updateSearchParams(e.query)})),origin:accessorDescriptor(getOrigin),protocol:accessorDescriptor(getProtocol,(function(t){var e=qn(this);parseURL(e,String(t)+":",ao)})),username:accessorDescriptor(getUsername,(function(t){var e=qn(this),r=gn(String(t));if(!cannotHaveUsernamePasswordPort(e)){e.username="";for(var n=0;n<r.length;n++)e.username+=percentEncode(r[n],oo)}})),password:accessorDescriptor(getPassword,(function(t){var e=qn(this),r=gn(String(t));if(!cannotHaveUsernamePasswordPort(e)){e.password="";for(var n=0;n<r.length;n++)e.password+=percentEncode(r[n],oo)}})),host:accessorDescriptor(getHost,(function(t){var e=qn(this);e.cannotBeABaseURL||parseURL(e,String(t),yo)})),hostname:accessorDescriptor(getHostname,(function(t){var e=qn(this);e.cannotBeABaseURL||parseURL(e,String(t),mo)})),port:accessorDescriptor(getPort,(function(t){var e=qn(this);cannotHaveUsernamePasswordPort(e)||(""==(t=String(t))?e.port=null:parseURL(e,t,bo))})),pathname:accessorDescriptor(getPathname,(function(t){var e=qn(this);e.cannotBeABaseURL||(e.path=[],parseURL(e,t+"",Eo))})),search:accessorDescriptor(getSearch,(function(t){var e=qn(this);""==(t=String(t))?e.query=null:("?"==t.charAt(0)&&(t=t.slice(1)),e.query="",parseURL(e,t,jo)),Nn(e.searchParams).updateSearchParams(e.query)})),searchParams:accessorDescriptor(getSearchParams),hash:accessorDescriptor(getHash,(function(t){var e=qn(this);""!=(t=String(t))?("#"==t.charAt(0)&&(t=t.slice(1)),e.fragment="",parseURL(e,t,Ao)):e.fragment=null}))}),B(Ro,"toJSON",(function toJSON(){return serializeURL.call(this)}),{enumerable:!0}),B(Ro,"toString",(function toString(){return serializeURL.call(this)}),{enumerable:!0}),Fn){var Po=Fn.createObjectURL,_o=Fn.revokeObjectURL;Po&&B(Lo,"createObjectURL",(function createObjectURL(t){return Po.apply(Fn,arguments)})),_o&&B(Lo,"revokeObjectURL",(function revokeObjectURL(t){return _o.apply(Fn,arguments)}))}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function asyncGeneratorStep(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function _next(t){asyncGeneratorStep(i,n,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(i,n,o,_next,_throw,"throw",t)}_next(void 0)}))}}setToStringTag(Lo,"URL"),_export({global:!0,forced:!fn,sham:!r},{URL:Lo}),defineWellKnownSymbol("asyncIterator"),defineWellKnownSymbol("iterator"),defineWellKnownSymbol("toStringTag");var Io=[].reverse,To=[1,2];_export({target:"Array",proto:!0,forced:String(To)===String(To.reverse())},{reverse:function reverse(){return st(this)&&(this.length=this.length),Io.call(this)}});var Uo=arrayMethodHasSpeciesSupport("slice"),Co=arrayMethodUsesToLength("slice",{ACCESSORS:!0,0:0,1:2}),Mo=wellKnownSymbol("species"),Fo=[].slice,Go=Math.max;_export({target:"Array",proto:!0,forced:!Uo||!Co},{slice:function slice(t,e){var r,n,o,i=toIndexedObject(this),a=toLength(i.length),c=toAbsoluteIndex(t,a),u=toAbsoluteIndex(void 0===e?a:e,a);if(st(i)&&("function"!=typeof(r=i.constructor)||r!==Array&&!st(r.prototype)?isObject(r)&&null===(r=r[Mo])&&(r=void 0):r=void 0,r===Array||void 0===r))return Fo.call(i,c,u);for(n=new(void 0===r?Array:r)(Go(u-c,0)),o=0;c<u;c++,o++)c in i&&createProperty(n,o,i[c]);return n.length=o,n}});var No=Date.prototype,Bo=No.toString,qo=No.getTime;new Date(NaN)+""!="Invalid Date"&&B(No,"toString",(function toString(){var t=qo.call(this);return t==t?Bo.call(this):"Invalid Date"})),setToStringTag(e.JSON,"JSON",!0),setToStringTag(Math,"Math",!0),_export({target:"Object",stat:!0,sham:!r},{create:dt}),_export({target:"Object",stat:!0,forced:!r,sham:!r},{defineProperty:v.f});var Do=fails((function(){We(1)}));_export({target:"Object",stat:!0,forced:Do,sham:!qe},{getPrototypeOf:function getPrototypeOf(t){return We(toObject(t))}}),_export({target:"Object",stat:!0},{setPrototypeOf:Ke});var $o=e.Promise,Wo=wellKnownSymbol("species"),zo=createCommonjsModule((function(t){var Result=function(t,e){this.stopped=t,this.result=e};(t.exports=function(t,e,r,n,o){var i,a,c,u,s,l,f,h=functionBindContext(e,r,n?2:1);if(o)i=t;else{if("function"!=typeof(a=getIteratorMethod(t)))throw TypeError("Target is not iterable");if(isArrayIteratorMethod(a)){for(c=0,u=toLength(t.length);u>c;c++)if((s=n?h(anObject(f=t[c])[0],f[1]):h(t[c]))&&s instanceof Result)return s;return new Result(!1)}i=a.call(t)}for(l=i.next;!(f=l.call(i)).done;)if("object"==typeof(s=callWithSafeIterationClosing(i,h,f.value,n))&&s&&s instanceof Result)return s;return new Result(!1)}).stop=function(t){return new Result(!0,t)}})),Vo=wellKnownSymbol("iterator"),Jo=!1;try{var Yo=0,Ko={next:function(){return{done:!!Yo++}},return:function(){Jo=!0}};Ko[Vo]=function(){return this},Array.from(Ko,(function(){throw 2}))}catch(t){}var Ho,Xo,Qo,Zo=wellKnownSymbol("species"),speciesConstructor=function(t,e){var r,n=anObject(t).constructor;return void 0===n||null==(r=anObject(n)[Zo])?e:aFunction$1(r)},ti=/(iphone|ipod|ipad).*applewebkit/i.test(pe),ei=e.location,ri=e.setImmediate,ni=e.clearImmediate,oi=e.process,ii=e.MessageChannel,ai=e.Dispatch,ci=0,ui={},run=function(t){if(ui.hasOwnProperty(t)){var e=ui[t];delete ui[t],e()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){e.postMessage(t+"",ei.protocol+"//"+ei.host)};ri&&ni||(ri=function setImmediate(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return ui[++ci]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},Ho(ci),ci},ni=function clearImmediate(t){delete ui[t]},"process"==classofRaw(oi)?Ho=function(t){oi.nextTick(runner(t))}:ai&&ai.now?Ho=function(t){ai.now(runner(t))}:ii&&!ti?(Qo=(Xo=new ii).port2,Xo.port1.onmessage=listener,Ho=functionBindContext(Qo.postMessage,Qo,1)):!e.addEventListener||"function"!=typeof postMessage||e.importScripts||fails(post)||"file:"===ei.protocol?Ho="onreadystatechange"in documentCreateElement("script")?function(t){ht.appendChild(documentCreateElement("script")).onreadystatechange=function(){ht.removeChild(this),run(t)}}:function(t){setTimeout(runner(t),0)}:(Ho=post,e.addEventListener("message",listener,!1)));var si,li,fi,hi,pi,di,gi,vi,yi={set:ri,clear:ni},mi=d.f,bi=yi.set,wi=e.MutationObserver||e.WebKitMutationObserver,xi=e.process,Si=e.Promise,Ei="process"==classofRaw(xi),Oi=mi(e,"queueMicrotask"),ki=Oi&&Oi.value;ki||(si=function(){var t,e;for(Ei&&(t=xi.domain)&&t.exit();li;){e=li.fn,li=li.next;try{e()}catch(t){throw li?hi():fi=void 0,t}}fi=void 0,t&&t.enter()},Ei?hi=function(){xi.nextTick(si)}:wi&&!ti?(pi=!0,di=document.createTextNode(""),new wi(si).observe(di,{characterData:!0}),hi=function(){di.data=pi=!pi}):Si&&Si.resolve?(gi=Si.resolve(void 0),vi=gi.then,hi=function(){vi.call(gi,si)}):hi=function(){bi.call(e,si)});var ji,Ai,Li,Ri,Pi=ki||function(t){var e={fn:t,next:void 0};fi&&(fi.next=e),li||(li=e,hi()),fi=e},PromiseCapability=function(t){var e,r;this.promise=new t((function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n})),this.resolve=aFunction$1(e),this.reject=aFunction$1(r)},_i={f:function(t){return new PromiseCapability(t)}},promiseResolve=function(t,e){if(anObject(t),isObject(e)&&e.constructor===t)return e;var r=_i.f(t);return(0,r.resolve)(e),r.promise},perform=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Ii=yi.set,Ti=wellKnownSymbol("species"),Ui="Promise",Ci=N.get,Mi=N.set,Fi=N.getterFor(Ui),Gi=$o,Ni=e.TypeError,Bi=e.document,qi=e.process,Di=getBuiltIn("fetch"),$i=_i.f,Wi=$i,zi="process"==classofRaw(qi),Vi=!!(Bi&&Bi.createEvent&&e.dispatchEvent),Ji=it(Ui,(function(){if(!(E(Gi)!==String(Gi))){if(66===ye)return!0;if(!zi&&"function"!=typeof PromiseRejectionEvent)return!0}if(ye>=51&&/native code/.test(Gi))return!1;var t=Gi.resolve(1),FakePromise=function(t){t((function(){}),(function(){}))};return(t.constructor={})[Ti]=FakePromise,!(t.then((function(){}))instanceof FakePromise)})),Yi=Ji||!function(t,e){if(!e&&!Jo)return!1;var r=!1;try{var n={};n[Vo]=function(){return{next:function(){return{done:r=!0}}}},t(n)}catch(t){}return r}((function(t){Gi.all(t).catch((function(){}))})),isThenable=function(t){var e;return!(!isObject(t)||"function"!=typeof(e=t.then))&&e},notify$1=function(t,e,r){if(!e.notified){e.notified=!0;var n=e.reactions;Pi((function(){for(var o=e.value,i=1==e.state,a=0;n.length>a;){var c,u,s,l=n[a++],f=i?l.ok:l.fail,h=l.resolve,p=l.reject,d=l.domain;try{f?(i||(2===e.rejection&&onHandleUnhandled(t,e),e.rejection=1),!0===f?c=o:(d&&d.enter(),c=f(o),d&&(d.exit(),s=!0)),c===l.promise?p(Ni("Promise-chain cycle")):(u=isThenable(c))?u.call(c,h,p):h(c)):p(o)}catch(t){d&&!s&&d.exit(),p(t)}}e.reactions=[],e.notified=!1,r&&!e.rejection&&onUnhandled(t,e)}))}},dispatchEvent=function(t,r,n){var o,i;Vi?((o=Bi.createEvent("Event")).promise=r,o.reason=n,o.initEvent(t,!1,!0),e.dispatchEvent(o)):o={promise:r,reason:n},(i=e["on"+t])?i(o):"unhandledrejection"===t&&function(t,r){var n=e.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,r))}("Unhandled promise rejection",n)},onUnhandled=function(t,r){Ii.call(e,(function(){var e,n=r.value;if(isUnhandled(r)&&(e=perform((function(){zi?qi.emit("unhandledRejection",n,t):dispatchEvent("unhandledrejection",t,n)})),r.rejection=zi||isUnhandled(r)?2:1,e.error))throw e.value}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t,r){Ii.call(e,(function(){zi?qi.emit("rejectionHandled",t):dispatchEvent("rejectionhandled",t,r.value)}))},bind=function(t,e,r,n){return function(o){t(e,r,o,n)}},internalReject=function(t,e,r,n){e.done||(e.done=!0,n&&(e=n),e.value=r,e.state=2,notify$1(t,e,!0))},internalResolve=function(t,e,r,n){if(!e.done){e.done=!0,n&&(e=n);try{if(t===r)throw Ni("Promise can't be resolved itself");var o=isThenable(r);o?Pi((function(){var n={done:!1};try{o.call(r,bind(internalResolve,t,n,e),bind(internalReject,t,n,e))}catch(r){internalReject(t,n,r,e)}})):(e.value=r,e.state=1,notify$1(t,e,!1))}catch(r){internalReject(t,{done:!1},r,e)}}};Ji&&(Gi=function Promise(t){anInstance(this,Gi,Ui),aFunction$1(t),ji.call(this);var e=Ci(this);try{t(bind(internalResolve,this,e),bind(internalReject,this,e))}catch(t){internalReject(this,e,t)}},(ji=function Promise(t){Mi(this,{type:Ui,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=redefineAll(Gi.prototype,{then:function then(t,e){var r=Fi(this),n=$i(speciesConstructor(this,Gi));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=zi?qi.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&notify$1(this,r,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),Ai=function(){var t=new ji,e=Ci(t);this.promise=t,this.resolve=bind(internalResolve,t,e),this.reject=bind(internalReject,t,e)},_i.f=$i=function(t){return t===Gi||t===Li?new Ai(t):Wi(t)},"function"==typeof $o&&(Ri=$o.prototype.then,B($o.prototype,"then",(function then(t,e){var r=this;return new Gi((function(t,e){Ri.call(r,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof Di&&_export({global:!0,enumerable:!0,forced:!0},{fetch:function fetch(t){return promiseResolve(Gi,Di.apply(e,arguments))}}))),_export({global:!0,wrap:!0,forced:Ji},{Promise:Gi}),setToStringTag(Gi,Ui,!1),function(t){var e=getBuiltIn(t),n=v.f;r&&e&&!e[Wo]&&n(e,Wo,{configurable:!0,get:function(){return this}})}(Ui),Li=getBuiltIn(Ui),_export({target:Ui,stat:!0,forced:Ji},{reject:function reject(t){var e=$i(this);return e.reject.call(void 0,t),e.promise}}),_export({target:Ui,stat:!0,forced:Ji},{resolve:function resolve(t){return promiseResolve(this,t)}}),_export({target:Ui,stat:!0,forced:Yi},{all:function all(t){var e=this,r=$i(e),n=r.resolve,o=r.reject,i=perform((function(){var r=aFunction$1(e.resolve),i=[],a=0,c=1;zo(t,(function(t){var u=a++,s=!1;i.push(void 0),c++,r.call(e,t).then((function(t){s||(s=!0,i[u]=t,--c||n(i))}),o)})),--c||n(i)}));return i.error&&o(i.value),r.promise},race:function race(t){var e=this,r=$i(e),n=r.reject,o=perform((function(){var o=aFunction$1(e.resolve);zo(t,(function(t){o.call(e,t).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var Ki=RegExp.prototype,Hi=Ki.toString,Xi=fails((function(){return"/a/b"!=Hi.call({source:"a",flags:"b"})})),Qi="toString"!=Hi.name;(Xi||Qi)&&B(RegExp.prototype,"toString",(function toString(){var t=anObject(this),e=String(t.source),r=t.flags;return"/"+e+"/"+String(void 0===r&&t instanceof RegExp&&!("flags"in Ki)?regexpFlags.call(t):r)}),{unsafe:!0});createCommonjsModule((function(t){var e=function(t){var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,r){return t[e]=r}}function wrap(t,e,r,n){var o=e&&e.prototype instanceof Generator?e:Generator,i=Object.create(o.prototype),a=new Context(n||[]);return i._invoke=function makeInvokeMethod(t,e,r){var n=u;return function invoke(o,i){if(n===l)throw new Error("Generator is already running");if(n===f){if("throw"===o)throw i;return doneResult()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=maybeInvokeDelegate(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===u)throw n=f,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=l;var p=tryCatch(t,e,r);if("normal"===p.type){if(n=r.done?f:s,p.arg===h)continue;return{value:p.arg,done:r.done}}"throw"===p.type&&(n=f,r.method="throw",r.arg=p.arg)}}}(t,r,a),i}function tryCatch(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=wrap;var u="suspendedStart",s="suspendedYield",l="executing",f="completed",h={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};p[i]=function(){return this};var d=Object.getPrototypeOf,g=d&&d(d(values([])));g&&g!==r&&n.call(g,i)&&(p=g);var v=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){var r;this._invoke=function enqueue(o,i){function callInvokeWithMethodAndArg(){return new e((function(r,a){!function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if("throw"!==c.type){var u=c.arg,s=u.value;return s&&"object"===_typeof(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){invoke("next",t,i,a)}),(function(t){invoke("throw",t,i,a)})):e.resolve(s).then((function(t){u.value=t,i(u)}),(function(t){return invoke("throw",t,i,a)}))}a(c.arg)}(o,i,r,a)}))}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,maybeInvokeDelegate(t,r),"throw"===r.method))return h;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=tryCatch(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,h;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,h):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function resetTryEntry(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function next(){for(;++o<t.length;)if(n.call(t,o))return next.value=t[o],next.done=!1,next;return next.value=e,next.done=!0,next};return a.next=a}}return{next:doneResult}}function doneResult(){return{value:e,done:!0}}return GeneratorFunction.prototype=v.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunction.displayName=define(GeneratorFunctionPrototype,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,c,"GeneratorFunction")),t.prototype=Object.create(v),t},t.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[a]=function(){return this},t.AsyncIterator=AsyncIterator,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new AsyncIterator(wrap(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},defineIteratorMethods(v),define(v,c,"Generator"),v[i]=function(){return this},v.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function next(){for(;e.length;){var r=e.pop();if(r in t)return next.value=r,next.done=!1,next}return next.done=!0,next}},t.values=values,Context.prototype={constructor:Context,reset:function reset(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(resetTryEntry),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var r=this;function handle(n,o){return a.type="throw",a.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return handle("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0);if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return handle(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return handle(i.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function complete(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),h}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;resetTryEntry(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,r,n){return this.delegate={iterator:values(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}));var Zi=Lt.find,ta=!0,ea=arrayMethodUsesToLength("find");"find"in[]&&Array(1).find((function(){ta=!1})),_export({target:"Array",proto:!0,forced:ta||!ea},{find:function find(t){return Zi(this,t,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("find");var ra=[].join,na=u!=Object,oa=arrayMethodIsStrict("join",",");_export({target:"Array",proto:!0,forced:na||!oa},{join:function join(t){return ra.call(toIndexedObject(this),void 0===t?",":t)}});var ia=Lt.some,aa=arrayMethodIsStrict("some"),ca=arrayMethodUsesToLength("some");_export({target:"Array",proto:!0,forced:!aa||!ca},{some:function some(t){return ia(this,t,arguments.length>1?arguments[1]:void 0)}});var ua=i.f,createMethod$3=function(t){return function(e){for(var n,o=toIndexedObject(e),i=lt(o),a=i.length,c=0,u=[];a>c;)n=i[c++],r&&!ua.call(o,n)||u.push(t?[n,o[n]]:o[n]);return u}},sa={entries:createMethod$3(!0),values:createMethod$3(!1)}.entries;_export({target:"Object",stat:!0},{entries:function entries(t){return sa(t)}});var la=[].push,fa=Math.min,ha=!fails((function(){return!RegExp(4294967295,"y")}));fixRegexpWellKnownSymbolLogic("split",2,(function(t,e,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var n=String(requireObjectCoercible(this)),o=void 0===r?4294967295:r>>>0;if(0===o)return[];if(void 0===t)return[n];if(!isRegexp(t))return e.call(n,t,o);for(var i,a,c,u=[],s=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),l=0,f=new RegExp(t.source,s+"g");(i=Ar.call(f,n))&&!((a=f.lastIndex)>l&&(u.push(n.slice(l,i.index)),i.length>1&&i.index<n.length&&la.apply(u,i.slice(1)),c=i[0].length,l=a,u.length>=o));)f.lastIndex===i.index&&f.lastIndex++;return l===n.length?!c&&f.test("")||u.push(""):u.push(n.slice(l)),u.length>o?u.slice(0,o):u}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:e.call(this,t,r)}:e,[function split(e,r){var o=requireObjectCoercible(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,o,r):n.call(String(o),e,r)},function(t,o){var i=r(n,t,this,o,n!==e);if(i.done)return i.value;var a=anObject(t),c=String(this),u=speciesConstructor(a,RegExp),s=a.unicode,l=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(ha?"y":"g"),f=new u(ha?a:"^(?:"+a.source+")",l),h=void 0===o?4294967295:o>>>0;if(0===h)return[];if(0===c.length)return null===regexpExecAbstract(f,c)?[c]:[];for(var p=0,d=0,g=[];d<c.length;){f.lastIndex=ha?d:0;var v,y=regexpExecAbstract(f,ha?c:c.slice(d));if(null===y||(v=fa(toLength(f.lastIndex+(ha?0:d)),c.length))===p)d=advanceStringIndex(c,d,s);else{if(g.push(c.slice(p,d)),g.length===h)return g;for(var m=1;m<=y.length-1;m++)if(g.push(y[m]),g.length===h)return g;d=p=v}}return g.push(c.slice(p)),g}]}),!ha);var pa="\t\n\v\f\r    \u2028\u2029\ufeff",da="["+pa+"]",ga=RegExp("^"+da+da+"*"),va=RegExp(da+da+"*$"),createMethod$4=function(t){return function(e){var r=String(requireObjectCoercible(e));return 1&t&&(r=r.replace(ga,"")),2&t&&(r=r.replace(va,"")),r}},ya={start:createMethod$4(1),end:createMethod$4(2),trim:createMethod$4(3)},ma=ya.trim;_export({target:"String",proto:!0,forced:function(t){return fails((function(){return!!pa[t]()||"…"!="…"[t]()||pa[t].name!==t}))}("trim")},{trim:function trim(){return ma(this)}});var ba=/"/g;_export({target:"String",proto:!0,forced:function(t){return fails((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}("bold")},{bold:function bold(){return t="b",e="",r="",n=String(requireObjectCoercible(this)),o="<"+t,""!==e&&(o+=" "+e+'="'+String(r).replace(ba,"&quot;")+'"'),o+">"+n+"</"+t+">";var t,e,r,n,o}});
/**
* Localizing script for SVG-edit UI.
* @module locale
* @license MIT
*
* @copyright 2010 Narendra Sisodya
* @copyright 2010 Alexis Deveria
*
*/
jQuery;var wa=function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function _callee2(t,e){var r;return regeneratorRuntime.wrap((function _callee2$(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,import("./extensions/ext-".concat(t,"/locale/").concat(e,".js"));case 3:r=n.sent,n.next=12;break;case 6:return n.prev=6,n.t0=n.catch(0),console.error("Missing translation (".concat(e,") for extension ").concat(t," - using 'en'")),n.next=11,import("./extensions/ext-".concat(t,"/locale/en.js"));case 11:r=n.sent;case 12:return n.abrupt("return",r.default);case 13:case"end":return n.stop()}}),_callee2,null,[[0,6]])})));return function loadExtensionTranslation(e,r){return t.apply(this,arguments)}}(),xa={name:"imagelib",init:function init(t){var e=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var r,n,o,i,a,c,u,s,l,f,h,p,d,g,v,y,m,b,w,x,S;return regeneratorRuntime.wrap((function _callee2$(E){for(;;)switch(E.prev=E.next){case 0:return x=function _showBrowser(){var t=r("#imgbrowse");if(t.length)r("#imgbrowse_holder").show();else{r("<div id=imgbrowse_holder><div id=imgbrowse class=toolbar_button></div></div>").insertAfter("#svg_docprops"),t=r("#imgbrowse");var e=a.select_lib,n=r("<ul id=imglib_opts>").appendTo(t),o=r('<iframe src="javascript:0"/>').prependTo(t).hide().wrap("<div id=lib_framewrap>"),i=r("<h1>").prependTo(t).text(e).css({position:"absolute",top:0,left:0,width:"100%"}),u=r("<button>"+c.common.cancel+"</button>").appendTo(t).on("click touchend",(function(){r("#imgbrowse_holder").hide()})).css({position:"absolute",top:5,right:-10}),s=r("<span>").css({position:"absolute",top:5,left:10}).appendTo(t),l=r("<button hidden>"+a.show_list+"</button>").appendTo(s).on("click touchend",(function(){o.attr("src","about:blank").hide(),n.show(),i.text(e),l.hide()})).css({"margin-right":5}).hide();r("<select><option value=s>"+a.import_single+"</option><option value=m>"+a.import_multi+"</option><option value=o>"+a.open+"</option></select>").appendTo(s).change((function(){switch(p=r(this).val()){case"s":case"o":w(!1);break;case"m":w(!0)}})).css({"margin-top":10}),u.prepend(r.getSvgIcon("cancel",!0)),l.prepend(r.getSvgIcon("tool_imagelib",!0)),a.imgLibs.forEach((function(t){var e=t.name,a=t.url,c=t.description;r("<li>").appendTo(n).text(e).on("click touchend",(function(){o.attr("src",a).show(),i.text(e),n.hide(),l.show()})).append("<span>".concat(c,"</span>"))}))}},w=function _toggleMulti(t){r("#lib_framewrap, #imglib_opts").css({right:t?200:10}),v||(v=r("<div id=imglib_preview>").css({position:"absolute",top:45,right:10,width:180,bottom:45,background:"#fff",overflow:"auto"}).insertAfter("#lib_framewrap"),y=r("<button disabled>Import selected</button>").appendTo("#imgbrowse").on("click touchend",(function(){r.each(d,(function(t){var e=this[0],r=this[1];"svg"===e?u.importSvgString(r):f(r),u.moveSelectedElements(20*t,20*t,!1)})),v.empty(),d=[],r("#imgbrowse_holder").hide()})).css({position:"absolute",bottom:10,right:-10})),v.toggle(t),y.toggle(t)},b=function _onMessage3(){return(b=_asyncToGenerator(regeneratorRuntime.mark((function _callee(t){var e,a,m,b,w,x,S,E,O,k,j,A,L,R,P,_,I;return regeneratorRuntime.wrap((function _callee$(T){for(;;)switch(T.prev=T.next){case 0:if(e=t.origin,(a=t.data)&&["string","object"].includes(_typeof(a))){T.next=3;break}return T.abrupt("return");case 3:if(T.prev=3,"imagelib"===(a="object"===_typeof(a)?a:JSON.parse(a)).namespace){T.next=7;break}return T.abrupt("return");case 7:if(s.includes("*")||s.includes(e)){T.next=10;break}return console.log("Origin ".concat(e," not whitelisted for posting to ").concat(window.origin)),T.abrupt("return");case 10:if(x="href"in a,(w="name"in a)||!g){T.next=15;break}return g=!1,T.abrupt("return");case 15:x&&(m=a.href,a=a.data),r("#dialog_box").hide(),b=w?"meta":a.charAt(0),T.next=28;break;case 20:if(T.prev=20,T.t0=T.catch(3),"string"!=typeof a){T.next=28;break}if("{"===(S=a.charAt(0))||!g){T.next=27;break}return g=!1,T.abrupt("return");case 27:"|"===S&&(E=a.indexOf("|",1),m=a.substr(1,E-1),a=a.substr(E+1),b=a.charAt(0));case 28:T.t1=b,T.next="meta"===T.t1?31:"<"===T.t1?47:"d"===T.t1?49:60;break;case 31:if(g=!1,h[(k=a).id]=k,L=k.name||"file",R=c.notification.retrieving.replace("%s",L),"m"===p){T.next=43;break}return T.next=39,r.process_cancel(R);case 39:g=!0,r("#dialog_box").hide(),T.next=46;break;case 43:O=r("<div>").text(R).data("id",k.id),v.append(O),k.entry=O;case 46:return T.abrupt("return");case 47:return j=!0,T.abrupt("break",62);case 49:if(!a.startsWith("data:image/svg+xml")){T.next=57;break}return"data:image/svg+xml;base64,",P=a.substring("data:image/svg+xml;base64,".length),a=n(P),j=!0,T.abrupt("break",62);case 57:if(!a.startsWith("data:image/")){T.next=60;break}return A=!0,T.abrupt("break",62);case 60:return"m"!==p?l():h[m].entry.remove(),T.abrupt("return");case 62:T.t2=p,T.next="s"===T.t2?65:"m"===T.t2?68:"o"===T.t2?72:83;break;case 65:return j?u.importSvgString(a):A&&f(a),l(),T.abrupt("break",83);case 68:return d.push([j?"svg":"img",a]),k=h[m],j?(k&&k.name?_=k.name:(I=(new DOMParser).parseFromString(o(a),"text/xml").documentElement,_=r(I).children("title").first().text()||"(SVG #"+a.length+")"),k?v.children().each((function(){r(this).data("id")===m&&(k.preview_url?r(this).html(r("<span>").append(r("<img>").attr("src",k.preview_url),_)):r(this).text(_),y.removeAttr("disabled"))})):(v.append(r("<div>").text(_)),y.removeAttr("disabled"))):(k&&k.preview_url?(_=k.name||"",O=r("<span>").append(r("<img>").attr("src",k.preview_url),_)):O=r("<img>").attr("src",a),k?v.children().each((function(){r(this).data("id")===m&&(r(this).html(O),y.removeAttr("disabled"))})):(v.append(r("<div>").append(O)),y.removeAttr("disabled"))),T.abrupt("break",83);case 72:if(j){T.next=74;break}return T.abrupt("break",83);case 74:return l(),T.next=77,i.openPrep();case 77:if(T.sent){T.next=80;break}return T.abrupt("return");case 80:return u.clear(),u.setSvgString(a),T.abrupt("break",83);case 83:case"end":return T.stop()}}),_callee,null,[[3,20]])})))).apply(this,arguments)},m=function _onMessage2(t){return b.apply(this,arguments)},f=function _importImage(t){var e=u.addSVGElementFromJson({element:"image",attr:{x:0,y:0,width:0,height:0,id:u.getNextId(),style:"pointer-events:inherit"}});u.clearSelection(),u.addToSelection([e]),u.setImageURL(t)},l=function _closeBrowser(){r("#imgbrowse_holder").hide(),document.activeElement.blur()},r=t.$,n=t.decode64,o=t.dropXMLInternalSubset,i=e,E.next=10,wa("imagelib",i.curPrefs.lang);case 10:return a=E.sent,c=i.uiStrings,u=i.canvas,s=a.imgLibs.map((function(t){var e=t.url;try{return new URL(e).origin}catch(t){return location.origin}})),h={},p="s",d=[],g=!1,window.addEventListener("message",m,!0),S=[{id:"tool_imagelib",type:"app_menu",icon:"imagelib.png",position:4,events:{mouseup:x}}],E.abrupt("return",{svgicons:"ext-imagelib.xml",buttons:a.buttons.map((function(t,e){return Object.assign(S[e],t)})),callback:function callback(){r("<style>").text("#imgbrowse_holder {position: absolute;top: 0;left: 0;width: 100%;height: 100%;background-color: rgba(0, 0, 0, .5);z-index: 5;}#imgbrowse {position: absolute;top: 25px;left: 25px;right: 25px;bottom: 25px;min-width: 300px;min-height: 200px;background: #B0B0B0;border: 1px outset #777;}#imgbrowse h1 {font-size: 20px;margin: .4em;text-align: center;}#lib_framewrap,#imgbrowse > ul {position: absolute;top: 45px;left: 10px;right: 10px;bottom: 10px;background: white;margin: 0;padding: 0;}#imgbrowse > ul {overflow: auto;}#imgbrowse > div {border: 1px solid #666;}#imglib_preview > div {padding: 5px;font-size: 12px;}#imglib_preview img {display: block;margin: 0 auto;max-height: 100px;}#imgbrowse li {list-style: none;padding: .5em;background: #E8E8E8;border-bottom: 1px solid #B0B0B0;line-height: 1.2em;font-style: sans-serif;}#imgbrowse li > span {color: #666;font-size: 15px;display: block;}#imgbrowse li:hover {background: #FFC;cursor: pointer;}#imgbrowse iframe {width: 100%;height: 100%;border: 0;}").appendTo("head")}});case 20:case"end":return E.stop()}}),_callee2)})))()}};export default xa;
//# sourceMappingURL=ext-imagelib.js.map