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

10 lines
154 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters!

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

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

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