svgedit/dist/editor/system/extensions/ext-server_moinsave/ext-server_moinsave.js

20 lines
154 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.

System.register([],(function(t,e){"use strict";return{execute:function(){var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(t,e,n){return t(n={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&&n.path)}},n.exports),n.exports}var check=function(t){return t&&t.Math==Math&&t},i=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof n&&n)||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},s=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),o={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,u={f:l&&!o.call({1:2},1)?function propertyIsEnumerable(t){var e=l(this,t);return!!e&&e.enumerable}:o},createPropertyDescriptor=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},h={}.toString,classofRaw=function(t){return h.call(t).slice(8,-1)},p="".split,d=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?p.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 d(requireObjectCoercible(t))},isObject=function(t){return"object"==typeof t?null!==t:"function"==typeof t},toPrimitive=function(t,e){if(!isObject(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!isObject(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!isObject(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!isObject(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")},v={}.hasOwnProperty,has=function(t,e){return v.call(t,e)},g=i.document,b=isObject(g)&&isObject(g.createElement),documentCreateElement=function(t){return b?g.createElement(t):{}},_=!s&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),w=Object.getOwnPropertyDescriptor,P={f:s?w:function getOwnPropertyDescriptor(t,e){if(t=toIndexedObject(t),e=toPrimitive(e,!0),_)try{return w(t,e)}catch(t){}if(has(t,e))return createPropertyDescriptor(!u.f.call(t,e),t[e])}},anObject=function(t){if(!isObject(t))throw TypeError(String(t)+" is not an object");return t},k=Object.defineProperty,C={f:s?k:function defineProperty(t,e,n){if(anObject(t),e=toPrimitive(e,!0),anObject(n),_)try{return k(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},E=s?function(t,e,n){return C.f(t,e,createPropertyDescriptor(1,n))}:function(t,e,n){return t[e]=n,t},setGlobal=function(t,e){try{E(i,t,e)}catch(n){i[t]=e}return e},S="__core-js_shared__",A=i[S]||setGlobal(S,{}),T=Function.toString;"function"!=typeof A.inspectSource&&(A.inspectSource=function(t){return T.call(t)});var O,R,M,B=A.inspectSource,V=i.WeakMap,I="function"==typeof V&&/native code/.test(B(V)),L=createCommonjsModule((function(t){(t.exports=function(t,e){return A[t]||(A[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),j=0,N=Math.random(),uid=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++j+N).toString(36)},D=L("keys"),sharedKey=function(t){return D[t]||(D[t]=uid(t))},G={},U=i.WeakMap;if(I){var z=new U,W=z.get,q=z.has,X=z.set;O=function(t,e){return X.call(z,t,e),e},R=function(t){return W.call(z,t)||{}},M=function(t){return q.call(z,t)}}else{var $=sharedKey("state");G[$]=!0,O=function(t,e){return E(t,$,e),e},R=function(t){return has(t,$)?t[$]:{}},M=function(t){return has(t,$)}}var H,Y,Q={set:O,get:R,has:M,enforce:function(t){return M(t)?R(t):O(t,{})},getterFor:function(t){return function(e){var n;if(!isObject(e)||(n=R(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},Z=createCommonjsModule((function(t){var e=Q.get,n=Q.enforce,s=String(String).split("String");(t.exports=function(t,e,o,l){var u=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,p=!!l&&!!l.noTargetGet;"function"==typeof o&&("string"!=typeof e||has(o,"name")||E(o,"name",e),n(o).source=s.join("string"==typeof e?e:"")),t!==i?(u?!p&&t[e]&&(h=!0):delete t[e],h?t[e]=o:E(t,e,o)):h?t[e]=o:setGlobal(e,o)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&e(this).source||B(this)}))})),J=i,aFunction=function(t){return"function"==typeof t?t:void 0},getBuiltIn=function(t,e){return arguments.length<2?aFunction(J[t])||aFunction(i[t]):J[t]&&J[t][e]||i[t]&&i[t][e]},K=Math.ceil,tt=Math.floor,toInteger=function(t){return isNaN(t=+t)?0:(t>0?tt:K)(t)},et=Math.min,toLength=function(t){return t>0?et(toInteger(t),9007199254740991):0},rt=Math.max,nt=Math.min,toAbsoluteIndex=function(t,e){var n=toInteger(t);return n<0?rt(n+e,0):nt(n,e)},createMethod=function(t){return function(e,n,i){var s,o=toIndexedObject(e),l=toLength(o.length),u=toAbsoluteIndex(i,l);if(t&&n!=n){for(;l>u;)if((s=o[u++])!=s)return!0}else for(;l>u;u++)if((t||u in o)&&o[u]===n)return t||u||0;return!t&&-1}},at={includes:createMethod(!0),indexOf:createMethod(!1)},it=at.indexOf,objectKeysInternal=function(t,e){var n,i=toIndexedObject(t),s=0,o=[];for(n in i)!has(G,n)&&has(i,n)&&o.push(n);for(;e.length>s;)has(i,n=e[s++])&&(~it(o,n)||o.push(n));return o},st=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ot=st.concat("length","prototype"),lt={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,ot)}},ut={f:Object.getOwnPropertySymbols},ct=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var e=lt.f(anObject(t)),n=ut.f;return n?e.concat(n(t)):e},copyConstructorProperties=function(t,e){for(var n=ct(e),i=C.f,s=P.f,o=0;o<n.length;o++){var l=n[o];has(t,l)||i(t,l,s(e,l))}},ht=/#|\.prototype\./,isForced=function(t,e){var n=pt[ft(t)];return n==vt||n!=dt&&("function"==typeof e?fails(e):!!e)},ft=isForced.normalize=function(t){return String(t).replace(ht,".").toLowerCase()},pt=isForced.data={},dt=isForced.NATIVE="N",vt=isForced.POLYFILL="P",yt=isForced,gt=P.f,_export=function(t,e){var n,s,o,l,u,h=t.target,p=t.global,d=t.stat;if(n=p?i:d?i[h]||setGlobal(h,{}):(i[h]||{}).prototype)for(s in e){if(l=e[s],o=t.noTargetGet?(u=gt(n,s))&&u.value:n[s],!yt(p?s:h+(d?".":"#")+s,t.forced)&&void 0!==o){if(typeof l==typeof o)continue;copyConstructorProperties(l,o)}(t.sham||o&&o.sham)&&E(l,"sham",!0),Z(n,s,l,t)}},mt=Array.isArray||function isArray(t){return"Array"==classofRaw(t)},toObject=function(t){return Object(requireObjectCoercible(t))},createProperty=function(t,e,n){var i=toPrimitive(e);i in t?C.f(t,i,createPropertyDescriptor(0,n)):t[i]=n},bt=!!Object.getOwnPropertySymbols&&!fails((function(){return!String(Symbol())})),xt=bt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,_t=L("wks"),wt=i.Symbol,Pt=xt?wt:wt&&wt.withoutSetter||uid,wellKnownSymbol=function(t){return has(_t,t)||(bt&&has(wt,t)?_t[t]=wt[t]:_t[t]=Pt("Symbol."+t)),_t[t]},kt=wellKnownSymbol("species"),arraySpeciesCreate=function(t,e){var n;return mt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!mt(n.prototype)?isObject(n)&&null===(n=n[kt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},Ct=getBuiltIn("navigator","userAgent")||"",Et=i.process,St=Et&&Et.versions,At=St&&St.v8;At?Y=(H=At.split("."))[0]+H[1]:Ct&&(!(H=Ct.match(/Edge\/(\d+)/))||H[1]>=74)&&(H=Ct.match(/Chrome\/(\d+)/))&&(Y=H[1]);var Tt=Y&&+Y,Ot=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(t){return Tt>=51||!fails((function(){var e=[];return(e.constructor={})[Ot]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Rt=wellKnownSymbol("isConcatSpreadable"),Mt=9007199254740991,Bt="Maximum allowed index exceeded",Vt=Tt>=51||!fails((function(){var t=[];return t[Rt]=!1,t.concat()[0]!==t})),It=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(t){if(!isObject(t))return!1;var e=t[Rt];return void 0!==e?!!e:mt(t)};_export({target:"Array",proto:!0,forced:!Vt||!It},{concat:function concat(t){var e,n,i,s,o,l=toObject(this),u=arraySpeciesCreate(l,0),h=0;for(e=-1,i=arguments.length;e<i;e++)if(isConcatSpreadable(o=-1===e?l:arguments[e])){if(h+(s=toLength(o.length))>Mt)throw TypeError(Bt);for(n=0;n<s;n++,h++)n in o&&createProperty(u,h,o[n])}else{if(h>=Mt)throw TypeError(Bt);createProperty(u,h++,o)}return u.length=h,u}});var Lt,jt=Object.keys||function keys(t){return objectKeysInternal(t,st)},Nt=s?Object.defineProperties:function defineProperties(t,e){anObject(t);for(var n,i=jt(e),s=i.length,o=0;s>o;)C.f(t,n=i[o++],e[n]);return t},Dt=getBuiltIn("document","documentElement"),Ft=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObject=function(){try{Lt=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;NullProtoObject=Lt?function(t){t.write(scriptTag("")),t.close();var e=t.parentWindow.Object;return t=null,e}(Lt):((e=documentCreateElement("iframe")).style.display="none",Dt.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F);for(var n=st.length;n--;)delete NullProtoObject.prototype[st[n]];return NullProtoObject()};G[Ft]=!0;var Gt=Object.create||function create(t,e){var n;return null!==t?(EmptyConstructor.prototype=anObject(t),n=new EmptyConstructor,EmptyConstructor.prototype=null,n[Ft]=t):n=NullProtoObject(),void 0===e?n:Nt(n,e)},Ut=wellKnownSymbol("unscopables"),zt=Array.prototype;null==zt[Ut]&&C.f(zt,Ut,{configurable:!0,value:Gt(null)});var Wt,qt,Xt,addToUnscopables=function(t){zt[Ut][t]=!0},$t={},Ht=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})),Yt=sharedKey("IE_PROTO"),Qt=Object.prototype,Zt=Ht?Object.getPrototypeOf:function(t){return t=toObject(t),has(t,Yt)?t[Yt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?Qt:null},Jt=wellKnownSymbol("iterator"),Kt=!1;[].keys&&("next"in(Xt=[].keys())?(qt=Zt(Zt(Xt)))!==Object.prototype&&(Wt=qt):Kt=!0),null==Wt&&(Wt={}),has(Wt,Jt)||E(Wt,Jt,(function(){return this}));var te={IteratorPrototype:Wt,BUGGY_SAFARI_ITERATORS:Kt},ee=C.f,re=wellKnownSymbol("toStringTag"),setToStringTag=function(t,e,n){t&&!has(t=n?t:t.prototype,re)&&ee(t,re,{configurable:!0,value:e})},ne=te.IteratorPrototype,returnThis$1=function(){return this},createIteratorConstructor=function(t,e,n){var i=e+" Iterator";return t.prototype=Gt(ne,{next:createPropertyDescriptor(1,n)}),setToStringTag(t,i,!1),$t[i]=returnThis$1,t},ae=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function setPrototypeOf(n,i){return anObject(n),function(t){if(!isObject(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(i),e?t.call(n,i):n.__proto__=i,n}}():void 0),ie=te.IteratorPrototype,se=te.BUGGY_SAFARI_ITERATORS,oe=wellKnownSymbol("iterator"),le="keys",ue="values",ce="entries",returnThis$2=function(){return this},defineIterator=function(t,e,n,i,s,o,l){createIteratorConstructor(n,e,i);var u,h,p,getIterationMethod=function(t){if(t===s&&_)return _;if(!se&&t in g)return g[t];switch(t){case le:return function keys(){return new n(this,t)};case ue:return function values(){return new n(this,t)};case ce:return function entries(){return new n(this,t)}}return function(){return new n(this)}},d=e+" Iterator",v=!1,g=t.prototype,b=g[oe]||g["@@iterator"]||s&&g[s],_=!se&&b||getIterationMethod(s),w="Array"==e&&g.entries||b;if(w&&(u=Zt(w.call(new t)),ie!==Object.prototype&&u.next&&(Zt(u)!==ie&&(ae?ae(u,ie):"function"!=typeof u[oe]&&E(u,oe,returnThis$2)),setToStringTag(u,d,!0))),s==ue&&b&&b.name!==ue&&(v=!0,_=function values(){return b.call(this)}),g[oe]!==_&&E(g,oe,_),$t[e]=_,s)if(h={values:getIterationMethod(ue),keys:o?_:getIterationMethod(le),entries:getIterationMethod(ce)},l)for(p in h)(se||v||!(p in g))&&Z(g,p,h[p]);else _export({target:e,proto:!0,forced:se||v},h);return h},he="Array Iterator",fe=Q.set,pe=Q.getterFor(he),de=defineIterator(Array,"Array",(function(t,e){fe(this,{type:he,target:toIndexedObject(t),index:0,kind:e})}),(function(){var t=pe(this),e=t.target,n=t.kind,i=t.index++;return!e||i>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:e[i],done:!1}:{value:[i,e[i]],done:!1}}),"values");$t.Arguments=$t.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries");var ve={};ve[wellKnownSymbol("toStringTag")]="z";var ye="[object z]"===String(ve),ge=wellKnownSymbol("toStringTag"),me="Arguments"==classofRaw(function(){return arguments}()),be=ye?classofRaw:function(t){var e,n,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),ge))?n:me?classofRaw(e):"Object"==(i=classofRaw(e))&&"function"==typeof e.callee?"Arguments":i},xe=ye?{}.toString:function toString(){return"[object "+be(this)+"]"};ye||Z(Object.prototype,"toString",xe,{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 _e,we,Pe={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")}))},ke=RegExp.prototype.exec,Ce=String.prototype.replace,Ee=ke,Se=(_e=/a/,we=/b*/g,ke.call(_e,"a"),ke.call(we,"a"),0!==_e.lastIndex||0!==we.lastIndex),Ae=Pe.UNSUPPORTED_Y||Pe.BROKEN_CARET,Te=void 0!==/()??/.exec("")[1];(Se||Te||Ae)&&(Ee=function exec(t){var e,n,i,s,o=this,l=Ae&&o.sticky,u=regexpFlags.call(o),h=o.source,p=0,d=t;return l&&(-1===(u=u.replace("y","")).indexOf("g")&&(u+="g"),d=String(t).slice(o.lastIndex),o.lastIndex>0&&(!o.multiline||o.multiline&&"\n"!==t[o.lastIndex-1])&&(h="(?: "+h+")",d=" "+d,p++),n=new RegExp("^(?:"+h+")",u)),Te&&(n=new RegExp("^"+h+"$(?!\\s)",u)),Se&&(e=o.lastIndex),i=ke.call(l?n:o,d),l?i?(i.input=i.input.slice(p),i[0]=i[0].slice(p),i.index=o.lastIndex,o.lastIndex+=i[0].length):o.lastIndex=0:Se&&i&&(o.lastIndex=o.global?i.index+i[0].length:e),Te&&i&&i.length>1&&Ce.call(i[0],n,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(i[s]=void 0)})),i});var Oe=Ee;_export({target:"RegExp",proto:!0,forced:/./.exec!==Oe},{exec:Oe});var createMethod$1=function(t){return function(e,n){var i,s,o=String(requireObjectCoercible(e)),l=toInteger(n),u=o.length;return l<0||l>=u?t?"":void 0:(i=o.charCodeAt(l))<55296||i>56319||l+1===u||(s=o.charCodeAt(l+1))<56320||s>57343?t?o.charAt(l):i:t?o.slice(l,l+2):s-56320+(i-55296<<10)+65536}},Re={codeAt:createMethod$1(!1),charAt:createMethod$1(!0)},Me=Re.charAt,Be="String Iterator",Ve=Q.set,Ie=Q.getterFor(Be);defineIterator(String,"String",(function(t){Ve(this,{type:Be,string:String(t),index:0})}),(function next(){var t,e=Ie(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=Me(n,i),e.index+=t.length,{value:t,done:!1})}));var Le=wellKnownSymbol("species"),je=!fails((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),Ne="$0"==="a".replace(/./,"$0"),De=wellKnownSymbol("replace"),Fe=!!/./[De]&&""===/./[De]("a","$0"),Ge=!fails((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),fixRegexpWellKnownSymbolLogic=function(t,e,n,i){var s=wellKnownSymbol(t),o=!fails((function(){var e={};return e[s]=function(){return 7},7!=""[t](e)})),l=o&&!fails((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[Le]=function(){return n},n.flags="",n[s]=/./[s]),n.exec=function(){return e=!0,null},n[s](""),!e}));if(!o||!l||"replace"===t&&(!je||!Ne||Fe)||"split"===t&&!Ge){var u=/./[s],h=n(s,""[t],(function(t,e,n,i,s){return e.exec===Oe?o&&!s?{done:!0,value:u.call(e,n,i)}:{done:!0,value:t.call(n,e,i)}:{done:!1}}),{REPLACE_KEEPS_$0:Ne,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Fe}),p=h[0],d=h[1];Z(String.prototype,t,p),Z(RegExp.prototype,s,2==e?function(t,e){return d.call(t,this,e)}:function(t){return d.call(t,this)})}i&&E(RegExp.prototype[s],"sham",!0)},Ue=Re.charAt,advanceStringIndex=function(t,e,n){return e+(n?Ue(t,e).length:1)},regexpExecAbstract=function(t,e){var n=t.exec;if("function"==typeof n){var i=n.call(t,e);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==classofRaw(t))throw TypeError("RegExp#exec called on incompatible receiver");return Oe.call(t,e)},ze=Math.max,We=Math.min,qe=Math.floor,Xe=/\$([$&'`]|\d\d?|<[^>]*>)/g,$e=/\$([$&'`]|\d\d?)/g;fixRegexpWellKnownSymbolLogic("replace",2,(function(t,e,n,i){var s=i.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,o=i.REPLACE_KEEPS_$0,l=s?"$":"$0";return[function replace(n,i){var s=requireObjectCoercible(this),o=null==n?void 0:n[t];return void 0!==o?o.call(n,s,i):e.call(String(s),n,i)},function(t,i){if(!s&&o||"string"==typeof i&&-1===i.indexOf(l)){var u=n(e,t,this,i);if(u.done)return u.value}var h=anObject(t),p=String(this),d="function"==typeof i;d||(i=String(i));var v=h.global;if(v){var g=h.unicode;h.lastIndex=0}for(var b=[];;){var _=regexpExecAbstract(h,p);if(null===_)break;if(b.push(_),!v)break;""===String(_[0])&&(h.lastIndex=advanceStringIndex(p,toLength(h.lastIndex),g))}for(var w,P="",k=0,C=0;C<b.length;C++){_=b[C];for(var E=String(_[0]),S=ze(We(toInteger(_.index),p.length),0),A=[],T=1;T<_.length;T++)A.push(void 0===(w=_[T])?w:String(w));var O=_.groups;if(d){var R=[E].concat(A,S,p);void 0!==O&&R.push(O);var M=String(i.apply(void 0,R))}else M=getSubstitution(E,p,S,A,O,i);S>=k&&(P+=p.slice(k,S)+M,k=S+E.length)}return P+p.slice(k)}];function getSubstitution(t,n,i,s,o,l){var u=i+t.length,h=s.length,p=$e;return void 0!==o&&(o=toObject(o),p=Xe),e.call(l,p,(function(e,l){var p;switch(l.charAt(0)){case"$":return"$";case"&":return t;case"`":return n.slice(0,i);case"'":return n.slice(u);case"<":p=o[l.slice(1,-1)];break;default:var d=+l;if(0===d)return e;if(d>h){var v=qe(d/10);return 0===v?e:v<=h?void 0===s[v-1]?l.charAt(1):s[v-1]+l.charAt(1):e}p=s[d-1]}return void 0===p?"":p}))}}));var He={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},Ye=wellKnownSymbol("iterator"),Qe=wellKnownSymbol("toStringTag"),Ze=de.values;for(var Je in He){var Ke=i[Je],tr=Ke&&Ke.prototype;if(tr){if(tr[Ye]!==Ze)try{E(tr,Ye,Ze)}catch(t){tr[Ye]=Ze}if(tr[Qe]||E(tr,Qe,Je),He[Je])for(var er in de)if(tr[er]!==de[er])try{E(tr,er,de[er])}catch(t){tr[er]=de[er]}}}var rr=wellKnownSymbol("iterator"),nr=!fails((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,n="";return t.pathname="c%20d",e.forEach((function(t,i){e.delete("b"),n+=i+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[rr]||"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"!==n||"x"!==new URL("http://x",void 0).host})),anInstance=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t},ar=Object.assign,ir=Object.defineProperty,sr=!ar||fails((function(){if(s&&1!==ar({b:1},ar(ir({},"a",{enumerable:!0,get:function(){ir(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach((function(t){e[t]=t})),7!=ar({},t)[n]||jt(ar({},e)).join("")!=i}))?function assign(t,e){for(var n=toObject(t),i=arguments.length,o=1,l=ut.f,h=u.f;i>o;)for(var p,v=d(arguments[o++]),g=l?jt(v).concat(l(v)):jt(v),b=g.length,_=0;b>_;)p=g[_++],s&&!h.call(v,p)||(n[p]=v[p]);return n}:ar,aFunction$1=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},functionBindContext=function(t,e,n){if(aFunction$1(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,s){return t.call(e,n,i,s)}}return function(){return t.apply(e,arguments)}},callWithSafeIterationClosing=function(t,e,n,i){try{return i?e(anObject(n)[0],n[1]):e(n)}catch(e){var s=t.return;throw void 0!==s&&anObject(s.call(t)),e}},or=wellKnownSymbol("iterator"),lr=Array.prototype,isArrayIteratorMethod=function(t){return void 0!==t&&($t.Array===t||lr[or]===t)},ur=wellKnownSymbol("iterator"),getIteratorMethod=function(t){if(null!=t)return t[ur]||t["@@iterator"]||$t[be(t)]},cr=function from(t){var e,n,i,s,o,l,u=toObject(t),h="function"==typeof this?this:Array,p=arguments.length,d=p>1?arguments[1]:void 0,v=void 0!==d,g=getIteratorMethod(u),b=0;if(v&&(d=functionBindContext(d,p>2?arguments[2]:void 0,2)),null==g||h==Array&&isArrayIteratorMethod(g))for(n=new h(e=toLength(u.length));e>b;b++)l=v?d(u[b],b):u[b],createProperty(n,b,l);else for(o=(s=g.call(u)).next,n=new h;!(i=o.call(s)).done;b++)l=v?callWithSafeIterationClosing(s,d,[i.value,b],!0):i.value,createProperty(n,b,l);return n.length=b,n},hr=2147483647,fr=/[^\0-\u007E]/,pr=/[.\u3002\uFF0E\uFF61]/g,dr="Overflow: input needs wider integers to process",vr=Math.floor,yr=String.fromCharCode,digitToBasic=function(t){return t+22+75*(t<26)},adapt=function(t,e,n){var i=0;for(t=n?vr(t/700):t>>1,t+=vr(t/e);t>455;i+=36)t=vr(t/35);return vr(i+36*t/(t+38))},encode=function(t){var e,n,i=[],s=(t=function(t){for(var e=[],n=0,i=t.length;n<i;){var s=t.charCodeAt(n++);if(s>=55296&&s<=56319&&n<i){var o=t.charCodeAt(n++);56320==(64512&o)?e.push(((1023&s)<<10)+(1023&o)+65536):(e.push(s),n--)}else e.push(s)}return e}(t)).length,o=128,l=0,u=72;for(e=0;e<t.length;e++)(n=t[e])<128&&i.push(yr(n));var h=i.length,p=h;for(h&&i.push("-");p<s;){var d=hr;for(e=0;e<t.length;e++)(n=t[e])>=o&&n<d&&(d=n);var v=p+1;if(d-o>vr((hr-l)/v))throw RangeError(dr);for(l+=(d-o)*v,o=d,e=0;e<t.length;e++){if((n=t[e])<o&&++l>hr)throw RangeError(dr);if(n==o){for(var g=l,b=36;;b+=36){var _=b<=u?1:b>=u+26?26:b-u;if(g<_)break;var w=g-_,P=36-_;i.push(yr(digitToBasic(_+w%P))),g=vr(w/P)}i.push(yr(digitToBasic(g))),u=adapt(l,v,p==h),l=0,++p}}++l,++o}return i.join("")},redefineAll=function(t,e,n){for(var i in e)Z(t,i,e[i],n);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))},gr=getBuiltIn("fetch"),mr=getBuiltIn("Headers"),br=wellKnownSymbol("iterator"),xr="URLSearchParams",_r="URLSearchParamsIterator",wr=Q.set,Pr=Q.getterFor(xr),kr=Q.getterFor(_r),Cr=/\+/g,Er=Array(4),percentSequence=function(t){return Er[t-1]||(Er[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(Cr," "),n=4;try{return decodeURIComponent(e)}catch(t){for(;n;)e=e.replace(percentSequence(n--),percentDecode);return e}},Sr=/[!'()~]|%20/g,Ar={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(t){return Ar[t]},serialize=function(t){return encodeURIComponent(t).replace(Sr,replacer)},parseSearchParams=function(t,e){if(e)for(var n,i,s=e.split("&"),o=0;o<s.length;)(n=s[o++]).length&&(i=n.split("="),t.push({key:deserialize(i.shift()),value:deserialize(i.join("="))}))},updateSearchParams=function(t){this.entries.length=0,parseSearchParams(this.entries,t)},validateArgumentsLength=function(t,e){if(t<e)throw TypeError("Not enough arguments")},Tr=createIteratorConstructor((function Iterator(t,e){wr(this,{type:_r,iterator:getIterator(Pr(t).entries),kind:e})}),"Iterator",(function next(){var t=kr(this),e=t.kind,n=t.iterator.next(),i=n.value;return n.done||(n.value="keys"===e?i.key:"values"===e?i.value:[i.key,i.value]),n})),Or=function URLSearchParams(){anInstance(this,Or,xr);var t,e,n,i,s,o,l,u,h,p=arguments.length>0?arguments[0]:void 0,d=this,v=[];if(wr(d,{type:xr,entries:v,updateURL:function(){},updateSearchParams:updateSearchParams}),void 0!==p)if(isObject(p))if("function"==typeof(t=getIteratorMethod(p)))for(n=(e=t.call(p)).next;!(i=n.call(e)).done;){if((l=(o=(s=getIterator(anObject(i.value))).next).call(s)).done||(u=o.call(s)).done||!o.call(s).done)throw TypeError("Expected sequence with length 2");v.push({key:l.value+"",value:u.value+""})}else for(h in p)has(p,h)&&v.push({key:h,value:p[h]+""});else parseSearchParams(v,"string"==typeof p?"?"===p.charAt(0)?p.slice(1):p:p+"")},Rr=Or.prototype;redefineAll(Rr,{append:function append(t,e){validateArgumentsLength(arguments.length,2);var n=Pr(this);n.entries.push({key:t+"",value:e+""}),n.updateURL()},delete:function(t){validateArgumentsLength(arguments.length,1);for(var e=Pr(this),n=e.entries,i=t+"",s=0;s<n.length;)n[s].key===i?n.splice(s,1):s++;e.updateURL()},get:function get(t){validateArgumentsLength(arguments.length,1);for(var e=Pr(this).entries,n=t+"",i=0;i<e.length;i++)if(e[i].key===n)return e[i].value;return null},getAll:function getAll(t){validateArgumentsLength(arguments.length,1);for(var e=Pr(this).entries,n=t+"",i=[],s=0;s<e.length;s++)e[s].key===n&&i.push(e[s].value);return i},has:function has(t){validateArgumentsLength(arguments.length,1);for(var e=Pr(this).entries,n=t+"",i=0;i<e.length;)if(e[i++].key===n)return!0;return!1},set:function set(t,e){validateArgumentsLength(arguments.length,1);for(var n,i=Pr(this),s=i.entries,o=!1,l=t+"",u=e+"",h=0;h<s.length;h++)(n=s[h]).key===l&&(o?s.splice(h--,1):(o=!0,n.value=u));o||s.push({key:l,value:u}),i.updateURL()},sort:function sort(){var t,e,n,i=Pr(this),s=i.entries,o=s.slice();for(s.length=0,n=0;n<o.length;n++){for(t=o[n],e=0;e<n;e++)if(s[e].key>t.key){s.splice(e,0,t);break}e===n&&s.push(t)}i.updateURL()},forEach:function forEach(t){for(var e,n=Pr(this).entries,i=functionBindContext(t,arguments.length>1?arguments[1]:void 0,3),s=0;s<n.length;)i((e=n[s++]).value,e.key,this)},keys:function keys(){return new Tr(this,"keys")},values:function values(){return new Tr(this,"values")},entries:function entries(){return new Tr(this,"entries")}},{enumerable:!0}),Z(Rr,br,Rr.entries),Z(Rr,"toString",(function toString(){for(var t,e=Pr(this).entries,n=[],i=0;i<e.length;)t=e[i++],n.push(serialize(t.key)+"="+serialize(t.value));return n.join("&")}),{enumerable:!0}),setToStringTag(Or,xr),_export({global:!0,forced:!nr},{URLSearchParams:Or}),nr||"function"!=typeof gr||"function"!=typeof mr||_export({global:!0,enumerable:!0,forced:!0},{fetch:function fetch(t){var e,n,i,s=[t];return arguments.length>1&&(isObject(e=arguments[1])&&(n=e.body,be(n)===xr&&((i=e.headers?new mr(e.headers):new mr).has("content-type")||i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),e=Gt(e,{body:createPropertyDescriptor(0,String(n)),headers:createPropertyDescriptor(0,i)}))),s.push(e)),gr.apply(this,s)}});var Mr,Br={URLSearchParams:Or,getState:Pr},Vr=Re.codeAt,Ir=i.URL,Lr=Br.URLSearchParams,jr=Br.getState,Nr=Q.set,Dr=Q.getterFor("URL"),Fr=Math.floor,Gr=Math.pow,Ur="Invalid scheme",zr="Invalid host",Wr="Invalid port",qr=/[A-Za-z]/,Xr=/[\d+-.A-Za-z]/,$r=/\d/,Hr=/^(0x|0X)/,Yr=/^[0-7]+$/,Qr=/^\d+$/,Zr=/^[\dA-Fa-f]+$/,Jr=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,Kr=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,tn=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,en=/[\u0009\u000A\u000D]/g,parseHost=function(t,e){var n,i,s;if("["==e.charAt(0)){if("]"!=e.charAt(e.length-1))return zr;if(!(n=parseIPv6(e.slice(1,-1))))return zr;t.host=n}else if(isSpecial(t)){if(e=function(t){var e,n,i=[],s=t.toLowerCase().replace(pr,".").split(".");for(e=0;e<s.length;e++)n=s[e],i.push(fr.test(n)?"xn--"+encode(n):n);return i.join(".")}(e),Jr.test(e))return zr;if(null===(n=parseIPv4(e)))return zr;t.host=n}else{if(Kr.test(e))return zr;for(n="",i=cr(e),s=0;s<i.length;s++)n+=percentEncode(i[s],rn);t.host=n}},parseIPv4=function(t){var e,n,i,s,o,l,u,h=t.split(".");if(h.length&&""==h[h.length-1]&&h.pop(),(e=h.length)>4)return t;for(n=[],i=0;i<e;i++){if(""==(s=h[i]))return t;if(o=10,s.length>1&&"0"==s.charAt(0)&&(o=Hr.test(s)?16:8,s=s.slice(8==o?1:2)),""===s)l=0;else{if(!(10==o?Qr:8==o?Yr:Zr).test(s))return t;l=parseInt(s,o)}n.push(l)}for(i=0;i<e;i++)if(l=n[i],i==e-1){if(l>=Gr(256,5-e))return null}else if(l>255)return null;for(u=n.pop(),i=0;i<n.length;i++)u+=n[i]*Gr(256,3-i);return u},parseIPv6=function(t){var e,n,i,s,o,l,u,h=[0,0,0,0,0,0,0,0],p=0,d=null,v=0,char=function(){return t.charAt(v)};if(":"==char()){if(":"!=t.charAt(1))return;v+=2,d=++p}for(;char();){if(8==p)return;if(":"!=char()){for(e=n=0;n<4&&Zr.test(char());)e=16*e+parseInt(char(),16),v++,n++;if("."==char()){if(0==n)return;if(v-=n,p>6)return;for(i=0;char();){if(s=null,i>0){if(!("."==char()&&i<4))return;v++}if(!$r.test(char()))return;for(;$r.test(char());){if(o=parseInt(char(),10),null===s)s=o;else{if(0==s)return;s=10*s+o}if(s>255)return;v++}h[p]=256*h[p]+s,2!=++i&&4!=i||p++}if(4!=i)return;break}if(":"==char()){if(v++,!char())return}else if(char())return;h[p++]=e}else{if(null!==d)return;v++,d=++p}}if(null!==d)for(l=p-d,p=7;0!=p&&l>0;)u=h[p],h[p--]=h[d+l-1],h[d+--l]=u;else if(8!=p)return;return h},serializeHost=function(t){var e,n,i,s;if("number"==typeof t){for(e=[],n=0;n<4;n++)e.unshift(t%256),t=Fr(t/256);return e.join(".")}if("object"==typeof t){for(e="",i=function(t){for(var e=null,n=1,i=null,s=0,o=0;o<8;o++)0!==t[o]?(s>n&&(e=i,n=s),i=null,s=0):(null===i&&(i=o),++s);return s>n&&(e=i,n=s),e}(t),n=0;n<8;n++)s&&0===t[n]||(s&&(s=!1),i===n?(e+=n?":":"::",s=!0):(e+=t[n].toString(16),n<7&&(e+=":")));return"["+e+"]"}return t},rn={},nn=sr({},rn,{" ":1,'"':1,"<":1,">":1,"`":1}),an=sr({},nn,{"#":1,"?":1,"{":1,"}":1}),sn=sr({},an,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(t,e){var n=Vr(t,0);return n>32&&n<127&&!has(e,t)?t:encodeURIComponent(t)},on={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isSpecial=function(t){return has(on,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 n;return 2==t.length&&qr.test(t.charAt(0))&&(":"==(n=t.charAt(1))||!e&&"|"==n)},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,n=e.length;!n||"file"==t.scheme&&1==n&&isWindowsDriveLetter(e[0],!0)||e.pop()},isSingleDot=function(t){return"."===t||"%2e"===t.toLowerCase()},ln={},un={},cn={},hn={},fn={},pn={},dn={},vn={},yn={},gn={},mn={},bn={},xn={},_n={},wn={},Pn={},kn={},Cn={},En={},Sn={},An={},parseURL=function(t,e,n,i){var s,o,l,u,h,p=n||ln,d=0,v="",g=!1,b=!1,_=!1;for(n||(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(tn,"")),e=e.replace(en,""),s=cr(e);d<=s.length;){switch(o=s[d],p){case ln:if(!o||!qr.test(o)){if(n)return Ur;p=cn;continue}v+=o.toLowerCase(),p=un;break;case un:if(o&&(Xr.test(o)||"+"==o||"-"==o||"."==o))v+=o.toLowerCase();else{if(":"!=o){if(n)return Ur;v="",p=cn,d=0;continue}if(n&&(isSpecial(t)!=has(on,v)||"file"==v&&(includesCredentials(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;if(t.scheme=v,n)return void(isSpecial(t)&&on[t.scheme]==t.port&&(t.port=null));v="","file"==t.scheme?p=_n:isSpecial(t)&&i&&i.scheme==t.scheme?p=hn:isSpecial(t)?p=vn:"/"==s[d+1]?(p=fn,d++):(t.cannotBeABaseURL=!0,t.path.push(""),p=En)}break;case cn:if(!i||i.cannotBeABaseURL&&"#"!=o)return Ur;if(i.cannotBeABaseURL&&"#"==o){t.scheme=i.scheme,t.path=i.path.slice(),t.query=i.query,t.fragment="",t.cannotBeABaseURL=!0,p=An;break}p="file"==i.scheme?_n:pn;continue;case hn:if("/"!=o||"/"!=s[d+1]){p=pn;continue}p=yn,d++;break;case fn:if("/"==o){p=gn;break}p=Cn;continue;case pn:if(t.scheme=i.scheme,o==Mr)t.username=i.username,t.password=i.password,t.host=i.host,t.port=i.port,t.path=i.path.slice(),t.query=i.query;else if("/"==o||"\\"==o&&isSpecial(t))p=dn;else if("?"==o)t.username=i.username,t.password=i.password,t.host=i.host,t.port=i.port,t.path=i.path.slice(),t.query="",p=Sn;else{if("#"!=o){t.username=i.username,t.password=i.password,t.host=i.host,t.port=i.port,t.path=i.path.slice(),t.path.pop(),p=Cn;continue}t.username=i.username,t.password=i.password,t.host=i.host,t.port=i.port,t.path=i.path.slice(),t.query=i.query,t.fragment="",p=An}break;case dn:if(!isSpecial(t)||"/"!=o&&"\\"!=o){if("/"!=o){t.username=i.username,t.password=i.password,t.host=i.host,t.port=i.port,p=Cn;continue}p=gn}else p=yn;break;case vn:if(p=yn,"/"!=o||"/"!=v.charAt(d+1))continue;d++;break;case yn:if("/"!=o&&"\\"!=o){p=gn;continue}break;case gn:if("@"==o){g&&(v="%40"+v),g=!0,l=cr(v);for(var w=0;w<l.length;w++){var P=l[w];if(":"!=P||_){var k=percentEncode(P,sn);_?t.password+=k:t.username+=k}else _=!0}v=""}else if(o==Mr||"/"==o||"?"==o||"#"==o||"\\"==o&&isSpecial(t)){if(g&&""==v)return"Invalid authority";d-=cr(v).length+1,v="",p=mn}else v+=o;break;case mn:case bn:if(n&&"file"==t.scheme){p=Pn;continue}if(":"!=o||b){if(o==Mr||"/"==o||"?"==o||"#"==o||"\\"==o&&isSpecial(t)){if(isSpecial(t)&&""==v)return zr;if(n&&""==v&&(includesCredentials(t)||null!==t.port))return;if(u=parseHost(t,v))return u;if(v="",p=kn,n)return;continue}"["==o?b=!0:"]"==o&&(b=!1),v+=o}else{if(""==v)return zr;if(u=parseHost(t,v))return u;if(v="",p=xn,n==bn)return}break;case xn:if(!$r.test(o)){if(o==Mr||"/"==o||"?"==o||"#"==o||"\\"==o&&isSpecial(t)||n){if(""!=v){var C=parseInt(v,10);if(C>65535)return Wr;t.port=isSpecial(t)&&C===on[t.scheme]?null:C,v=""}if(n)return;p=kn;continue}return Wr}v+=o;break;case _n:if(t.scheme="file","/"==o||"\\"==o)p=wn;else{if(!i||"file"!=i.scheme){p=Cn;continue}if(o==Mr)t.host=i.host,t.path=i.path.slice(),t.query=i.query;else if("?"==o)t.host=i.host,t.path=i.path.slice(),t.query="",p=Sn;else{if("#"!=o){startsWithWindowsDriveLetter(s.slice(d).join(""))||(t.host=i.host,t.path=i.path.slice(),shortenURLsPath(t)),p=Cn;continue}t.host=i.host,t.path=i.path.slice(),t.query=i.query,t.fragment="",p=An}}break;case wn:if("/"==o||"\\"==o){p=Pn;break}i&&"file"==i.scheme&&!startsWithWindowsDriveLetter(s.slice(d).join(""))&&(isWindowsDriveLetter(i.path[0],!0)?t.path.push(i.path[0]):t.host=i.host),p=Cn;continue;case Pn:if(o==Mr||"/"==o||"\\"==o||"?"==o||"#"==o){if(!n&&isWindowsDriveLetter(v))p=Cn;else if(""==v){if(t.host="",n)return;p=kn}else{if(u=parseHost(t,v))return u;if("localhost"==t.host&&(t.host=""),n)return;v="",p=kn}continue}v+=o;break;case kn:if(isSpecial(t)){if(p=Cn,"/"!=o&&"\\"!=o)continue}else if(n||"?"!=o)if(n||"#"!=o){if(o!=Mr&&(p=Cn,"/"!=o))continue}else t.fragment="",p=An;else t.query="",p=Sn;break;case Cn:if(o==Mr||"/"==o||"\\"==o&&isSpecial(t)||!n&&("?"==o||"#"==o)){if(".."===(h=(h=v).toLowerCase())||"%2e."===h||".%2e"===h||"%2e%2e"===h?(shortenURLsPath(t),"/"==o||"\\"==o&&isSpecial(t)||t.path.push("")):isSingleDot(v)?"/"==o||"\\"==o&&isSpecial(t)||t.path.push(""):("file"==t.scheme&&!t.path.length&&isWindowsDriveLetter(v)&&(t.host&&(t.host=""),v=v.charAt(0)+":"),t.path.push(v)),v="","file"==t.scheme&&(o==Mr||"?"==o||"#"==o))for(;t.path.length>1&&""===t.path[0];)t.path.shift();"?"==o?(t.query="",p=Sn):"#"==o&&(t.fragment="",p=An)}else v+=percentEncode(o,an);break;case En:"?"==o?(t.query="",p=Sn):"#"==o?(t.fragment="",p=An):o!=Mr&&(t.path[0]+=percentEncode(o,rn));break;case Sn:n||"#"!=o?o!=Mr&&("'"==o&&isSpecial(t)?t.query+="%27":t.query+="#"==o?"%23":percentEncode(o,rn)):(t.fragment="",p=An);break;case An:o!=Mr&&(t.fragment+=percentEncode(o,nn))}d++}},Tn=function URL(t){var e,n,i=anInstance(this,Tn,"URL"),o=arguments.length>1?arguments[1]:void 0,l=String(t),u=Nr(i,{type:"URL"});if(void 0!==o)if(o instanceof Tn)e=Dr(o);else if(n=parseURL(e={},String(o)))throw TypeError(n);if(n=parseURL(u,l,null,e))throw TypeError(n);var h=u.searchParams=new Lr,p=jr(h);p.updateSearchParams(u.query),p.updateURL=function(){u.query=String(h)||null},s||(i.href=serializeURL.call(i),i.origin=getOrigin.call(i),i.protocol=getProtocol.call(i),i.username=getUsername.call(i),i.password=getPassword.call(i),i.host=getHost.call(i),i.hostname=getHostname.call(i),i.port=getPort.call(i),i.pathname=getPathname.call(i),i.search=getSearch.call(i),i.searchParams=getSearchParams.call(i),i.hash=getHash.call(i))},On=Tn.prototype,serializeURL=function(){var t=Dr(this),e=t.scheme,n=t.username,i=t.password,s=t.host,o=t.port,l=t.path,u=t.query,h=t.fragment,p=e+":";return null!==s?(p+="//",includesCredentials(t)&&(p+=n+(i?":"+i:"")+"@"),p+=serializeHost(s),null!==o&&(p+=":"+o)):"file"==e&&(p+="//"),p+=t.cannotBeABaseURL?l[0]:l.length?"/"+l.join("/"):"",null!==u&&(p+="?"+u),null!==h&&(p+="#"+h),p},getOrigin=function(){var t=Dr(this),e=t.scheme,n=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!==n?":"+n:""):"null"},getProtocol=function(){return Dr(this).scheme+":"},getUsername=function(){return Dr(this).username},getPassword=function(){return Dr(this).password},getHost=function(){var t=Dr(this),e=t.host,n=t.port;return null===e?"":null===n?serializeHost(e):serializeHost(e)+":"+n},getHostname=function(){var t=Dr(this).host;return null===t?"":serializeHost(t)},getPort=function(){var t=Dr(this).port;return null===t?"":String(t)},getPathname=function(){var t=Dr(this),e=t.path;return t.cannotBeABaseURL?e[0]:e.length?"/"+e.join("/"):""},getSearch=function(){var t=Dr(this).query;return t?"?"+t:""},getSearchParams=function(){return Dr(this).searchParams},getHash=function(){var t=Dr(this).fragment;return t?"#"+t:""},accessorDescriptor=function(t,e){return{get:t,set:e,configurable:!0,enumerable:!0}};if(s&&Nt(On,{href:accessorDescriptor(serializeURL,(function(t){var e=Dr(this),n=String(t),i=parseURL(e,n);if(i)throw TypeError(i);jr(e.searchParams).updateSearchParams(e.query)})),origin:accessorDescriptor(getOrigin),protocol:accessorDescriptor(getProtocol,(function(t){var e=Dr(this);parseURL(e,String(t)+":",ln)})),username:accessorDescriptor(getUsername,(function(t){var e=Dr(this),n=cr(String(t));if(!cannotHaveUsernamePasswordPort(e)){e.username="";for(var i=0;i<n.length;i++)e.username+=percentEncode(n[i],sn)}})),password:accessorDescriptor(getPassword,(function(t){var e=Dr(this),n=cr(String(t));if(!cannotHaveUsernamePasswordPort(e)){e.password="";for(var i=0;i<n.length;i++)e.password+=percentEncode(n[i],sn)}})),host:accessorDescriptor(getHost,(function(t){var e=Dr(this);e.cannotBeABaseURL||parseURL(e,String(t),mn)})),hostname:accessorDescriptor(getHostname,(function(t){var e=Dr(this);e.cannotBeABaseURL||parseURL(e,String(t),bn)})),port:accessorDescriptor(getPort,(function(t){var e=Dr(this);cannotHaveUsernamePasswordPort(e)||(""==(t=String(t))?e.port=null:parseURL(e,t,xn))})),pathname:accessorDescriptor(getPathname,(function(t){var e=Dr(this);e.cannotBeABaseURL||(e.path=[],parseURL(e,t+"",kn))})),search:accessorDescriptor(getSearch,(function(t){var e=Dr(this);""==(t=String(t))?e.query=null:("?"==t.charAt(0)&&(t=t.slice(1)),e.query="",parseURL(e,t,Sn)),jr(e.searchParams).updateSearchParams(e.query)})),searchParams:accessorDescriptor(getSearchParams),hash:accessorDescriptor(getHash,(function(t){var e=Dr(this);""!=(t=String(t))?("#"==t.charAt(0)&&(t=t.slice(1)),e.fragment="",parseURL(e,t,An)):e.fragment=null}))}),Z(On,"toJSON",(function toJSON(){return serializeURL.call(this)}),{enumerable:!0}),Z(On,"toString",(function toString(){return serializeURL.call(this)}),{enumerable:!0}),Ir){var Rn=Ir.createObjectURL,Mn=Ir.revokeObjectURL;Rn&&Z(Tn,"createObjectURL",(function createObjectURL(t){return Rn.apply(Ir,arguments)})),Mn&&Z(Tn,"revokeObjectURL",(function revokeObjectURL(t){return Mn.apply(Ir,arguments)}))}setToStringTag(Tn,"URL"),_export({global:!0,forced:!nr,sham:!s},{URL:Tn});var Bn=lt.f,Vn={}.toString,In="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Ln={f:function getOwnPropertyNames(t){return In&&"[object Window]"==Vn.call(t)?function(t){try{return Bn(t)}catch(t){return In.slice()}}(t):Bn(toIndexedObject(t))}},jn={f:wellKnownSymbol},Nn=C.f,defineWellKnownSymbol=function(t){var e=J.Symbol||(J.Symbol={});has(e,t)||Nn(e,t,{value:jn.f(t)})},Dn=[].push,createMethod$2=function(t){var e=1==t,n=2==t,i=3==t,s=4==t,o=6==t,l=5==t||o;return function(u,h,p,v){for(var g,b,_=toObject(u),w=d(_),P=functionBindContext(h,p,3),k=toLength(w.length),C=0,E=v||arraySpeciesCreate,S=e?E(u,k):n?E(u,0):void 0;k>C;C++)if((l||C in w)&&(b=P(g=w[C],C,_),t))if(e)S[C]=b;else if(b)switch(t){case 3:return!0;case 5:return g;case 6:return C;case 2:Dn.call(S,g)}else if(s)return!1;return o?-1:i||s?s:S}},Fn={forEach:createMethod$2(0),map:createMethod$2(1),filter:createMethod$2(2),some:createMethod$2(3),every:createMethod$2(4),find:createMethod$2(5),findIndex:createMethod$2(6)},Gn=Fn.forEach,Un=sharedKey("hidden"),zn="Symbol",Wn=wellKnownSymbol("toPrimitive"),qn=Q.set,Xn=Q.getterFor(zn),$n=Object.prototype,Hn=i.Symbol,Yn=getBuiltIn("JSON","stringify"),Qn=P.f,Zn=C.f,Jn=Ln.f,Kn=u.f,ta=L("symbols"),ea=L("op-symbols"),ra=L("string-to-symbol-registry"),na=L("symbol-to-string-registry"),aa=L("wks"),ia=i.QObject,sa=!ia||!ia.prototype||!ia.prototype.findChild,oa=s&&fails((function(){return 7!=Gt(Zn({},"a",{get:function(){return Zn(this,"a",{value:7}).a}})).a}))?function(t,e,n){var i=Qn($n,e);i&&delete $n[e],Zn(t,e,n),i&&t!==$n&&Zn($n,e,i)}:Zn,wrap=function(t,e){var n=ta[t]=Gt(Hn.prototype);return qn(n,{type:zn,tag:t,description:e}),s||(n.description=e),n},la=xt?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof Hn},ua=function defineProperty(t,e,n){t===$n&&ua(ea,e,n),anObject(t);var i=toPrimitive(e,!0);return anObject(n),has(ta,i)?(n.enumerable?(has(t,Un)&&t[Un][i]&&(t[Un][i]=!1),n=Gt(n,{enumerable:createPropertyDescriptor(0,!1)})):(has(t,Un)||Zn(t,Un,createPropertyDescriptor(1,{})),t[Un][i]=!0),oa(t,i,n)):Zn(t,i,n)},ca=function defineProperties(t,e){anObject(t);var n=toIndexedObject(e),i=jt(n).concat(da(n));return Gn(i,(function(e){s&&!ha.call(n,e)||ua(t,e,n[e])})),t},ha=function propertyIsEnumerable(t){var e=toPrimitive(t,!0),n=Kn.call(this,e);return!(this===$n&&has(ta,e)&&!has(ea,e))&&(!(n||!has(this,e)||!has(ta,e)||has(this,Un)&&this[Un][e])||n)},fa=function getOwnPropertyDescriptor(t,e){var n=toIndexedObject(t),i=toPrimitive(e,!0);if(n!==$n||!has(ta,i)||has(ea,i)){var s=Qn(n,i);return!s||!has(ta,i)||has(n,Un)&&n[Un][i]||(s.enumerable=!0),s}},pa=function getOwnPropertyNames(t){var e=Jn(toIndexedObject(t)),n=[];return Gn(e,(function(t){has(ta,t)||has(G,t)||n.push(t)})),n},da=function getOwnPropertySymbols(t){var e=t===$n,n=Jn(e?ea:toIndexedObject(t)),i=[];return Gn(n,(function(t){!has(ta,t)||e&&!has($n,t)||i.push(ta[t])})),i};if(bt||(Z((Hn=function Symbol(){if(this instanceof Hn)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===$n&&setter.call(ea,t),has(this,Un)&&has(this[Un],e)&&(this[Un][e]=!1),oa(this,e,createPropertyDescriptor(1,t))};return s&&sa&&oa($n,e,{configurable:!0,set:setter}),wrap(e,t)}).prototype,"toString",(function toString(){return Xn(this).tag})),Z(Hn,"withoutSetter",(function(t){return wrap(uid(t),t)})),u.f=ha,C.f=ua,P.f=fa,lt.f=Ln.f=pa,ut.f=da,jn.f=function(t){return wrap(wellKnownSymbol(t),t)},s&&(Zn(Hn.prototype,"description",{configurable:!0,get:function description(){return Xn(this).description}}),Z($n,"propertyIsEnumerable",ha,{unsafe:!0}))),_export({global:!0,wrap:!0,forced:!bt,sham:!bt},{Symbol:Hn}),Gn(jt(aa),(function(t){defineWellKnownSymbol(t)})),_export({target:zn,stat:!0,forced:!bt},{for:function(t){var e=String(t);if(has(ra,e))return ra[e];var n=Hn(e);return ra[e]=n,na[n]=e,n},keyFor:function keyFor(t){if(!la(t))throw TypeError(t+" is not a symbol");if(has(na,t))return na[t]},useSetter:function(){sa=!0},useSimple:function(){sa=!1}}),_export({target:"Object",stat:!0,forced:!bt,sham:!s},{create:function create(t,e){return void 0===e?Gt(t):ca(Gt(t),e)},defineProperty:ua,defineProperties:ca,getOwnPropertyDescriptor:fa}),_export({target:"Object",stat:!0,forced:!bt},{getOwnPropertyNames:pa,getOwnPropertySymbols:da}),_export({target:"Object",stat:!0,forced:fails((function(){ut.f(1)}))},{getOwnPropertySymbols:function getOwnPropertySymbols(t){return ut.f(toObject(t))}}),Yn){var va=!bt||fails((function(){var t=Hn();return"[null]"!=Yn([t])||"{}"!=Yn({a:t})||"{}"!=Yn(Object(t))}));_export({target:"JSON",stat:!0,forced:va},{stringify:function stringify(t,e,n){for(var i,s=[t],o=1;arguments.length>o;)s.push(arguments[o++]);if(i=e,(isObject(e)||void 0!==t)&&!la(t))return mt(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!la(e))return e}),s[1]=e,Yn.apply(null,s)}})}Hn.prototype[Wn]||E(Hn.prototype,Wn,Hn.prototype.valueOf),setToStringTag(Hn,zn),G[Un]=!0;var ya=C.f,ga=i.Symbol;if(s&&"function"==typeof ga&&(!("description"in ga.prototype)||void 0!==ga().description)){var ma={},ba=function Symbol(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof ba?new ga(t):void 0===t?ga():ga(t);return""===t&&(ma[e]=!0),e};copyConstructorProperties(ba,ga);var xa=ba.prototype=ga.prototype;xa.constructor=ba;var _a=xa.toString,wa="Symbol(test)"==String(ga("test")),Pa=/^Symbol\((.*)\)[^)]+$/;ya(xa,"description",{configurable:!0,get:function description(){var t=isObject(this)?this.valueOf():this,e=_a.call(t);if(has(ma,t))return"";var n=wa?e.slice(7,-1):e.replace(Pa,"$1");return""===n?void 0:n}}),_export({global:!0,forced:!0},{Symbol:ba})}defineWellKnownSymbol("asyncIterator"),defineWellKnownSymbol("iterator"),defineWellKnownSymbol("toStringTag");var arrayMethodIsStrict=function(t,e){var n=[][t];return!!n&&fails((function(){n.call(null,e||function(){throw 1},1)}))},ka=Object.defineProperty,Ca={},thrower=function(t){throw t},arrayMethodUsesToLength=function(t,e){if(has(Ca,t))return Ca[t];e||(e={});var n=[][t],i=!!has(e,"ACCESSORS")&&e.ACCESSORS,o=has(e,0)?e[0]:thrower,l=has(e,1)?e[1]:void 0;return Ca[t]=!!n&&!fails((function(){if(i&&!s)return!0;var t={length:-1};i?ka(t,1,{enumerable:!0,get:thrower}):t[1]=1,n.call(t,o,l)}))},Ea=Fn.forEach,Sa=arrayMethodIsStrict("forEach"),Aa=arrayMethodUsesToLength("forEach"),Ta=Sa&&Aa?[].forEach:function forEach(t){return Ea(this,t,arguments.length>1?arguments[1]:void 0)};_export({target:"Array",proto:!0,forced:[].forEach!=Ta},{forEach:Ta});var Oa=[].reverse,Ra=[1,2];_export({target:"Array",proto:!0,forced:String(Ra)===String(Ra.reverse())},{reverse:function reverse(){return mt(this)&&(this.length=this.length),Oa.call(this)}});var Ma=arrayMethodHasSpeciesSupport("slice"),Ba=arrayMethodUsesToLength("slice",{ACCESSORS:!0,0:0,1:2}),Va=wellKnownSymbol("species"),Ia=[].slice,La=Math.max;_export({target:"Array",proto:!0,forced:!Ma||!Ba},{slice:function slice(t,e){var n,i,s,o=toIndexedObject(this),l=toLength(o.length),u=toAbsoluteIndex(t,l),h=toAbsoluteIndex(void 0===e?l:e,l);if(mt(o)&&("function"!=typeof(n=o.constructor)||n!==Array&&!mt(n.prototype)?isObject(n)&&null===(n=n[Va])&&(n=void 0):n=void 0,n===Array||void 0===n))return Ia.call(o,u,h);for(i=new(void 0===n?Array:n)(La(h-u,0)),s=0;u<h;u++,s++)u in o&&createProperty(i,s,o[u]);return i.length=s,i}});var ja=Date.prototype,Na="Invalid Date",Da="toString",Fa=ja.toString,Ga=ja.getTime;new Date(NaN)+""!=Na&&Z(ja,Da,(function toString(){var t=Ga.call(this);return t==t?Fa.call(this):Na}));var Ua=C.f,za=Function.prototype,Wa=za.toString,qa=/^\s*function ([^ (]*)/,Xa="name";s&&!(Xa in za)&&Ua(za,Xa,{configurable:!0,get:function(){try{return Wa.call(this).match(qa)[1]}catch(t){return""}}}),setToStringTag(i.JSON,"JSON",!0),setToStringTag(Math,"Math",!0),_export({target:"Object",stat:!0,sham:!s},{create:Gt}),_export({target:"Object",stat:!0,forced:!s,sham:!s},{defineProperty:C.f});var $a=fails((function(){Zt(1)}));_export({target:"Object",stat:!0,forced:$a,sham:!Ht},{getPrototypeOf:function getPrototypeOf(t){return Zt(toObject(t))}}),_export({target:"Object",stat:!0},{setPrototypeOf:ae});var Ha=i.Promise,Ya=wellKnownSymbol("species"),Qa=createCommonjsModule((function(t){var Result=function(t,e){this.stopped=t,this.result=e};(t.exports=function(t,e,n,i,s){var o,l,u,h,p,d,v,g=functionBindContext(e,n,i?2:1);if(s)o=t;else{if("function"!=typeof(l=getIteratorMethod(t)))throw TypeError("Target is not iterable");if(isArrayIteratorMethod(l)){for(u=0,h=toLength(t.length);h>u;u++)if((p=i?g(anObject(v=t[u])[0],v[1]):g(t[u]))&&p instanceof Result)return p;return new Result(!1)}o=l.call(t)}for(d=o.next;!(v=d.call(o)).done;)if("object"==typeof(p=callWithSafeIterationClosing(o,g,v.value,i))&&p&&p instanceof Result)return p;return new Result(!1)}).stop=function(t){return new Result(!0,t)}})),Za=wellKnownSymbol("iterator"),Ja=!1;try{var Ka=0,ti={next:function(){return{done:!!Ka++}},return:function(){Ja=!0}};ti[Za]=function(){return this},Array.from(ti,(function(){throw 2}))}catch(t){}var ei,ri,ni,ai=wellKnownSymbol("species"),speciesConstructor=function(t,e){var n,i=anObject(t).constructor;return void 0===i||null==(n=anObject(i)[ai])?e:aFunction$1(n)},ii=/(iphone|ipod|ipad).*applewebkit/i.test(Ct),si=i.location,oi=i.setImmediate,li=i.clearImmediate,ui=i.process,ci=i.MessageChannel,hi=i.Dispatch,fi=0,pi={},di="onreadystatechange",run=function(t){if(pi.hasOwnProperty(t)){var e=pi[t];delete pi[t],e()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){i.postMessage(t+"",si.protocol+"//"+si.host)};oi&&li||(oi=function setImmediate(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return pi[++fi]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},ei(fi),fi},li=function clearImmediate(t){delete pi[t]},"process"==classofRaw(ui)?ei=function(t){ui.nextTick(runner(t))}:hi&&hi.now?ei=function(t){hi.now(runner(t))}:ci&&!ii?(ni=(ri=new ci).port2,ri.port1.onmessage=listener,ei=functionBindContext(ni.postMessage,ni,1)):!i.addEventListener||"function"!=typeof postMessage||i.importScripts||fails(post)||"file:"===si.protocol?ei=di in documentCreateElement("script")?function(t){Dt.appendChild(documentCreateElement("script")).onreadystatechange=function(){Dt.removeChild(this),run(t)}}:function(t){setTimeout(runner(t),0)}:(ei=post,i.addEventListener("message",listener,!1)));var vi,yi,gi,mi,bi,xi,_i,wi,Pi={set:oi,clear:li},ki=P.f,Ci=Pi.set,Ei=i.MutationObserver||i.WebKitMutationObserver,Si=i.process,Ai=i.Promise,Ti="process"==classofRaw(Si),Oi=ki(i,"queueMicrotask"),Ri=Oi&&Oi.value;Ri||(vi=function(){var t,e;for(Ti&&(t=Si.domain)&&t.exit();yi;){e=yi.fn,yi=yi.next;try{e()}catch(t){throw yi?mi():gi=void 0,t}}gi=void 0,t&&t.enter()},Ti?mi=function(){Si.nextTick(vi)}:Ei&&!ii?(bi=!0,xi=document.createTextNode(""),new Ei(vi).observe(xi,{characterData:!0}),mi=function(){xi.data=bi=!bi}):Ai&&Ai.resolve?(_i=Ai.resolve(void 0),wi=_i.then,mi=function(){wi.call(_i,vi)}):mi=function(){Ci.call(i,vi)});var Mi,Bi,Vi,Ii,Li=Ri||function(t){var e={fn:t,next:void 0};gi&&(gi.next=e),yi||(yi=e,mi()),gi=e},PromiseCapability=function(t){var e,n;this.promise=new t((function(t,i){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=i})),this.resolve=aFunction$1(e),this.reject=aFunction$1(n)},ji={f:function(t){return new PromiseCapability(t)}},promiseResolve=function(t,e){if(anObject(t),isObject(e)&&e.constructor===t)return e;var n=ji.f(t);return(0,n.resolve)(e),n.promise},perform=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Ni=Pi.set,Di=wellKnownSymbol("species"),Fi="Promise",Gi=Q.get,Ui=Q.set,zi=Q.getterFor(Fi),Wi=Ha,qi=i.TypeError,Xi=i.document,$i=i.process,Hi=getBuiltIn("fetch"),Yi=ji.f,Qi=Yi,Zi="process"==classofRaw($i),Ji=!!(Xi&&Xi.createEvent&&i.dispatchEvent),Ki="unhandledrejection",ts=yt(Fi,(function(){if(!(B(Wi)!==String(Wi))){if(66===Tt)return!0;if(!Zi&&"function"!=typeof PromiseRejectionEvent)return!0}if(Tt>=51&&/native code/.test(Wi))return!1;var t=Wi.resolve(1),FakePromise=function(t){t((function(){}),(function(){}))};return(t.constructor={})[Di]=FakePromise,!(t.then((function(){}))instanceof FakePromise)})),es=ts||!function(t,e){if(!e&&!Ja)return!1;var n=!1;try{var i={};i[Za]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}((function(t){Wi.all(t).catch((function(){}))})),isThenable=function(t){var e;return!(!isObject(t)||"function"!=typeof(e=t.then))&&e},notify$1=function(t,e,n){if(!e.notified){e.notified=!0;var i=e.reactions;Li((function(){for(var s=e.value,o=1==e.state,l=0;i.length>l;){var u,h,p,d=i[l++],v=o?d.ok:d.fail,g=d.resolve,b=d.reject,_=d.domain;try{v?(o||(2===e.rejection&&onHandleUnhandled(t,e),e.rejection=1),!0===v?u=s:(_&&_.enter(),u=v(s),_&&(_.exit(),p=!0)),u===d.promise?b(qi("Promise-chain cycle")):(h=isThenable(u))?h.call(u,g,b):g(u)):b(s)}catch(t){_&&!p&&_.exit(),b(t)}}e.reactions=[],e.notified=!1,n&&!e.rejection&&onUnhandled(t,e)}))}},dispatchEvent=function(t,e,n){var s,o;Ji?((s=Xi.createEvent("Event")).promise=e,s.reason=n,s.initEvent(t,!1,!0),i.dispatchEvent(s)):s={promise:e,reason:n},(o=i["on"+t])?o(s):t===Ki&&function(t,e){var n=i.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}("Unhandled promise rejection",n)},onUnhandled=function(t,e){Ni.call(i,(function(){var n,i=e.value;if(isUnhandled(e)&&(n=perform((function(){Zi?$i.emit("unhandledRejection",i,t):dispatchEvent(Ki,t,i)})),e.rejection=Zi||isUnhandled(e)?2:1,n.error))throw n.value}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t,e){Ni.call(i,(function(){Zi?$i.emit("rejectionHandled",t):dispatchEvent("rejectionhandled",t,e.value)}))},bind=function(t,e,n,i){return function(s){t(e,n,s,i)}},internalReject=function(t,e,n,i){e.done||(e.done=!0,i&&(e=i),e.value=n,e.state=2,notify$1(t,e,!0))},internalResolve=function(t,e,n,i){if(!e.done){e.done=!0,i&&(e=i);try{if(t===n)throw qi("Promise can't be resolved itself");var s=isThenable(n);s?Li((function(){var i={done:!1};try{s.call(n,bind(internalResolve,t,i,e),bind(internalReject,t,i,e))}catch(n){internalReject(t,i,n,e)}})):(e.value=n,e.state=1,notify$1(t,e,!1))}catch(n){internalReject(t,{done:!1},n,e)}}};ts&&(Wi=function Promise(t){anInstance(this,Wi,Fi),aFunction$1(t),Mi.call(this);var e=Gi(this);try{t(bind(internalResolve,this,e),bind(internalReject,this,e))}catch(t){internalReject(this,e,t)}},(Mi=function Promise(t){Ui(this,{type:Fi,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=redefineAll(Wi.prototype,{then:function then(t,e){var n=zi(this),i=Yi(speciesConstructor(this,Wi));return i.ok="function"!=typeof t||t,i.fail="function"==typeof e&&e,i.domain=Zi?$i.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&notify$1(this,n,!1),i.promise},catch:function(t){return this.then(void 0,t)}}),Bi=function(){var t=new Mi,e=Gi(t);this.promise=t,this.resolve=bind(internalResolve,t,e),this.reject=bind(internalReject,t,e)},ji.f=Yi=function(t){return t===Wi||t===Vi?new Bi(t):Qi(t)},"function"==typeof Ha&&(Ii=Ha.prototype.then,Z(Ha.prototype,"then",(function then(t,e){var n=this;return new Wi((function(t,e){Ii.call(n,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof Hi&&_export({global:!0,enumerable:!0,forced:!0},{fetch:function fetch(t){return promiseResolve(Wi,Hi.apply(i,arguments))}}))),_export({global:!0,wrap:!0,forced:ts},{Promise:Wi}),setToStringTag(Wi,Fi,!1),function(t){var e=getBuiltIn(t),n=C.f;s&&e&&!e[Ya]&&n(e,Ya,{configurable:!0,get:function(){return this}})}(Fi),Vi=getBuiltIn(Fi),_export({target:Fi,stat:!0,forced:ts},{reject:function reject(t){var e=Yi(this);return e.reject.call(void 0,t),e.promise}}),_export({target:Fi,stat:!0,forced:ts},{resolve:function resolve(t){return promiseResolve(this,t)}}),_export({target:Fi,stat:!0,forced:es},{all:function all(t){var e=this,n=Yi(e),i=n.resolve,s=n.reject,o=perform((function(){var n=aFunction$1(e.resolve),o=[],l=0,u=1;Qa(t,(function(t){var h=l++,p=!1;o.push(void 0),u++,n.call(e,t).then((function(t){p||(p=!0,o[h]=t,--u||i(o))}),s)})),--u||i(o)}));return o.error&&s(o.value),n.promise},race:function race(t){var e=this,n=Yi(e),i=n.reject,s=perform((function(){var s=aFunction$1(e.resolve);Qa(t,(function(t){s.call(e,t).then(n.resolve,i)}))}));return s.error&&i(s.value),n.promise}});var rs="toString",ns=RegExp.prototype,as=ns.toString,is=fails((function(){return"/a/b"!=as.call({source:"a",flags:"b"})})),ss=as.name!=rs;for(var os in(is||ss)&&Z(RegExp.prototype,rs,(function toString(){var t=anObject(this),e=String(t.source),n=t.flags;return"/"+e+"/"+String(void 0===n&&t instanceof RegExp&&!("flags"in ns)?regexpFlags.call(t):n)}),{unsafe:!0}),He){var ls=i[os],us=ls&&ls.prototype;if(us&&us.forEach!==Ta)try{E(us,"forEach",Ta)}catch(t){us.forEach=Ta}}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,n,i,s,o,l){try{var u=t[o](l),h=u.value}catch(t){return void n(t)}u.done?e(h):Promise.resolve(h).then(i,s)}function _asyncToGenerator(t){return function(){var e=this,n=arguments;return new Promise((function(i,s){var o=t.apply(e,n);function _next(t){asyncGeneratorStep(o,i,s,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(o,i,s,_next,_throw,"throw",t)}_next(void 0)}))}}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),t}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_setPrototypeOf(t,e)}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,e){return t.__proto__=e,t})(t,e)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function _construct(t,e,n){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function _construct(t,e,n){var i=[null];i.push.apply(i,e);var s=new(Function.bind.apply(t,i));return n&&_setPrototypeOf(s,n.prototype),s}).apply(null,arguments)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _possibleConstructorReturn(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?_assertThisInitialized(t):e}function _createSuper(t){var e=_isNativeReflectConstruct();return function _createSuperInternal(){var n,i=_getPrototypeOf(t);if(e){var s=_getPrototypeOf(this).constructor;n=Reflect.construct(i,arguments,s)}else n=i.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _get(t,e,n){return(_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,e,n){var i=function _superPropBase(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=_getPrototypeOf(t)););return t}(t,e);if(i){var s=Object.getOwnPropertyDescriptor(i,e);return s.get?s.get.call(n):s.value}})(t,e,n||t)}function _slicedToArray(t,e){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,s=!1,o=void 0;try{for(var l,u=t[Symbol.iterator]();!(i=(l=u.next()).done)&&(n.push(l.value),!e||n.length!==e);i=!0);}catch(t){s=!0,o=t}finally{try{i||null==u.return||u.return()}finally{if(s)throw o}}return n}(t,e)||_unsupportedIterableToArray(t,e)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(t,e):void 0}}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}createCommonjsModule((function(t){var e=function(t){var e,n=Object.prototype,i=n.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",u=s.toStringTag||"@@toStringTag";function define(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{define({},"")}catch(t){define=function define(t,e,n){return t[e]=n}}function wrap(t,e,n,i){var s=e&&e.prototype instanceof Generator?e:Generator,o=Object.create(s.prototype),l=new Context(i||[]);return o._invoke=function makeInvokeMethod(t,e,n){var i=h;return function invoke(s,o){if(i===d)throw new Error("Generator is already running");if(i===v){if("throw"===s)throw o;return doneResult()}for(n.method=s,n.arg=o;;){var l=n.delegate;if(l){var u=maybeInvokeDelegate(l,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var b=tryCatch(t,e,n);if("normal"===b.type){if(i=n.done?v:p,b.arg===g)continue;return{value:b.arg,done:n.done}}"throw"===b.type&&(i=v,n.method="throw",n.arg=b.arg)}}}(t,n,l),o}function tryCatch(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=wrap;var h="suspendedStart",p="suspendedYield",d="executing",v="completed",g={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var b={};b[o]=function(){return this};var _=Object.getPrototypeOf,w=_&&_(_(values([])));w&&w!==n&&i.call(w,o)&&(b=w);var P=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(b);function defineIteratorMethods(t){["next","throw","return"].forEach((function(e){define(t,e,(function(t){return this._invoke(e,t)}))}))}function AsyncIterator(t,e){var n;this._invoke=function enqueue(s,o){function callInvokeWithMethodAndArg(){return new e((function(n,l){!function invoke(n,s,o,l){var u=tryCatch(t[n],t,s);if("throw"!==u.type){var h=u.arg,p=h.value;return p&&"object"===_typeof(p)&&i.call(p,"__await")?e.resolve(p.__await).then((function(t){invoke("next",t,o,l)}),(function(t){invoke("throw",t,o,l)})):e.resolve(p).then((function(t){h.value=t,o(h)}),(function(t){return invoke("throw",t,o,l)}))}l(u.arg)}(s,o,n,l)}))}return n=n?n.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,n){var i=t.iterator[n.method];if(i===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,maybeInvokeDelegate(t,n),"throw"===n.method))return g;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var s=tryCatch(i,t.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,g;var o=s.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}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 n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var s=-1,l=function next(){for(;++s<t.length;)if(i.call(t,s))return next.value=t[s],next.done=!1,next;return next.value=e,next.done=!0,next};return l.next=l}}return{next:doneResult}}function doneResult(){return{value:e,done:!0}}return GeneratorFunction.prototype=P.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"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,u,"GeneratorFunction")),t.prototype=Object.create(P),t},t.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[l]=function(){return this},t.AsyncIterator=AsyncIterator,t.async=function(e,n,i,s,o){void 0===o&&(o=Promise);var l=new AsyncIterator(wrap(e,n,i,s),o);return t.isGeneratorFunction(n)?l:l.next().then((function(t){return t.done?t.value:l.next()}))},defineIteratorMethods(P),define(P,u,"Generator"),P[o]=function(){return this},P.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function next(){for(;e.length;){var n=e.pop();if(n in t)return next.value=n,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 n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=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 n=this;function handle(i,s){return l.type="throw",l.arg=t,n.next=i,s&&(n.method="next",n.arg=e),!!s}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],l=o.completion;if("root"===o.tryLoc)return handle("end");if(o.tryLoc<=this.prev){var u=i.call(o,"catchLoc"),h=i.call(o,"finallyLoc");if(u&&h){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0);if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return handle(o.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return handle(o.finallyLoc)}}}},abrupt:function abrupt(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var s=this.tryEntries[n];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var o=s;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var l=o?o.completion:{};return l.type=t,l.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(l)},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),g},finish:function finish(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),resetTryEntry(n),g}},catch:function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var s=i.arg;resetTryEntry(n)}return s}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,n,i){return this.delegate={iterator:values(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),g}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}));var cs=Fn.every,hs=arrayMethodIsStrict("every"),fs=arrayMethodUsesToLength("every");_export({target:"Array",proto:!0,forced:!hs||!fs},{every:function every(t){return cs(this,t,arguments.length>1?arguments[1]:void 0)}});_export({target:"Array",proto:!0},{fill:function fill(t){for(var e=toObject(this),n=toLength(e.length),i=arguments.length,s=toAbsoluteIndex(i>1?arguments[1]:void 0,n),o=i>2?arguments[2]:void 0,l=void 0===o?n:toAbsoluteIndex(o,n);l>s;)e[s++]=t;return e}}),addToUnscopables("fill");var ps=Fn.filter,ds=arrayMethodHasSpeciesSupport("filter"),vs=arrayMethodUsesToLength("filter");_export({target:"Array",proto:!0,forced:!ds||!vs},{filter:function filter(t){return ps(this,t,arguments.length>1?arguments[1]:void 0)}});var ys=at.includes,gs=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:!gs},{includes:function includes(t){return ys(this,t,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("includes");var ms=at.indexOf,bs=[].indexOf,xs=!!bs&&1/[1].indexOf(1,-0)<0,_s=arrayMethodIsStrict("indexOf"),ws=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:xs||!_s||!ws},{indexOf:function indexOf(t){return xs?bs.apply(this,arguments)||0:ms(this,t,arguments.length>1?arguments[1]:void 0)}});var Ps=[].join,ks=d!=Object,Cs=arrayMethodIsStrict("join",",");_export({target:"Array",proto:!0,forced:ks||!Cs},{join:function join(t){return Ps.call(toIndexedObject(this),void 0===t?",":t)}});var Es=Fn.map,Ss=arrayMethodHasSpeciesSupport("map"),As=arrayMethodUsesToLength("map");_export({target:"Array",proto:!0,forced:!Ss||!As},{map:function map(t){return Es(this,t,arguments.length>1?arguments[1]:void 0)}});var inheritIfRequired=function(t,e,n){var i,s;return ae&&"function"==typeof(i=e.constructor)&&i!==n&&isObject(s=i.prototype)&&s!==n.prototype&&ae(t,s),t},Ts="\t\n\v\f\r    \u2028\u2029\ufeff",Os="["+Ts+"]",Rs=RegExp("^"+Os+Os+"*"),Ms=RegExp(Os+Os+"*$"),createMethod$3=function(t){return function(e){var n=String(requireObjectCoercible(e));return 1&t&&(n=n.replace(Rs,"")),2&t&&(n=n.replace(Ms,"")),n}},Bs={start:createMethod$3(1),end:createMethod$3(2),trim:createMethod$3(3)},Vs=lt.f,Is=P.f,Ls=C.f,js=Bs.trim,Ns="Number",Ds=i.Number,Fs=Ds.prototype,Gs=classofRaw(Gt(Fs))==Ns,toNumber=function(t){var e,n,i,s,o,l,u,h,p=toPrimitive(t,!1);if("string"==typeof p&&p.length>2)if(43===(e=(p=js(p)).charCodeAt(0))||45===e){if(88===(n=p.charCodeAt(2))||120===n)return NaN}else if(48===e){switch(p.charCodeAt(1)){case 66:case 98:i=2,s=49;break;case 79:case 111:i=8,s=55;break;default:return+p}for(l=(o=p.slice(2)).length,u=0;u<l;u++)if((h=o.charCodeAt(u))<48||h>s)return NaN;return parseInt(o,i)}return+p};if(yt(Ns,!Ds(" 0o1")||!Ds("0b1")||Ds("+0x1"))){for(var Us,zs=function Number(t){var e=arguments.length<1?0:t,n=this;return n instanceof zs&&(Gs?fails((function(){Fs.valueOf.call(n)})):classofRaw(n)!=Ns)?inheritIfRequired(new Ds(toNumber(e)),n,zs):toNumber(e)},Ws=s?Vs(Ds):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),qs=0;Ws.length>qs;qs++)has(Ds,Us=Ws[qs])&&!has(zs,Us)&&Ls(zs,Us,Is(Ds,Us));zs.prototype=Fs,Fs.constructor=zs,Z(i,Ns,zs)}var Xs=Bs.trim,$s=i.parseFloat,Hs=1/$s(Ts+"-0")!=-1/0?function parseFloat(t){var e=Xs(String(t)),n=$s(e);return 0===n&&"-"==e.charAt(0)?-0:n}:$s;_export({target:"Number",stat:!0,forced:Number.parseFloat!=Hs},{parseFloat:Hs});var Ys=Bs.trim,Qs=i.parseInt,Zs=/^[+-]?0[Xx]/,Js=8!==Qs(Ts+"08")||22!==Qs(Ts+"0x16")?function parseInt(t,e){var n=Ys(String(t));return Qs(n,e>>>0||(Zs.test(n)?16:10))}:Qs;_export({target:"Number",stat:!0,forced:Number.parseInt!=Js},{parseInt:Js}),_export({target:"Object",stat:!0,forced:Object.assign!==sr},{assign:sr});var Ks=u.f,createMethod$4=function(t){return function(e){for(var n,i=toIndexedObject(e),o=jt(i),l=o.length,u=0,h=[];l>u;)n=o[u++],s&&!Ks.call(i,n)||h.push(t?[n,i[n]]:i[n]);return h}},to={entries:createMethod$4(!0),values:createMethod$4(!1)}.entries;_export({target:"Object",stat:!0},{entries:function entries(t){return to(t)}});var eo,ro=wellKnownSymbol("match"),isRegexp=function(t){var e;return isObject(t)&&(void 0!==(e=t[ro])?!!e:"RegExp"==classofRaw(t))},notARegexp=function(t){if(isRegexp(t))throw TypeError("The method doesn't accept regular expressions");return t},no=wellKnownSymbol("match"),correctIsRegexpLogic=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[no]=!1,"/./"[t](e)}catch(t){}}return!1},ao=P.f,io="".endsWith,so=Math.min,oo=correctIsRegexpLogic("endsWith"),lo=!(oo||(eo=ao(String.prototype,"endsWith"),!eo||eo.writable));_export({target:"String",proto:!0,forced:!lo&&!oo},{endsWith:function endsWith(t){var e=String(requireObjectCoercible(this));notARegexp(t);var n=arguments.length>1?arguments[1]:void 0,i=toLength(e.length),s=void 0===n?i:so(toLength(n),i),o=String(t);return io?io.call(e,o,s):e.slice(s-o.length,s)===o}}),_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)}}),fixRegexpWellKnownSymbolLogic("match",1,(function(t,e,n){return[function match(e){var n=requireObjectCoercible(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,n):new RegExp(e)[t](String(n))},function(t){var i=n(e,t,this);if(i.done)return i.value;var s=anObject(t),o=String(this);if(!s.global)return regexpExecAbstract(s,o);var l=s.unicode;s.lastIndex=0;for(var u,h=[],p=0;null!==(u=regexpExecAbstract(s,o));){var d=String(u[0]);h[p]=d,""===d&&(s.lastIndex=advanceStringIndex(o,toLength(s.lastIndex),l)),p++}return 0===p?null:h}]}));var uo=[].push,co=Math.min,ho=4294967295,fo=!fails((function(){return!RegExp(ho,"y")}));fixRegexpWellKnownSymbolLogic("split",2,(function(t,e,n){var i;return i="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,n){var i=String(requireObjectCoercible(this)),s=void 0===n?ho:n>>>0;if(0===s)return[];if(void 0===t)return[i];if(!isRegexp(t))return e.call(i,t,s);for(var o,l,u,h=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),d=0,v=new RegExp(t.source,p+"g");(o=Oe.call(v,i))&&!((l=v.lastIndex)>d&&(h.push(i.slice(d,o.index)),o.length>1&&o.index<i.length&&uo.apply(h,o.slice(1)),u=o[0].length,d=l,h.length>=s));)v.lastIndex===o.index&&v.lastIndex++;return d===i.length?!u&&v.test("")||h.push(""):h.push(i.slice(d)),h.length>s?h.slice(0,s):h}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function split(e,n){var s=requireObjectCoercible(this),o=null==e?void 0:e[t];return void 0!==o?o.call(e,s,n):i.call(String(s),e,n)},function(t,s){var o=n(i,t,this,s,i!==e);if(o.done)return o.value;var l=anObject(t),u=String(this),h=speciesConstructor(l,RegExp),p=l.unicode,d=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(fo?"y":"g"),v=new h(fo?l:"^(?:"+l.source+")",d),g=void 0===s?ho:s>>>0;if(0===g)return[];if(0===u.length)return null===regexpExecAbstract(v,u)?[u]:[];for(var b=0,_=0,w=[];_<u.length;){v.lastIndex=fo?_:0;var P,k=regexpExecAbstract(v,fo?u:u.slice(_));if(null===k||(P=co(toLength(v.lastIndex+(fo?0:_)),u.length))===b)_=advanceStringIndex(u,_,p);else{if(w.push(u.slice(b,_)),w.length===g)return w;for(var C=1;C<=k.length-1;C++)if(w.push(k[C]),w.length===g)return w;_=b=P}}return w.push(u.slice(b)),w}]}),!fo);var po=P.f,vo="".startsWith,yo=Math.min,go=correctIsRegexpLogic("startsWith"),mo=!go&&!!function(){var t=po(String.prototype,"startsWith");return t&&!t.writable}();_export({target:"String",proto:!0,forced:!mo&&!go},{startsWith:function startsWith(t){var e=String(requireObjectCoercible(this));notARegexp(t);var n=toLength(yo(arguments.length>1?arguments[1]:void 0,e.length)),i=String(t);return vo?vo.call(e,i,n):e.slice(n,n+i.length)===i}});var bo=Bs.trim;_export({target:"String",proto:!0,forced:function(t){return fails((function(){return!!Ts[t]()||"…"!="…"[t]()||Ts[t].name!==t}))}("trim")},{trim:function trim(){return bo(this)}});var flattenIntoArray=function(t,e,n,i,s,o,l,u){for(var h,p=s,d=0,v=!!l&&functionBindContext(l,u,3);d<i;){if(d in n){if(h=v?v(n[d],d,e):n[d],o>0&&mt(h))p=flattenIntoArray(t,e,h,toLength(h.length),p,o-1)-1;else{if(p>=9007199254740991)throw TypeError("Exceed the acceptable array length");t[p]=h}p++}d++}return p},xo=flattenIntoArray;_export({target:"Array",proto:!0},{flatMap:function flatMap(t){var e,n=toObject(this),i=toLength(n.length);return aFunction$1(t),(e=arraySpeciesCreate(n,0)).length=xo(e,n,n,i,0,1,t,arguments.length>1?arguments[1]:void 0),e}}),addToUnscopables("flatMap");var _o=fails((function(){jt(1)}));_export({target:"Object",stat:!0,forced:_o},{keys:function keys(t){return jt(toObject(t))}});
/**
* For parsing color values.
* @module RGBColor
* @author Stoyan Stefanov <sstoo@gmail.com>
* @see https://www.phpied.com/rgb-color-parser-in-javascript/
* @license MIT
*/
var wo={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},Po=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function process(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.map((function(t){return Number.parseInt(t)}))}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function process(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.map((function(t){return Number.parseInt(t,16)}))}},{re:/^(\w)(\w)(\w)$/,example:["#fb0","f0f"],process:function process(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.map((function(t){return Number.parseInt(t+t,16)}))}}],ko=function(){function RGBColor(t){var e=this;_classCallCheck(this,RGBColor),this.ok=!1,"#"===t.charAt(0)&&(t=t.substr(1,6)),(t=(t=t.replace(/ /g,"")).toLowerCase())in wo&&(t=wo[t]),Po.forEach((function(n){var i=n.re,s=n.process,o=i.exec(t);if(o){var l=_slicedToArray(s.apply(void 0,_toConsumableArray(o)),3),u=l[0],h=l[1],p=l[2];Object.assign(e,{r:u,g:h,b:p}),e.ok=!0}})),this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b}return _createClass(RGBColor,[{key:"toRGB",value:function toRGB(){return"rgb("+this.r+", "+this.g+", "+this.b+")"}},{key:"toHex",value:function toHex(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1===t.length&&(t="0"+t),1===e.length&&(e="0"+e),1===n.length&&(n="0"+n),"#"+t+e+n}}],[{key:"getHelpXML",value:function getHelpXML(){var t=[].concat(_toConsumableArray(Po.flatMap((function(t){return t.example}))),_toConsumableArray(Object.keys(wo))),e=document.createElement("ul");return e.setAttribute("id","rgbcolor-examples"),e.append.apply(e,_toConsumableArray(t.map((function(t){try{var e=document.createElement("li"),n=new RGBColor(t),i=document.createElement("div");i.style.cssText="\n margin: 3px;\n border: 1px solid black;\n background: ".concat(n.toHex(),";\n color: ").concat(n.toHex(),";"),i.append("test");var s=" ".concat(t," -> ").concat(n.toRGB()," -> ").concat(n.toHex());return e.append(i,s),e}catch(t){return""}})))),e}}]),RGBColor}();function _typeof$1(t){return(_typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(t){return typeof t}:function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Co=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Eo=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function processCanvasRGBA(t,e,n,i,s,o){if(!(isNaN(o)||o<1)){o|=0;var l=function getImageDataFromCanvas(t,e,n,i,s){if("string"==typeof t&&(t=document.getElementById(t)),!t||"object"!==_typeof$1(t)||!("getContext"in t))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var o=t.getContext("2d");try{return o.getImageData(e,n,i,s)}catch(t){throw new Error("unable to access image data: "+t)}}(t,e,n,i,s);l=function processImageDataRGBA(t,e,n,i,s,o){var l,u,h,p,d,v,g,b,_,w,P,k,C,E,S,A,T,O,R,M,B,V,I,L,j,N=t.data,D=2*o+1,G=i-1,U=s-1,z=o+1,W=z*(z+1)/2,q=new So,X=q;for(h=1;h<D;h++)X=X.next=new So,h===z&&(j=X);X.next=q;var $=null,H=null;g=v=0;var Y=Co[o],Q=Eo[o];for(u=0;u<s;u++){for(A=T=O=R=b=_=w=P=0,k=z*(M=N[v]),C=z*(B=N[v+1]),E=z*(V=N[v+2]),S=z*(I=N[v+3]),b+=W*M,_+=W*B,w+=W*V,P+=W*I,X=q,h=0;h<z;h++)X.r=M,X.g=B,X.b=V,X.a=I,X=X.next;for(h=1;h<z;h++)p=v+((G<h?G:h)<<2),b+=(X.r=M=N[p])*(L=z-h),_+=(X.g=B=N[p+1])*L,w+=(X.b=V=N[p+2])*L,P+=(X.a=I=N[p+3])*L,A+=M,T+=B,O+=V,R+=I,X=X.next;for($=q,H=j,l=0;l<i;l++)N[v+3]=I=P*Y>>Q,0!==I?(I=255/I,N[v]=(b*Y>>Q)*I,N[v+1]=(_*Y>>Q)*I,N[v+2]=(w*Y>>Q)*I):N[v]=N[v+1]=N[v+2]=0,b-=k,_-=C,w-=E,P-=S,k-=$.r,C-=$.g,E-=$.b,S-=$.a,p=g+((p=l+o+1)<G?p:G)<<2,b+=A+=$.r=N[p],_+=T+=$.g=N[p+1],w+=O+=$.b=N[p+2],P+=R+=$.a=N[p+3],$=$.next,k+=M=H.r,C+=B=H.g,E+=V=H.b,S+=I=H.a,A-=M,T-=B,O-=V,R-=I,H=H.next,v+=4;g+=i}for(l=0;l<i;l++){for(T=O=R=A=_=w=P=b=0,k=z*(M=N[v=l<<2]),C=z*(B=N[v+1]),E=z*(V=N[v+2]),S=z*(I=N[v+3]),b+=W*M,_+=W*B,w+=W*V,P+=W*I,X=q,h=0;h<z;h++)X.r=M,X.g=B,X.b=V,X.a=I,X=X.next;for(d=i,h=1;h<=o;h++)v=d+l<<2,b+=(X.r=M=N[v])*(L=z-h),_+=(X.g=B=N[v+1])*L,w+=(X.b=V=N[v+2])*L,P+=(X.a=I=N[v+3])*L,A+=M,T+=B,O+=V,R+=I,X=X.next,h<U&&(d+=i);for(v=l,$=q,H=j,u=0;u<s;u++)N[(p=v<<2)+3]=I=P*Y>>Q,I>0?(I=255/I,N[p]=(b*Y>>Q)*I,N[p+1]=(_*Y>>Q)*I,N[p+2]=(w*Y>>Q)*I):N[p]=N[p+1]=N[p+2]=0,b-=k,_-=C,w-=E,P-=S,k-=$.r,C-=$.g,E-=$.b,S-=$.a,p=l+((p=u+z)<U?p:U)*i<<2,b+=A+=$.r=N[p],_+=T+=$.g=N[p+1],w+=O+=$.b=N[p+2],P+=R+=$.a=N[p+3],$=$.next,k+=M=H.r,C+=B=H.g,E+=V=H.b,S+=I=H.a,A-=M,T-=B,O-=V,R-=I,H=H.next,v+=i}return t}(l,0,0,i,s,o),t.getContext("2d").putImageData(l,e,n)}}var So=function BlurStack(){!function _classCallCheck$1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,BlurStack),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null},Ao=function isNullish(t){return null==t},To=function canvg(t,e,n){if(Ao(t)&&Ao(e)&&Ao(n)){var i=document.querySelectorAll("svg");return Promise.all(_toConsumableArray(i).map((function(t){var e=document.createElement("canvas");e.width=t.clientWidth,e.height=t.clientHeight,t.before(e),t.remove();var n=document.createElement("div");return n.append(t),canvg(e,n.innerHTML)})))}"string"==typeof t&&(t=document.getElementById(t)),Ao(t.svg)||t.svg.stop();var s=function build(t){var e={opts:t,FRAMERATE:30,MAX_VIRTUAL_PIXELS:3e4,log:function(t){}};!0===e.opts.log&&"undefined"!=typeof console&&(e.log=function(t){console.log(t)});e.init=function(t){var n=0;e.UniqueId=function(){return"canvg"+ ++n},e.Definitions={},e.Styles={},e.Animations=[],e.Images=[],e.ctx=t,e.ViewPort={viewPorts:[],Clear:function Clear(){this.viewPorts=[]},SetCurrent:function SetCurrent(t,e){this.viewPorts.push({width:t,height:e})},RemoveCurrent:function RemoveCurrent(){this.viewPorts.pop()},Current:function Current(){return this.viewPorts[this.viewPorts.length-1]},width:function width(){return this.Current().width},height:function height(){return this.Current().height},ComputeSize:function ComputeSize(t){return Ao(t)||"number"!=typeof t?"x"===t?this.width():"y"===t?this.height():Math.sqrt(Math.pow(this.width(),2)+Math.pow(this.height(),2))/Math.sqrt(2):t}}},e.init(),e.ImagesLoaded=function(){return e.Images.every((function(t){return t.loaded}))},e.trim=function(t){return t.replace(/^\s+|\s+$/g,"")},e.compressSpaces=function(t){return t.replace(/\s+/gm," ")},e.ajax=function(t,e){var n=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");return e?new Promise((function(e,i){n.open("GET",t,!0).addEventListener("load",(function(){e(n.responseText)})),n.send(null)})):(n.open("GET",t,!1),n.send(null),n.responseText)},e.parseXml=function(t){if(window.DOMParser)return(new DOMParser).parseFromString(t,"text/xml");t=t.replace(/<!DOCTYPE svg[^>]*>/,"");var e=new window.ActiveXObject("Microsoft.XMLDOM");return e.async="false",e.loadXML(t),e};var n={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};e.Property=function(){function Property(t,e){_classCallCheck(this,Property),this.name=t,this.value=e}return _createClass(Property,[{key:"getValue",value:function getValue(){return this.value}},{key:"hasValue",value:function hasValue(){return!Ao(this.value)&&""!==this.value}},{key:"numValue",value:function numValue(){if(!this.hasValue())return 0;var t=Number.parseFloat(this.value);return String(this.value).endsWith("%")&&(t/=100),t}},{key:"valueOrDefault",value:function valueOrDefault(t){return this.hasValue()?this.value:t}},{key:"numValueOrDefault",value:function numValueOrDefault(t){return this.hasValue()?this.numValue():t}},{key:"addOpacity",value:function addOpacity(t){var n=this.value;if(!Ao(t.value)&&""!==t.value&&"string"==typeof this.value){var i=new ko(this.value);i.ok&&(n="rgba("+i.r+", "+i.g+", "+i.b+", "+t.numValue()+")")}return new e.Property(this.name,n)}},{key:"getDefinition",value:function getDefinition(){var t=this.value.match(/#([^)'"]+)/);return t&&(t=t[1]),t||(t=this.value),e.Definitions[t]}},{key:"isUrlDefinition",value:function isUrlDefinition(){return this.value.startsWith("url(")}},{key:"getFillStyleDefinition",value:function getFillStyleDefinition(t,n){var i=this.getDefinition();if(!Ao(i)&&i.createGradient)return i.createGradient(e.ctx,t,n);if(!Ao(i)&&i.createPattern){if(i.getHrefAttribute().hasValue()){var s=i.attribute("patternTransform");i=i.getHrefAttribute().getDefinition(),s.hasValue()&&(i.attribute("patternTransform",!0).value=s.value)}return i.createPattern(e.ctx,t)}return null}},{key:"getDPI",value:function getDPI(t){return 96}},{key:"getEM",value:function getEM(t){var n=12,i=new e.Property("fontSize",e.Font.Parse(e.ctx.font).fontSize);return i.hasValue()&&(n=i.toPixels(t)),n}},{key:"getUnits",value:function getUnits(){return String(this.value).replace(/[\d.-]/g,"")}},{key:"toPixels",value:function toPixels(t,n){if(!this.hasValue())return 0;var i=String(this.value);if(i.endsWith("em"))return this.numValue()*this.getEM(t);if(i.endsWith("ex"))return this.numValue()*this.getEM(t)/2;if(i.endsWith("px"))return this.numValue();if(i.endsWith("pt"))return this.numValue()*this.getDPI(t)*(1/72);if(i.endsWith("pc"))return 15*this.numValue();if(i.endsWith("cm"))return this.numValue()*this.getDPI(t)/2.54;if(i.endsWith("mm"))return this.numValue()*this.getDPI(t)/25.4;if(i.endsWith("in"))return this.numValue()*this.getDPI(t);if(i.endsWith("%"))return this.numValue()*e.ViewPort.ComputeSize(t);var s=this.numValue();return n&&s<1?s*e.ViewPort.ComputeSize(t):s}},{key:"toMilliseconds",value:function toMilliseconds(){if(!this.hasValue())return 0;var t=String(this.value);return t.endsWith("ms")?this.numValue():t.endsWith("s")?1e3*this.numValue():this.numValue()}},{key:"toRadians",value:function toRadians(){if(!this.hasValue())return 0;var t=String(this.value);return t.endsWith("deg")?this.numValue()*(Math.PI/180):t.endsWith("grad")?this.numValue()*(Math.PI/200):t.endsWith("rad")?this.numValue():this.numValue()*(Math.PI/180)}},{key:"toTextBaseline",value:function toTextBaseline(){return this.hasValue()?n[this.value]:null}}]),Property}(),e.Font={Styles:"normal|italic|oblique|inherit",Variants:"normal|small-caps|inherit",Weights:"normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit",CreateFont:function CreateFont(t,n,i,s,o,l){var u=Ao(l)?this.CreateFont("","","","","",e.ctx.font):this.Parse(l);return{fontFamily:o||u.fontFamily,fontSize:s||u.fontSize,fontStyle:t||u.fontStyle,fontWeight:i||u.fontWeight,fontVariant:n||u.fontVariant,toString:function toString(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}},Parse:function Parse(t){var n=this,i={},s=e.trim(e.compressSpaces(t||"")).split(" "),o={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1},l="";return s.forEach((function(t){!o.fontStyle&&n.Styles.includes(t)?("inherit"!==t&&(i.fontStyle=t),o.fontStyle=!0):!o.fontVariant&&n.Variants.includes(t)?("inherit"!==t&&(i.fontVariant=t),o.fontStyle=o.fontVariant=!0):!o.fontWeight&&n.Weights.includes(t)?("inherit"!==t&&(i.fontWeight=t),o.fontStyle=o.fontVariant=o.fontWeight=!0):o.fontSize?"inherit"!==t&&(l+=t):("inherit"!==t&&(i.fontSize=t.split("/")[0]),o.fontStyle=o.fontVariant=o.fontWeight=o.fontSize=!0)})),""!==l&&(i.fontFamily=l),i}},e.ToNumberArray=function(t){return e.trim(e.compressSpaces((t||"").replace(/,/g," "))).split(" ").map((function(t){return Number.parseFloat(t)}))},e.Point=function(){function _class(t,e){_classCallCheck(this,_class),this.x=t,this.y=e}return _createClass(_class,[{key:"angleTo",value:function angleTo(t){return Math.atan2(t.y-this.y,t.x-this.x)}},{key:"applyTransform",value:function applyTransform(t){var e=this.x*t[0]+this.y*t[2]+t[4],n=this.x*t[1]+this.y*t[3]+t[5];this.x=e,this.y=n}}]),_class}(),e.CreatePoint=function(t){var n=e.ToNumberArray(t);return new e.Point(n[0],n[1])},e.CreatePath=function(t){for(var n=e.ToNumberArray(t),i=[],s=0;s<n.length;s+=2)i.push(new e.Point(n[s],n[s+1]));return i},e.BoundingBox=function(){function _class2(t,e,n,i){_classCallCheck(this,_class2),this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN,this.addPoint(t,e),this.addPoint(n,i)}return _createClass(_class2,[{key:"x",value:function x(){return this.x1}},{key:"y",value:function y(){return this.y1}},{key:"width",value:function width(){return this.x2-this.x1}},{key:"height",value:function height(){return this.y2-this.y1}},{key:"addPoint",value:function addPoint(t,e){Ao(t)||((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),Ao(e)||((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))}},{key:"addX",value:function addX(t){this.addPoint(t,null)}},{key:"addY",value:function addY(t){this.addPoint(null,t)}},{key:"addBoundingBox",value:function addBoundingBox(t){this.addPoint(t.x1,t.y1),this.addPoint(t.x2,t.y2)}},{key:"addQuadraticCurve",value:function addQuadraticCurve(t,e,n,i,s,o){var l=t+2/3*(n-t),u=e+2/3*(i-e),h=l+1/3*(s-t),p=u+1/3*(o-e);this.addBezierCurve(t,e,l,h,u,p,s,o)}},{key:"addBezierCurve",value:function addBezierCurve(t,e,n,i,s,o,l,u){var h=this,p=[t,e],d=[n,i],v=[s,o],g=[l,u];this.addPoint(p[0],p[1]),this.addPoint(g[0],g[1]);for(var b=function _loop(t){var e=function f(e){return Math.pow(1-e,3)*p[t]+3*Math.pow(1-e,2)*e*d[t]+3*(1-e)*Math.pow(e,2)*v[t]+Math.pow(e,3)*g[t]},n=6*p[t]-12*d[t]+6*v[t],i=-3*p[t]+9*d[t]-9*v[t]+3*g[t],s=3*d[t]-3*p[t];if(0===i){if(0===n)return"continue";var o=-s/n;return o>0&&o<1&&(0===t&&h.addX(e(o)),1===t&&h.addY(e(o))),"continue"}var l=Math.pow(n,2)-4*s*i;if(l<0)return"continue";var u=(-n+Math.sqrt(l))/(2*i);u>0&&u<1&&(0===t&&h.addX(e(u)),1===t&&h.addY(e(u)));var b=(-n-Math.sqrt(l))/(2*i);b>0&&b<1&&(0===t&&h.addX(e(b)),1===t&&h.addY(e(b)))},_=0;_<=1;_++)b(_)}},{key:"isPointInBox",value:function isPointInBox(t,e){return this.x1<=t&&t<=this.x2&&this.y1<=e&&e<=this.y2}}]),_class2}(),e.Transform=function(){function _class3(t){var n=this;_classCallCheck(this,_class3),this.Type={translate:function translate(t){_classCallCheck(this,translate),this.p=e.CreatePoint(t),this.apply=function(t){t.translate(this.p.x||0,this.p.y||0)},this.unapply=function(t){t.translate(-1*this.p.x||0,-1*this.p.y||0)},this.applyToPoint=function(t){t.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0])}},rotate:function rotate(t){_classCallCheck(this,rotate);var n=e.ToNumberArray(t);this.angle=new e.Property("angle",n[0]),this.cx=n[1]||0,this.cy=n[2]||0,this.apply=function(t){t.translate(this.cx,this.cy),t.rotate(this.angle.toRadians()),t.translate(-this.cx,-this.cy)},this.unapply=function(t){t.translate(this.cx,this.cy),t.rotate(-1*this.angle.toRadians()),t.translate(-this.cx,-this.cy)},this.applyToPoint=function(t){var e=this.angle.toRadians();t.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]),t.applyTransform([Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0]),t.applyTransform([1,0,0,1,-this.p.x||0,-this.p.y||0])}},scale:function scale(t){_classCallCheck(this,scale),this.p=e.CreatePoint(t),this.apply=function(t){t.scale(this.p.x||1,this.p.y||this.p.x||1)},this.unapply=function(t){t.scale(1/this.p.x||1,1/this.p.y||this.p.x||1)},this.applyToPoint=function(t){t.applyTransform([this.p.x||0,0,0,this.p.y||0,0,0])}},matrix:function matrix(t){_classCallCheck(this,matrix),this.m=e.ToNumberArray(t),this.apply=function(t){t.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])},this.applyToPoint=function(t){t.applyTransform(this.m)}}},Object.assign(this.Type,{SkewBase:function(t){_inherits(SkewBase,t);var n=_createSuper(SkewBase);function SkewBase(t){var i;return _classCallCheck(this,SkewBase),(i=n.call(this,t)).angle=new e.Property("angle",t),i}return SkewBase}(this.Type.matrix)}),Object.assign(this.Type,{skewX:function(t){_inherits(skewX,t);var e=_createSuper(skewX);function skewX(t){var n;return _classCallCheck(this,skewX),(n=e.call(this,t)).m=[1,0,Math.tan(n.angle.toRadians()),1,0,0],n}return skewX}(this.Type.SkewBase),skewY:function(t){_inherits(skewY,t);var e=_createSuper(skewY);function skewY(t){var n;return _classCallCheck(this,skewY),(n=e.call(this,t)).m=[1,Math.tan(n.angle.toRadians()),0,1,0,0],n}return skewY}(this.Type.SkewBase)});var i=e.trim(e.compressSpaces(t)).replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/);this.transforms=i.map((function(t){var i=e.trim(t.split("(")[0]),s=t.split("(")[1].replace(")",""),o=new n.Type[i](s);return o.type=i,o}))}return _createClass(_class3,[{key:"apply",value:function apply(t){this.transforms.forEach((function(e){e.apply(t)}))}},{key:"unapply",value:function unapply(t){for(var e=this.transforms.length-1;e>=0;e--)this.transforms[e].unapply(t)}},{key:"applyToPoint",value:function applyToPoint(t){this.transforms.forEach((function(e){e.applyToPoint(t)}))}}]),_class3}(),e.AspectRatio=function(t,n,i,s,o,l,u,h,p,d){var v=(n=(n=e.compressSpaces(n)).replace(/^defer\s/,"")).split(" ")[0]||"xMidYMid",g=n.split(" ")[1]||"meet",b=i/s,_=o/l,w=Math.min(b,_),P=Math.max(b,_);"meet"===g&&(s*=w,l*=w),"slice"===g&&(s*=P,l*=P),p=new e.Property("refX",p),d=new e.Property("refY",d),p.hasValue()&&d.hasValue()?t.translate(-w*p.toPixels("x"),-w*d.toPixels("y")):(v.startsWith("xMid")&&("meet"===g&&w===_||"slice"===g&&P===_)&&t.translate(i/2-s/2,0),v.endsWith("YMid")&&("meet"===g&&w===b||"slice"===g&&P===b)&&t.translate(0,o/2-l/2),v.startsWith("xMax")&&("meet"===g&&w===_||"slice"===g&&P===_)&&t.translate(i-s,0),v.endsWith("YMax")&&("meet"===g&&w===b||"slice"===g&&P===b)&&t.translate(0,o-l)),"none"===v?t.scale(b,_):"meet"===g?t.scale(w,w):"slice"===g&&t.scale(P,P),t.translate(Ao(u)?0:-u,Ao(h)?0:-h)},e.Element={},e.EmptyProperty=new e.Property("EMPTY",""),e.Element.ElementBase=function(){function _class4(t){var n=this;if(_classCallCheck(this,_class4),this.captureTextNodes=arguments[1],this.attributes={},this.styles={},this.children=[],!Ao(t)&&1===t.nodeType){_toConsumableArray(t.childNodes).forEach((function(t){if(1===t.nodeType&&n.addChild(t,!0),n.captureTextNodes&&(3===t.nodeType||4===t.nodeType)){var i=t.nodeValue||t.text||"";""!==e.trim(e.compressSpaces(i))&&n.addChild(new e.Element.tspan(t),!1)}})),_toConsumableArray(t.attributes).forEach((function(t){var i=t.nodeName,s=t.nodeValue;n.attributes[i]=new e.Property(i,s)}));var i=e.Styles[t.nodeName];if(Ao(i)||Object.entries(i).forEach((function(t){var e=_slicedToArray(t,2),i=e[0],s=e[1];n.styles[i]=s})),this.attribute("class").hasValue())e.compressSpaces(this.attribute("class").value).split(" ").forEach((function(s){i=e.Styles["."+s],Ao(i)||Object.entries(i).forEach((function(t){var e=_slicedToArray(t,2),i=e[0],s=e[1];n.styles[i]=s})),i=e.Styles[t.nodeName+"."+s],Ao(i)||Object.entries(i).forEach((function(t){var e=_slicedToArray(t,2),i=e[0],s=e[1];n.styles[i]=s}))}));if(this.attribute("id").hasValue()){var s=e.Styles["#"+this.attribute("id").value];Ao(s)||Object.entries(s).forEach((function(t){var e=_slicedToArray(t,2),i=e[0],s=e[1];n.styles[i]=s}))}if(this.attribute("style").hasValue())this.attribute("style").value.split(";").forEach((function(t){if(""!==e.trim(t)){var i=t.split(":"),s=i.name,o=i.value;s=e.trim(s),o=e.trim(o),n.styles[s]=new e.Property(s,o)}}));this.attribute("id").hasValue()&&Ao(e.Definitions[this.attribute("id").value])&&(e.Definitions[this.attribute("id").value]=this)}}return _createClass(_class4,[{key:"attribute",value:function attribute(t,n){var i=this.attributes[t];return Ao(i)?(!0===n&&(i=new e.Property(t,""),this.attributes[t]=i),i||e.EmptyProperty):i}},{key:"getHrefAttribute",value:function getHrefAttribute(){for(var t in this.attributes)if(t.endsWith(":href"))return this.attributes[t];return e.EmptyProperty}},{key:"style",value:function style(t,n,i){var s=this.styles[t];if(!Ao(s))return s;var o=this.attribute(t);if(!Ao(o)&&o.hasValue())return this.styles[t]=o,o;if(!0!==i){var l=this.parent;if(!Ao(l)){var u=l.style(t);if(!Ao(u)&&u.hasValue())return u}}return!0===n&&(s=new e.Property(t,""),this.styles[t]=s),s||e.EmptyProperty}},{key:"render",value:function render(t){if("none"!==this.style("display").value&&"hidden"!==this.style("visibility").value){if(t.save(),this.attribute("mask").hasValue()){var e=this.attribute("mask").getDefinition();Ao(e)||e.apply(t,this)}else if(this.style("filter").hasValue()){var n=this.style("filter").getDefinition();Ao(n)||n.apply(t,this)}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}},{key:"setContext",value:function setContext(t){}},{key:"clearContext",value:function clearContext(t){}},{key:"renderChildren",value:function renderChildren(t){this.children.forEach((function(e){e.render(t)}))}},{key:"addChild",value:function addChild(t,n){var i=n?e.CreateElement(t):t;i.parent=this,"title"!==i.type&&this.children.push(i)}}]),_class4}(),e.Element.RenderedElementBase=function(t){_inherits(_class5,t);var n=_createSuper(_class5);function _class5(){return _classCallCheck(this,_class5),n.apply(this,arguments)}return _createClass(_class5,[{key:"setContext",value:function setContext(t){if(this.style("fill").isUrlDefinition()){var n=this.style("fill").getFillStyleDefinition(this,this.style("fill-opacity"));Ao(n)||(t.fillStyle=n)}else if(this.style("fill").hasValue()){var i=this.style("fill");"currentColor"===i.value&&(i.value=this.style("color").value),t.fillStyle="none"===i.value?"rgba(0,0,0,0)":i.value}if(this.style("fill-opacity").hasValue()){var s=new e.Property("fill",t.fillStyle);s=s.addOpacity(this.style("fill-opacity")),t.fillStyle=s.value}if(this.style("stroke").isUrlDefinition()){var o=this.style("stroke").getFillStyleDefinition(this,this.style("stroke-opacity"));Ao(o)||(t.strokeStyle=o)}else if(this.style("stroke").hasValue()){var l=this.style("stroke");"currentColor"===l.value&&(l.value=this.style("color").value),t.strokeStyle="none"===l.value?"rgba(0,0,0,0)":l.value}if(this.style("stroke-opacity").hasValue()){var u=new e.Property("stroke",t.strokeStyle);u=u.addOpacity(this.style("stroke-opacity")),t.strokeStyle=u.value}if(this.style("stroke-width").hasValue()){var h=this.style("stroke-width").toPixels();t.lineWidth=0===h?.001:h}if(this.style("stroke-linecap").hasValue()&&(t.lineCap=this.style("stroke-linecap").value),this.style("stroke-linejoin").hasValue()&&(t.lineJoin=this.style("stroke-linejoin").value),this.style("stroke-miterlimit").hasValue()&&(t.miterLimit=this.style("stroke-miterlimit").value),this.style("stroke-dasharray").hasValue()&&"none"!==this.style("stroke-dasharray").value){var p=e.ToNumberArray(this.style("stroke-dasharray").value);void 0!==t.setLineDash?t.setLineDash(p):void 0!==t.webkitLineDash?t.webkitLineDash=p:void 0===t.mozDash||1===p.length&&0===p[0]||(t.mozDash=p);var d=this.style("stroke-dashoffset").numValueOrDefault(1);void 0!==t.lineDashOffset?t.lineDashOffset=d:void 0!==t.webkitLineDashOffset?t.webkitLineDashOffset=d:void 0!==t.mozDashOffset&&(t.mozDashOffset=d)}(void 0!==t.font&&(t.font=e.Font.CreateFont(this.style("font-style").value,this.style("font-variant").value,this.style("font-weight").value,this.style("font-size").hasValue()?this.style("font-size").toPixels()+"px":"",this.style("font-family").value).toString()),this.attribute("transform").hasValue())&&new e.Transform(this.attribute("transform").value).apply(t);if(this.style("clip-path",!1,!0).hasValue()){var v=this.style("clip-path",!1,!0).getDefinition();Ao(v)||v.apply(t)}this.style("opacity").hasValue()&&(t.globalAlpha=this.style("opacity").numValue())}}]),_class5}(e.Element.ElementBase),e.Element.PathElementBase=function(t){_inherits(_class6,t);var n=_createSuper(_class6);function _class6(){return _classCallCheck(this,_class6),n.apply(this,arguments)}return _createClass(_class6,[{key:"path",value:function path(t){return Ao(t)||t.beginPath(),new e.BoundingBox}},{key:"renderChildren",value:function renderChildren(t){this.path(t),e.Mouse.checkPath(this,t),""!==t.fillStyle&&("inherit"!==this.style("fill-rule").valueOrDefault("inherit")?t.fill(this.style("fill-rule").value):t.fill()),""!==t.strokeStyle&&t.stroke();var n=this.getMarkers();if(!Ao(n)){if(this.style("marker-start").isUrlDefinition())this.style("marker-start").getDefinition().render(t,n[0][0],n[0][1]);if(this.style("marker-mid").isUrlDefinition())for(var i=this.style("marker-mid").getDefinition(),s=1;s<n.length-1;s++)i.render(t,n[s][0],n[s][1]);if(this.style("marker-end").isUrlDefinition())this.style("marker-end").getDefinition().render(t,n[n.length-1][0],n[n.length-1][1])}}},{key:"getBoundingBox",value:function getBoundingBox(){return this.path()}},{key:"getMarkers",value:function getMarkers(){return null}}]),_class6}(e.Element.RenderedElementBase),e.Element.svg=function(t){_inherits(_class7,t);var n=_createSuper(_class7);function _class7(){return _classCallCheck(this,_class7),n.apply(this,arguments)}return _createClass(_class7,[{key:"clearContext",value:function clearContext(t){_get(_getPrototypeOf(_class7.prototype),"clearContext",this).call(this,t),e.ViewPort.RemoveCurrent()}},{key:"setContext",value:function setContext(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4,void 0!==t.font&&void 0!==window.getComputedStyle&&(t.font=window.getComputedStyle(t.canvas).getPropertyValue("font")),_get(_getPrototypeOf(_class7.prototype),"setContext",this).call(this,t),this.attribute("x").hasValue()||(this.attribute("x",!0).value=0),this.attribute("y").hasValue()||(this.attribute("y",!0).value=0),t.translate(this.attribute("x").toPixels("x"),this.attribute("y").toPixels("y"));var n=e.ViewPort.width(),i=e.ViewPort.height();if(this.attribute("width").hasValue()||(this.attribute("width",!0).value="100%"),this.attribute("height").hasValue()||(this.attribute("height",!0).value="100%"),void 0===this.root){n=this.attribute("width").toPixels("x"),i=this.attribute("height").toPixels("y");var s=0,o=0;this.attribute("refX").hasValue()&&this.attribute("refY").hasValue()&&(s=-this.attribute("refX").toPixels("x"),o=-this.attribute("refY").toPixels("y")),"visible"!==this.attribute("overflow").valueOrDefault("hidden")&&(t.beginPath(),t.moveTo(s,o),t.lineTo(n,o),t.lineTo(n,i),t.lineTo(s,i),t.closePath(),t.clip())}if(e.ViewPort.SetCurrent(n,i),this.attribute("viewBox").hasValue()){var l=e.ToNumberArray(this.attribute("viewBox").value),u=l[0],h=l[1];n=l[2],i=l[3],e.AspectRatio(t,this.attribute("preserveAspectRatio").value,e.ViewPort.width(),n,e.ViewPort.height(),i,u,h,this.attribute("refX").value,this.attribute("refY").value),e.ViewPort.RemoveCurrent(),e.ViewPort.SetCurrent(l[2],l[3])}}}]),_class7}(e.Element.RenderedElementBase),e.Element.rect=function(t){_inherits(_class8,t);var n=_createSuper(_class8);function _class8(){return _classCallCheck(this,_class8),n.apply(this,arguments)}return _createClass(_class8,[{key:"path",value:function path(t){var n=this.attribute("x").toPixels("x"),i=this.attribute("y").toPixels("y"),s=this.attribute("width").toPixels("x"),o=this.attribute("height").toPixels("y"),l=this.attribute("rx").toPixels("x"),u=this.attribute("ry").toPixels("y");return this.attribute("rx").hasValue()&&!this.attribute("ry").hasValue()&&(u=l),this.attribute("ry").hasValue()&&!this.attribute("rx").hasValue()&&(l=u),l=Math.min(l,s/2),u=Math.min(u,o/2),Ao(t)||(t.beginPath(),t.moveTo(n+l,i),t.lineTo(n+s-l,i),t.quadraticCurveTo(n+s,i,n+s,i+u),t.lineTo(n+s,i+o-u),t.quadraticCurveTo(n+s,i+o,n+s-l,i+o),t.lineTo(n+l,i+o),t.quadraticCurveTo(n,i+o,n,i+o-u),t.lineTo(n,i+u),t.quadraticCurveTo(n,i,n+l,i),t.closePath()),new e.BoundingBox(n,i,n+s,i+o)}}]),_class8}(e.Element.PathElementBase),e.Element.circle=function(t){_inherits(_class9,t);var n=_createSuper(_class9);function _class9(){return _classCallCheck(this,_class9),n.apply(this,arguments)}return _createClass(_class9,[{key:"path",value:function path(t){var n=this.attribute("cx").toPixels("x"),i=this.attribute("cy").toPixels("y"),s=this.attribute("r").toPixels();return Ao(t)||(t.beginPath(),t.arc(n,i,s,0,2*Math.PI,!0),t.closePath()),new e.BoundingBox(n-s,i-s,n+s,i+s)}}]),_class9}(e.Element.PathElementBase);var i=(Math.sqrt(2)-1)/3*4;function imGet(t,e,n,i,s,o){return t[n*i*4+4*e+o]}function imSet(t,e,n,i,s,o,l){t[n*i*4+4*e+o]=l}return e.Element.ellipse=function(t){_inherits(_class10,t);var n=_createSuper(_class10);function _class10(){return _classCallCheck(this,_class10),n.apply(this,arguments)}return _createClass(_class10,[{key:"path",value:function path(t){var n=this.attribute("rx").toPixels("x"),s=this.attribute("ry").toPixels("y"),o=this.attribute("cx").toPixels("x"),l=this.attribute("cy").toPixels("y");return Ao(t)||(t.beginPath(),t.moveTo(o,l-s),t.bezierCurveTo(o+i*n,l-s,o+n,l-i*s,o+n,l),t.bezierCurveTo(o+n,l+i*s,o+i*n,l+s,o,l+s),t.bezierCurveTo(o-i*n,l+s,o-n,l+i*s,o-n,l),t.bezierCurveTo(o-n,l-i*s,o-i*n,l-s,o,l-s),t.closePath()),new e.BoundingBox(o-n,l-s,o+n,l+s)}}]),_class10}(e.Element.PathElementBase),e.Element.line=function(t){_inherits(_class11,t);var n=_createSuper(_class11);function _class11(){return _classCallCheck(this,_class11),n.apply(this,arguments)}return _createClass(_class11,[{key:"getPoints",value:function getPoints(){return[new e.Point(this.attribute("x1").toPixels("x"),this.attribute("y1").toPixels("y")),new e.Point(this.attribute("x2").toPixels("x"),this.attribute("y2").toPixels("y"))]}},{key:"path",value:function path(t){var n=this.getPoints();return Ao(t)||(t.beginPath(),t.moveTo(n[0].x,n[0].y),t.lineTo(n[1].x,n[1].y)),new e.BoundingBox(n[0].x,n[0].y,n[1].x,n[1].y)}},{key:"getMarkers",value:function getMarkers(){var t=this.getPoints(),e=t[0].angleTo(t[1]);return[[t[0],e],[t[1],e]]}}]),_class11}(e.Element.PathElementBase),e.Element.polyline=function(t){_inherits(_class12,t);var n=_createSuper(_class12);function _class12(t){var i;return _classCallCheck(this,_class12),(i=n.call(this,t)).points=e.CreatePath(i.attribute("points").value),i}return _createClass(_class12,[{key:"path",value:function path(t){var n=this.points[0],i=n.x,s=n.y,o=new e.BoundingBox(i,s);Ao(t)||(t.beginPath(),t.moveTo(i,s));for(var l=1;l<this.points.length;l++){var u=this.points[l],h=u.x,p=u.y;o.addPoint(h,p),Ao(t)||t.lineTo(h,p)}return o}},{key:"getMarkers",value:function getMarkers(){for(var t=[],e=0;e<this.points.length-1;e++)t.push([this.points[e],this.points[e].angleTo(this.points[e+1])]);return t.push([this.points[this.points.length-1],t[t.length-1][1]]),t}}]),_class12}(e.Element.PathElementBase),e.Element.polygon=function(t){_inherits(_class13,t);var e=_createSuper(_class13);function _class13(){return _classCallCheck(this,_class13),e.apply(this,arguments)}return _createClass(_class13,[{key:"path",value:function path(t){var e=_get(_getPrototypeOf(_class13.prototype),"path",this).call(this,t);return Ao(t)||(t.lineTo(this.points[0].x,this.points[0].y),t.closePath()),e}}]),_class13}(e.Element.polyline),e.Element.path=function(t){_inherits(_class14,t);var n=_createSuper(_class14);function _class14(t){var i;_classCallCheck(this,_class14);var s=(i=n.call(this,t)).attribute("d").value.replace(/,/gm," ").replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2").replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2").replace(/([MmZzLlHhVvCcSsQqTtAa])(\S)/gm,"$1 $2").replace(/(\S)([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2").replace(/(\d)([+-])/gm,"$1 $2").replace(/(\.\d*)(\.)/gm,"$1 $2").replace(/([Aa](\s+\d+)(\s+\d+)(\s+\d+))\s+([01])\s*([01])/gm,"$1 $5 $6 ");return s=e.compressSpaces(s),s=e.trim(s),i.PathParser={tokens:s.split(" "),reset:function reset(){this.i=-1,this.command="",this.previousCommand="",this.start=new e.Point(0,0),this.control=new e.Point(0,0),this.current=new e.Point(0,0),this.points=[],this.angles=[]},isEnd:function isEnd(){return this.i>=this.tokens.length-1},isCommandOrEnd:function isCommandOrEnd(){return!!this.isEnd()||!Ao(this.tokens[this.i+1].match(/^[A-Za-z]$/))},isRelativeCommand:function isRelativeCommand(){switch(this.command){case"m":case"l":case"h":case"v":case"c":case"s":case"q":case"t":case"a":case"z":return!0}return!1},getToken:function getToken(){return this.i++,this.tokens[this.i]},getScalar:function getScalar(){return Number.parseFloat(this.getToken())},nextCommand:function nextCommand(){this.previousCommand=this.command,this.command=this.getToken()},getPoint:function getPoint(){var t=new e.Point(this.getScalar(),this.getScalar());return this.makeAbsolute(t)},getAsControlPoint:function getAsControlPoint(){var t=this.getPoint();return this.control=t,t},getAsCurrentPoint:function getAsCurrentPoint(){var t=this.getPoint();return this.current=t,t},getReflectedControlPoint:function getReflectedControlPoint(){return"c"!==this.previousCommand.toLowerCase()&&"s"!==this.previousCommand.toLowerCase()&&"q"!==this.previousCommand.toLowerCase()&&"t"!==this.previousCommand.toLowerCase()?this.current:new e.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y)},makeAbsolute:function makeAbsolute(t){return this.isRelativeCommand()&&(t.x+=this.current.x,t.y+=this.current.y),t},addMarker:function addMarker(t,e,n){!Ao(n)&&this.angles.length>0&&Ao(this.angles[this.angles.length-1])&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(n)),this.addMarkerAngle(t,Ao(e)?null:e.angleTo(t))},addMarkerAngle:function addMarkerAngle(t,e){this.points.push(t),this.angles.push(e)},getMarkerPoints:function getMarkerPoints(){return this.points},getMarkerAngles:function getMarkerAngles(){for(var t=0;t<this.angles.length;t++)if(Ao(this.angles[t]))for(var e=t+1;e<this.angles.length;e++)if(!Ao(this.angles[e])){this.angles[t]=this.angles[e];break}return this.angles}},i}return _createClass(_class14,[{key:"path",value:function path(t){var n=this.PathParser;n.reset();var i=new e.BoundingBox;for(Ao(t)||t.beginPath();!n.isEnd();)switch(n.nextCommand(),n.command){case"M":case"m":var s=n.getAsCurrentPoint();for(n.addMarker(s),i.addPoint(s.x,s.y),Ao(t)||t.moveTo(s.x,s.y),n.start=n.current;!n.isCommandOrEnd();){var o=n.getAsCurrentPoint();n.addMarker(o,n.start),i.addPoint(o.x,o.y),Ao(t)||t.lineTo(o.x,o.y)}break;case"L":case"l":for(;!n.isCommandOrEnd();){var l=n.current,u=n.getAsCurrentPoint();n.addMarker(u,l),i.addPoint(u.x,u.y),Ao(t)||t.lineTo(u.x,u.y)}break;case"H":case"h":for(;!n.isCommandOrEnd();){var h=new e.Point((n.isRelativeCommand()?n.current.x:0)+n.getScalar(),n.current.y);n.addMarker(h,n.current),n.current=h,i.addPoint(n.current.x,n.current.y),Ao(t)||t.lineTo(n.current.x,n.current.y)}break;case"V":case"v":for(;!n.isCommandOrEnd();){var p=new e.Point(n.current.x,(n.isRelativeCommand()?n.current.y:0)+n.getScalar());n.addMarker(p,n.current),n.current=p,i.addPoint(n.current.x,n.current.y),Ao(t)||t.lineTo(n.current.x,n.current.y)}break;case"C":case"c":for(;!n.isCommandOrEnd();){var d=n.current,v=n.getPoint(),g=n.getAsControlPoint(),b=n.getAsCurrentPoint();n.addMarker(b,g,v),i.addBezierCurve(d.x,d.y,v.x,v.y,g.x,g.y,b.x,b.y),Ao(t)||t.bezierCurveTo(v.x,v.y,g.x,g.y,b.x,b.y)}break;case"S":case"s":for(;!n.isCommandOrEnd();){var _=n.current,w=n.getReflectedControlPoint(),P=n.getAsControlPoint(),k=n.getAsCurrentPoint();n.addMarker(k,P,w),i.addBezierCurve(_.x,_.y,w.x,w.y,P.x,P.y,k.x,k.y),Ao(t)||t.bezierCurveTo(w.x,w.y,P.x,P.y,k.x,k.y)}break;case"Q":case"q":for(;!n.isCommandOrEnd();){var C=n.current,E=n.getAsControlPoint(),S=n.getAsCurrentPoint();n.addMarker(S,E,E),i.addQuadraticCurve(C.x,C.y,E.x,E.y,S.x,S.y),Ao(t)||t.quadraticCurveTo(E.x,E.y,S.x,S.y)}break;case"T":case"t":for(;!n.isCommandOrEnd();){var A=n.current,T=n.getReflectedControlPoint();n.control=T;var O=n.getAsCurrentPoint();n.addMarker(O,T,T),i.addQuadraticCurve(A.x,A.y,T.x,T.y,O.x,O.y),Ao(t)||t.quadraticCurveTo(T.x,T.y,O.x,O.y)}break;case"A":case"a":for(var R=function _loop2(){var s=n.current,o=n.getScalar(),l=n.getScalar(),u=n.getScalar()*(Math.PI/180),h=n.getScalar(),p=n.getScalar(),d=n.getAsCurrentPoint(),v=new e.Point(Math.cos(u)*(s.x-d.x)/2+Math.sin(u)*(s.y-d.y)/2,-Math.sin(u)*(s.x-d.x)/2+Math.cos(u)*(s.y-d.y)/2),g=Math.pow(v.x,2)/Math.pow(o,2)+Math.pow(v.y,2)/Math.pow(l,2);g>1&&(o*=Math.sqrt(g),l*=Math.sqrt(g));var b=(h===p?-1:1)*Math.sqrt((Math.pow(o,2)*Math.pow(l,2)-Math.pow(o,2)*Math.pow(v.y,2)-Math.pow(l,2)*Math.pow(v.x,2))/(Math.pow(o,2)*Math.pow(v.y,2)+Math.pow(l,2)*Math.pow(v.x,2)));isNaN(b)&&(b=0);var _=new e.Point(b*o*v.y/l,b*-l*v.x/o),w=new e.Point((s.x+d.x)/2+Math.cos(u)*_.x-Math.sin(u)*_.y,(s.y+d.y)/2+Math.sin(u)*_.x+Math.cos(u)*_.y),P=function m(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))},k=function r(t,e){return(t[0]*e[0]+t[1]*e[1])/(P(t)*P(e))},C=function a(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(k(t,e))},E=C([1,0],[(v.x-_.x)/o,(v.y-_.y)/l]),S=[(v.x-_.x)/o,(v.y-_.y)/l],A=[(-v.x-_.x)/o,(-v.y-_.y)/l],T=C(S,A);k(S,A)<=-1&&(T=Math.PI),k(S,A)>=1&&(T=0);var O=1-p?1:-1,R=E+O*(T/2),M=new e.Point(w.x+o*Math.cos(R),w.y+l*Math.sin(R));if(n.addMarkerAngle(M,R-O*Math.PI/2),n.addMarkerAngle(d,R-O*Math.PI),i.addPoint(d.x,d.y),!Ao(t)){var B=o>l?o:l,V=o>l?1:o/l,I=o>l?l/o:1;t.translate(w.x,w.y),t.rotate(u),t.scale(V,I),t.arc(0,0,B,E,E+T,1-p),t.scale(1/V,1/I),t.rotate(-u),t.translate(-w.x,-w.y)}};!n.isCommandOrEnd();)R();break;case"Z":case"z":Ao(t)||t.closePath(),n.current=n.start}return i}},{key:"getMarkers",value:function getMarkers(){var t=this.PathParser.getMarkerPoints(),e=this.PathParser.getMarkerAngles();return t.map((function(t,n){return[t,e[n]]}))}}]),_class14}(e.Element.PathElementBase),e.Element.pattern=function(t){_inherits(_class15,t);var n=_createSuper(_class15);function _class15(){return _classCallCheck(this,_class15),n.apply(this,arguments)}return _createClass(_class15,[{key:"createPattern",value:function createPattern(t,n){var i=this.attribute("width").toPixels("x",!0),s=this.attribute("height").toPixels("y",!0),o=new e.Element.svg;o.attributes.viewBox=new e.Property("viewBox",this.attribute("viewBox").value),o.attributes.width=new e.Property("width",i+"px"),o.attributes.height=new e.Property("height",s+"px"),o.attributes.transform=new e.Property("transform",this.attribute("patternTransform").value),o.children=this.children;var l=document.createElement("canvas");l.width=i,l.height=s;var u=l.getContext("2d");this.attribute("x").hasValue()&&this.attribute("y").hasValue()&&u.translate(this.attribute("x").toPixels("x",!0),this.attribute("y").toPixels("y",!0));for(var h=-1;h<=1;h++)for(var p=-1;p<=1;p++)u.save(),u.translate(h*l.width,p*l.height),o.render(u),u.restore();return t.createPattern(l,"repeat")}}]),_class15}(e.Element.ElementBase),e.Element.marker=function(t){_inherits(_class16,t);var n=_createSuper(_class16);function _class16(){return _classCallCheck(this,_class16),n.apply(this,arguments)}return _createClass(_class16,[{key:"render",value:function render(t,n,i){t.translate(n.x,n.y),"auto"===this.attribute("orient").valueOrDefault("auto")&&t.rotate(i),"strokeWidth"===this.attribute("markerUnits").valueOrDefault("strokeWidth")&&t.scale(t.lineWidth,t.lineWidth),t.save();var s=new e.Element.svg;s.attributes.viewBox=new e.Property("viewBox",this.attribute("viewBox").value),s.attributes.refX=new e.Property("refX",this.attribute("refX").value),s.attributes.refY=new e.Property("refY",this.attribute("refY").value),s.attributes.width=new e.Property("width",this.attribute("markerWidth").value),s.attributes.height=new e.Property("height",this.attribute("markerHeight").value),s.attributes.fill=new e.Property("fill",this.attribute("fill").valueOrDefault("black")),s.attributes.stroke=new e.Property("stroke",this.attribute("stroke").valueOrDefault("none")),s.children=this.children,s.render(t),t.restore(),"strokeWidth"===this.attribute("markerUnits").valueOrDefault("strokeWidth")&&t.scale(1/t.lineWidth,1/t.lineWidth),"auto"===this.attribute("orient").valueOrDefault("auto")&&t.rotate(-i),t.translate(-n.x,-n.y)}}]),_class16}(e.Element.ElementBase),e.Element.defs=function(t){_inherits(_class17,t);var e=_createSuper(_class17);function _class17(){return _classCallCheck(this,_class17),e.apply(this,arguments)}return _createClass(_class17,[{key:"render",value:function render(t){}}]),_class17}(e.Element.ElementBase),e.Element.GradientBase=function(t){_inherits(_class18,t);var n=_createSuper(_class18);function _class18(t){var e;return _classCallCheck(this,_class18),(e=n.call(this,t)).gradientUnits=e.attribute("gradientUnits").valueOrDefault("objectBoundingBox"),e.stops=[],e.children.forEach((function(t){"stop"===t.type&&e.stops.push(t)})),e}return _createClass(_class18,[{key:"getGradient",value:function getGradient(){}},{key:"createGradient",value:function createGradient(t,n,i){var s=this.getHrefAttribute().hasValue()?this.getHrefAttribute().getDefinition():this,o=function addParentOpacity(t){return i.hasValue()?new e.Property("color",t).addOpacity(i).value:t},l=this.getGradient(t,n);if(Ao(l))return o(s.stops[s.stops.length-1].color);if(s.stops.forEach((function(t){var e=t.offset,n=t.color;l.addColorStop(e,o(n))})),this.attribute("gradientTransform").hasValue()){var u=e.ViewPort.viewPorts[0],h=new e.Element.rect;h.attributes.x=new e.Property("x",-e.MAX_VIRTUAL_PIXELS/3),h.attributes.y=new e.Property("y",-e.MAX_VIRTUAL_PIXELS/3),h.attributes.width=new e.Property("width",e.MAX_VIRTUAL_PIXELS),h.attributes.height=new e.Property("height",e.MAX_VIRTUAL_PIXELS);var p=new e.Element.g;p.attributes.transform=new e.Property("transform",this.attribute("gradientTransform").value),p.children=[h];var d=new e.Element.svg;d.attributes.x=new e.Property("x",0),d.attributes.y=new e.Property("y",0),d.attributes.width=new e.Property("width",u.width),d.attributes.height=new e.Property("height",u.height),d.children=[p];var v=document.createElement("canvas");v.width=u.width,v.height=u.height;var g=v.getContext("2d");return g.fillStyle=l,d.render(g),g.createPattern(v,"no-repeat")}return l}}]),_class18}(e.Element.ElementBase),e.Element.linearGradient=function(t){_inherits(_class19,t);var e=_createSuper(_class19);function _class19(){return _classCallCheck(this,_class19),e.apply(this,arguments)}return _createClass(_class19,[{key:"getGradient",value:function getGradient(t,e){var n="objectBoundingBox"===this.gradientUnits&&e.getBoundingBox,i=n?e.getBoundingBox():null;this.attribute("x1").hasValue()||this.attribute("y1").hasValue()||this.attribute("x2").hasValue()||this.attribute("y2").hasValue()||(this.attribute("x1",!0).value=0,this.attribute("y1",!0).value=0,this.attribute("x2",!0).value=1,this.attribute("y2",!0).value=0);var s=n?i.x()+i.width()*this.attribute("x1").numValue():this.attribute("x1").toPixels("x"),o=n?i.y()+i.height()*this.attribute("y1").numValue():this.attribute("y1").toPixels("y"),l=n?i.x()+i.width()*this.attribute("x2").numValue():this.attribute("x2").toPixels("x"),u=n?i.y()+i.height()*this.attribute("y2").numValue():this.attribute("y2").toPixels("y");return s===l&&o===u?null:t.createLinearGradient(s,o,l,u)}}]),_class19}(e.Element.GradientBase),e.Element.radialGradient=function(t){_inherits(_class20,t);var e=_createSuper(_class20);function _class20(){return _classCallCheck(this,_class20),e.apply(this,arguments)}return _createClass(_class20,[{key:"getGradient",value:function getGradient(t,e){var n="objectBoundingBox"===this.gradientUnits&&e.getBoundingBox,i=n?e.getBoundingBox():null;this.attribute("cx").hasValue()||(this.attribute("cx",!0).value="50%"),this.attribute("cy").hasValue()||(this.attribute("cy",!0).value="50%"),this.attribute("r").hasValue()||(this.attribute("r",!0).value="50%");var s=n?i.x()+i.width()*this.attribute("cx").numValue():this.attribute("cx").toPixels("x"),o=n?i.y()+i.height()*this.attribute("cy").numValue():this.attribute("cy").toPixels("y"),l=s,u=o;this.attribute("fx").hasValue()&&(l=n?i.x()+i.width()*this.attribute("fx").numValue():this.attribute("fx").toPixels("x")),this.attribute("fy").hasValue()&&(u=n?i.y()+i.height()*this.attribute("fy").numValue():this.attribute("fy").toPixels("y"));var h=n?(i.width()+i.height())/2*this.attribute("r").numValue():this.attribute("r").toPixels();return t.createRadialGradient(l,u,0,s,o,h)}}]),_class20}(e.Element.GradientBase),e.Element.stop=function(t){_inherits(_class21,t);var e=_createSuper(_class21);function _class21(t){var n;_classCallCheck(this,_class21),(n=e.call(this,t)).offset=n.attribute("offset").numValue(),n.offset<0&&(n.offset=0),n.offset>1&&(n.offset=1);var i=n.style("stop-color");return n.style("stop-opacity").hasValue()&&(i=i.addOpacity(n.style("stop-opacity"))),n.color=i.value,n}return _class21}(e.Element.ElementBase),e.Element.AnimateBase=function(t){_inherits(_class22,t);var n=_createSuper(_class22);function _class22(t){var i;return _classCallCheck(this,_class22),i=n.call(this,t),e.Animations.push(_assertThisInitialized(i)),i.duration=0,i.begin=i.attribute("begin").toMilliseconds(),i.maxDuration=i.begin+i.attribute("dur").toMilliseconds(),i.initialValue=null,i.initialUnits="",i.removed=!1,i.from=i.attribute("from"),i.to=i.attribute("to"),i.values=i.attribute("values"),i.values.hasValue()&&(i.values.value=i.values.value.split(";")),i}return _createClass(_class22,[{key:"getProperty",value:function getProperty(){var t=this.attribute("attributeType").value,e=this.attribute("attributeName").value;return"CSS"===t?this.parent.style(e,!0):this.parent.attribute(e,!0)}},{key:"calcValue",value:function calcValue(){return""}},{key:"update",value:function update(t){if(Ao(this.initialValue)&&(this.initialValue=this.getProperty().value,this.initialUnits=this.getProperty().getUnits()),this.duration>this.maxDuration){if("indefinite"===this.attribute("repeatCount").value||"indefinite"===this.attribute("repeatDur").value)this.duration=0;else if("freeze"!==this.attribute("fill").valueOrDefault("remove")||this.frozen){if("remove"===this.attribute("fill").valueOrDefault("remove")&&!this.removed)return this.removed=!0,this.getProperty().value=this.parent.animationFrozen?this.parent.animationFrozenValue:this.initialValue,!0}else this.frozen=!0,this.parent.animationFrozen=!0,this.parent.animationFrozenValue=this.getProperty().value;return!1}this.duration+=t;var e=!1;if(this.begin<this.duration){var n=this.calcValue();if(this.attribute("type").hasValue())n=this.attribute("type").value+"("+n+")";this.getProperty().value=n,e=!0}return e}},{key:"progress",value:function progress(){var t={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(this.values.hasValue()){var n=t.progress*(this.values.value.length-1),i=Math.floor(n),s=Math.ceil(n);t.from=new e.Property("from",Number.parseFloat(this.values.value[i])),t.to=new e.Property("to",Number.parseFloat(this.values.value[s])),t.progress=(n-i)/(s-i)}else t.from=this.from,t.to=this.to;return t}}]),_class22}(e.Element.ElementBase),e.Element.animate=function(t){_inherits(_class23,t);var e=_createSuper(_class23);function _class23(){return _classCallCheck(this,_class23),e.apply(this,arguments)}return _createClass(_class23,[{key:"calcValue",value:function calcValue(){var t=this.progress();return t.from.numValue()+(t.to.numValue()-t.from.numValue())*t.progress+this.initialUnits}}]),_class23}(e.Element.AnimateBase),e.Element.animateColor=function(t){_inherits(_class24,t);var e=_createSuper(_class24);function _class24(){return _classCallCheck(this,_class24),e.apply(this,arguments)}return _createClass(_class24,[{key:"calcValue",value:function calcValue(){var t=this.progress(),e=new ko(t.from.value),n=new ko(t.to.value);if(e.ok&&n.ok){var i=e.r+(n.r-e.r)*t.progress,s=e.g+(n.g-e.g)*t.progress,o=e.b+(n.b-e.b)*t.progress;return"rgb("+Number.parseInt(i)+","+Number.parseInt(s)+","+Number.parseInt(o)+")"}return this.attribute("from").value}}]),_class24}(e.Element.AnimateBase),e.Element.animateTransform=function(t){_inherits(_class25,t);var n=_createSuper(_class25);function _class25(){return _classCallCheck(this,_class25),n.apply(this,arguments)}return _createClass(_class25,[{key:"calcValue",value:function calcValue(){var t=this.progress(),n=e.ToNumberArray(t.from.value),i=e.ToNumberArray(t.to.value),s="";return n.forEach((function(e,n){s+=e+(i[n]-e)*t.progress+" "})),s}}]),_class25}(e.Element.animate),e.Element.font=function(t){_inherits(_class26,t);var n=_createSuper(_class26);function _class26(t){var i;return _classCallCheck(this,_class26),(i=n.call(this,t)).horizAdvX=i.attribute("horiz-adv-x").numValue(),i.isRTL=!1,i.isArabic=!1,i.fontFace=null,i.missingGlyph=null,i.glyphs=[],i.children.forEach((function(t){"font-face"===t.type?(i.fontFace=t,t.style("font-family").hasValue()&&(e.Definitions[t.style("font-family").value]=_assertThisInitialized(i))):"missing-glyph"===t.type?i.missingGlyph=t:"glyph"===t.type&&(""!==t.arabicForm?(i.isRTL=!0,i.isArabic=!0,void 0===i.glyphs[t.unicode]&&(i.glyphs[t.unicode]=[]),i.glyphs[t.unicode][t.arabicForm]=t):i.glyphs[t.unicode]=t)})),i}return _class26}(e.Element.ElementBase),e.Element.fontface=function(t){_inherits(_class27,t);var e=_createSuper(_class27);function _class27(t){var n;return _classCallCheck(this,_class27),(n=e.call(this,t)).ascent=n.attribute("ascent").value,n.descent=n.attribute("descent").value,n.unitsPerEm=n.attribute("units-per-em").numValue(),n}return _class27}(e.Element.ElementBase),e.Element.missingglyph=function(t){_inherits(_class28,t);var e=_createSuper(_class28);function _class28(t){var n;return _classCallCheck(this,_class28),(n=e.call(this,t)).horizAdvX=0,n}return _class28}(e.Element.path),e.Element.glyph=function(t){_inherits(_class29,t);var e=_createSuper(_class29);function _class29(t){var n;return _classCallCheck(this,_class29),(n=e.call(this,t)).horizAdvX=n.attribute("horiz-adv-x").numValue(),n.unicode=n.attribute("unicode").value,n.arabicForm=n.attribute("arabic-form").value,n}return _class29}(e.Element.path),e.Element.text=function(t){_inherits(_class30,t);var n=_createSuper(_class30);function _class30(t){return _classCallCheck(this,_class30),n.call(this,t,!0)}return _createClass(_class30,[{key:"setContext",value:function setContext(t){_get(_getPrototypeOf(_class30.prototype),"setContext",this).call(this,t);var e=this.style("dominant-baseline").toTextBaseline();Ao(e)&&(e=this.style("alignment-baseline").toTextBaseline()),Ao(e)||(t.textBaseline=e)}},{key:"getBoundingBox",value:function getBoundingBox(){var t=this.attribute("x").toPixels("x"),n=this.attribute("y").toPixels("y"),i=this.parent.style("font-size").numValueOrDefault(e.Font.Parse(e.ctx.font).fontSize);return new e.BoundingBox(t,n-i,t+Math.floor(2*i/3)*this.children[0].getText().length,n)}},{key:"renderChildren",value:function renderChildren(t){var e=this;this.x=this.attribute("x").toPixels("x"),this.y=this.attribute("y").toPixels("y"),this.x+=this.getAnchorDelta(t,this,0),this.children.forEach((function(n,i){e.renderChild(t,e,i)}))}},{key:"getAnchorDelta",value:function getAnchorDelta(t,e,n){var i=this.style("text-anchor").valueOrDefault("start");if("start"!==i){for(var s=0,o=n;o<e.children.length;o++){var l=e.children[o];if(o>n&&l.attribute("x").hasValue())break;s+=l.measureTextRecursive(t)}return-1*("end"===i?s:s/2)}return 0}},{key:"renderChild",value:function renderChild(t,e,n){var i=e.children[n];i.attribute("x").hasValue()?(i.x=i.attribute("x").toPixels("x")+this.getAnchorDelta(t,e,n),i.attribute("dx").hasValue()&&(i.x+=i.attribute("dx").toPixels("x"))):(this.attribute("dx").hasValue()&&(this.x+=this.attribute("dx").toPixels("x")),i.attribute("dx").hasValue()&&(this.x+=i.attribute("dx").toPixels("x")),i.x=this.x),this.x=i.x+i.measureText(t),i.attribute("y").hasValue()?(i.y=i.attribute("y").toPixels("y"),i.attribute("dy").hasValue()&&(i.y+=i.attribute("dy").toPixels("y"))):(this.attribute("dy").hasValue()&&(this.y+=this.attribute("dy").toPixels("y")),i.attribute("dy").hasValue()&&(this.y+=i.attribute("dy").toPixels("y")),i.y=this.y),this.y=i.y,i.render(t);for(var s=0;s<i.children.length;s++)this.renderChild(t,i,s)}}]),_class30}(e.Element.RenderedElementBase),e.Element.TextElementBase=function(t){_inherits(_class31,t);var n=_createSuper(_class31);function _class31(){return _classCallCheck(this,_class31),n.apply(this,arguments)}return _createClass(_class31,[{key:"getGlyph",value:function getGlyph(t,e,n){var i=e[n],s=null;if(t.isArabic){var o="isolated";(0===n||" "===e[n-1])&&n<e.length-2&&" "!==e[n+1]&&(o="terminal"),n>0&&" "!==e[n-1]&&n<e.length-2&&" "!==e[n+1]&&(o="medial"),n>0&&" "!==e[n-1]&&(n===e.length-1||" "===e[n+1])&&(o="initial"),void 0!==t.glyphs[i]&&(s=t.glyphs[i][o],Ao(s)&&"glyph"===t.glyphs[i].type&&(s=t.glyphs[i]))}else s=t.glyphs[i];return Ao(s)&&(s=t.missingGlyph),s}},{key:"renderChildren",value:function renderChildren(t){var n=this.parent.style("font-family").getDefinition();if(Ao(n))""!==t.fillStyle&&t.fillText(e.compressSpaces(this.getText()),this.x,this.y),""!==t.strokeStyle&&t.strokeText(e.compressSpaces(this.getText()),this.x,this.y);else{var i=this.parent.style("font-size").numValueOrDefault(e.Font.Parse(e.ctx.font).fontSize),s=this.parent.style("font-style").valueOrDefault(e.Font.Parse(e.ctx.font).fontStyle),o=this.getText();n.isRTL&&(o=o.split("").reverse().join(""));for(var l=e.ToNumberArray(this.parent.attribute("dx").value),u=0;u<o.length;u++){var h=this.getGlyph(n,o,u),p=i/n.fontFace.unitsPerEm;t.translate(this.x,this.y),t.scale(p,-p);var d=t.lineWidth;t.lineWidth=t.lineWidth*n.fontFace.unitsPerEm/i,"italic"===s&&t.transform(1,0,.4,1,0,0),h.render(t),"italic"===s&&t.transform(1,0,-.4,1,0,0),t.lineWidth=d,t.scale(1/p,-1/p),t.translate(-this.x,-this.y),this.x+=i*(h.horizAdvX||n.horizAdvX)/n.fontFace.unitsPerEm,void 0===l[u]||isNaN(l[u])||(this.x+=l[u])}}}},{key:"getText",value:function getText(){}},{key:"measureTextRecursive",value:function measureTextRecursive(t){var e=this.measureText(t);return this.children.forEach((function(n){e+=n.measureTextRecursive(t)})),e}},{key:"measureText",value:function measureText(t){var n=this.parent.style("font-family").getDefinition();if(!Ao(n)){var i=this.parent.style("font-size").numValueOrDefault(e.Font.Parse(e.ctx.font).fontSize),s=0,o=this.getText();n.isRTL&&(o=o.split("").reverse().join(""));for(var l=e.ToNumberArray(this.parent.attribute("dx").value),u=0;u<o.length;u++){s+=(this.getGlyph(n,o,u).horizAdvX||n.horizAdvX)*i/n.fontFace.unitsPerEm,void 0===l[u]||isNaN(l[u])||(s+=l[u])}return s}var h=e.compressSpaces(this.getText());if(!t.measureText)return 10*h.length;t.save(),this.setContext(t);var p=t.measureText(h).width;return t.restore(),p}}]),_class31}(e.Element.RenderedElementBase),e.Element.tspan=function(t){_inherits(_class32,t);var e=_createSuper(_class32);function _class32(t){var n;return _classCallCheck(this,_class32),(n=e.call(this,t,!0)).text=t.nodeValue||t.text||"",n}return _createClass(_class32,[{key:"getText",value:function getText(){return this.text}}]),_class32}(e.Element.TextElementBase),e.Element.tref=function(t){_inherits(_class33,t);var e=_createSuper(_class33);function _class33(){return _classCallCheck(this,_class33),e.apply(this,arguments)}return _createClass(_class33,[{key:"getText",value:function getText(){var t=this.getHrefAttribute().getDefinition();if(!Ao(t))return t.children[0].getText()}}]),_class33}(e.Element.TextElementBase),e.Element.a=function(t){_inherits(_class34,t);var n=_createSuper(_class34);function _class34(t){var e;return _classCallCheck(this,_class34),(e=n.call(this,t)).hasText=!0,_toConsumableArray(t.childNodes).forEach((function(t){3!==t.nodeType&&(e.hasText=!1)})),e.text=e.hasText?t.childNodes[0].nodeValue:"",e}return _createClass(_class34,[{key:"getText",value:function getText(){return this.text}},{key:"renderChildren",value:function renderChildren(t){if(this.hasText){_get(_getPrototypeOf(_class34.prototype),"renderChildren",this).call(this,t);var n=new e.Property("fontSize",e.Font.Parse(e.ctx.font).fontSize);e.Mouse.checkBoundingBox(this,new e.BoundingBox(this.x,this.y-n.toPixels("y"),this.x+this.measureText(t),this.y))}else{var i=new e.Element.g;i.children=this.children,i.parent=this,i.render(t)}}},{key:"onclick",value:function onclick(){window.open(this.getHrefAttribute().value)}},{key:"onmousemove",value:function onmousemove(){e.ctx.canvas.style.cursor="pointer"}}]),_class34}(e.Element.TextElementBase),e.Element.image=function(t){_inherits(_class35,t);var n=_createSuper(_class35);function _class35(t){var i;_classCallCheck(this,_class35);var s=(i=n.call(this,t)).getHrefAttribute().value;return""===s?_possibleConstructorReturn(i):(i._isSvg=s.match(/\.svg$/),e.Images.push(_assertThisInitialized(i)),i.loaded=!1,i._isSvg?e.ajax(s,!0).then((function(t){i.img=t,i.loaded=!0})).catch((function(t){i.erred=!0,console.error("Ajax error for canvg",t)})):(i.img=document.createElement("img"),!0===e.opts.useCORS&&(i.img.crossOrigin="Anonymous"),i.img.addEventListener("load",(function(){i.loaded=!0})),i.img.addEventListener("error",(function(){e.log('ERROR: image "'+s+'" not found'),i.loaded=!0})),i.img.src=s),i)}return _createClass(_class35,[{key:"renderChildren",value:function renderChildren(t){var n=this.attribute("x").toPixels("x"),i=this.attribute("y").toPixels("y"),s=this.attribute("width").toPixels("x"),o=this.attribute("height").toPixels("y");0!==s&&0!==o&&(t.save(),this._isSvg?t.drawSvg(this.img,n,i,s,o):(t.translate(n,i),e.AspectRatio(t,this.attribute("preserveAspectRatio").value,s,this.img.width,o,this.img.height,0,0),t.drawImage(this.img,0,0)),t.restore())}},{key:"getBoundingBox",value:function getBoundingBox(){var t=this.attribute("x").toPixels("x"),n=this.attribute("y").toPixels("y"),i=this.attribute("width").toPixels("x"),s=this.attribute("height").toPixels("y");return new e.BoundingBox(t,n,t+i,n+s)}}]),_class35}(e.Element.RenderedElementBase),e.Element.g=function(t){_inherits(_class36,t);var n=_createSuper(_class36);function _class36(){return _classCallCheck(this,_class36),n.apply(this,arguments)}return _createClass(_class36,[{key:"getBoundingBox",value:function getBoundingBox(){var t=new e.BoundingBox;return this.children.forEach((function(e){t.addBoundingBox(e.getBoundingBox())})),t}}]),_class36}(e.Element.RenderedElementBase),e.Element.symbol=function(t){_inherits(_class37,t);var e=_createSuper(_class37);function _class37(){return _classCallCheck(this,_class37),e.apply(this,arguments)}return _createClass(_class37,[{key:"render",value:function render(t){}}]),_class37}(e.Element.RenderedElementBase),e.Element.style=function(t){_inherits(_class38,t);var n=_createSuper(_class38);function _class38(t){var i;_classCallCheck(this,_class38),i=n.call(this,t);var s="";return _toConsumableArray(t.childNodes).forEach((function(t){var e=t.nodeValue;s+=e})),s=s.replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^\s*\/\/.*)/gm,""),(s=e.compressSpaces(s)).split("}").forEach((function(t){if(""!==e.trim(t)){var n=_slicedToArray(t.split("{"),2),i=n[0],s=n[1];i=i.split(","),s=s.split(";"),i.forEach((function(t){if(""!==(t=e.trim(t))){var n={};if(s.forEach((function(t){var i=t.indexOf(":"),s=t.substr(0,i),o=t.substr(i+1,t.length-i);Ao(s)||Ao(o)||(n[e.trim(s)]=new e.Property(e.trim(s),e.trim(o)))})),e.Styles[t]=n,"@font-face"===t){var i=n["font-family"].value.replace(/"/g,"");n.src.value.split(",").forEach((function(t){if(t.includes('format("svg")')){var n=t.indexOf("url"),s=t.indexOf(")",n),o=t.substr(n+5,s-n-6);_toConsumableArray(e.parseXml(e.ajax(o)).getElementsByTagName("font")).forEach((function(t){t=e.CreateElement(t),e.Definitions[i]=t}))}}))}}}))}})),i}return _class38}(e.Element.ElementBase),e.Element.use=function(t){_inherits(_class39,t);var n=_createSuper(_class39);function _class39(t){var e;return _classCallCheck(this,_class39),(e=n.call(this,t))._el=e.getHrefAttribute().getDefinition(),e}return _createClass(_class39,[{key:"setContext",value:function setContext(t){_get(_getPrototypeOf(_class39.prototype),"setContext",this).call(this,t),this.attribute("x").hasValue()&&t.translate(this.attribute("x").toPixels("x"),0),this.attribute("y").hasValue()&&t.translate(0,this.attribute("y").toPixels("y"))}},{key:"path",value:function path(t){var e=this._el;Ao(e)||e.path(t)}},{key:"getBoundingBox",value:function getBoundingBox(){var t=this._el;if(!Ao(t))return t.getBoundingBox()}},{key:"renderChildren",value:function renderChildren(t){var n=this._el;if(!Ao(n)){var i=n;"symbol"===n.type&&((i=new e.Element.svg).type="svg",i.attributes.viewBox=new e.Property("viewBox",n.attribute("viewBox").value),i.attributes.preserveAspectRatio=new e.Property("preserveAspectRatio",n.attribute("preserveAspectRatio").value),i.attributes.overflow=new e.Property("overflow",n.attribute("overflow").value),i.children=n.children),"svg"===i.type&&(this.attribute("width").hasValue()&&(i.attributes.width=new e.Property("width",this.attribute("width").value)),this.attribute("height").hasValue()&&(i.attributes.height=new e.Property("height",this.attribute("height").value)));var s=i.parent;i.parent=null,i.render(t),i.parent=s}}}]),_class39}(e.Element.RenderedElementBase),e.Element.mask=function(t){_inherits(_class40,t);var n=_createSuper(_class40);function _class40(){return _classCallCheck(this,_class40),n.apply(this,arguments)}return _createClass(_class40,[{key:"apply",value:function apply(t,n){var i=this.attribute("x").toPixels("x"),s=this.attribute("y").toPixels("y"),o=this.attribute("width").toPixels("x"),l=this.attribute("height").toPixels("y");if(0===o&&0===l){var u=new e.BoundingBox;this.children.forEach((function(t){u.addBoundingBox(t.getBoundingBox())})),i=Math.floor(u.x1),s=Math.floor(u.y1),o=Math.floor(u.width()),l=Math.floor(u.height())}var h=n.attribute("mask").value;n.attribute("mask").value="";var p=document.createElement("canvas");p.width=i+o,p.height=s+l;var d=p.getContext("2d");this.renderChildren(d);var v=document.createElement("canvas");v.width=i+o,v.height=s+l;var g=v.getContext("2d");n.render(g),g.globalCompositeOperation="destination-in",g.fillStyle=d.createPattern(p,"no-repeat"),g.fillRect(0,0,i+o,s+l),t.fillStyle=g.createPattern(v,"no-repeat"),t.fillRect(0,0,i+o,s+l),n.attribute("mask").value=h}},{key:"render",value:function render(t){}}]),_class40}(e.Element.ElementBase),e.Element.clipPath=function(t){_inherits(_class41,t);var n=_createSuper(_class41);function _class41(){return _classCallCheck(this,_class41),n.apply(this,arguments)}return _createClass(_class41,[{key:"apply",value:function apply(t){this.children.forEach((function(n){if(void 0!==n.path){var i=null;n.attribute("transform").hasValue()&&(i=new e.Transform(n.attribute("transform").value)).apply(t),n.path(t),t.clip(),i&&i.unapply(t)}}))}},{key:"render",value:function render(t){}}]),_class41}(e.Element.ElementBase),e.Element.filter=function(t){_inherits(_class42,t);var e=_createSuper(_class42);function _class42(){return _classCallCheck(this,_class42),e.apply(this,arguments)}return _createClass(_class42,[{key:"apply",value:function apply(t,e){var n=e.getBoundingBox(),i=Math.floor(n.x1),s=Math.floor(n.y1),o=Math.floor(n.width()),l=Math.floor(n.height()),u=e.style("filter").value;e.style("filter").value="";var h=0,p=0;this.children.forEach((function(t){var e=t.extraFilterDistance||0;h=Math.max(h,e),p=Math.max(p,e)}));var d=document.createElement("canvas");d.width=o+2*h,d.height=l+2*p;var v=d.getContext("2d");v.translate(-i+h,-s+p),e.render(v),this.children.forEach((function(t){t.apply(v,0,0,o+2*h,l+2*p)})),t.drawImage(d,0,0,o+2*h,l+2*p,i-h,s-p,o+2*h,l+2*p),e.style("filter",!0).value=u}},{key:"render",value:function render(t){}}]),_class42}(e.Element.ElementBase),e.Element.feMorphology=function(t){_inherits(_class43,t);var e=_createSuper(_class43);function _class43(){return _classCallCheck(this,_class43),e.apply(this,arguments)}return _createClass(_class43,[{key:"apply",value:function apply(t,e,n,i,s){}}]),_class43}(e.Element.ElementBase),e.Element.feComposite=function(t){_inherits(_class44,t);var e=_createSuper(_class44);function _class44(){return _classCallCheck(this,_class44),e.apply(this,arguments)}return _createClass(_class44,[{key:"apply",value:function apply(t,e,n,i,s){}}]),_class44}(e.Element.ElementBase),e.Element.feColorMatrix=function(t){_inherits(_class45,t);var n=_createSuper(_class45);function _class45(t){var i;_classCallCheck(this,_class45),i=n.call(this,t);var s=e.ToNumberArray(i.attribute("values").value);switch(i.attribute("type").valueOrDefault("matrix")){case"saturate":var o=s[0];s=[.213+.787*o,.715-.715*o,.072-.072*o,0,0,.213-.213*o,.715+.285*o,.072-.072*o,0,0,.213-.213*o,.715-.715*o,.072+.928*o,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var l=s[0]*Math.PI/180,u=function c(t,e,n){return t+Math.cos(l)*e+Math.sin(l)*n};s=[u(.213,.787,-.213),u(.715,-.715,-.715),u(.072,-.072,.928),0,0,u(.213,-.213,.143),u(.715,.285,.14),u(.072,-.072,-.283),0,0,u(.213,-.213,-.787),u(.715,-.715,.715),u(.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}return i.matrix=s,i._m=function(t,e){var n=s[t];return n*(n<0?e-255:e)},i}return _createClass(_class45,[{key:"apply",value:function apply(t,e,n,i,s){for(var o=this._m,l=t.getImageData(0,0,i,s),u=0;u<s;u++)for(var h=0;h<i;h++){var p=imGet(l.data,h,u,i,s,0),d=imGet(l.data,h,u,i,s,1),v=imGet(l.data,h,u,i,s,2),g=imGet(l.data,h,u,i,s,3);imSet(l.data,h,u,i,s,0,o(0,p)+o(1,d)+o(2,v)+o(3,g)+o(4,1)),imSet(l.data,h,u,i,s,1,o(5,p)+o(6,d)+o(7,v)+o(8,g)+o(9,1)),imSet(l.data,h,u,i,s,2,o(10,p)+o(11,d)+o(12,v)+o(13,g)+o(14,1)),imSet(l.data,h,u,i,s,3,o(15,p)+o(16,d)+o(17,v)+o(18,g)+o(19,1))}t.clearRect(0,0,i,s),t.putImageData(l,0,0)}}]),_class45}(e.Element.ElementBase),e.Element.feGaussianBlur=function(t){_inherits(_class46,t);var n=_createSuper(_class46);function _class46(t){var e;return _classCallCheck(this,_class46),(e=n.call(this,t)).blurRadius=Math.floor(e.attribute("stdDeviation").numValue()),e.extraFilterDistance=e.blurRadius,e}return _createClass(_class46,[{key:"apply",value:function apply(t,n,i,s,o){t.canvas.id=e.UniqueId(),t.canvas.style.display="none",document.body.append(t.canvas),processCanvasRGBA(t.canvas,n,i,s,o,this.blurRadius),t.canvas.remove()}}]),_class46}(e.Element.ElementBase),e.Element.title=function(t){_inherits(_class47,t);var e=_createSuper(_class47);function _class47(t){return _classCallCheck(this,_class47),e.call(this)}return _class47}(e.Element.ElementBase),e.Element.desc=function(t){_inherits(_class48,t);var e=_createSuper(_class48);function _class48(t){return _classCallCheck(this,_class48),e.call(this)}return _class48}(e.Element.ElementBase),e.Element.MISSING=function(t){_inherits(_class49,t);var n=_createSuper(_class49);function _class49(t){var i;return _classCallCheck(this,_class49),i=n.call(this),e.log("ERROR: Element '"+t.nodeName+"' not yet implemented."),i}return _class49}(e.Element.ElementBase),e.CreateElement=function(t){var n,i=t.nodeName.replace(/^[^:]+:/,"").replace(/-/g,"");return(n=void 0!==e.Element[i]?new e.Element[i](t):new e.Element.MISSING(t)).type=t.nodeName,n},e.load=function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function _callee(t,n){var i;return regeneratorRuntime.wrap((function _callee$(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,e.ajax(n,!0);case 2:return i=s.sent,s.abrupt("return",e.loadXml(t,i));case 4:case"end":return s.stop()}}),_callee)})));return function(e,n){return t.apply(this,arguments)}}(),e.loadXml=function(t,n){return e.loadXmlDoc(t,e.parseXml(n))},e.loadXmlDoc=function(t,n){var i;e.init(t);var s=function mapXY(e){for(var n=t.canvas;n;)e.x-=n.offsetLeft,e.y-=n.offsetTop,n=n.offsetParent;return window.scrollX&&(e.x+=window.scrollX),window.scrollY&&(e.y+=window.scrollY),e};!0!==e.opts.ignoreMouse&&(t.canvas.addEventListener("click",(function(t){var n=Ao(t)?[event.clientX,event.clientY]:[t.clientX,t.clientY],i=s(_construct(e.Point,n)),o=i.x,l=i.y;e.Mouse.onclick(o,l)})),t.canvas.addEventListener("mousemove",(function(t){var n=Ao(t)?[event.clientX,event.clientY]:[t.clientX,t.clientY],i=s(_construct(e.Point,n)),o=i.x,l=i.y;e.Mouse.onmousemove(o,l)})));var o=e.CreateElement(n.documentElement);o.root=!0;var l=!0,u=function draw(i){e.ViewPort.Clear(),t.canvas.parentNode&&e.ViewPort.SetCurrent(t.canvas.parentNode.clientWidth,t.canvas.parentNode.clientHeight),!0!==e.opts.ignoreDimensions&&(o.style("width").hasValue()&&(t.canvas.width=o.style("width").toPixels("x"),t.canvas.style.width=t.canvas.width+"px"),o.style("height").hasValue()&&(t.canvas.height=o.style("height").toPixels("y"),t.canvas.style.height=t.canvas.height+"px"));var s=t.canvas.clientWidth||t.canvas.width,u=t.canvas.clientHeight||t.canvas.height;if(!0===e.opts.ignoreDimensions&&o.style("width").hasValue()&&o.style("height").hasValue()&&(s=o.style("width").toPixels("x"),u=o.style("height").toPixels("y")),e.ViewPort.SetCurrent(s,u),Ao(e.opts.offsetX)||(o.attribute("x",!0).value=e.opts.offsetX),Ao(e.opts.offsetY)||(o.attribute("y",!0).value=e.opts.offsetY),!Ao(e.opts.scaleWidth)||!Ao(e.opts.scaleHeight)){var h=e.ToNumberArray(o.attribute("viewBox").value),p=null,d=null;Ao(e.opts.scaleWidth)||(o.attribute("width").hasValue()?p=o.attribute("width").toPixels("x")/e.opts.scaleWidth:isNaN(h[2])||(p=h[2]/e.opts.scaleWidth)),Ao(e.opts.scaleHeight)||(o.attribute("height").hasValue()?d=o.attribute("height").toPixels("y")/e.opts.scaleHeight:isNaN(h[3])||(d=h[3]/e.opts.scaleHeight)),Ao(p)&&(p=d),Ao(d)&&(d=p),o.attribute("width",!0).value=e.opts.scaleWidth,o.attribute("height",!0).value=e.opts.scaleHeight,o.attribute("viewBox",!0).value="0 0 "+s*p+" "+u*d,o.attribute("preserveAspectRatio",!0).value="none"}!0!==e.opts.ignoreClear&&t.clearRect(0,0,s,u),o.render(t),l&&(l=!1,i(n))},h=!0;return e.intervalID=setInterval((function(){var t=!1;h&&e.ImagesLoaded()&&(h=!1,t=!0),!0!==e.opts.ignoreMouse&&(t=t||e.Mouse.hasEvents()),!0!==e.opts.ignoreAnimation&&e.Animations.forEach((function(n){var i=n.update(1e3/e.FRAMERATE);t=t||i})),"function"==typeof e.opts.forceRedraw&&!0===e.opts.forceRedraw()&&(t=!0),t&&(u(i),e.Mouse.runEvents())}),1e3/e.FRAMERATE),new Promise((function(t,n){if(e.ImagesLoaded())return h=!1,void u(t);i=t}))},e.stop=function(){e.intervalID&&clearInterval(e.intervalID)},e.Mouse={events:[],hasEvents:function hasEvents(){return 0!==this.events.length},onclick:function onclick(t,e){this.events.push({type:"onclick",x:t,y:e,run:function run(t){t.onclick&&t.onclick()}})},onmousemove:function onmousemove(t,e){this.events.push({type:"onmousemove",x:t,y:e,run:function run(t){t.onmousemove&&t.onmousemove()}})},eventElements:[],checkPath:function checkPath(t,e){var n=this;this.events.forEach((function(i,s){var o=i.x,l=i.y;e.isPointInPath&&e.isPointInPath(o,l)&&(n.eventElements[s]=t)}))},checkBoundingBox:function checkBoundingBox(t,e){var n=this;this.events.forEach((function(i,s){var o=i.x,l=i.y;e.isPointInBox(o,l)&&(n.eventElements[s]=t)}))},runEvents:function runEvents(){var t=this;e.ctx.canvas.style.cursor="",this.events.forEach((function(e,n){for(var i=t.eventElements[n];i;)e.run(i),i=i.parent})),this.events=[],this.eventElements=[]}},e}(n||{});1===t.childNodes.length&&"OBJECT"===t.childNodes[0].nodeName||(t.svg=s);var o=t.getContext("2d");return void 0!==e.documentElement?s.loadXmlDoc(o,e):"<"===e.substr(0,1)?s.loadXml(o,e):s.load(o,e)};"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.drawSvg=function(t,e,n,i,s){To(this.canvas,t,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:e,offsetY:n,scaleWidth:i,scaleHeight:s})});var Oo=Fn.find,Ro="find",Mo=!0,Bo=arrayMethodUsesToLength(Ro);Ro in[]&&Array(1).find((function(){Mo=!1})),_export({target:"Array",proto:!0,forced:Mo||!Bo},{find:function find(t){return Oo(this,t,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables(Ro);var Vo=Fn.some,Io=arrayMethodIsStrict("some"),Lo=arrayMethodUsesToLength("some");_export({target:"Array",proto:!0,forced:!Io||!Lo},{some:function some(t){return Vo(this,t,arguments.length>1?arguments[1]:void 0)}});var jo=/"/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="",n="",i=String(requireObjectCoercible(this)),s="<"+t,""!==e&&(s+=" "+e+'="'+String(n).replace(jo,"&quot;")+'"'),s+">"+i+"</"+t+">";var t,e,n,i,s}});
/**
* Localizing script for SVG-edit UI.
* @module locale
* @license MIT
*
* @copyright 2010 Narendra Sisodya
* @copyright 2010 Alexis Deveria
*
*/
jQuery;var No=function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function _callee2(t,n){var i;return regeneratorRuntime.wrap((function _callee2$(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,s.next=3,e.import("./extensions/ext-".concat(t,"/locale/").concat(n,".js"));case 3:i=s.sent,s.next=12;break;case 6:return s.prev=6,s.t0=s.catch(0),console.error("Missing translation (".concat(n,") for extension ").concat(t," - using 'en'")),s.next=11,e.import("./extensions/ext-".concat(t,"/locale/en.js"));case 11:i=s.sent;case 12:return s.abrupt("return",i.default);case 13:case"end":return s.stop()}}),_callee2,null,[[0,6]])})));return function loadExtensionTranslation(e,n){return t.apply(this,arguments)}}();t("default",{name:"server_moinsave",init:function init(t){var e=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var n,i,s,o,l;return regeneratorRuntime.wrap((function _callee2$(u){for(;;)switch(u.prev=u.next){case 0:return n=t.$,i=t.encode64,t.importLocale,s=e,u.next=4,No("server_moinsave",s.curPrefs.lang);case 4:o=u.sent,l=s.canvas,"/+modify",n('<iframe name="output_frame" title="'.concat(o.hiddenframe,'"\n style="width: 0; height: 0;" src="data:text/html;base64,PGh0bWw+PC9odG1sPg=="/>')).appendTo("body"),s.setCustomHandlers({save:function save(t,e){return _asyncToGenerator(regeneratorRuntime.mark((function _callee(){var t,s,u,h,p,d,v,g;return regeneratorRuntime.wrap((function _callee$(b){for(;;)switch(b.prev=b.next){case 0:return t='<?xml version="1.0"?>\n'+e,s=new URL(location),u=s.pathname,h=u.replace(/\/+get\//,""),p=i(t),n("#export_canvas").length||n("<canvas>",{id:"export_canvas"}).hide().appendTo("body"),(d=n("#export_canvas")[0]).width=l.contentW,d.height=l.contentH,b.next=10,To(d,t);case 10:v=d.toDataURL("image/png"),g=i(v),n("<form>").attr({method:"post",action:"/+modify/"+h,target:"output_frame"}).append('\n <input type="hidden" name="png_data" value="'.concat(g,'">\n <input type="hidden" name="filepath" value="').concat(p,'">\n <input type="hidden" name="filename" value="drawing.svg">\n <input type="hidden" name="contenttype" value="application/x-svgdraw">\n ')).appendTo("body").submit().remove(),n.alert(o.saved),top.window.location="/"+h;case 15:case"end":return b.stop()}}),_callee)})))()}});case 9:case"end":return u.stop()}}),_callee2)})))()}})}}}));