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

21 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.

var t="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},e=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof t&&t)||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},n=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),i={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,o={f:s&&!i.call({1:2},1)?function propertyIsEnumerable(t){var e=s(this,t);return!!e&&e.enumerable}:i},createPropertyDescriptor=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},l={}.toString,classofRaw=function(t){return l.call(t).slice(8,-1)},u="".split,h=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?u.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 h(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")},p={}.hasOwnProperty,has=function(t,e){return p.call(t,e)},d=e.document,v=isObject(d)&&isObject(d.createElement),documentCreateElement=function(t){return v?d.createElement(t):{}},g=!n&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),b=Object.getOwnPropertyDescriptor,_={f:n?b:function getOwnPropertyDescriptor(t,e){if(t=toIndexedObject(t),e=toPrimitive(e,!0),g)try{return b(t,e)}catch(t){}if(has(t,e))return createPropertyDescriptor(!o.f.call(t,e),t[e])}},anObject=function(t){if(!isObject(t))throw TypeError(String(t)+" is not an object");return t},w=Object.defineProperty,P={f:n?w:function defineProperty(t,e,n){if(anObject(t),e=toPrimitive(e,!0),anObject(n),g)try{return w(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}},k=n?function(t,e,n){return P.f(t,e,createPropertyDescriptor(1,n))}:function(t,e,n){return t[e]=n,t},setGlobal=function(t,n){try{k(e,t,n)}catch(i){e[t]=n}return n},C=e["__core-js_shared__"]||setGlobal("__core-js_shared__",{}),S=Function.toString;"function"!=typeof C.inspectSource&&(C.inspectSource=function(t){return S.call(t)});var E,A,T,O=C.inspectSource,R=e.WeakMap,M="function"==typeof R&&/native code/.test(O(R)),B=createCommonjsModule((function(t){(t.exports=function(t,e){return C[t]||(C[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),I=0,V=Math.random(),uid=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++I+V).toString(36)},L=B("keys"),sharedKey=function(t){return L[t]||(L[t]=uid(t))},j={},N=e.WeakMap;if(M){var D=new N,U=D.get,G=D.has,z=D.set;E=function(t,e){return z.call(D,t,e),e},A=function(t){return U.call(D,t)||{}},T=function(t){return G.call(D,t)}}else{var W=sharedKey("state");j[W]=!0,E=function(t,e){return k(t,W,e),e},A=function(t){return has(t,W)?t[W]:{}},T=function(t){return has(t,W)}}var q,X,$={set:E,get:A,has:T,enforce:function(t){return T(t)?A(t):E(t,{})},getterFor:function(t){return function(e){var n;if(!isObject(e)||(n=A(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},H=createCommonjsModule((function(t){var n=$.get,i=$.enforce,s=String(String).split("String");(t.exports=function(t,n,o,l){var u=!!l&&!!l.unsafe,h=!!l&&!!l.enumerable,p=!!l&&!!l.noTargetGet;"function"==typeof o&&("string"!=typeof n||has(o,"name")||k(o,"name",n),i(o).source=s.join("string"==typeof n?n:"")),t!==e?(u?!p&&t[n]&&(h=!0):delete t[n],h?t[n]=o:k(t,n,o)):h?t[n]=o:setGlobal(n,o)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&n(this).source||O(this)}))})),Y=e,aFunction=function(t){return"function"==typeof t?t:void 0},getBuiltIn=function(t,n){return arguments.length<2?aFunction(Y[t])||aFunction(e[t]):Y[t]&&Y[t][n]||e[t]&&e[t][n]},Q=Math.ceil,Z=Math.floor,toInteger=function(t){return isNaN(t=+t)?0:(t>0?Z:Q)(t)},J=Math.min,toLength=function(t){return t>0?J(toInteger(t),9007199254740991):0},K=Math.max,tt=Math.min,toAbsoluteIndex=function(t,e){var n=toInteger(t);return n<0?K(n+e,0):tt(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}},et={includes:createMethod(!0),indexOf:createMethod(!1)},rt=et.indexOf,objectKeysInternal=function(t,e){var n,i=toIndexedObject(t),s=0,o=[];for(n in i)!has(j,n)&&has(i,n)&&o.push(n);for(;e.length>s;)has(i,n=e[s++])&&(~rt(o,n)||o.push(n));return o},nt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],at=nt.concat("length","prototype"),it={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,at)}},st={f:Object.getOwnPropertySymbols},ot=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var e=it.f(anObject(t)),n=st.f;return n?e.concat(n(t)):e},copyConstructorProperties=function(t,e){for(var n=ot(e),i=P.f,s=_.f,o=0;o<n.length;o++){var l=n[o];has(t,l)||i(t,l,s(e,l))}},lt=/#|\.prototype\./,isForced=function(t,e){var n=ct[ut(t)];return n==ft||n!=ht&&("function"==typeof e?fails(e):!!e)},ut=isForced.normalize=function(t){return String(t).replace(lt,".").toLowerCase()},ct=isForced.data={},ht=isForced.NATIVE="N",ft=isForced.POLYFILL="P",pt=isForced,dt=_.f,_export=function(t,n){var i,s,o,l,u,h=t.target,p=t.global,d=t.stat;if(i=p?e:d?e[h]||setGlobal(h,{}):(e[h]||{}).prototype)for(s in n){if(l=n[s],o=t.noTargetGet?(u=dt(i,s))&&u.value:i[s],!pt(p?s:h+(d?".":"#")+s,t.forced)&&void 0!==o){if(typeof l==typeof o)continue;copyConstructorProperties(l,o)}(t.sham||o&&o.sham)&&k(l,"sham",!0),H(i,s,l,t)}},vt=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?P.f(t,i,createPropertyDescriptor(0,n)):t[i]=n},yt=!!Object.getOwnPropertySymbols&&!fails((function(){return!String(Symbol())})),gt=yt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,mt=B("wks"),bt=e.Symbol,xt=gt?bt:bt&&bt.withoutSetter||uid,wellKnownSymbol=function(t){return has(mt,t)||(yt&&has(bt,t)?mt[t]=bt[t]:mt[t]=xt("Symbol."+t)),mt[t]},_t=wellKnownSymbol("species"),arraySpeciesCreate=function(t,e){var n;return vt(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!vt(n.prototype)?isObject(n)&&null===(n=n[_t])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)},wt=getBuiltIn("navigator","userAgent")||"",Pt=e.process,kt=Pt&&Pt.versions,Ct=kt&&kt.v8;Ct?X=(q=Ct.split("."))[0]+q[1]:wt&&(!(q=wt.match(/Edge\/(\d+)/))||q[1]>=74)&&(q=wt.match(/Chrome\/(\d+)/))&&(X=q[1]);var St=X&&+X,Et=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(t){return St>=51||!fails((function(){var e=[];return(e.constructor={})[Et]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},At=wellKnownSymbol("isConcatSpreadable"),Tt=St>=51||!fails((function(){var t=[];return t[At]=!1,t.concat()[0]!==t})),Ot=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(t){if(!isObject(t))return!1;var e=t[At];return void 0!==e?!!e:vt(t)};_export({target:"Array",proto:!0,forced:!Tt||!Ot},{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))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<s;n++,h++)n in o&&createProperty(u,h,o[n])}else{if(h>=9007199254740991)throw TypeError("Maximum allowed index exceeded");createProperty(u,h++,o)}return u.length=h,u}});var Rt,Mt=Object.keys||function keys(t){return objectKeysInternal(t,nt)},Bt=n?Object.defineProperties:function defineProperties(t,e){anObject(t);for(var n,i=Mt(e),s=i.length,o=0;s>o;)P.f(t,n=i[o++],e[n]);return t},It=getBuiltIn("document","documentElement"),Vt=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"<\/script>"},NullProtoObject=function(){try{Rt=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;NullProtoObject=Rt?function(t){t.write(scriptTag("")),t.close();var e=t.parentWindow.Object;return t=null,e}(Rt):((e=documentCreateElement("iframe")).style.display="none",It.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F);for(var n=nt.length;n--;)delete NullProtoObject.prototype[nt[n]];return NullProtoObject()};j[Vt]=!0;var Lt=Object.create||function create(t,e){var n;return null!==t?(EmptyConstructor.prototype=anObject(t),n=new EmptyConstructor,EmptyConstructor.prototype=null,n[Vt]=t):n=NullProtoObject(),void 0===e?n:Bt(n,e)},jt=wellKnownSymbol("unscopables"),Nt=Array.prototype;null==Nt[jt]&&P.f(Nt,jt,{configurable:!0,value:Lt(null)});var Dt,Ft,Ut,addToUnscopables=function(t){Nt[jt][t]=!0},Gt={},zt=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})),Wt=sharedKey("IE_PROTO"),qt=Object.prototype,Xt=zt?Object.getPrototypeOf:function(t){return t=toObject(t),has(t,Wt)?t[Wt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?qt:null},$t=wellKnownSymbol("iterator"),Ht=!1;[].keys&&("next"in(Ut=[].keys())?(Ft=Xt(Xt(Ut)))!==Object.prototype&&(Dt=Ft):Ht=!0),null==Dt&&(Dt={}),has(Dt,$t)||k(Dt,$t,(function(){return this}));var Yt={IteratorPrototype:Dt,BUGGY_SAFARI_ITERATORS:Ht},Qt=P.f,Zt=wellKnownSymbol("toStringTag"),setToStringTag=function(t,e,n){t&&!has(t=n?t:t.prototype,Zt)&&Qt(t,Zt,{configurable:!0,value:e})},Jt=Yt.IteratorPrototype,returnThis$1=function(){return this},createIteratorConstructor=function(t,e,n){var i=e+" Iterator";return t.prototype=Lt(Jt,{next:createPropertyDescriptor(1,n)}),setToStringTag(t,i,!1),Gt[i]=returnThis$1,t},Kt=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),te=Yt.IteratorPrototype,ee=Yt.BUGGY_SAFARI_ITERATORS,re=wellKnownSymbol("iterator"),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(!ee&&t in g)return g[t];switch(t){case"keys":return function keys(){return new n(this,t)};case"values":return function values(){return new n(this,t)};case"entries":return function entries(){return new n(this,t)}}return function(){return new n(this)}},d=e+" Iterator",v=!1,g=t.prototype,b=g[re]||g["@@iterator"]||s&&g[s],_=!ee&&b||getIterationMethod(s),w="Array"==e&&g.entries||b;if(w&&(u=Xt(w.call(new t)),te!==Object.prototype&&u.next&&(Xt(u)!==te&&(Kt?Kt(u,te):"function"!=typeof u[re]&&k(u,re,returnThis$2)),setToStringTag(u,d,!0))),"values"==s&&b&&"values"!==b.name&&(v=!0,_=function values(){return b.call(this)}),g[re]!==_&&k(g,re,_),Gt[e]=_,s)if(h={values:getIterationMethod("values"),keys:o?_:getIterationMethod("keys"),entries:getIterationMethod("entries")},l)for(p in h)(ee||v||!(p in g))&&H(g,p,h[p]);else _export({target:e,proto:!0,forced:ee||v},h);return h},ne=$.set,ae=$.getterFor("Array Iterator"),ie=defineIterator(Array,"Array",(function(t,e){ne(this,{type:"Array Iterator",target:toIndexedObject(t),index:0,kind:e})}),(function(){var t=ae(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");Gt.Arguments=Gt.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries");var se={};se[wellKnownSymbol("toStringTag")]="z";var oe="[object z]"===String(se),le=wellKnownSymbol("toStringTag"),ue="Arguments"==classofRaw(function(){return arguments}()),ce=oe?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),le))?n:ue?classofRaw(e):"Object"==(i=classofRaw(e))&&"function"==typeof e.callee?"Arguments":i},he=oe?{}.toString:function toString(){return"[object "+ce(this)+"]"};oe||H(Object.prototype,"toString",he,{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 fe,pe,de={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")}))},ve=RegExp.prototype.exec,ye=String.prototype.replace,ge=ve,me=(fe=/a/,pe=/b*/g,ve.call(fe,"a"),ve.call(pe,"a"),0!==fe.lastIndex||0!==pe.lastIndex),be=de.UNSUPPORTED_Y||de.BROKEN_CARET,xe=void 0!==/()??/.exec("")[1];(me||xe||be)&&(ge=function exec(t){var e,n,i,s,o=this,l=be&&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)),xe&&(n=new RegExp("^"+h+"$(?!\\s)",u)),me&&(e=o.lastIndex),i=ve.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:me&&i&&(o.lastIndex=o.global?i.index+i[0].length:e),xe&&i&&i.length>1&&ye.call(i[0],n,(function(){for(s=1;s<arguments.length-2;s++)void 0===arguments[s]&&(i[s]=void 0)})),i});var _e=ge;_export({target:"RegExp",proto:!0,forced:/./.exec!==_e},{exec:_e});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}},we={codeAt:createMethod$1(!1),charAt:createMethod$1(!0)},Pe=we.charAt,ke=$.set,Ce=$.getterFor("String Iterator");defineIterator(String,"String",(function(t){ke(this,{type:"String Iterator",string:String(t),index:0})}),(function next(){var t,e=Ce(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=Pe(n,i),e.index+=t.length,{value:t,done:!1})}));var Se=wellKnownSymbol("species"),Ee=!fails((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),Ae="$0"==="a".replace(/./,"$0"),Te=wellKnownSymbol("replace"),Oe=!!/./[Te]&&""===/./[Te]("a","$0"),Re=!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[Se]=function(){return n},n.flags="",n[s]=/./[s]),n.exec=function(){return e=!0,null},n[s](""),!e}));if(!o||!l||"replace"===t&&(!Ee||!Ae||Oe)||"split"===t&&!Re){var u=/./[s],h=n(s,""[t],(function(t,e,n,i,s){return e.exec===_e?o&&!s?{done:!0,value:u.call(e,n,i)}:{done:!0,value:t.call(n,e,i)}:{done:!1}}),{REPLACE_KEEPS_$0:Ae,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Oe}),p=h[0],d=h[1];H(String.prototype,t,p),H(RegExp.prototype,s,2==e?function(t,e){return d.call(t,this,e)}:function(t){return d.call(t,this)})}i&&k(RegExp.prototype[s],"sham",!0)},Me=we.charAt,advanceStringIndex=function(t,e,n){return e+(n?Me(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 _e.call(t,e)},Be=Math.max,Ie=Math.min,Ve=Math.floor,Le=/\$([$&'`]|\d\d?|<[^>]*>)/g,je=/\$([$&'`]|\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 S=String(_[0]),E=Be(Ie(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=[S].concat(A,E,p);void 0!==O&&R.push(O);var M=String(i.apply(void 0,R))}else M=getSubstitution(S,p,E,A,O,i);E>=k&&(P+=p.slice(k,E)+M,k=E+S.length)}return P+p.slice(k)}];function getSubstitution(t,n,i,s,o,l){var u=i+t.length,h=s.length,p=je;return void 0!==o&&(o=toObject(o),p=Le),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=Ve(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 Ne={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},De=wellKnownSymbol("iterator"),Fe=wellKnownSymbol("toStringTag"),Ue=ie.values;for(var Ge in Ne){var ze=e[Ge],We=ze&&ze.prototype;if(We){if(We[De]!==Ue)try{k(We,De,Ue)}catch(t){We[De]=Ue}if(We[Fe]||k(We,Fe,Ge),Ne[Ge])for(var qe in ie)if(We[qe]!==ie[qe])try{k(We,qe,ie[qe])}catch(t){We[qe]=ie[qe]}}}var Xe=wellKnownSymbol("iterator"),$e=!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[Xe]||"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},He=Object.assign,Ye=Object.defineProperty,Qe=!He||fails((function(){if(n&&1!==He({b:1},He(Ye({},"a",{enumerable:!0,get:function(){Ye(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},i=Symbol(),s="abcdefghijklmnopqrst";return t[i]=7,s.split("").forEach((function(t){e[t]=t})),7!=He({},t)[i]||Mt(He({},e)).join("")!=s}))?function assign(t,e){for(var i=toObject(t),s=arguments.length,l=1,u=st.f,p=o.f;s>l;)for(var d,v=h(arguments[l++]),g=u?Mt(v).concat(u(v)):Mt(v),b=g.length,_=0;b>_;)d=g[_++],n&&!p.call(v,d)||(i[d]=v[d]);return i}:He,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}},Ze=wellKnownSymbol("iterator"),Je=Array.prototype,isArrayIteratorMethod=function(t){return void 0!==t&&(Gt.Array===t||Je[Ze]===t)},Ke=wellKnownSymbol("iterator"),getIteratorMethod=function(t){if(null!=t)return t[Ke]||t["@@iterator"]||Gt[ce(t)]},tr=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},er=/[^\0-\u007E]/,rr=/[.\u3002\uFF0E\uFF61]/g,nr="Overflow: input needs wider integers to process",ar=Math.floor,ir=String.fromCharCode,digitToBasic=function(t){return t+22+75*(t<26)},adapt=function(t,e,n){var i=0;for(t=n?ar(t/700):t>>1,t+=ar(t/e);t>455;i+=36)t=ar(t/35);return ar(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(ir(n));var h=i.length,p=h;for(h&&i.push("-");p<s;){var d=2147483647;for(e=0;e<t.length;e++)(n=t[e])>=o&&n<d&&(d=n);var v=p+1;if(d-o>ar((2147483647-l)/v))throw RangeError(nr);for(l+=(d-o)*v,o=d,e=0;e<t.length;e++){if((n=t[e])<o&&++l>2147483647)throw RangeError(nr);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(ir(digitToBasic(_+w%P))),g=ar(w/P)}i.push(ir(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)H(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))},sr=getBuiltIn("fetch"),or=getBuiltIn("Headers"),lr=wellKnownSymbol("iterator"),ur=$.set,cr=$.getterFor("URLSearchParams"),hr=$.getterFor("URLSearchParamsIterator"),fr=/\+/g,pr=Array(4),percentSequence=function(t){return pr[t-1]||(pr[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(fr," "),n=4;try{return decodeURIComponent(e)}catch(t){for(;n;)e=e.replace(percentSequence(n--),percentDecode);return e}},dr=/[!'()~]|%20/g,vr={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(t){return vr[t]},serialize=function(t){return encodeURIComponent(t).replace(dr,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")},yr=createIteratorConstructor((function Iterator(t,e){ur(this,{type:"URLSearchParamsIterator",iterator:getIterator(cr(t).entries),kind:e})}),"Iterator",(function next(){var t=hr(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})),gr=function URLSearchParams(){anInstance(this,gr,"URLSearchParams");var t,e,n,i,s,o,l,u,h,p=arguments.length>0?arguments[0]:void 0,d=this,v=[];if(ur(d,{type:"URLSearchParams",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+"")},mr=gr.prototype;redefineAll(mr,{append:function append(t,e){validateArgumentsLength(arguments.length,2);var n=cr(this);n.entries.push({key:t+"",value:e+""}),n.updateURL()},delete:function(t){validateArgumentsLength(arguments.length,1);for(var e=cr(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=cr(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=cr(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=cr(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=cr(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=cr(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=cr(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 yr(this,"keys")},values:function values(){return new yr(this,"values")},entries:function entries(){return new yr(this,"entries")}},{enumerable:!0}),H(mr,lr,mr.entries),H(mr,"toString",(function toString(){for(var t,e=cr(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(gr,"URLSearchParams"),_export({global:!0,forced:!$e},{URLSearchParams:gr}),$e||"function"!=typeof sr||"function"!=typeof or||_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,"URLSearchParams"===ce(n)&&((i=e.headers?new or(e.headers):new or).has("content-type")||i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),e=Lt(e,{body:createPropertyDescriptor(0,String(n)),headers:createPropertyDescriptor(0,i)}))),s.push(e)),sr.apply(this,s)}});var br,xr={URLSearchParams:gr,getState:cr},_r=we.codeAt,wr=e.URL,Pr=xr.URLSearchParams,kr=xr.getState,Cr=$.set,Sr=$.getterFor("URL"),Er=Math.floor,Ar=Math.pow,Tr=/[A-Za-z]/,Or=/[\d+-.A-Za-z]/,Rr=/\d/,Mr=/^(0x|0X)/,Br=/^[0-7]+$/,Ir=/^\d+$/,Vr=/^[\dA-Fa-f]+$/,Lr=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,jr=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,Nr=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,Dr=/[\u0009\u000A\u000D]/g,parseHost=function(t,e){var n,i,s;if("["==e.charAt(0)){if("]"!=e.charAt(e.length-1))return"Invalid host";if(!(n=parseIPv6(e.slice(1,-1))))return"Invalid host";t.host=n}else if(isSpecial(t)){if(e=function(t){var e,n,i=[],s=t.toLowerCase().replace(rr,".").split(".");for(e=0;e<s.length;e++)n=s[e],i.push(er.test(n)?"xn--"+encode(n):n);return i.join(".")}(e),Lr.test(e))return"Invalid host";if(null===(n=parseIPv4(e)))return"Invalid host";t.host=n}else{if(jr.test(e))return"Invalid host";for(n="",i=tr(e),s=0;s<i.length;s++)n+=percentEncode(i[s],Fr);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=Mr.test(s)?16:8,s=s.slice(8==o?1:2)),""===s)l=0;else{if(!(10==o?Ir:8==o?Br:Vr).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>=Ar(256,5-e))return null}else if(l>255)return null;for(u=n.pop(),i=0;i<n.length;i++)u+=n[i]*Ar(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&&Vr.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(!Rr.test(char()))return;for(;Rr.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=Er(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},Fr={},Ur=Qe({},Fr,{" ":1,'"':1,"<":1,">":1,"`":1}),Gr=Qe({},Ur,{"#":1,"?":1,"{":1,"}":1}),zr=Qe({},Gr,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(t,e){var n=_r(t,0);return n>32&&n<127&&!has(e,t)?t:encodeURIComponent(t)},Wr={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isSpecial=function(t){return has(Wr,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&&Tr.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()},qr={},Xr={},$r={},Hr={},Yr={},Qr={},Zr={},Jr={},Kr={},tn={},en={},rn={},nn={},an={},sn={},on={},ln={},un={},cn={},hn={},fn={},parseURL=function(t,e,n,i){var s,o,l,u,h,p=n||qr,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(Nr,"")),e=e.replace(Dr,""),s=tr(e);d<=s.length;){switch(o=s[d],p){case qr:if(!o||!Tr.test(o)){if(n)return"Invalid scheme";p=$r;continue}v+=o.toLowerCase(),p=Xr;break;case Xr:if(o&&(Or.test(o)||"+"==o||"-"==o||"."==o))v+=o.toLowerCase();else{if(":"!=o){if(n)return"Invalid scheme";v="",p=$r,d=0;continue}if(n&&(isSpecial(t)!=has(Wr,v)||"file"==v&&(includesCredentials(t)||null!==t.port)||"file"==t.scheme&&!t.host))return;if(t.scheme=v,n)return void(isSpecial(t)&&Wr[t.scheme]==t.port&&(t.port=null));v="","file"==t.scheme?p=an:isSpecial(t)&&i&&i.scheme==t.scheme?p=Hr:isSpecial(t)?p=Jr:"/"==s[d+1]?(p=Yr,d++):(t.cannotBeABaseURL=!0,t.path.push(""),p=cn)}break;case $r:if(!i||i.cannotBeABaseURL&&"#"!=o)return"Invalid scheme";if(i.cannotBeABaseURL&&"#"==o){t.scheme=i.scheme,t.path=i.path.slice(),t.query=i.query,t.fragment="",t.cannotBeABaseURL=!0,p=fn;break}p="file"==i.scheme?an:Qr;continue;case Hr:if("/"!=o||"/"!=s[d+1]){p=Qr;continue}p=Kr,d++;break;case Yr:if("/"==o){p=tn;break}p=un;continue;case Qr:if(t.scheme=i.scheme,o==br)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=Zr;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=hn;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=un;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=fn}break;case Zr:if(!isSpecial(t)||"/"!=o&&"\\"!=o){if("/"!=o){t.username=i.username,t.password=i.password,t.host=i.host,t.port=i.port,p=un;continue}p=tn}else p=Kr;break;case Jr:if(p=Kr,"/"!=o||"/"!=v.charAt(d+1))continue;d++;break;case Kr:if("/"!=o&&"\\"!=o){p=tn;continue}break;case tn:if("@"==o){g&&(v="%40"+v),g=!0,l=tr(v);for(var w=0;w<l.length;w++){var P=l[w];if(":"!=P||_){var k=percentEncode(P,zr);_?t.password+=k:t.username+=k}else _=!0}v=""}else if(o==br||"/"==o||"?"==o||"#"==o||"\\"==o&&isSpecial(t)){if(g&&""==v)return"Invalid authority";d-=tr(v).length+1,v="",p=en}else v+=o;break;case en:case rn:if(n&&"file"==t.scheme){p=on;continue}if(":"!=o||b){if(o==br||"/"==o||"?"==o||"#"==o||"\\"==o&&isSpecial(t)){if(isSpecial(t)&&""==v)return"Invalid host";if(n&&""==v&&(includesCredentials(t)||null!==t.port))return;if(u=parseHost(t,v))return u;if(v="",p=ln,n)return;continue}"["==o?b=!0:"]"==o&&(b=!1),v+=o}else{if(""==v)return"Invalid host";if(u=parseHost(t,v))return u;if(v="",p=nn,n==rn)return}break;case nn:if(!Rr.test(o)){if(o==br||"/"==o||"?"==o||"#"==o||"\\"==o&&isSpecial(t)||n){if(""!=v){var C=parseInt(v,10);if(C>65535)return"Invalid port";t.port=isSpecial(t)&&C===Wr[t.scheme]?null:C,v=""}if(n)return;p=ln;continue}return"Invalid port"}v+=o;break;case an:if(t.scheme="file","/"==o||"\\"==o)p=sn;else{if(!i||"file"!=i.scheme){p=un;continue}if(o==br)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=hn;else{if("#"!=o){startsWithWindowsDriveLetter(s.slice(d).join(""))||(t.host=i.host,t.path=i.path.slice(),shortenURLsPath(t)),p=un;continue}t.host=i.host,t.path=i.path.slice(),t.query=i.query,t.fragment="",p=fn}}break;case sn:if("/"==o||"\\"==o){p=on;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=un;continue;case on:if(o==br||"/"==o||"\\"==o||"?"==o||"#"==o){if(!n&&isWindowsDriveLetter(v))p=un;else if(""==v){if(t.host="",n)return;p=ln}else{if(u=parseHost(t,v))return u;if("localhost"==t.host&&(t.host=""),n)return;v="",p=ln}continue}v+=o;break;case ln:if(isSpecial(t)){if(p=un,"/"!=o&&"\\"!=o)continue}else if(n||"?"!=o)if(n||"#"!=o){if(o!=br&&(p=un,"/"!=o))continue}else t.fragment="",p=fn;else t.query="",p=hn;break;case un:if(o==br||"/"==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==br||"?"==o||"#"==o))for(;t.path.length>1&&""===t.path[0];)t.path.shift();"?"==o?(t.query="",p=hn):"#"==o&&(t.fragment="",p=fn)}else v+=percentEncode(o,Gr);break;case cn:"?"==o?(t.query="",p=hn):"#"==o?(t.fragment="",p=fn):o!=br&&(t.path[0]+=percentEncode(o,Fr));break;case hn:n||"#"!=o?o!=br&&("'"==o&&isSpecial(t)?t.query+="%27":t.query+="#"==o?"%23":percentEncode(o,Fr)):(t.fragment="",p=fn);break;case fn:o!=br&&(t.fragment+=percentEncode(o,Ur))}d++}},pn=function URL(t){var e,i,s=anInstance(this,pn,"URL"),o=arguments.length>1?arguments[1]:void 0,l=String(t),u=Cr(s,{type:"URL"});if(void 0!==o)if(o instanceof pn)e=Sr(o);else if(i=parseURL(e={},String(o)))throw TypeError(i);if(i=parseURL(u,l,null,e))throw TypeError(i);var h=u.searchParams=new Pr,p=kr(h);p.updateSearchParams(u.query),p.updateURL=function(){u.query=String(h)||null},n||(s.href=serializeURL.call(s),s.origin=getOrigin.call(s),s.protocol=getProtocol.call(s),s.username=getUsername.call(s),s.password=getPassword.call(s),s.host=getHost.call(s),s.hostname=getHostname.call(s),s.port=getPort.call(s),s.pathname=getPathname.call(s),s.search=getSearch.call(s),s.searchParams=getSearchParams.call(s),s.hash=getHash.call(s))},dn=pn.prototype,serializeURL=function(){var t=Sr(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=Sr(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 Sr(this).scheme+":"},getUsername=function(){return Sr(this).username},getPassword=function(){return Sr(this).password},getHost=function(){var t=Sr(this),e=t.host,n=t.port;return null===e?"":null===n?serializeHost(e):serializeHost(e)+":"+n},getHostname=function(){var t=Sr(this).host;return null===t?"":serializeHost(t)},getPort=function(){var t=Sr(this).port;return null===t?"":String(t)},getPathname=function(){var t=Sr(this),e=t.path;return t.cannotBeABaseURL?e[0]:e.length?"/"+e.join("/"):""},getSearch=function(){var t=Sr(this).query;return t?"?"+t:""},getSearchParams=function(){return Sr(this).searchParams},getHash=function(){var t=Sr(this).fragment;return t?"#"+t:""},accessorDescriptor=function(t,e){return{get:t,set:e,configurable:!0,enumerable:!0}};if(n&&Bt(dn,{href:accessorDescriptor(serializeURL,(function(t){var e=Sr(this),n=String(t),i=parseURL(e,n);if(i)throw TypeError(i);kr(e.searchParams).updateSearchParams(e.query)})),origin:accessorDescriptor(getOrigin),protocol:accessorDescriptor(getProtocol,(function(t){var e=Sr(this);parseURL(e,String(t)+":",qr)})),username:accessorDescriptor(getUsername,(function(t){var e=Sr(this),n=tr(String(t));if(!cannotHaveUsernamePasswordPort(e)){e.username="";for(var i=0;i<n.length;i++)e.username+=percentEncode(n[i],zr)}})),password:accessorDescriptor(getPassword,(function(t){var e=Sr(this),n=tr(String(t));if(!cannotHaveUsernamePasswordPort(e)){e.password="";for(var i=0;i<n.length;i++)e.password+=percentEncode(n[i],zr)}})),host:accessorDescriptor(getHost,(function(t){var e=Sr(this);e.cannotBeABaseURL||parseURL(e,String(t),en)})),hostname:accessorDescriptor(getHostname,(function(t){var e=Sr(this);e.cannotBeABaseURL||parseURL(e,String(t),rn)})),port:accessorDescriptor(getPort,(function(t){var e=Sr(this);cannotHaveUsernamePasswordPort(e)||(""==(t=String(t))?e.port=null:parseURL(e,t,nn))})),pathname:accessorDescriptor(getPathname,(function(t){var e=Sr(this);e.cannotBeABaseURL||(e.path=[],parseURL(e,t+"",ln))})),search:accessorDescriptor(getSearch,(function(t){var e=Sr(this);""==(t=String(t))?e.query=null:("?"==t.charAt(0)&&(t=t.slice(1)),e.query="",parseURL(e,t,hn)),kr(e.searchParams).updateSearchParams(e.query)})),searchParams:accessorDescriptor(getSearchParams),hash:accessorDescriptor(getHash,(function(t){var e=Sr(this);""!=(t=String(t))?("#"==t.charAt(0)&&(t=t.slice(1)),e.fragment="",parseURL(e,t,fn)):e.fragment=null}))}),H(dn,"toJSON",(function toJSON(){return serializeURL.call(this)}),{enumerable:!0}),H(dn,"toString",(function toString(){return serializeURL.call(this)}),{enumerable:!0}),wr){var vn=wr.createObjectURL,yn=wr.revokeObjectURL;vn&&H(pn,"createObjectURL",(function createObjectURL(t){return vn.apply(wr,arguments)})),yn&&H(pn,"revokeObjectURL",(function revokeObjectURL(t){return yn.apply(wr,arguments)}))}setToStringTag(pn,"URL"),_export({global:!0,forced:!$e,sham:!n},{URL:pn});var gn=it.f,mn={}.toString,bn="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],xn={f:function getOwnPropertyNames(t){return bn&&"[object Window]"==mn.call(t)?function(t){try{return gn(t)}catch(t){return bn.slice()}}(t):gn(toIndexedObject(t))}},_n={f:wellKnownSymbol},wn=P.f,defineWellKnownSymbol=function(t){var e=Y.Symbol||(Y.Symbol={});has(e,t)||wn(e,t,{value:_n.f(t)})},Pn=[].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,p,d,v){for(var g,b,_=toObject(u),w=h(_),P=functionBindContext(p,d,3),k=toLength(w.length),C=0,S=v||arraySpeciesCreate,E=e?S(u,k):n?S(u,0):void 0;k>C;C++)if((l||C in w)&&(b=P(g=w[C],C,_),t))if(e)E[C]=b;else if(b)switch(t){case 3:return!0;case 5:return g;case 6:return C;case 2:Pn.call(E,g)}else if(s)return!1;return o?-1:i||s?s:E}},kn={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)},Cn=kn.forEach,Sn=sharedKey("hidden"),En=wellKnownSymbol("toPrimitive"),An=$.set,Tn=$.getterFor("Symbol"),On=Object.prototype,Rn=e.Symbol,Mn=getBuiltIn("JSON","stringify"),Bn=_.f,In=P.f,Vn=xn.f,Ln=o.f,jn=B("symbols"),Nn=B("op-symbols"),Dn=B("string-to-symbol-registry"),Fn=B("symbol-to-string-registry"),Un=B("wks"),Gn=e.QObject,zn=!Gn||!Gn.prototype||!Gn.prototype.findChild,Wn=n&&fails((function(){return 7!=Lt(In({},"a",{get:function(){return In(this,"a",{value:7}).a}})).a}))?function(t,e,n){var i=Bn(On,e);i&&delete On[e],In(t,e,n),i&&t!==On&&In(On,e,i)}:In,wrap=function(t,e){var i=jn[t]=Lt(Rn.prototype);return An(i,{type:"Symbol",tag:t,description:e}),n||(i.description=e),i},qn=gt?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof Rn},Xn=function defineProperty(t,e,n){t===On&&Xn(Nn,e,n),anObject(t);var i=toPrimitive(e,!0);return anObject(n),has(jn,i)?(n.enumerable?(has(t,Sn)&&t[Sn][i]&&(t[Sn][i]=!1),n=Lt(n,{enumerable:createPropertyDescriptor(0,!1)})):(has(t,Sn)||In(t,Sn,createPropertyDescriptor(1,{})),t[Sn][i]=!0),Wn(t,i,n)):In(t,i,n)},$n=function defineProperties(t,e){anObject(t);var i=toIndexedObject(e),s=Mt(i).concat(Zn(i));return Cn(s,(function(e){n&&!Hn.call(i,e)||Xn(t,e,i[e])})),t},Hn=function propertyIsEnumerable(t){var e=toPrimitive(t,!0),n=Ln.call(this,e);return!(this===On&&has(jn,e)&&!has(Nn,e))&&(!(n||!has(this,e)||!has(jn,e)||has(this,Sn)&&this[Sn][e])||n)},Yn=function getOwnPropertyDescriptor(t,e){var n=toIndexedObject(t),i=toPrimitive(e,!0);if(n!==On||!has(jn,i)||has(Nn,i)){var s=Bn(n,i);return!s||!has(jn,i)||has(n,Sn)&&n[Sn][i]||(s.enumerable=!0),s}},Qn=function getOwnPropertyNames(t){var e=Vn(toIndexedObject(t)),n=[];return Cn(e,(function(t){has(jn,t)||has(j,t)||n.push(t)})),n},Zn=function getOwnPropertySymbols(t){var e=t===On,n=Vn(e?Nn:toIndexedObject(t)),i=[];return Cn(n,(function(t){!has(jn,t)||e&&!has(On,t)||i.push(jn[t])})),i};if(yt||(H((Rn=function Symbol(){if(this instanceof Rn)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===On&&setter.call(Nn,t),has(this,Sn)&&has(this[Sn],e)&&(this[Sn][e]=!1),Wn(this,e,createPropertyDescriptor(1,t))};return n&&zn&&Wn(On,e,{configurable:!0,set:setter}),wrap(e,t)}).prototype,"toString",(function toString(){return Tn(this).tag})),H(Rn,"withoutSetter",(function(t){return wrap(uid(t),t)})),o.f=Hn,P.f=Xn,_.f=Yn,it.f=xn.f=Qn,st.f=Zn,_n.f=function(t){return wrap(wellKnownSymbol(t),t)},n&&(In(Rn.prototype,"description",{configurable:!0,get:function description(){return Tn(this).description}}),H(On,"propertyIsEnumerable",Hn,{unsafe:!0}))),_export({global:!0,wrap:!0,forced:!yt,sham:!yt},{Symbol:Rn}),Cn(Mt(Un),(function(t){defineWellKnownSymbol(t)})),_export({target:"Symbol",stat:!0,forced:!yt},{for:function(t){var e=String(t);if(has(Dn,e))return Dn[e];var n=Rn(e);return Dn[e]=n,Fn[n]=e,n},keyFor:function keyFor(t){if(!qn(t))throw TypeError(t+" is not a symbol");if(has(Fn,t))return Fn[t]},useSetter:function(){zn=!0},useSimple:function(){zn=!1}}),_export({target:"Object",stat:!0,forced:!yt,sham:!n},{create:function create(t,e){return void 0===e?Lt(t):$n(Lt(t),e)},defineProperty:Xn,defineProperties:$n,getOwnPropertyDescriptor:Yn}),_export({target:"Object",stat:!0,forced:!yt},{getOwnPropertyNames:Qn,getOwnPropertySymbols:Zn}),_export({target:"Object",stat:!0,forced:fails((function(){st.f(1)}))},{getOwnPropertySymbols:function getOwnPropertySymbols(t){return st.f(toObject(t))}}),Mn){var Jn=!yt||fails((function(){var t=Rn();return"[null]"!=Mn([t])||"{}"!=Mn({a:t})||"{}"!=Mn(Object(t))}));_export({target:"JSON",stat:!0,forced:Jn},{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)&&!qn(t))return vt(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!qn(e))return e}),s[1]=e,Mn.apply(null,s)}})}Rn.prototype[En]||k(Rn.prototype,En,Rn.prototype.valueOf),setToStringTag(Rn,"Symbol"),j[Sn]=!0;var Kn=P.f,ta=e.Symbol;if(n&&"function"==typeof ta&&(!("description"in ta.prototype)||void 0!==ta().description)){var ea={},ra=function Symbol(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof ra?new ta(t):void 0===t?ta():ta(t);return""===t&&(ea[e]=!0),e};copyConstructorProperties(ra,ta);var na=ra.prototype=ta.prototype;na.constructor=ra;var aa=na.toString,ia="Symbol(test)"==String(ta("test")),sa=/^Symbol\((.*)\)[^)]+$/;Kn(na,"description",{configurable:!0,get:function description(){var t=isObject(this)?this.valueOf():this,e=aa.call(t);if(has(ea,t))return"";var n=ia?e.slice(7,-1):e.replace(sa,"$1");return""===n?void 0:n}}),_export({global:!0,forced:!0},{Symbol:ra})}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)}))},oa=Object.defineProperty,la={},thrower=function(t){throw t},arrayMethodUsesToLength=function(t,e){if(has(la,t))return la[t];e||(e={});var i=[][t],s=!!has(e,"ACCESSORS")&&e.ACCESSORS,o=has(e,0)?e[0]:thrower,l=has(e,1)?e[1]:void 0;return la[t]=!!i&&!fails((function(){if(s&&!n)return!0;var t={length:-1};s?oa(t,1,{enumerable:!0,get:thrower}):t[1]=1,i.call(t,o,l)}))},ua=kn.forEach,ca=arrayMethodIsStrict("forEach"),ha=arrayMethodUsesToLength("forEach"),fa=ca&&ha?[].forEach:function forEach(t){return ua(this,t,arguments.length>1?arguments[1]:void 0)};_export({target:"Array",proto:!0,forced:[].forEach!=fa},{forEach:fa});var pa=[].reverse,da=[1,2];_export({target:"Array",proto:!0,forced:String(da)===String(da.reverse())},{reverse:function reverse(){return vt(this)&&(this.length=this.length),pa.call(this)}});var va=arrayMethodHasSpeciesSupport("slice"),ya=arrayMethodUsesToLength("slice",{ACCESSORS:!0,0:0,1:2}),ga=wellKnownSymbol("species"),ma=[].slice,ba=Math.max;_export({target:"Array",proto:!0,forced:!va||!ya},{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(vt(o)&&("function"!=typeof(n=o.constructor)||n!==Array&&!vt(n.prototype)?isObject(n)&&null===(n=n[ga])&&(n=void 0):n=void 0,n===Array||void 0===n))return ma.call(o,u,h);for(i=new(void 0===n?Array:n)(ba(h-u,0)),s=0;u<h;u++,s++)u in o&&createProperty(i,s,o[u]);return i.length=s,i}});var xa=Date.prototype,_a=xa.toString,wa=xa.getTime;new Date(NaN)+""!="Invalid Date"&&H(xa,"toString",(function toString(){var t=wa.call(this);return t==t?_a.call(this):"Invalid Date"}));var Pa=P.f,ka=Function.prototype,Ca=ka.toString,Sa=/^\s*function ([^ (]*)/;n&&!("name"in ka)&&Pa(ka,"name",{configurable:!0,get:function(){try{return Ca.call(this).match(Sa)[1]}catch(t){return""}}}),setToStringTag(e.JSON,"JSON",!0),setToStringTag(Math,"Math",!0),_export({target:"Object",stat:!0,sham:!n},{create:Lt}),_export({target:"Object",stat:!0,forced:!n,sham:!n},{defineProperty:P.f});var Ea=fails((function(){Xt(1)}));_export({target:"Object",stat:!0,forced:Ea,sham:!zt},{getPrototypeOf:function getPrototypeOf(t){return Xt(toObject(t))}}),_export({target:"Object",stat:!0},{setPrototypeOf:Kt});var Aa=e.Promise,Ta=wellKnownSymbol("species"),Oa=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)}})),Ra=wellKnownSymbol("iterator"),Ma=!1;try{var Ba=0,Ia={next:function(){return{done:!!Ba++}},return:function(){Ma=!0}};Ia[Ra]=function(){return this},Array.from(Ia,(function(){throw 2}))}catch(t){}var Va,La,ja,Na=wellKnownSymbol("species"),speciesConstructor=function(t,e){var n,i=anObject(t).constructor;return void 0===i||null==(n=anObject(i)[Na])?e:aFunction$1(n)},Da=/(iphone|ipod|ipad).*applewebkit/i.test(wt),Fa=e.location,Ua=e.setImmediate,Ga=e.clearImmediate,za=e.process,Wa=e.MessageChannel,qa=e.Dispatch,Xa=0,$a={},run=function(t){if($a.hasOwnProperty(t)){var e=$a[t];delete $a[t],e()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){e.postMessage(t+"",Fa.protocol+"//"+Fa.host)};Ua&&Ga||(Ua=function setImmediate(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return $a[++Xa]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},Va(Xa),Xa},Ga=function clearImmediate(t){delete $a[t]},"process"==classofRaw(za)?Va=function(t){za.nextTick(runner(t))}:qa&&qa.now?Va=function(t){qa.now(runner(t))}:Wa&&!Da?(ja=(La=new Wa).port2,La.port1.onmessage=listener,Va=functionBindContext(ja.postMessage,ja,1)):!e.addEventListener||"function"!=typeof postMessage||e.importScripts||fails(post)||"file:"===Fa.protocol?Va="onreadystatechange"in documentCreateElement("script")?function(t){It.appendChild(documentCreateElement("script")).onreadystatechange=function(){It.removeChild(this),run(t)}}:function(t){setTimeout(runner(t),0)}:(Va=post,e.addEventListener("message",listener,!1)));var Ha,Ya,Qa,Za,Ja,Ka,ti,ei,ri={set:Ua,clear:Ga},ni=_.f,ai=ri.set,ii=e.MutationObserver||e.WebKitMutationObserver,si=e.process,oi=e.Promise,li="process"==classofRaw(si),ui=ni(e,"queueMicrotask"),ci=ui&&ui.value;ci||(Ha=function(){var t,e;for(li&&(t=si.domain)&&t.exit();Ya;){e=Ya.fn,Ya=Ya.next;try{e()}catch(t){throw Ya?Za():Qa=void 0,t}}Qa=void 0,t&&t.enter()},li?Za=function(){si.nextTick(Ha)}:ii&&!Da?(Ja=!0,Ka=document.createTextNode(""),new ii(Ha).observe(Ka,{characterData:!0}),Za=function(){Ka.data=Ja=!Ja}):oi&&oi.resolve?(ti=oi.resolve(void 0),ei=ti.then,Za=function(){ei.call(ti,Ha)}):Za=function(){ai.call(e,Ha)});var hi,fi,pi,di,vi=ci||function(t){var e={fn:t,next:void 0};Qa&&(Qa.next=e),Ya||(Ya=e,Za()),Qa=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)},yi={f:function(t){return new PromiseCapability(t)}},promiseResolve=function(t,e){if(anObject(t),isObject(e)&&e.constructor===t)return e;var n=yi.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}}},gi=ri.set,mi=wellKnownSymbol("species"),bi="Promise",xi=$.get,_i=$.set,wi=$.getterFor(bi),Pi=Aa,ki=e.TypeError,Ci=e.document,Si=e.process,Ei=getBuiltIn("fetch"),Ai=yi.f,Ti=Ai,Oi="process"==classofRaw(Si),Ri=!!(Ci&&Ci.createEvent&&e.dispatchEvent),Mi=pt(bi,(function(){if(!(O(Pi)!==String(Pi))){if(66===St)return!0;if(!Oi&&"function"!=typeof PromiseRejectionEvent)return!0}if(St>=51&&/native code/.test(Pi))return!1;var t=Pi.resolve(1),FakePromise=function(t){t((function(){}),(function(){}))};return(t.constructor={})[mi]=FakePromise,!(t.then((function(){}))instanceof FakePromise)})),Bi=Mi||!function(t,e){if(!e&&!Ma)return!1;var n=!1;try{var i={};i[Ra]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}((function(t){Pi.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;vi((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(ki("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,n,i){var s,o;Ri?((s=Ci.createEvent("Event")).promise=n,s.reason=i,s.initEvent(t,!1,!0),e.dispatchEvent(s)):s={promise:n,reason:i},(o=e["on"+t])?o(s):"unhandledrejection"===t&&function(t,n){var i=e.console;i&&i.error&&(1===arguments.length?i.error(t):i.error(t,n))}("Unhandled promise rejection",i)},onUnhandled=function(t,n){gi.call(e,(function(){var e,i=n.value;if(isUnhandled(n)&&(e=perform((function(){Oi?Si.emit("unhandledRejection",i,t):dispatchEvent("unhandledrejection",t,i)})),n.rejection=Oi||isUnhandled(n)?2:1,e.error))throw e.value}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t,n){gi.call(e,(function(){Oi?Si.emit("rejectionHandled",t):dispatchEvent("rejectionhandled",t,n.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 ki("Promise can't be resolved itself");var s=isThenable(n);s?vi((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)}}};Mi&&(Pi=function Promise(t){anInstance(this,Pi,bi),aFunction$1(t),hi.call(this);var e=xi(this);try{t(bind(internalResolve,this,e),bind(internalReject,this,e))}catch(t){internalReject(this,e,t)}},(hi=function Promise(t){_i(this,{type:bi,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=redefineAll(Pi.prototype,{then:function then(t,e){var n=wi(this),i=Ai(speciesConstructor(this,Pi));return i.ok="function"!=typeof t||t,i.fail="function"==typeof e&&e,i.domain=Oi?Si.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)}}),fi=function(){var t=new hi,e=xi(t);this.promise=t,this.resolve=bind(internalResolve,t,e),this.reject=bind(internalReject,t,e)},yi.f=Ai=function(t){return t===Pi||t===pi?new fi(t):Ti(t)},"function"==typeof Aa&&(di=Aa.prototype.then,H(Aa.prototype,"then",(function then(t,e){var n=this;return new Pi((function(t,e){di.call(n,t,e)})).then(t,e)}),{unsafe:!0}),"function"==typeof Ei&&_export({global:!0,enumerable:!0,forced:!0},{fetch:function fetch(t){return promiseResolve(Pi,Ei.apply(e,arguments))}}))),_export({global:!0,wrap:!0,forced:Mi},{Promise:Pi}),setToStringTag(Pi,bi,!1),function(t){var e=getBuiltIn(t),i=P.f;n&&e&&!e[Ta]&&i(e,Ta,{configurable:!0,get:function(){return this}})}(bi),pi=getBuiltIn(bi),_export({target:bi,stat:!0,forced:Mi},{reject:function reject(t){var e=Ai(this);return e.reject.call(void 0,t),e.promise}}),_export({target:bi,stat:!0,forced:Mi},{resolve:function resolve(t){return promiseResolve(this,t)}}),_export({target:bi,stat:!0,forced:Bi},{all:function all(t){var e=this,n=Ai(e),i=n.resolve,s=n.reject,o=perform((function(){var n=aFunction$1(e.resolve),o=[],l=0,u=1;Oa(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=Ai(e),i=n.reject,s=perform((function(){var s=aFunction$1(e.resolve);Oa(t,(function(t){s.call(e,t).then(n.resolve,i)}))}));return s.error&&i(s.value),n.promise}});var Ii=RegExp.prototype,Vi=Ii.toString,Li=fails((function(){return"/a/b"!=Vi.call({source:"a",flags:"b"})})),ji="toString"!=Vi.name;for(var Ni in(Li||ji)&&H(RegExp.prototype,"toString",(function toString(){var t=anObject(this),e=String(t.source),n=t.flags;return"/"+e+"/"+String(void 0===n&&t instanceof RegExp&&!("flags"in Ii)?regexpFlags.call(t):n)}),{unsafe:!0}),Ne){var Di=e[Ni],Fi=Di&&Di.prototype;if(Fi&&Fi.forEach!==fa)try{k(Fi,"forEach",fa)}catch(t){Fi.forEach=fa}}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 Ui=kn.every,Gi=arrayMethodIsStrict("every"),zi=arrayMethodUsesToLength("every");_export({target:"Array",proto:!0,forced:!Gi||!zi},{every:function every(t){return Ui(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 Wi=kn.filter,qi=arrayMethodHasSpeciesSupport("filter"),Xi=arrayMethodUsesToLength("filter");_export({target:"Array",proto:!0,forced:!qi||!Xi},{filter:function filter(t){return Wi(this,t,arguments.length>1?arguments[1]:void 0)}});var $i=et.includes,Hi=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:!Hi},{includes:function includes(t){return $i(this,t,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("includes");var Yi=et.indexOf,Qi=[].indexOf,Zi=!!Qi&&1/[1].indexOf(1,-0)<0,Ji=arrayMethodIsStrict("indexOf"),Ki=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:Zi||!Ji||!Ki},{indexOf:function indexOf(t){return Zi?Qi.apply(this,arguments)||0:Yi(this,t,arguments.length>1?arguments[1]:void 0)}});var ts=[].join,es=h!=Object,rs=arrayMethodIsStrict("join",",");_export({target:"Array",proto:!0,forced:es||!rs},{join:function join(t){return ts.call(toIndexedObject(this),void 0===t?",":t)}});var ns=kn.map,as=arrayMethodHasSpeciesSupport("map"),is=arrayMethodUsesToLength("map");_export({target:"Array",proto:!0,forced:!as||!is},{map:function map(t){return ns(this,t,arguments.length>1?arguments[1]:void 0)}});var inheritIfRequired=function(t,e,n){var i,s;return Kt&&"function"==typeof(i=e.constructor)&&i!==n&&isObject(s=i.prototype)&&s!==n.prototype&&Kt(t,s),t},ss="\t\n\v\f\r    \u2028\u2029\ufeff",os="["+ss+"]",ls=RegExp("^"+os+os+"*"),us=RegExp(os+os+"*$"),createMethod$3=function(t){return function(e){var n=String(requireObjectCoercible(e));return 1&t&&(n=n.replace(ls,"")),2&t&&(n=n.replace(us,"")),n}},cs={start:createMethod$3(1),end:createMethod$3(2),trim:createMethod$3(3)},hs=it.f,fs=_.f,ps=P.f,ds=cs.trim,vs=e.Number,ys=vs.prototype,gs="Number"==classofRaw(Lt(ys)),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=ds(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(pt("Number",!vs(" 0o1")||!vs("0b1")||vs("+0x1"))){for(var ms,bs=function Number(t){var e=arguments.length<1?0:t,n=this;return n instanceof bs&&(gs?fails((function(){ys.valueOf.call(n)})):"Number"!=classofRaw(n))?inheritIfRequired(new vs(toNumber(e)),n,bs):toNumber(e)},xs=n?hs(vs):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),_s=0;xs.length>_s;_s++)has(vs,ms=xs[_s])&&!has(bs,ms)&&ps(bs,ms,fs(vs,ms));bs.prototype=ys,ys.constructor=bs,H(e,"Number",bs)}var ws=cs.trim,Ps=e.parseFloat,ks=1/Ps(ss+"-0")!=-1/0?function parseFloat(t){var e=ws(String(t)),n=Ps(e);return 0===n&&"-"==e.charAt(0)?-0:n}:Ps;_export({target:"Number",stat:!0,forced:Number.parseFloat!=ks},{parseFloat:ks});var Cs=cs.trim,Ss=e.parseInt,Es=/^[+-]?0[Xx]/,As=8!==Ss(ss+"08")||22!==Ss(ss+"0x16")?function parseInt(t,e){var n=Cs(String(t));return Ss(n,e>>>0||(Es.test(n)?16:10))}:Ss;_export({target:"Number",stat:!0,forced:Number.parseInt!=As},{parseInt:As}),_export({target:"Object",stat:!0,forced:Object.assign!==Qe},{assign:Qe});var Ts=o.f,createMethod$4=function(t){return function(e){for(var i,s=toIndexedObject(e),o=Mt(s),l=o.length,u=0,h=[];l>u;)i=o[u++],n&&!Ts.call(s,i)||h.push(t?[i,s[i]]:s[i]);return h}},Os={entries:createMethod$4(!0),values:createMethod$4(!1)}.entries;_export({target:"Object",stat:!0},{entries:function entries(t){return Os(t)}});var Rs,Ms=wellKnownSymbol("match"),isRegexp=function(t){var e;return isObject(t)&&(void 0!==(e=t[Ms])?!!e:"RegExp"==classofRaw(t))},notARegexp=function(t){if(isRegexp(t))throw TypeError("The method doesn't accept regular expressions");return t},Bs=wellKnownSymbol("match"),correctIsRegexpLogic=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[Bs]=!1,"/./"[t](e)}catch(t){}}return!1},Is=_.f,Vs="".endsWith,Ls=Math.min,js=correctIsRegexpLogic("endsWith"),Ns=!(js||(Rs=Is(String.prototype,"endsWith"),!Rs||Rs.writable));_export({target:"String",proto:!0,forced:!Ns&&!js},{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:Ls(toLength(n),i),o=String(t);return Vs?Vs.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 Ds=[].push,Fs=Math.min,Us=!fails((function(){return!RegExp(4294967295,"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?4294967295: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=_e.call(v,i))&&!((l=v.lastIndex)>d&&(h.push(i.slice(d,o.index)),o.length>1&&o.index<i.length&&Ds.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":"")+(Us?"y":"g"),v=new h(Us?l:"^(?:"+l.source+")",d),g=void 0===s?4294967295: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=Us?_:0;var P,k=regexpExecAbstract(v,Us?u:u.slice(_));if(null===k||(P=Fs(toLength(v.lastIndex+(Us?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}]}),!Us);var Gs=_.f,zs="".startsWith,Ws=Math.min,qs=correctIsRegexpLogic("startsWith"),Xs=!qs&&!!function(){var t=Gs(String.prototype,"startsWith");return t&&!t.writable}();_export({target:"String",proto:!0,forced:!Xs&&!qs},{startsWith:function startsWith(t){var e=String(requireObjectCoercible(this));notARegexp(t);var n=toLength(Ws(arguments.length>1?arguments[1]:void 0,e.length)),i=String(t);return zs?zs.call(e,i,n):e.slice(n,n+i.length)===i}});var $s=cs.trim;_export({target:"String",proto:!0,forced:function(t){return fails((function(){return!!ss[t]()||"…"!="…"[t]()||ss[t].name!==t}))}("trim")},{trim:function trim(){return $s(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&&vt(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},Hs=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=Hs(e,n,n,i,0,1,t,arguments.length>1?arguments[1]:void 0),e}}),addToUnscopables("flatMap");var Ys=fails((function(){Mt(1)}));_export({target:"Object",stat:!0,forced:Ys},{keys:function keys(t){return Mt(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 Qs={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"},Zs=[{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)}))}}],Js=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 Qs&&(t=Qs[t]),Zs.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(Zs.flatMap((function(t){return t.example}))),_toConsumableArray(Object.keys(Qs))),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 Ks=[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],to=[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,S,E,A,T,O,R,M,B,I,V,L,j,N=t.data,D=2*o+1,U=i-1,G=s-1,z=o+1,W=z*(z+1)/2,q=new eo,X=q;for(h=1;h<D;h++)X=X.next=new eo,h===z&&(j=X);X.next=q;var $=null,H=null;g=v=0;var Y=Ks[o],Q=to[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]),S=z*(I=N[v+2]),E=z*(V=N[v+3]),b+=W*M,_+=W*B,w+=W*I,P+=W*V,X=q,h=0;h<z;h++)X.r=M,X.g=B,X.b=I,X.a=V,X=X.next;for(h=1;h<z;h++)p=v+((U<h?U:h)<<2),b+=(X.r=M=N[p])*(L=z-h),_+=(X.g=B=N[p+1])*L,w+=(X.b=I=N[p+2])*L,P+=(X.a=V=N[p+3])*L,A+=M,T+=B,O+=I,R+=V,X=X.next;for($=q,H=j,l=0;l<i;l++)N[v+3]=V=P*Y>>Q,0!==V?(V=255/V,N[v]=(b*Y>>Q)*V,N[v+1]=(_*Y>>Q)*V,N[v+2]=(w*Y>>Q)*V):N[v]=N[v+1]=N[v+2]=0,b-=k,_-=C,w-=S,P-=E,k-=$.r,C-=$.g,S-=$.b,E-=$.a,p=g+((p=l+o+1)<U?p:U)<<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,S+=I=H.b,E+=V=H.a,A-=M,T-=B,O-=I,R-=V,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]),S=z*(I=N[v+2]),E=z*(V=N[v+3]),b+=W*M,_+=W*B,w+=W*I,P+=W*V,X=q,h=0;h<z;h++)X.r=M,X.g=B,X.b=I,X.a=V,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=I=N[v+2])*L,P+=(X.a=V=N[v+3])*L,A+=M,T+=B,O+=I,R+=V,X=X.next,h<G&&(d+=i);for(v=l,$=q,H=j,u=0;u<s;u++)N[(p=v<<2)+3]=V=P*Y>>Q,V>0?(V=255/V,N[p]=(b*Y>>Q)*V,N[p+1]=(_*Y>>Q)*V,N[p+2]=(w*Y>>Q)*V):N[p]=N[p+1]=N[p+2]=0,b-=k,_-=C,w-=S,P-=E,k-=$.r,C-=$.g,S-=$.b,E-=$.a,p=l+((p=u+z)<G?p:G)*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,S+=I=H.b,E+=V=H.a,A-=M,T-=B,O-=I,R-=V,H=H.next,v+=i}return t}(l,0,0,i,s,o),t.getContext("2d").putImageData(l,e,n)}}var eo=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},ro=function isNullish(t){return null==t},no=function canvg(t,e,n){if(ro(t)&&ro(e)&&ro(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)),ro(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 ro(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!ro(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(!ro(t.value)&&""!==t.value&&"string"==typeof this.value){var i=new Js(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(!ro(i)&&i.createGradient)return i.createGradient(e.ctx,t,n);if(!ro(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=ro(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){ro(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)),ro(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(ro(u)?0:-u,ro(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=[],!ro(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(ro(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],ro(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],ro(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];ro(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()&&ro(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 ro(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(!ro(s))return s;var o=this.attribute(t);if(!ro(o)&&o.hasValue())return this.styles[t]=o,o;if(!0!==i){var l=this.parent;if(!ro(l)){var u=l.style(t);if(!ro(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();ro(e)||e.apply(t,this)}else if(this.style("filter").hasValue()){var n=this.style("filter").getDefinition();ro(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"));ro(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"));ro(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();ro(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 ro(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(!ro(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),ro(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 ro(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 ro(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 ro(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);ro(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),ro(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 ro(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()||!ro(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){!ro(n)&&this.angles.length>0&&ro(this.angles[this.angles.length-1])&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(n)),this.addMarkerAngle(t,ro(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(ro(this.angles[t]))for(var e=t+1;e<this.angles.length;e++)if(!ro(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(ro(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),ro(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),ro(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),ro(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),ro(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),ro(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),ro(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),ro(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,S=n.getAsControlPoint(),E=n.getAsCurrentPoint();n.addMarker(E,S,S),i.addQuadraticCurve(C.x,C.y,S.x,S.y,E.x,E.y),ro(t)||t.quadraticCurveTo(S.x,S.y,E.x,E.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),ro(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))},S=C([1,0],[(v.x-_.x)/o,(v.y-_.y)/l]),E=[(v.x-_.x)/o,(v.y-_.y)/l],A=[(-v.x-_.x)/o,(-v.y-_.y)/l],T=C(E,A);k(E,A)<=-1&&(T=Math.PI),k(E,A)>=1&&(T=0);var O=1-p?1:-1,R=S+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),!ro(t)){var B=o>l?o:l,I=o>l?1:o/l,V=o>l?l/o:1;t.translate(w.x,w.y),t.rotate(u),t.scale(I,V),t.arc(0,0,B,S,S+T,1-p),t.scale(1/I,1/V),t.rotate(-u),t.translate(-w.x,-w.y)}};!n.isCommandOrEnd();)R();break;case"Z":case"z":ro(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(ro(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(ro(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 Js(t.from.value),n=new Js(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();ro(e)&&(e=this.style("alignment-baseline").toTextBaseline()),ro(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],ro(s)&&"glyph"===t.glyphs[i].type&&(s=t.glyphs[i]))}else s=t.glyphs[i];return ro(s)&&(s=t.missingGlyph),s}},{key:"renderChildren",value:function renderChildren(t){var n=this.parent.style("font-family").getDefinition();if(ro(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(!ro(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(!ro(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);ro(s)||ro(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;ro(e)||e.path(t)}},{key:"getBoundingBox",value:function getBoundingBox(){var t=this._el;if(!ro(t))return t.getBoundingBox()}},{key:"renderChildren",value:function renderChildren(t){var n=this._el;if(!ro(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=ro(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=ro(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),ro(e.opts.offsetX)||(o.attribute("x",!0).value=e.opts.offsetX),ro(e.opts.offsetY)||(o.attribute("y",!0).value=e.opts.offsetY),!ro(e.opts.scaleWidth)||!ro(e.opts.scaleHeight)){var h=e.ToNumberArray(o.attribute("viewBox").value),p=null,d=null;ro(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)),ro(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)),ro(p)&&(p=d),ro(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){no(this.canvas,t,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:e,offsetY:n,scaleWidth:i,scaleHeight:s})});var ao=kn.find,io=!0,so=arrayMethodUsesToLength("find");"find"in[]&&Array(1).find((function(){io=!1})),_export({target:"Array",proto:!0,forced:io||!so},{find:function find(t){return ao(this,t,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("find");var oo=kn.some,lo=arrayMethodIsStrict("some"),uo=arrayMethodUsesToLength("some");_export({target:"Array",proto:!0,forced:!lo||!uo},{some:function some(t){return oo(this,t,arguments.length>1?arguments[1]:void 0)}});var co=/"/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(co,"&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 ho=function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function _callee2(t,e){var n;return regeneratorRuntime.wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,import("./extensions/ext-".concat(t,"/locale/").concat(e,".js"));case 3:n=i.sent,i.next=12;break;case 6:return i.prev=6,i.t0=i.catch(0),console.error("Missing translation (".concat(e,") for extension ").concat(t," - using 'en'")),i.next=11,import("./extensions/ext-".concat(t,"/locale/en.js"));case 11:n=i.sent;case 12:return i.abrupt("return",n.default);case 13:case"end":return i.stop()}}),_callee2,null,[[0,6]])})));return function loadExtensionTranslation(e,n){return t.apply(this,arguments)}}(),fo={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,ho("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,no(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)})))()}};export default fo;
//# sourceMappingURL=ext-server_moinsave.js.map