Files
svgedit/dist/editor/extensions/ext-server_opensave/ext-server_opensave.js
2020-10-05 22:01:57 +02:00

3 lines
212 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(t,r,i){return t(i={path:r,exports:{},require:function(t,r){return function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==r&&i.path)}},i.exports),i.exports}var check=function(t){return t&&t.Math==Math&&t},r=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof t&&t)||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},i=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),o={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,u={f:a&&!o.call({1:2},1)?function propertyIsEnumerable(t){var r=a(this,t);return!!r&&r.enumerable}:o},createPropertyDescriptor=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}},l={}.toString,classofRaw=function(t){return l.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,r){if(!isObject(t))return t;var i,o;if(r&&"function"==typeof(i=t.toString)&&!isObject(o=i.call(t)))return o;if("function"==typeof(i=t.valueOf)&&!isObject(o=i.call(t)))return o;if(!r&&"function"==typeof(i=t.toString)&&!isObject(o=i.call(t)))return o;throw TypeError("Can't convert object to primitive value")},y={}.hasOwnProperty,has=function(t,r){return y.call(t,r)},g=r.document,d=isObject(g)&&isObject(g.createElement),documentCreateElement=function(t){return d?g.createElement(t):{}},v=!i&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),x=Object.getOwnPropertyDescriptor,b={f:i?x:function getOwnPropertyDescriptor(t,r){if(t=toIndexedObject(t),r=toPrimitive(r,!0),v)try{return x(t,r)}catch(t){}if(has(t,r))return createPropertyDescriptor(!u.f.call(t,r),t[r])}},anObject=function(t){if(!isObject(t))throw TypeError(String(t)+" is not an object");return t},S=Object.defineProperty,w={f:i?S:function defineProperty(t,r,i){if(anObject(t),r=toPrimitive(r,!0),anObject(i),v)try{return S(t,r,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(t[r]=i.value),t}},k=i?function(t,r,i){return w.f(t,r,createPropertyDescriptor(1,i))}:function(t,r,i){return t[r]=i,t},setGlobal=function(t,i){try{k(r,t,i)}catch(o){r[t]=i}return i},E=r["__core-js_shared__"]||setGlobal("__core-js_shared__",{}),P=Function.toString;"function"!=typeof E.inspectSource&&(E.inspectSource=function(t){return P.call(t)});var C,R,A,_=E.inspectSource,T=r.WeakMap,M="function"==typeof T&&/native code/.test(_(T)),N=createCommonjsModule((function(t){(t.exports=function(t,r){return E[t]||(E[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),O=0,D=Math.random(),uid=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++O+D).toString(36)},$=N("keys"),sharedKey=function(t){return $[t]||($[t]=uid(t))},I={},V=r.WeakMap;if(M){var L=new V,j=L.get,B=L.has,G=L.set;C=function(t,r){return G.call(L,t,r),r},R=function(t){return j.call(L,t)||{}},A=function(t){return B.call(L,t)}}else{var z=sharedKey("state");I[z]=!0,C=function(t,r){return k(t,z,r),r},R=function(t){return has(t,z)?t[z]:{}},A=function(t){return has(t,z)}}var U,q,W={set:C,get:R,has:A,enforce:function(t){return A(t)?R(t):C(t,{})},getterFor:function(t){return function(r){var i;if(!isObject(r)||(i=R(r)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return i}}},H=createCommonjsModule((function(t){var i=W.get,o=W.enforce,a=String(String).split("String");(t.exports=function(t,i,u,l){var h=!!l&&!!l.unsafe,p=!!l&&!!l.enumerable,y=!!l&&!!l.noTargetGet;"function"==typeof u&&("string"!=typeof i||has(u,"name")||k(u,"name",i),o(u).source=a.join("string"==typeof i?i:"")),t!==r?(h?!y&&t[i]&&(p=!0):delete t[i],p?t[i]=u:k(t,i,u)):p?t[i]=u:setGlobal(i,u)})(Function.prototype,"toString",(function toString(){return"function"==typeof this&&i(this).source||_(this)}))})),X=r,aFunction=function(t){return"function"==typeof t?t:void 0},getBuiltIn=function(t,i){return arguments.length<2?aFunction(X[t])||aFunction(r[t]):X[t]&&X[t][i]||r[t]&&r[t][i]},Y=Math.ceil,Q=Math.floor,toInteger=function(t){return isNaN(t=+t)?0:(t>0?Q:Y)(t)},K=Math.min,toLength=function(t){return t>0?K(toInteger(t),9007199254740991):0},Z=Math.max,J=Math.min,toAbsoluteIndex=function(t,r){var i=toInteger(t);return i<0?Z(i+r,0):J(i,r)},createMethod=function(t){return function(r,i,o){var a,u=toIndexedObject(r),l=toLength(u.length),h=toAbsoluteIndex(o,l);if(t&&i!=i){for(;l>h;)if((a=u[h++])!=a)return!0}else for(;l>h;h++)if((t||h in u)&&u[h]===i)return t||h||0;return!t&&-1}},tt={includes:createMethod(!0),indexOf:createMethod(!1)},et=tt.indexOf,objectKeysInternal=function(t,r){var i,o=toIndexedObject(t),a=0,u=[];for(i in o)!has(I,i)&&has(o,i)&&u.push(i);for(;r.length>a;)has(o,i=r[a++])&&(~et(u,i)||u.push(i));return u},rt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],nt=rt.concat("length","prototype"),it={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,nt)}},ot={f:Object.getOwnPropertySymbols},at=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var r=it.f(anObject(t)),i=ot.f;return i?r.concat(i(t)):r},copyConstructorProperties=function(t,r){for(var i=at(r),o=w.f,a=b.f,u=0;u<i.length;u++){var l=i[u];has(t,l)||o(t,l,a(r,l))}},ut=/#|\.prototype\./,isForced=function(t,r){var i=ct[st(t)];return i==ft||i!=lt&&("function"==typeof r?fails(r):!!r)},st=isForced.normalize=function(t){return String(t).replace(ut,".").toLowerCase()},ct=isForced.data={},lt=isForced.NATIVE="N",ft=isForced.POLYFILL="P",ht=isForced,pt=b.f,_export=function(t,i){var o,a,u,l,h,p=t.target,y=t.global,g=t.stat;if(o=y?r:g?r[p]||setGlobal(p,{}):(r[p]||{}).prototype)for(a in i){if(l=i[a],u=t.noTargetGet?(h=pt(o,a))&&h.value:o[a],!ht(y?a:p+(g?".":"#")+a,t.forced)&&void 0!==u){if(typeof l==typeof u)continue;copyConstructorProperties(l,u)}(t.sham||u&&u.sham)&&k(l,"sham",!0),H(o,a,l,t)}},yt=Array.isArray||function isArray(t){return"Array"==classofRaw(t)},toObject=function(t){return Object(requireObjectCoercible(t))},createProperty=function(t,r,i){var o=toPrimitive(r);o in t?w.f(t,o,createPropertyDescriptor(0,i)):t[o]=i},gt=!!Object.getOwnPropertySymbols&&!fails((function(){return!String(Symbol())})),dt=gt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,vt=N("wks"),mt=r.Symbol,xt=dt?mt:mt&&mt.withoutSetter||uid,wellKnownSymbol=function(t){return has(vt,t)||(gt&&has(mt,t)?vt[t]=mt[t]:vt[t]=xt("Symbol."+t)),vt[t]},bt=wellKnownSymbol("species"),arraySpeciesCreate=function(t,r){var i;return yt(t)&&("function"!=typeof(i=t.constructor)||i!==Array&&!yt(i.prototype)?isObject(i)&&null===(i=i[bt])&&(i=void 0):i=void 0),new(void 0===i?Array:i)(0===r?0:r)},St=getBuiltIn("navigator","userAgent")||"",wt=r.process,kt=wt&&wt.versions,Et=kt&&kt.v8;Et?q=(U=Et.split("."))[0]+U[1]:St&&(!(U=St.match(/Edge\/(\d+)/))||U[1]>=74)&&(U=St.match(/Chrome\/(\d+)/))&&(q=U[1]);var Pt=q&&+q,Ct=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(t){return Pt>=51||!fails((function(){var r=[];return(r.constructor={})[Ct]=function(){return{foo:1}},1!==r[t](Boolean).foo}))},Rt=wellKnownSymbol("isConcatSpreadable"),At=Pt>=51||!fails((function(){var t=[];return t[Rt]=!1,t.concat()[0]!==t})),_t=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(t){if(!isObject(t))return!1;var r=t[Rt];return void 0!==r?!!r:yt(t)};_export({target:"Array",proto:!0,forced:!At||!_t},{concat:function concat(t){var r,i,o,a,u,l=toObject(this),h=arraySpeciesCreate(l,0),p=0;for(r=-1,o=arguments.length;r<o;r++)if(isConcatSpreadable(u=-1===r?l:arguments[r])){if(p+(a=toLength(u.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(i=0;i<a;i++,p++)i in u&&createProperty(h,p,u[i])}else{if(p>=9007199254740991)throw TypeError("Maximum allowed index exceeded");createProperty(h,p++,u)}return h.length=p,h}});var arrayMethodIsStrict=function(t,r){var i=[][t];return!!i&&fails((function(){i.call(null,r||function(){throw 1},1)}))},Tt=[].join,Mt=p!=Object,Nt=arrayMethodIsStrict("join",",");_export({target:"Array",proto:!0,forced:Mt||!Nt},{join:function join(t){return Tt.call(toIndexedObject(this),void 0===t?",":t)}});var Ot={};Ot[wellKnownSymbol("toStringTag")]="z";var Dt="[object z]"===String(Ot),$t=wellKnownSymbol("toStringTag"),It="Arguments"==classofRaw(function(){return arguments}()),Ft=Dt?classofRaw:function(t){var r,i,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,r){try{return t[r]}catch(t){}}(r=Object(t),$t))?i:It?classofRaw(r):"Object"==(o=classofRaw(r))&&"function"==typeof r.callee?"Arguments":o},Vt=Dt?{}.toString:function toString(){return"[object "+Ft(this)+"]"};Dt||H(Object.prototype,"toString",Vt,{unsafe:!0});var Lt=r.Promise,redefineAll=function(t,r,i){for(var o in r)H(t,o,r[o],i);return t},jt=w.f,Bt=wellKnownSymbol("toStringTag"),setToStringTag=function(t,r,i){t&&!has(t=i?t:t.prototype,Bt)&&jt(t,Bt,{configurable:!0,value:r})},Gt=wellKnownSymbol("species"),setSpecies=function(t){var r=getBuiltIn(t),o=w.f;i&&r&&!r[Gt]&&o(r,Gt,{configurable:!0,get:function(){return this}})},aFunction$1=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},anInstance=function(t,r,i){if(!(t instanceof r))throw TypeError("Incorrect "+(i?i+" ":"")+"invocation");return t},zt={},Ut=wellKnownSymbol("iterator"),qt=Array.prototype,isArrayIteratorMethod=function(t){return void 0!==t&&(zt.Array===t||qt[Ut]===t)},functionBindContext=function(t,r,i){if(aFunction$1(t),void 0===r)return t;switch(i){case 0:return function(){return t.call(r)};case 1:return function(i){return t.call(r,i)};case 2:return function(i,o){return t.call(r,i,o)};case 3:return function(i,o,a){return t.call(r,i,o,a)}}return function(){return t.apply(r,arguments)}},Wt=wellKnownSymbol("iterator"),getIteratorMethod=function(t){if(null!=t)return t[Wt]||t["@@iterator"]||zt[Ft(t)]},callWithSafeIterationClosing=function(t,r,i,o){try{return o?r(anObject(i)[0],i[1]):r(i)}catch(r){var a=t.return;throw void 0!==a&&anObject(a.call(t)),r}},Ht=createCommonjsModule((function(t){var Result=function(t,r){this.stopped=t,this.result=r};(t.exports=function(t,r,i,o,a){var u,l,h,p,y,g,d,v=functionBindContext(r,i,o?2:1);if(a)u=t;else{if("function"!=typeof(l=getIteratorMethod(t)))throw TypeError("Target is not iterable");if(isArrayIteratorMethod(l)){for(h=0,p=toLength(t.length);p>h;h++)if((y=o?v(anObject(d=t[h])[0],d[1]):v(t[h]))&&y instanceof Result)return y;return new Result(!1)}u=l.call(t)}for(g=u.next;!(d=g.call(u)).done;)if("object"==typeof(y=callWithSafeIterationClosing(u,v,d.value,o))&&y&&y instanceof Result)return y;return new Result(!1)}).stop=function(t){return new Result(!0,t)}})),Xt=wellKnownSymbol("iterator"),Yt=!1;try{var Qt=0,Kt={next:function(){return{done:!!Qt++}},return:function(){Yt=!0}};Kt[Xt]=function(){return this},Array.from(Kt,(function(){throw 2}))}catch(t){}var Zt,Jt,te,checkCorrectnessOfIteration=function(t,r){if(!r&&!Yt)return!1;var i=!1;try{var o={};o[Xt]=function(){return{next:function(){return{done:i=!0}}}},t(o)}catch(t){}return i},ee=wellKnownSymbol("species"),speciesConstructor=function(t,r){var i,o=anObject(t).constructor;return void 0===o||null==(i=anObject(o)[ee])?r:aFunction$1(i)},re=getBuiltIn("document","documentElement"),ne=/(iphone|ipod|ipad).*applewebkit/i.test(St),ie=r.location,oe=r.setImmediate,ae=r.clearImmediate,ue=r.process,se=r.MessageChannel,ce=r.Dispatch,le=0,fe={},run=function(t){if(fe.hasOwnProperty(t)){var r=fe[t];delete fe[t],r()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){r.postMessage(t+"",ie.protocol+"//"+ie.host)};oe&&ae||(oe=function setImmediate(t){for(var r=[],i=1;arguments.length>i;)r.push(arguments[i++]);return fe[++le]=function(){("function"==typeof t?t:Function(t)).apply(void 0,r)},Zt(le),le},ae=function clearImmediate(t){delete fe[t]},"process"==classofRaw(ue)?Zt=function(t){ue.nextTick(runner(t))}:ce&&ce.now?Zt=function(t){ce.now(runner(t))}:se&&!ne?(te=(Jt=new se).port2,Jt.port1.onmessage=listener,Zt=functionBindContext(te.postMessage,te,1)):!r.addEventListener||"function"!=typeof postMessage||r.importScripts||fails(post)||"file:"===ie.protocol?Zt="onreadystatechange"in documentCreateElement("script")?function(t){re.appendChild(documentCreateElement("script")).onreadystatechange=function(){re.removeChild(this),run(t)}}:function(t){setTimeout(runner(t),0)}:(Zt=post,r.addEventListener("message",listener,!1)));var he,pe,ye,ge,de,ve,me,xe,be={set:oe,clear:ae},Se=b.f,we=be.set,ke=r.MutationObserver||r.WebKitMutationObserver,Ee=r.process,Pe=r.Promise,Ce="process"==classofRaw(Ee),Re=Se(r,"queueMicrotask"),Ae=Re&&Re.value;Ae||(he=function(){var t,r;for(Ce&&(t=Ee.domain)&&t.exit();pe;){r=pe.fn,pe=pe.next;try{r()}catch(t){throw pe?ge():ye=void 0,t}}ye=void 0,t&&t.enter()},Ce?ge=function(){Ee.nextTick(he)}:ke&&!ne?(de=!0,ve=document.createTextNode(""),new ke(he).observe(ve,{characterData:!0}),ge=function(){ve.data=de=!de}):Pe&&Pe.resolve?(me=Pe.resolve(void 0),xe=me.then,ge=function(){xe.call(me,he)}):ge=function(){we.call(r,he)});var _e,Te,Me,Ne,Oe=Ae||function(t){var r={fn:t,next:void 0};ye&&(ye.next=r),pe||(pe=r,ge()),ye=r},PromiseCapability=function(t){var r,i;this.promise=new t((function(t,o){if(void 0!==r||void 0!==i)throw TypeError("Bad Promise constructor");r=t,i=o})),this.resolve=aFunction$1(r),this.reject=aFunction$1(i)},De={f:function(t){return new PromiseCapability(t)}},promiseResolve=function(t,r){if(anObject(t),isObject(r)&&r.constructor===t)return r;var i=De.f(t);return(0,i.resolve)(r),i.promise},perform=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},$e=be.set,Ie=wellKnownSymbol("species"),Fe="Promise",Ve=W.get,Le=W.set,je=W.getterFor(Fe),Be=Lt,Ge=r.TypeError,ze=r.document,Ue=r.process,qe=getBuiltIn("fetch"),We=De.f,He=We,Xe="process"==classofRaw(Ue),Ye=!!(ze&&ze.createEvent&&r.dispatchEvent),Qe=ht(Fe,(function(){if(!(_(Be)!==String(Be))){if(66===Pt)return!0;if(!Xe&&"function"!=typeof PromiseRejectionEvent)return!0}if(Pt>=51&&/native code/.test(Be))return!1;var t=Be.resolve(1),FakePromise=function(t){t((function(){}),(function(){}))};return(t.constructor={})[Ie]=FakePromise,!(t.then((function(){}))instanceof FakePromise)})),Ke=Qe||!checkCorrectnessOfIteration((function(t){Be.all(t).catch((function(){}))})),isThenable=function(t){var r;return!(!isObject(t)||"function"!=typeof(r=t.then))&&r},notify$1=function(t,r,i){if(!r.notified){r.notified=!0;var o=r.reactions;Oe((function(){for(var a=r.value,u=1==r.state,l=0;o.length>l;){var h,p,y,g=o[l++],d=u?g.ok:g.fail,v=g.resolve,x=g.reject,b=g.domain;try{d?(u||(2===r.rejection&&onHandleUnhandled(t,r),r.rejection=1),!0===d?h=a:(b&&b.enter(),h=d(a),b&&(b.exit(),y=!0)),h===g.promise?x(Ge("Promise-chain cycle")):(p=isThenable(h))?p.call(h,v,x):v(h)):x(a)}catch(t){b&&!y&&b.exit(),x(t)}}r.reactions=[],r.notified=!1,i&&!r.rejection&&onUnhandled(t,r)}))}},dispatchEvent=function(t,i,o){var a,u;Ye?((a=ze.createEvent("Event")).promise=i,a.reason=o,a.initEvent(t,!1,!0),r.dispatchEvent(a)):a={promise:i,reason:o},(u=r["on"+t])?u(a):"unhandledrejection"===t&&function(t,i){var o=r.console;o&&o.error&&(1===arguments.length?o.error(t):o.error(t,i))}("Unhandled promise rejection",o)},onUnhandled=function(t,i){$e.call(r,(function(){var r,o=i.value;if(isUnhandled(i)&&(r=perform((function(){Xe?Ue.emit("unhandledRejection",o,t):dispatchEvent("unhandledrejection",t,o)})),i.rejection=Xe||isUnhandled(i)?2:1,r.error))throw r.value}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t,i){$e.call(r,(function(){Xe?Ue.emit("rejectionHandled",t):dispatchEvent("rejectionhandled",t,i.value)}))},bind=function(t,r,i,o){return function(a){t(r,i,a,o)}},internalReject=function(t,r,i,o){r.done||(r.done=!0,o&&(r=o),r.value=i,r.state=2,notify$1(t,r,!0))},internalResolve=function(t,r,i,o){if(!r.done){r.done=!0,o&&(r=o);try{if(t===i)throw Ge("Promise can't be resolved itself");var a=isThenable(i);a?Oe((function(){var o={done:!1};try{a.call(i,bind(internalResolve,t,o,r),bind(internalReject,t,o,r))}catch(i){internalReject(t,o,i,r)}})):(r.value=i,r.state=1,notify$1(t,r,!1))}catch(i){internalReject(t,{done:!1},i,r)}}};Qe&&(Be=function Promise(t){anInstance(this,Be,Fe),aFunction$1(t),_e.call(this);var r=Ve(this);try{t(bind(internalResolve,this,r),bind(internalReject,this,r))}catch(t){internalReject(this,r,t)}},(_e=function Promise(t){Le(this,{type:Fe,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=redefineAll(Be.prototype,{then:function then(t,r){var i=je(this),o=We(speciesConstructor(this,Be));return o.ok="function"!=typeof t||t,o.fail="function"==typeof r&&r,o.domain=Xe?Ue.domain:void 0,i.parent=!0,i.reactions.push(o),0!=i.state&&notify$1(this,i,!1),o.promise},catch:function(t){return this.then(void 0,t)}}),Te=function(){var t=new _e,r=Ve(t);this.promise=t,this.resolve=bind(internalResolve,t,r),this.reject=bind(internalReject,t,r)},De.f=We=function(t){return t===Be||t===Me?new Te(t):He(t)},"function"==typeof Lt&&(Ne=Lt.prototype.then,H(Lt.prototype,"then",(function then(t,r){var i=this;return new Be((function(t,r){Ne.call(i,t,r)})).then(t,r)}),{unsafe:!0}),"function"==typeof qe&&_export({global:!0,enumerable:!0,forced:!0},{fetch:function fetch(t){return promiseResolve(Be,qe.apply(r,arguments))}}))),_export({global:!0,wrap:!0,forced:Qe},{Promise:Be}),setToStringTag(Be,Fe,!1),setSpecies(Fe),Me=getBuiltIn(Fe),_export({target:Fe,stat:!0,forced:Qe},{reject:function reject(t){var r=We(this);return r.reject.call(void 0,t),r.promise}}),_export({target:Fe,stat:!0,forced:Qe},{resolve:function resolve(t){return promiseResolve(this,t)}}),_export({target:Fe,stat:!0,forced:Ke},{all:function all(t){var r=this,i=We(r),o=i.resolve,a=i.reject,u=perform((function(){var i=aFunction$1(r.resolve),u=[],l=0,h=1;Ht(t,(function(t){var p=l++,y=!1;u.push(void 0),h++,i.call(r,t).then((function(t){y||(y=!0,u[p]=t,--h||o(u))}),a)})),--h||o(u)}));return u.error&&a(u.value),i.promise},race:function race(t){var r=this,i=We(r),o=i.reject,a=perform((function(){var a=aFunction$1(r.resolve);Ht(t,(function(t){a.call(r,t).then(i.resolve,o)}))}));return a.error&&o(a.value),i.promise}});var regexpFlags=function(){var t=anObject(this),r="";return t.global&&(r+="g"),t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.dotAll&&(r+="s"),t.unicode&&(r+="u"),t.sticky&&(r+="y"),r};function RE(t,r){return RegExp(t,r)}var Ze,Je,tr={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")}))},er=RegExp.prototype.exec,rr=String.prototype.replace,nr=er,ir=(Ze=/a/,Je=/b*/g,er.call(Ze,"a"),er.call(Je,"a"),0!==Ze.lastIndex||0!==Je.lastIndex),or=tr.UNSUPPORTED_Y||tr.BROKEN_CARET,ar=void 0!==/()??/.exec("")[1];(ir||ar||or)&&(nr=function exec(t){var r,i,o,a,u=this,l=or&&u.sticky,h=regexpFlags.call(u),p=u.source,y=0,g=t;return l&&(-1===(h=h.replace("y","")).indexOf("g")&&(h+="g"),g=String(t).slice(u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==t[u.lastIndex-1])&&(p="(?: "+p+")",g=" "+g,y++),i=new RegExp("^(?:"+p+")",h)),ar&&(i=new RegExp("^"+p+"$(?!\\s)",h)),ir&&(r=u.lastIndex),o=er.call(l?i:u,g),l?o?(o.input=o.input.slice(y),o[0]=o[0].slice(y),o.index=u.lastIndex,u.lastIndex+=o[0].length):u.lastIndex=0:ir&&o&&(u.lastIndex=u.global?o.index+o[0].length:r),ar&&o&&o.length>1&&rr.call(o[0],i,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(o[a]=void 0)})),o});var ur=nr;_export({target:"RegExp",proto:!0,forced:/./.exec!==ur},{exec:ur});var sr=wellKnownSymbol("species"),cr=!fails((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),lr="$0"==="a".replace(/./,"$0"),fr=wellKnownSymbol("replace"),hr=!!/./[fr]&&""===/./[fr]("a","$0"),pr=!fails((function(){var t=/(?:)/,r=t.exec;t.exec=function(){return r.apply(this,arguments)};var i="ab".split(t);return 2!==i.length||"a"!==i[0]||"b"!==i[1]})),fixRegexpWellKnownSymbolLogic=function(t,r,i,o){var a=wellKnownSymbol(t),u=!fails((function(){var r={};return r[a]=function(){return 7},7!=""[t](r)})),l=u&&!fails((function(){var r=!1,i=/a/;return"split"===t&&((i={}).constructor={},i.constructor[sr]=function(){return i},i.flags="",i[a]=/./[a]),i.exec=function(){return r=!0,null},i[a](""),!r}));if(!u||!l||"replace"===t&&(!cr||!lr||hr)||"split"===t&&!pr){var h=/./[a],p=i(a,""[t],(function(t,r,i,o,a){return r.exec===ur?u&&!a?{done:!0,value:h.call(r,i,o)}:{done:!0,value:t.call(i,r,o)}:{done:!1}}),{REPLACE_KEEPS_$0:lr,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:hr}),y=p[0],g=p[1];H(String.prototype,t,y),H(RegExp.prototype,a,2==r?function(t,r){return g.call(t,this,r)}:function(t){return g.call(t,this)})}o&&k(RegExp.prototype[a],"sham",!0)},createMethod$1=function(t){return function(r,i){var o,a,u=String(requireObjectCoercible(r)),l=toInteger(i),h=u.length;return l<0||l>=h?t?"":void 0:(o=u.charCodeAt(l))<55296||o>56319||l+1===h||(a=u.charCodeAt(l+1))<56320||a>57343?t?u.charAt(l):o:t?u.slice(l,l+2):a-56320+(o-55296<<10)+65536}},yr={codeAt:createMethod$1(!1),charAt:createMethod$1(!0)},gr=yr.charAt,advanceStringIndex=function(t,r,i){return r+(i?gr(t,r).length:1)},regexpExecAbstract=function(t,r){var i=t.exec;if("function"==typeof i){var o=i.call(t,r);if("object"!=typeof o)throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==classofRaw(t))throw TypeError("RegExp#exec called on incompatible receiver");return ur.call(t,r)},dr=Math.max,vr=Math.min,mr=Math.floor,xr=/\$([$&'`]|\d\d?|<[^>]*>)/g,br=/\$([$&'`]|\d\d?)/g;fixRegexpWellKnownSymbolLogic("replace",2,(function(t,r,i,o){var a=o.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,u=o.REPLACE_KEEPS_$0,l=a?"$":"$0";return[function replace(i,o){var a=requireObjectCoercible(this),u=null==i?void 0:i[t];return void 0!==u?u.call(i,a,o):r.call(String(a),i,o)},function(t,o){if(!a&&u||"string"==typeof o&&-1===o.indexOf(l)){var h=i(r,t,this,o);if(h.done)return h.value}var p=anObject(t),y=String(this),g="function"==typeof o;g||(o=String(o));var d=p.global;if(d){var v=p.unicode;p.lastIndex=0}for(var x=[];;){var b=regexpExecAbstract(p,y);if(null===b)break;if(x.push(b),!d)break;""===String(b[0])&&(p.lastIndex=advanceStringIndex(y,toLength(p.lastIndex),v))}for(var S,w="",k=0,E=0;E<x.length;E++){b=x[E];for(var P=String(b[0]),C=dr(vr(toInteger(b.index),y.length),0),R=[],A=1;A<b.length;A++)R.push(void 0===(S=b[A])?S:String(S));var _=b.groups;if(g){var T=[P].concat(R,C,y);void 0!==_&&T.push(_);var M=String(o.apply(void 0,T))}else M=getSubstitution(P,y,C,R,_,o);C>=k&&(w+=y.slice(k,C)+M,k=C+P.length)}return w+y.slice(k)}];function getSubstitution(t,i,o,a,u,l){var h=o+t.length,p=a.length,y=br;return void 0!==u&&(u=toObject(u),y=xr),r.call(l,y,(function(r,l){var y;switch(l.charAt(0)){case"$":return"$";case"&":return t;case"`":return i.slice(0,o);case"'":return i.slice(h);case"<":y=u[l.slice(1,-1)];break;default:var g=+l;if(0===g)return r;if(g>p){var d=mr(g/10);return 0===d?r:d<=p?void 0===a[d-1]?l.charAt(1):a[d-1]+l.charAt(1):r}y=a[g-1]}return void 0===y?"":y}))}}));var Sr="\t\n\v\f\r    \u2028\u2029\ufeff",wr="["+Sr+"]",kr=RegExp("^"+wr+wr+"*"),Er=RegExp(wr+wr+"*$"),createMethod$2=function(t){return function(r){var i=String(requireObjectCoercible(r));return 1&t&&(i=i.replace(kr,"")),2&t&&(i=i.replace(Er,"")),i}},Pr={start:createMethod$2(1),end:createMethod$2(2),trim:createMethod$2(3)},Cr=Pr.trim;_export({target:"String",proto:!0,forced:function(t){return fails((function(){return!!Sr[t]()||"…"!="…"[t]()||Sr[t].name!==t}))}("trim")},{trim:function trim(){return Cr(this)}});var Rr,Ar=Object.keys||function keys(t){return objectKeysInternal(t,rt)},_r=i?Object.defineProperties:function defineProperties(t,r){anObject(t);for(var i,o=Ar(r),a=o.length,u=0;a>u;)w.f(t,i=o[u++],r[i]);return t},Tr=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"<\/script>"},NullProtoObject=function(){try{Rr=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,r;NullProtoObject=Rr?function(t){t.write(scriptTag("")),t.close();var r=t.parentWindow.Object;return t=null,r}(Rr):((r=documentCreateElement("iframe")).style.display="none",re.appendChild(r),r.src=String("javascript:"),(t=r.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F);for(var i=rt.length;i--;)delete NullProtoObject.prototype[rt[i]];return NullProtoObject()};I[Tr]=!0;var Mr=Object.create||function create(t,r){var i;return null!==t?(EmptyConstructor.prototype=anObject(t),i=new EmptyConstructor,EmptyConstructor.prototype=null,i[Tr]=t):i=NullProtoObject(),void 0===r?i:_r(i,r)},Nr=it.f,Or={}.toString,Dr="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],$r={f:function getOwnPropertyNames(t){return Dr&&"[object Window]"==Or.call(t)?function(t){try{return Nr(t)}catch(t){return Dr.slice()}}(t):Nr(toIndexedObject(t))}},Ir={f:wellKnownSymbol},Fr=w.f,defineWellKnownSymbol=function(t){var r=X.Symbol||(X.Symbol={});has(r,t)||Fr(r,t,{value:Ir.f(t)})},Vr=[].push,createMethod$3=function(t){var r=1==t,i=2==t,o=3==t,a=4==t,u=6==t,l=5==t||u;return function(h,y,g,d){for(var v,x,b=toObject(h),S=p(b),w=functionBindContext(y,g,3),k=toLength(S.length),E=0,P=d||arraySpeciesCreate,C=r?P(h,k):i?P(h,0):void 0;k>E;E++)if((l||E in S)&&(x=w(v=S[E],E,b),t))if(r)C[E]=x;else if(x)switch(t){case 3:return!0;case 5:return v;case 6:return E;case 2:Vr.call(C,v)}else if(a)return!1;return u?-1:o||a?a:C}},Lr={forEach:createMethod$3(0),map:createMethod$3(1),filter:createMethod$3(2),some:createMethod$3(3),every:createMethod$3(4),find:createMethod$3(5),findIndex:createMethod$3(6)},jr=Lr.forEach,Br=sharedKey("hidden"),Gr=wellKnownSymbol("toPrimitive"),zr=W.set,Ur=W.getterFor("Symbol"),qr=Object.prototype,Wr=r.Symbol,Hr=getBuiltIn("JSON","stringify"),Xr=b.f,Yr=w.f,Qr=$r.f,Kr=u.f,Zr=N("symbols"),Jr=N("op-symbols"),tn=N("string-to-symbol-registry"),en=N("symbol-to-string-registry"),rn=N("wks"),nn=r.QObject,on=!nn||!nn.prototype||!nn.prototype.findChild,an=i&&fails((function(){return 7!=Mr(Yr({},"a",{get:function(){return Yr(this,"a",{value:7}).a}})).a}))?function(t,r,i){var o=Xr(qr,r);o&&delete qr[r],Yr(t,r,i),o&&t!==qr&&Yr(qr,r,o)}:Yr,wrap=function(t,r){var o=Zr[t]=Mr(Wr.prototype);return zr(o,{type:"Symbol",tag:t,description:r}),i||(o.description=r),o},un=dt?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof Wr},sn=function defineProperty(t,r,i){t===qr&&sn(Jr,r,i),anObject(t);var o=toPrimitive(r,!0);return anObject(i),has(Zr,o)?(i.enumerable?(has(t,Br)&&t[Br][o]&&(t[Br][o]=!1),i=Mr(i,{enumerable:createPropertyDescriptor(0,!1)})):(has(t,Br)||Yr(t,Br,createPropertyDescriptor(1,{})),t[Br][o]=!0),an(t,o,i)):Yr(t,o,i)},cn=function defineProperties(t,r){anObject(t);var o=toIndexedObject(r),a=Ar(o).concat(pn(o));return jr(a,(function(r){i&&!ln.call(o,r)||sn(t,r,o[r])})),t},ln=function propertyIsEnumerable(t){var r=toPrimitive(t,!0),i=Kr.call(this,r);return!(this===qr&&has(Zr,r)&&!has(Jr,r))&&(!(i||!has(this,r)||!has(Zr,r)||has(this,Br)&&this[Br][r])||i)},fn=function getOwnPropertyDescriptor(t,r){var i=toIndexedObject(t),o=toPrimitive(r,!0);if(i!==qr||!has(Zr,o)||has(Jr,o)){var a=Xr(i,o);return!a||!has(Zr,o)||has(i,Br)&&i[Br][o]||(a.enumerable=!0),a}},hn=function getOwnPropertyNames(t){var r=Qr(toIndexedObject(t)),i=[];return jr(r,(function(t){has(Zr,t)||has(I,t)||i.push(t)})),i},pn=function getOwnPropertySymbols(t){var r=t===qr,i=Qr(r?Jr:toIndexedObject(t)),o=[];return jr(i,(function(t){!has(Zr,t)||r&&!has(qr,t)||o.push(Zr[t])})),o};if(gt||(H((Wr=function Symbol(){if(this instanceof Wr)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,r=uid(t),setter=function(t){this===qr&&setter.call(Jr,t),has(this,Br)&&has(this[Br],r)&&(this[Br][r]=!1),an(this,r,createPropertyDescriptor(1,t))};return i&&on&&an(qr,r,{configurable:!0,set:setter}),wrap(r,t)}).prototype,"toString",(function toString(){return Ur(this).tag})),H(Wr,"withoutSetter",(function(t){return wrap(uid(t),t)})),u.f=ln,w.f=sn,b.f=fn,it.f=$r.f=hn,ot.f=pn,Ir.f=function(t){return wrap(wellKnownSymbol(t),t)},i&&(Yr(Wr.prototype,"description",{configurable:!0,get:function description(){return Ur(this).description}}),H(qr,"propertyIsEnumerable",ln,{unsafe:!0}))),_export({global:!0,wrap:!0,forced:!gt,sham:!gt},{Symbol:Wr}),jr(Ar(rn),(function(t){defineWellKnownSymbol(t)})),_export({target:"Symbol",stat:!0,forced:!gt},{for:function(t){var r=String(t);if(has(tn,r))return tn[r];var i=Wr(r);return tn[r]=i,en[i]=r,i},keyFor:function keyFor(t){if(!un(t))throw TypeError(t+" is not a symbol");if(has(en,t))return en[t]},useSetter:function(){on=!0},useSimple:function(){on=!1}}),_export({target:"Object",stat:!0,forced:!gt,sham:!i},{create:function create(t,r){return void 0===r?Mr(t):cn(Mr(t),r)},defineProperty:sn,defineProperties:cn,getOwnPropertyDescriptor:fn}),_export({target:"Object",stat:!0,forced:!gt},{getOwnPropertyNames:hn,getOwnPropertySymbols:pn}),_export({target:"Object",stat:!0,forced:fails((function(){ot.f(1)}))},{getOwnPropertySymbols:function getOwnPropertySymbols(t){return ot.f(toObject(t))}}),Hr){var yn=!gt||fails((function(){var t=Wr();return"[null]"!=Hr([t])||"{}"!=Hr({a:t})||"{}"!=Hr(Object(t))}));_export({target:"JSON",stat:!0,forced:yn},{stringify:function stringify(t,r,i){for(var o,a=[t],u=1;arguments.length>u;)a.push(arguments[u++]);if(o=r,(isObject(r)||void 0!==t)&&!un(t))return yt(r)||(r=function(t,r){if("function"==typeof o&&(r=o.call(this,t,r)),!un(r))return r}),a[1]=r,Hr.apply(null,a)}})}Wr.prototype[Gr]||k(Wr.prototype,Gr,Wr.prototype.valueOf),setToStringTag(Wr,"Symbol"),I[Br]=!0;var gn=w.f,dn=r.Symbol;if(i&&"function"==typeof dn&&(!("description"in dn.prototype)||void 0!==dn().description)){var vn={},mn=function Symbol(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),r=this instanceof mn?new dn(t):void 0===t?dn():dn(t);return""===t&&(vn[r]=!0),r};copyConstructorProperties(mn,dn);var xn=mn.prototype=dn.prototype;xn.constructor=mn;var bn=xn.toString,Sn="Symbol(test)"==String(dn("test")),wn=/^Symbol\((.*)\)[^)]+$/;gn(xn,"description",{configurable:!0,get:function description(){var t=isObject(this)?this.valueOf():this,r=bn.call(t);if(has(vn,t))return"";var i=Sn?r.slice(7,-1):r.replace(wn,"$1");return""===i?void 0:i}}),_export({global:!0,forced:!0},{Symbol:mn})}defineWellKnownSymbol("asyncIterator"),defineWellKnownSymbol("iterator"),defineWellKnownSymbol("toStringTag");var kn=Object.defineProperty,En={},thrower=function(t){throw t},arrayMethodUsesToLength=function(t,r){if(has(En,t))return En[t];r||(r={});var o=[][t],a=!!has(r,"ACCESSORS")&&r.ACCESSORS,u=has(r,0)?r[0]:thrower,l=has(r,1)?r[1]:void 0;return En[t]=!!o&&!fails((function(){if(a&&!i)return!0;var t={length:-1};a?kn(t,1,{enumerable:!0,get:thrower}):t[1]=1,o.call(t,u,l)}))},Pn=Lr.forEach,Cn=arrayMethodIsStrict("forEach"),Rn=arrayMethodUsesToLength("forEach"),An=Cn&&Rn?[].forEach:function forEach(t){return Pn(this,t,arguments.length>1?arguments[1]:void 0)};_export({target:"Array",proto:!0,forced:[].forEach!=An},{forEach:An});var _n=wellKnownSymbol("unscopables"),Tn=Array.prototype;null==Tn[_n]&&w.f(Tn,_n,{configurable:!0,value:Mr(null)});var Mn,Nn,On,addToUnscopables=function(t){Tn[_n][t]=!0},Dn=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})),$n=sharedKey("IE_PROTO"),In=Object.prototype,Fn=Dn?Object.getPrototypeOf:function(t){return t=toObject(t),has(t,$n)?t[$n]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?In:null},Vn=wellKnownSymbol("iterator"),Ln=!1;[].keys&&("next"in(On=[].keys())?(Nn=Fn(Fn(On)))!==Object.prototype&&(Mn=Nn):Ln=!0),null==Mn&&(Mn={}),has(Mn,Vn)||k(Mn,Vn,(function(){return this}));var jn={IteratorPrototype:Mn,BUGGY_SAFARI_ITERATORS:Ln},Bn=jn.IteratorPrototype,returnThis$1=function(){return this},Gn=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,i={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(i,[]),r=i instanceof Array}catch(t){}return function setPrototypeOf(i,o){return anObject(i),function(t){if(!isObject(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype")}(o),r?t.call(i,o):i.__proto__=o,i}}():void 0),zn=jn.IteratorPrototype,Un=jn.BUGGY_SAFARI_ITERATORS,qn=wellKnownSymbol("iterator"),returnThis$2=function(){return this},defineIterator=function(t,r,i,o,a,u,l){!function(t,r,i){var o=r+" Iterator";t.prototype=Mr(Bn,{next:createPropertyDescriptor(1,i)}),setToStringTag(t,o,!1),zt[o]=returnThis$1}(i,r,o);var h,p,y,getIterationMethod=function(t){if(t===a&&b)return b;if(!Un&&t in v)return v[t];switch(t){case"keys":return function keys(){return new i(this,t)};case"values":return function values(){return new i(this,t)};case"entries":return function entries(){return new i(this,t)}}return function(){return new i(this)}},g=r+" Iterator",d=!1,v=t.prototype,x=v[qn]||v["@@iterator"]||a&&v[a],b=!Un&&x||getIterationMethod(a),S="Array"==r&&v.entries||x;if(S&&(h=Fn(S.call(new t)),zn!==Object.prototype&&h.next&&(Fn(h)!==zn&&(Gn?Gn(h,zn):"function"!=typeof h[qn]&&k(h,qn,returnThis$2)),setToStringTag(h,g,!0))),"values"==a&&x&&"values"!==x.name&&(d=!0,b=function values(){return x.call(this)}),v[qn]!==b&&k(v,qn,b),zt[r]=b,a)if(p={values:getIterationMethod("values"),keys:u?b:getIterationMethod("keys"),entries:getIterationMethod("entries")},l)for(y in p)(Un||d||!(y in v))&&H(v,y,p[y]);else _export({target:r,proto:!0,forced:Un||d},p);return p},Wn=W.set,Hn=W.getterFor("Array Iterator"),Xn=defineIterator(Array,"Array",(function(t,r){Wn(this,{type:"Array Iterator",target:toIndexedObject(t),index:0,kind:r})}),(function(){var t=Hn(this),r=t.target,i=t.kind,o=t.index++;return!r||o>=r.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:o,done:!1}:"values"==i?{value:r[o],done:!1}:{value:[o,r[o]],done:!1}}),"values");zt.Arguments=zt.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries");var Yn=[].reverse,Qn=[1,2];_export({target:"Array",proto:!0,forced:String(Qn)===String(Qn.reverse())},{reverse:function reverse(){return yt(this)&&(this.length=this.length),Yn.call(this)}});var Kn=arrayMethodHasSpeciesSupport("slice"),Zn=arrayMethodUsesToLength("slice",{ACCESSORS:!0,0:0,1:2}),Jn=wellKnownSymbol("species"),ti=[].slice,ei=Math.max;_export({target:"Array",proto:!0,forced:!Kn||!Zn},{slice:function slice(t,r){var i,o,a,u=toIndexedObject(this),l=toLength(u.length),h=toAbsoluteIndex(t,l),p=toAbsoluteIndex(void 0===r?l:r,l);if(yt(u)&&("function"!=typeof(i=u.constructor)||i!==Array&&!yt(i.prototype)?isObject(i)&&null===(i=i[Jn])&&(i=void 0):i=void 0,i===Array||void 0===i))return ti.call(u,h,p);for(o=new(void 0===i?Array:i)(ei(p-h,0)),a=0;h<p;h++,a++)h in u&&createProperty(o,a,u[h]);return o.length=a,o}});var ri=Date.prototype,ni=ri.toString,ii=ri.getTime;new Date(NaN)+""!="Invalid Date"&&H(ri,"toString",(function toString(){var t=ii.call(this);return t==t?ni.call(this):"Invalid Date"}));var oi=w.f,ai=Function.prototype,ui=ai.toString,si=/^\s*function ([^ (]*)/;i&&!("name"in ai)&&oi(ai,"name",{configurable:!0,get:function(){try{return ui.call(this).match(si)[1]}catch(t){return""}}}),setToStringTag(r.JSON,"JSON",!0),setToStringTag(Math,"Math",!0),_export({target:"Object",stat:!0,sham:!i},{create:Mr}),_export({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperty:w.f});var ci=fails((function(){Fn(1)}));_export({target:"Object",stat:!0,forced:ci,sham:!Dn},{getPrototypeOf:function getPrototypeOf(t){return Fn(toObject(t))}}),_export({target:"Object",stat:!0},{setPrototypeOf:Gn});var li=RegExp.prototype,fi=li.toString,hi=fails((function(){return"/a/b"!=fi.call({source:"a",flags:"b"})})),pi="toString"!=fi.name;(hi||pi)&&H(RegExp.prototype,"toString",(function toString(){var t=anObject(this),r=String(t.source),i=t.flags;return"/"+r+"/"+String(void 0===i&&t instanceof RegExp&&!("flags"in li)?regexpFlags.call(t):i)}),{unsafe:!0});var yi=yr.charAt,gi=W.set,di=W.getterFor("String Iterator");defineIterator(String,"String",(function(t){gi(this,{type:"String Iterator",string:String(t),index:0})}),(function next(){var t,r=di(this),i=r.string,o=r.index;return o>=i.length?{value:void 0,done:!0}:(t=yi(i,o),r.index+=t.length,{value:t,done:!1})}));var vi={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var mi in vi){var xi=r[mi],bi=xi&&xi.prototype;if(bi&&bi.forEach!==An)try{k(bi,"forEach",An)}catch(t){bi.forEach=An}}var Si=wellKnownSymbol("iterator"),wi=wellKnownSymbol("toStringTag"),ki=Xn.values;for(var Ei in vi){var Pi=r[Ei],Ci=Pi&&Pi.prototype;if(Ci){if(Ci[Si]!==ki)try{k(Ci,Si,ki)}catch(t){Ci[Si]=ki}if(Ci[wi]||k(Ci,wi,Ei),vi[Ei])for(var Ri in Xn)if(Ci[Ri]!==Xn[Ri])try{k(Ci,Ri,Xn[Ri])}catch(t){Ci[Ri]=Xn[Ri]}}}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,r,i,o,a,u,l){try{var h=t[u](l),p=h.value}catch(t){return void i(t)}h.done?r(p):Promise.resolve(p).then(o,a)}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var u=t.apply(r,i);function _next(t){asyncGeneratorStep(u,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,o,a,_next,_throw,"throw",t)}_next(void 0)}))}}var Ai=createCommonjsModule((function(t){var r=function(t){var r,i=Object.prototype,o=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",h=a.toStringTag||"@@toStringTag";function define(t,r,i){return Object.defineProperty(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{define({},"")}catch(t){define=function define(t,r,i){return t[r]=i}}function wrap(t,r,i,o){var a=r&&r.prototype instanceof Generator?r:Generator,u=Object.create(a.prototype),l=new Context(o||[]);return u._invoke=function makeInvokeMethod(t,r,i){var o=p;return function invoke(a,u){if(o===g)throw new Error("Generator is already running");if(o===d){if("throw"===a)throw u;return doneResult()}for(i.method=a,i.arg=u;;){var l=i.delegate;if(l){var h=maybeInvokeDelegate(l,i);if(h){if(h===v)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===p)throw o=d,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=g;var x=tryCatch(t,r,i);if("normal"===x.type){if(o=i.done?d:y,x.arg===v)continue;return{value:x.arg,done:i.done}}"throw"===x.type&&(o=d,i.method="throw",i.arg=x.arg)}}}(t,i,l),u}function tryCatch(t,r,i){try{return{type:"normal",arg:t.call(r,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=wrap;var p="suspendedStart",y="suspendedYield",g="executing",d="completed",v={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var x={};x[u]=function(){return this};var b=Object.getPrototypeOf,S=b&&b(b(values([])));S&&S!==i&&o.call(S,u)&&(x=S);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(x);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}function AsyncIterator(t,r){var i;this._invoke=function enqueue(a,u){function callInvokeWithMethodAndArg(){return new r((function(i,l){!function invoke(i,a,u,l){var h=tryCatch(t[i],t,a);if("throw"!==h.type){var p=h.arg,y=p.value;return y&&"object"===_typeof(y)&&o.call(y,"__await")?r.resolve(y.__await).then((function(t){invoke("next",t,u,l)}),(function(t){invoke("throw",t,u,l)})):r.resolve(y).then((function(t){p.value=t,u(p)}),(function(t){return invoke("throw",t,u,l)}))}l(h.arg)}(a,u,i,l)}))}return i=i?i.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,i){var o=t.iterator[i.method];if(o===r){if(i.delegate=null,"throw"===i.method){if(t.iterator.return&&(i.method="return",i.arg=r,maybeInvokeDelegate(t,i),"throw"===i.method))return v;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var a=tryCatch(o,t.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,v;var u=a.arg;return u?u.done?(i[t.resultName]=u.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=r),i.delegate=null,v):u:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,v)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var i=t[u];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,l=function next(){for(;++a<t.length;)if(o.call(t,a))return next.value=t[a],next.done=!1,next;return next.value=r,next.done=!0,next};return l.next=l}}return{next:doneResult}}function doneResult(){return{value:r,done:!0}}return GeneratorFunction.prototype=w.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunction.displayName=define(GeneratorFunctionPrototype,h,"GeneratorFunction"),t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,h,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[l]=function(){return this},t.AsyncIterator=AsyncIterator,t.async=function(r,i,o,a,u){void 0===u&&(u=Promise);var l=new AsyncIterator(wrap(r,i,o,a),u);return t.isGeneratorFunction(i)?l:l.next().then((function(t){return t.done?t.value:l.next()}))},defineIteratorMethods(w),define(w,h,"Generator"),w[u]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var r=[];for(var i in t)r.push(i);return r.reverse(),function next(){for(;r.length;){var i=r.pop();if(i in t)return next.value=i,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=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(resetTryEntry),!t)for(var i in this)"t"===i.charAt(0)&&o.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=r)},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 i=this;function handle(o,a){return l.type="throw",l.arg=t,i.next=o,a&&(i.method="next",i.arg=r),!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],l=u.completion;if("root"===u.tryLoc)return handle("end");if(u.tryLoc<=this.prev){var h=o.call(u,"catchLoc"),p=o.call(u,"finallyLoc");if(h&&p){if(this.prev<u.catchLoc)return handle(u.catchLoc,!0);if(this.prev<u.finallyLoc)return handle(u.finallyLoc)}else if(h){if(this.prev<u.catchLoc)return handle(u.catchLoc,!0)}else{if(!p)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return handle(u.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&o.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var u=a;break}}u&&("break"===t||"continue"===t)&&u.tryLoc<=r&&r<=u.finallyLoc&&(u=null);var l=u?u.completion:{};return l.type=t,l.arg=r,u?(this.method="next",this.next=u.finallyLoc,v):this.complete(l)},complete:function complete(t,r){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&&r&&(this.next=r),v},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),resetTryEntry(i),v}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc===t){var o=i.completion;if("throw"===o.type){var a=o.arg;resetTryEntry(i)}return a}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,i,o){return this.delegate={iterator:values(t),resultName:i,nextLoc:o},"next"===this.method&&(this.arg=r),v}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}})),_i="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var Ti=defaultSetTimout,Mi=defaultClearTimeout;function runTimeout(t){if(Ti===setTimeout)return setTimeout(t,0);if((Ti===defaultSetTimout||!Ti)&&setTimeout)return Ti=setTimeout,setTimeout(t,0);try{return Ti(t,0)}catch(r){try{return Ti.call(null,t,0)}catch(r){return Ti.call(this,t,0)}}}"function"==typeof _i.setTimeout&&(Ti=setTimeout),"function"==typeof _i.clearTimeout&&(Mi=clearTimeout);var Ni,Oi=[],Di=!1,$i=-1;function cleanUpNextTick(){Di&&Ni&&(Di=!1,Ni.length?Oi=Ni.concat(Oi):$i=-1,Oi.length&&drainQueue())}function drainQueue(){if(!Di){var t=runTimeout(cleanUpNextTick);Di=!0;for(var r=Oi.length;r;){for(Ni=Oi,Oi=[];++$i<r;)Ni&&Ni[$i].run();$i=-1,r=Oi.length}Ni=null,Di=!1,function runClearTimeout(t){if(Mi===clearTimeout)return clearTimeout(t);if((Mi===defaultClearTimeout||!Mi)&&clearTimeout)return Mi=clearTimeout,clearTimeout(t);try{return Mi(t)}catch(r){try{return Mi.call(null,t)}catch(r){return Mi.call(this,t)}}}(t)}}function Item(t,r){this.fun=t,this.array=r}Item.prototype.run=function(){this.fun.apply(null,this.array)};function noop(){}var Ii=noop,Fi=noop,Vi=noop,Li=noop,ji=noop,Bi=noop,Gi=noop;var zi=_i.performance||{},Ui=zi.now||zi.mozNow||zi.msNow||zi.oNow||zi.webkitNow||function(){return(new Date).getTime()};var qi=new Date;var Wi={nextTick:function nextTick(t){var r=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)r[i-1]=arguments[i];Oi.push(new Item(t,r)),1!==Oi.length||Di||runTimeout(drainQueue)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Ii,addListener:Fi,once:Vi,off:Li,removeListener:ji,removeAllListeners:Bi,emit:Gi,binding:function binding(t){throw new Error("process.binding is not supported")},cwd:function cwd(){return"/"},chdir:function chdir(t){throw new Error("process.chdir is not supported")},umask:function umask(){return 0},hrtime:function hrtime(t){var r=.001*Ui.call(zi),i=Math.floor(r),o=Math.floor(r%1*1e9);return t&&(i-=t[0],(o-=t[1])<0&&(i--,o+=1e9)),[i,o]},platform:"browser",release:{},config:{},uptime:function uptime(){return(new Date-qi)/1e3}},Hi=Lr.every,Xi=arrayMethodIsStrict("every"),Yi=arrayMethodUsesToLength("every");_export({target:"Array",proto:!0,forced:!Xi||!Yi},{every:function every(t){return Hi(this,t,arguments.length>1?arguments[1]:void 0)}});_export({target:"Array",proto:!0},{fill:function fill(t){for(var r=toObject(this),i=toLength(r.length),o=arguments.length,a=toAbsoluteIndex(o>1?arguments[1]:void 0,i),u=o>2?arguments[2]:void 0,l=void 0===u?i:toAbsoluteIndex(u,i);l>a;)r[a++]=t;return r}}),addToUnscopables("fill");var Qi=Lr.filter,Ki=arrayMethodHasSpeciesSupport("filter"),Zi=arrayMethodUsesToLength("filter");_export({target:"Array",proto:!0,forced:!Ki||!Zi},{filter:function filter(t){return Qi(this,t,arguments.length>1?arguments[1]:void 0)}});var Ji=!checkCorrectnessOfIteration((function(t){Array.from(t)}));_export({target:"Array",stat:!0,forced:Ji},{from:function from(t){var r,i,o,a,u,l,h=toObject(t),p="function"==typeof this?this:Array,y=arguments.length,g=y>1?arguments[1]:void 0,d=void 0!==g,v=getIteratorMethod(h),x=0;if(d&&(g=functionBindContext(g,y>2?arguments[2]:void 0,2)),null==v||p==Array&&isArrayIteratorMethod(v))for(i=new p(r=toLength(h.length));r>x;x++)l=d?g(h[x],x):h[x],createProperty(i,x,l);else for(u=(a=v.call(h)).next,i=new p;!(o=u.call(a)).done;x++)l=d?callWithSafeIterationClosing(a,g,[o.value,x],!0):o.value,createProperty(i,x,l);return i.length=x,i}});var to=tt.includes,eo=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:!eo},{includes:function includes(t){return to(this,t,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("includes");var ro=tt.indexOf,no=[].indexOf,io=!!no&&1/[1].indexOf(1,-0)<0,oo=arrayMethodIsStrict("indexOf"),ao=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:io||!oo||!ao},{indexOf:function indexOf(t){return io?no.apply(this,arguments)||0:ro(this,t,arguments.length>1?arguments[1]:void 0)}}),_export({target:"Array",stat:!0},{isArray:yt});var uo=Lr.map,so=arrayMethodHasSpeciesSupport("map"),co=arrayMethodUsesToLength("map");_export({target:"Array",proto:!0,forced:!so||!co},{map:function map(t){return uo(this,t,arguments.length>1?arguments[1]:void 0)}});var createMethod$4=function(t){return function(r,i,o,a){aFunction$1(i);var u=toObject(r),l=p(u),h=toLength(u.length),y=t?h-1:0,g=t?-1:1;if(o<2)for(;;){if(y in l){a=l[y],y+=g;break}if(y+=g,t?y<0:h<=y)throw TypeError("Reduce of empty array with no initial value")}for(;t?y>=0:h>y;y+=g)y in l&&(a=i(a,l[y],y,u));return a}},lo={left:createMethod$4(!1),right:createMethod$4(!0)}.left,fo=arrayMethodIsStrict("reduce"),ho=arrayMethodUsesToLength("reduce",{1:0});_export({target:"Array",proto:!0,forced:!fo||!ho},{reduce:function reduce(t){return lo(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}});var po=Lr.some,yo=arrayMethodIsStrict("some"),go=arrayMethodUsesToLength("some");_export({target:"Array",proto:!0,forced:!yo||!go},{some:function some(t){return po(this,t,arguments.length>1?arguments[1]:void 0)}}),_export({target:"Date",stat:!0},{now:function now(){return(new Date).getTime()}});var vo=[].slice,mo={},construct=function(t,r,i){if(!(r in mo)){for(var o=[],a=0;a<r;a++)o[a]="a["+a+"]";mo[r]=Function("C,a","return new C("+o.join(",")+")")}return mo[r](t,i)},xo=Function.bind||function bind(t){var r=aFunction$1(this),i=vo.call(arguments,1),o=function bound(){var a=i.concat(vo.call(arguments));return this instanceof o?construct(r,a.length,a):r.apply(t,a)};return isObject(r.prototype)&&(o.prototype=r.prototype),o};_export({target:"Function",proto:!0},{bind:xo});var bo=!fails((function(){return Object.isExtensible(Object.preventExtensions({}))})),So=createCommonjsModule((function(t){var r=w.f,i=uid("meta"),o=0,a=Object.isExtensible||function(){return!0},setMetadata=function(t){r(t,i,{value:{objectID:"O"+ ++o,weakData:{}}})},u=t.exports={REQUIRED:!1,fastKey:function(t,r){if(!isObject(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!has(t,i)){if(!a(t))return"F";if(!r)return"E";setMetadata(t)}return t[i].objectID},getWeakData:function(t,r){if(!has(t,i)){if(!a(t))return!0;if(!r)return!1;setMetadata(t)}return t[i].weakData},onFreeze:function(t){return bo&&u.REQUIRED&&a(t)&&!has(t,i)&&setMetadata(t),t}};I[i]=!0})),inheritIfRequired=function(t,r,i){var o,a;return Gn&&"function"==typeof(o=r.constructor)&&o!==i&&isObject(a=o.prototype)&&a!==i.prototype&&Gn(t,a),t},wo=w.f,ko=So.fastKey,Eo=W.set,Po=W.getterFor,Co=(function(t,i,o){var a=-1!==t.indexOf("Map"),u=-1!==t.indexOf("Weak"),l=a?"set":"add",h=r[t],p=h&&h.prototype,y=h,g={},fixMethod=function(t){var r=p[t];H(p,t,"add"==t?function add(t){return r.call(this,0===t?0:t),this}:"delete"==t?function(t){return!(u&&!isObject(t))&&r.call(this,0===t?0:t)}:"get"==t?function get(t){return u&&!isObject(t)?void 0:r.call(this,0===t?0:t)}:"has"==t?function has(t){return!(u&&!isObject(t))&&r.call(this,0===t?0:t)}:function set(t,i){return r.call(this,0===t?0:t,i),this})};if(ht(t,"function"!=typeof h||!(u||p.forEach&&!fails((function(){(new h).entries().next()})))))y=o.getConstructor(i,t,a,l),So.REQUIRED=!0;else if(ht(t,!0)){var d=new y,v=d[l](u?{}:-0,1)!=d,x=fails((function(){d.has(1)})),b=checkCorrectnessOfIteration((function(t){new h(t)})),S=!u&&fails((function(){for(var t=new h,r=5;r--;)t[l](r,r);return!t.has(-0)}));b||((y=i((function(r,i){anInstance(r,y,t);var o=inheritIfRequired(new h,r,y);return null!=i&&Ht(i,o[l],o,a),o}))).prototype=p,p.constructor=y),(x||S)&&(fixMethod("delete"),fixMethod("has"),a&&fixMethod("get")),(S||v)&&fixMethod(l),u&&p.clear&&delete p.clear}g[t]=y,_export({global:!0,forced:y!=h},g),setToStringTag(y,t),u||o.setStrong(y,t,a)}("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),{getConstructor:function(t,r,o,a){var u=t((function(t,l){anInstance(t,u,r),Eo(t,{type:r,index:Mr(null),first:void 0,last:void 0,size:0}),i||(t.size=0),null!=l&&Ht(l,t[a],t,o)})),l=Po(r),define=function(t,r,o){var a,u,h=l(t),p=getEntry(t,r);return p?p.value=o:(h.last=p={index:u=ko(r,!0),key:r,value:o,previous:a=h.last,next:void 0,removed:!1},h.first||(h.first=p),a&&(a.next=p),i?h.size++:t.size++,"F"!==u&&(h.index[u]=p)),t},getEntry=function(t,r){var i,o=l(t),a=ko(r);if("F"!==a)return o.index[a];for(i=o.first;i;i=i.next)if(i.key==r)return i};return redefineAll(u.prototype,{clear:function clear(){for(var t=l(this),r=t.index,o=t.first;o;)o.removed=!0,o.previous&&(o.previous=o.previous.next=void 0),delete r[o.index],o=o.next;t.first=t.last=void 0,i?t.size=0:this.size=0},delete:function(t){var r=this,o=l(r),a=getEntry(r,t);if(a){var u=a.next,h=a.previous;delete o.index[a.index],a.removed=!0,h&&(h.next=u),u&&(u.previous=h),o.first==a&&(o.first=u),o.last==a&&(o.last=h),i?o.size--:r.size--}return!!a},forEach:function forEach(t){for(var r,i=l(this),o=functionBindContext(t,arguments.length>1?arguments[1]:void 0,3);r=r?r.next:i.first;)for(o(r.value,r.key,this);r&&r.removed;)r=r.previous},has:function has(t){return!!getEntry(this,t)}}),redefineAll(u.prototype,o?{get:function get(t){var r=getEntry(this,t);return r&&r.value},set:function set(t,r){return define(this,0===t?0:t,r)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}}),i&&wo(u.prototype,"size",{get:function(){return l(this).size}}),u},setStrong:function(t,r,i){var o=r+" Iterator",a=Po(r),u=Po(o);defineIterator(t,r,(function(t,r){Eo(this,{type:o,target:t,state:a(t),kind:r,last:void 0})}),(function(){for(var t=u(this),r=t.kind,i=t.last;i&&i.removed;)i=i.previous;return t.target&&(t.last=i=i?i.next:t.state.first)?"keys"==r?{value:i.key,done:!1}:"values"==r?{value:i.value,done:!1}:{value:[i.key,i.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),i?"entries":"values",!i,!0),setSpecies(r)}}),it.f),Ro=b.f,Ao=w.f,_o=Pr.trim,To=r.Number,Mo=To.prototype,No="Number"==classofRaw(Mr(Mo)),toNumber=function(t){var r,i,o,a,u,l,h,p,y=toPrimitive(t,!1);if("string"==typeof y&&y.length>2)if(43===(r=(y=_o(y)).charCodeAt(0))||45===r){if(88===(i=y.charCodeAt(2))||120===i)return NaN}else if(48===r){switch(y.charCodeAt(1)){case 66:case 98:o=2,a=49;break;case 79:case 111:o=8,a=55;break;default:return+y}for(l=(u=y.slice(2)).length,h=0;h<l;h++)if((p=u.charCodeAt(h))<48||p>a)return NaN;return parseInt(u,o)}return+y};if(ht("Number",!To(" 0o1")||!To("0b1")||To("+0x1"))){for(var Oo,Do=function Number(t){var r=arguments.length<1?0:t,i=this;return i instanceof Do&&(No?fails((function(){Mo.valueOf.call(i)})):"Number"!=classofRaw(i))?inheritIfRequired(new To(toNumber(r)),i,Do):toNumber(r)},$o=i?Co(To):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),Io=0;$o.length>Io;Io++)has(To,Oo=$o[Io])&&!has(Do,Oo)&&Ao(Do,Oo,Ro(To,Oo));Do.prototype=Mo,Mo.constructor=Do,H(r,"Number",Do)}_export({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperties:_r});var Fo=So.onFreeze,Vo=Object.freeze,Lo=fails((function(){Vo(1)}));_export({target:"Object",stat:!0,forced:Lo,sham:!bo},{freeze:function freeze(t){return Vo&&isObject(t)?Vo(Fo(t)):t}});var jo=b.f,Bo=fails((function(){jo(1)}));_export({target:"Object",stat:!0,forced:!i||Bo,sham:!i},{getOwnPropertyDescriptor:function getOwnPropertyDescriptor(t,r){return jo(toIndexedObject(t),r)}}),_export({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function getOwnPropertyDescriptors(t){for(var r,i,o=toIndexedObject(t),a=b.f,u=at(o),l={},h=0;u.length>h;)void 0!==(i=a(o,r=u[h++]))&&createProperty(l,r,i);return l}});var Go=fails((function(){Ar(1)}));_export({target:"Object",stat:!0,forced:Go},{keys:function keys(t){return Ar(toObject(t))}});var zo=Pr.trim,Uo=r.parseFloat,qo=1/Uo(Sr+"-0")!=-1/0?function parseFloat(t){var r=zo(String(t)),i=Uo(r);return 0===i&&"-"==r.charAt(0)?-0:i}:Uo;_export({global:!0,forced:parseFloat!=qo},{parseFloat:qo});var Wo=Pr.trim,Ho=r.parseInt,Xo=/^[+-]?0[Xx]/,Yo=8!==Ho(Sr+"08")||22!==Ho(Sr+"0x16")?function parseInt(t,r){var i=Wo(String(t));return Ho(i,r>>>0||(Xo.test(i)?16:10))}:Ho;_export({global:!0,forced:parseInt!=Yo},{parseInt:Yo});var Qo=getBuiltIn("Reflect","apply"),Ko=Function.apply,Zo=!fails((function(){Qo((function(){}))}));_export({target:"Reflect",stat:!0,forced:Zo},{apply:function apply(t,r,i){return aFunction$1(t),anObject(i),Qo?Qo(t,r,i):Ko.call(t,r,i)}});var Jo=getBuiltIn("Reflect","construct"),ta=fails((function(){function F(){}return!(Jo((function(){}),[],F)instanceof F)})),ea=!fails((function(){Jo((function(){}))})),ra=ta||ea;_export({target:"Reflect",stat:!0,forced:ra,sham:ra},{construct:function construct(t,r){aFunction$1(t),anObject(r);var i=arguments.length<3?t:aFunction$1(arguments[2]);if(ea&&!ta)return Jo(t,r,i);if(t==i){switch(r.length){case 0:return new t;case 1:return new t(r[0]);case 2:return new t(r[0],r[1]);case 3:return new t(r[0],r[1],r[2]);case 4:return new t(r[0],r[1],r[2],r[3])}var o=[null];return o.push.apply(o,r),new(xo.apply(t,o))}var a=i.prototype,u=Mr(isObject(a)?a:Object.prototype),l=Function.apply.call(t,u,r);return isObject(l)?l:u}});var na=b.f;_export({target:"Reflect",stat:!0},{deleteProperty:function deleteProperty(t,r){var i=na(anObject(t),r);return!(i&&!i.configurable)&&delete t[r]}}),_export({target:"Reflect",stat:!0,sham:!Dn},{getPrototypeOf:function getPrototypeOf(t){return Fn(anObject(t))}});var ia=wellKnownSymbol("match"),isRegexp=function(t){var r;return isObject(t)&&(void 0!==(r=t[ia])?!!r:"RegExp"==classofRaw(t))},notARegexp=function(t){if(isRegexp(t))throw TypeError("The method doesn't accept regular expressions");return t},oa=wellKnownSymbol("match"),correctIsRegexpLogic=function(t){var r=/./;try{"/./"[t](r)}catch(i){try{return r[oa]=!1,"/./"[t](r)}catch(t){}}return!1};_export({target:"String",proto:!0,forced:!correctIsRegexpLogic("includes")},{includes:function includes(t){return!!~String(requireObjectCoercible(this)).indexOf(notARegexp(t),arguments.length>1?arguments[1]:void 0)}}),fixRegexpWellKnownSymbolLogic("match",1,(function(t,r,i){return[function match(r){var i=requireObjectCoercible(this),o=null==r?void 0:r[t];return void 0!==o?o.call(r,i):new RegExp(r)[t](String(i))},function(t){var o=i(r,t,this);if(o.done)return o.value;var a=anObject(t),u=String(this);if(!a.global)return regexpExecAbstract(a,u);var l=a.unicode;a.lastIndex=0;for(var h,p=[],y=0;null!==(h=regexpExecAbstract(a,u));){var g=String(h[0]);p[y]=g,""===g&&(a.lastIndex=advanceStringIndex(u,toLength(a.lastIndex),l)),y++}return 0===y?null:p}]}));var aa=[].push,ua=Math.min,sa=!fails((function(){return!RegExp(4294967295,"y")}));fixRegexpWellKnownSymbolLogic("split",2,(function(t,r,i){var o;return o="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,i){var o=String(requireObjectCoercible(this)),a=void 0===i?4294967295:i>>>0;if(0===a)return[];if(void 0===t)return[o];if(!isRegexp(t))return r.call(o,t,a);for(var u,l,h,p=[],y=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),g=0,d=new RegExp(t.source,y+"g");(u=ur.call(d,o))&&!((l=d.lastIndex)>g&&(p.push(o.slice(g,u.index)),u.length>1&&u.index<o.length&&aa.apply(p,u.slice(1)),h=u[0].length,g=l,p.length>=a));)d.lastIndex===u.index&&d.lastIndex++;return g===o.length?!h&&d.test("")||p.push(""):p.push(o.slice(g)),p.length>a?p.slice(0,a):p}:"0".split(void 0,0).length?function(t,i){return void 0===t&&0===i?[]:r.call(this,t,i)}:r,[function split(r,i){var a=requireObjectCoercible(this),u=null==r?void 0:r[t];return void 0!==u?u.call(r,a,i):o.call(String(a),r,i)},function(t,a){var u=i(o,t,this,a,o!==r);if(u.done)return u.value;var l=anObject(t),h=String(this),p=speciesConstructor(l,RegExp),y=l.unicode,g=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(sa?"y":"g"),d=new p(sa?l:"^(?:"+l.source+")",g),v=void 0===a?4294967295:a>>>0;if(0===v)return[];if(0===h.length)return null===regexpExecAbstract(d,h)?[h]:[];for(var x=0,b=0,S=[];b<h.length;){d.lastIndex=sa?b:0;var w,k=regexpExecAbstract(d,sa?h:h.slice(b));if(null===k||(w=ua(toLength(d.lastIndex+(sa?0:b)),h.length))===x)b=advanceStringIndex(h,b,y);else{if(S.push(h.slice(x,b)),S.length===v)return S;for(var E=1;E<=k.length-1;E++)if(S.push(k[E]),S.length===v)return S;b=x=w}}return S.push(h.slice(x)),S}]}),!sa);var ca,la=b.f,fa="".startsWith,ha=Math.min,pa=correctIsRegexpLogic("startsWith"),ya=!(pa||(ca=la(String.prototype,"startsWith"),!ca||ca.writable));_export({target:"String",proto:!0,forced:!ya&&!pa},{startsWith:function startsWith(t){var r=String(requireObjectCoercible(this));notARegexp(t);var i=toLength(ha(arguments.length>1?arguments[1]:void 0,r.length)),o=String(t);return fa?fa.call(r,o,i):r.slice(i,i+o.length)===o}});var ga=function _arrayWithHoles(t){if(Array.isArray(t))return t};var da=function _iterableToArrayLimit(t,r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var i=[],o=!0,a=!1,u=void 0;try{for(var l,h=t[Symbol.iterator]();!(o=(l=h.next()).done)&&(i.push(l.value),!r||i.length!==r);o=!0);}catch(t){a=!0,u=t}finally{try{o||null==h.return||h.return()}finally{if(a)throw u}}return i}};var va=function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o};var ma=function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return va(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?va(t,r):void 0}};var xa=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.")};var ba=function _slicedToArray(t,r){return ga(t)||da(t,r)||ma(t,r)||xa()},Sa=Ai;function asyncGeneratorStep$1(t,r,i,o,a,u,l){try{var h=t[u](l),p=h.value}catch(t){return void i(t)}h.done?r(p):Promise.resolve(p).then(o,a)}var wa=function _asyncToGenerator$1(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var u=t.apply(r,i);function _next(t){asyncGeneratorStep$1(u,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep$1(u,o,a,_next,_throw,"throw",t)}_next(void 0)}))}};var ka=function _defineProperty(t,r,i){return r in t?Object.defineProperty(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,t};var Ea=function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")};function _defineProperties(t,r){for(var i=0;i<r.length;i++){var o=r[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}for(var Pa=function _createClass(t,r,i){return r&&_defineProperties(t.prototype,r),i&&_defineProperties(t,i),t},Ca=createCommonjsModule((function(r){(function(){var t,i,o,a,u,l;"undefined"!=typeof performance&&null!==performance&&performance.now?r.exports=function(){return performance.now()}:null!=Wi&&Wi.hrtime?(r.exports=function(){return(t()-u)/1e6},i=Wi.hrtime,a=(t=function getNanoSeconds(){var t;return 1e9*(t=i())[0]+t[1]})(),l=1e9*Wi.uptime(),u=a-l):Date.now?(r.exports=function(){return Date.now()-o},o=Date.now()):(r.exports=function(){return(new Date).getTime()-o},o=(new Date).getTime())}).call(t)})),Ra="undefined"==typeof window?t:window,Aa=["moz","webkit"],_a="AnimationFrame",Ta=Ra["request"+_a],Ma=Ra["cancel"+_a]||Ra["cancelRequest"+_a],Na=0;!Ta&&Na<Aa.length;Na++)Ta=Ra[Aa[Na]+"Request"+_a],Ma=Ra[Aa[Na]+"Cancel"+_a]||Ra[Aa[Na]+"CancelRequest"+_a];if(!Ta||!Ma){var Oa=0,Da=0,$a=[];Ta=function raf(t){if(0===$a.length){var r=Ca(),i=Math.max(0,16.666666666666668-(r-Oa));Oa=i+r,setTimeout((function(){var t=$a.slice(0);$a.length=0;for(var r=0;r<t.length;r++)if(!t[r].cancelled)try{t[r].callback(Oa)}catch(t){setTimeout((function(){throw t}),0)}}),Math.round(i))}return $a.push({handle:++Da,callback:t,cancelled:!1}),Da},Ma=function caf(t){for(var r=0;r<$a.length;r++)$a[r].handle===t&&($a[r].cancelled=!0)}}var Ia=function raf_1(t){return Ta.call(Ra,t)};Ia.cancel=function cancel(){Ma.apply(Ra,arguments)},Ia.polyfill=function polyfill(t){t||(t=Ra),t.requestAnimationFrame=Ta,t.cancelAnimationFrame=Ma};var Fa=function rgbcolor(t){this.ok=!1,this.alpha=1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t=(t=t.replace(/ /g,"")).toLowerCase();var r={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",rebeccapurple:"663399",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"};t=r[t]||t;for(var i=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function process(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),parseFloat(t[4])]}},{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){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function process(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function process(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],o=0;o<i.length;o++){var a=i[o].re,u=i[o].process,l=a.exec(t);if(l){var h=u(l);this.r=h[0],this.g=h[1],this.b=h[2],h.length>3&&(this.alpha=h[3]),this.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,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var t=this.r.toString(16),r=this.g.toString(16),i=this.b.toString(16);return 1==t.length&&(t="0"+t),1==r.length&&(r="0"+r),1==i.length&&(i="0"+i),"#"+t+r+i},this.getHelpXML=function(){for(var t=new Array,o=0;o<i.length;o++)for(var a=i[o].example,u=0;u<a.length;u++)t[t.length]=a[u];for(var l in r)t[t.length]=l;var h=document.createElement("ul");h.setAttribute("id","rgbcolor-examples");for(o=0;o<t.length;o++)try{var p=document.createElement("li"),y=new RGBColor(t[o]),g=document.createElement("div");g.style.cssText="margin: 3px; border: 1px solid black; background:"+y.toHex()+"; color:"+y.toHex(),g.appendChild(document.createTextNode("test"));var d=document.createTextNode(" "+t[o]+" -> "+y.toRGB()+" -> "+y.toHex());p.appendChild(g),p.appendChild(d),h.appendChild(p)}catch(t){}return h}},Va=createCommonjsModule((function(t){function _typeof(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=_typeof=function _typeof(t){return typeof t}:t.exports=_typeof=function _typeof(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(r)}t.exports=_typeof}));var La=function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var ja=function _possibleConstructorReturn(t,r){return!r||"object"!==Va(r)&&"function"!=typeof r?La(t):r},Ba=createCommonjsModule((function(t){function _getPrototypeOf(r){return t.exports=_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)},_getPrototypeOf(r)}t.exports=_getPrototypeOf})),Ga=createCommonjsModule((function(t){function _setPrototypeOf(r,i){return t.exports=_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){return t.__proto__=r,t},_setPrototypeOf(r,i)}t.exports=_setPrototypeOf}));var za=function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&Ga(t,r)};var Ua=function _arrayWithoutHoles(t){if(Array.isArray(t))return va(t)};var qa=function _iterableToArray(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)};var Wa=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.")};var Ha=function _toConsumableArray(t){return Ua(t)||qa(t)||ma(t)||Wa()};_export({target:"Reflect",stat:!0},{get:function get$1(t,r){var i,o,a=arguments.length<3?t:arguments[2];return anObject(t)===a?t[r]:(i=b.f(t,r))?has(i,"value")?i.value:void 0===i.get?void 0:i.get.call(a):isObject(o=Fn(t))?get$1(o,r,a):void 0}});var Xa=function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=Ba(t)););return t},Ya=createCommonjsModule((function(t){function _get(r,i,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=_get=Reflect.get:t.exports=_get=function _get(t,r,i){var o=Xa(t,r);if(o){var a=Object.getOwnPropertyDescriptor(o,r);return a.get?a.get.call(i):a.value}},_get(r,i,o||r)}t.exports=_get}));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 Qa=[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],Ka=[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,r,i,o,a,u){if(!(isNaN(u)||u<1)){u|=0;var l=function getImageDataFromCanvas(t,r,i,o,a){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 u=t.getContext("2d");try{return u.getImageData(r,i,o,a)}catch(t){throw new Error("unable to access image data: "+t)}}(t,r,i,o,a);l=function processImageDataRGBA(t,r,i,o,a,u){for(var l,h=t.data,p=2*u+1,y=o-1,g=a-1,d=u+1,v=d*(d+1)/2,x=new Za,b=x,S=1;S<p;S++)b=b.next=new Za,S===d&&(l=b);b.next=x;for(var w=null,k=null,E=0,P=0,C=Qa[u],R=Ka[u],A=0;A<a;A++){b=x;for(var _=h[P],T=h[P+1],M=h[P+2],N=h[P+3],O=0;O<d;O++)b.r=_,b.g=T,b.b=M,b.a=N,b=b.next;for(var D=0,$=0,I=0,V=0,L=d*_,j=d*T,B=d*M,G=d*N,z=v*_,U=v*T,q=v*M,W=v*N,H=1;H<d;H++){var X=P+((y<H?y:H)<<2),Y=h[X],Q=h[X+1],K=h[X+2],Z=h[X+3],J=d-H;z+=(b.r=Y)*J,U+=(b.g=Q)*J,q+=(b.b=K)*J,W+=(b.a=Z)*J,D+=Y,$+=Q,I+=K,V+=Z,b=b.next}w=x,k=l;for(var tt=0;tt<o;tt++){var et=W*C>>R;if(h[P+3]=et,0!==et){var rt=255/et;h[P]=(z*C>>R)*rt,h[P+1]=(U*C>>R)*rt,h[P+2]=(q*C>>R)*rt}else h[P]=h[P+1]=h[P+2]=0;z-=L,U-=j,q-=B,W-=G,L-=w.r,j-=w.g,B-=w.b,G-=w.a;var nt=tt+u+1;nt=E+(nt<y?nt:y)<<2,z+=D+=w.r=h[nt],U+=$+=w.g=h[nt+1],q+=I+=w.b=h[nt+2],W+=V+=w.a=h[nt+3],w=w.next;var it=k,ot=it.r,at=it.g,ut=it.b,st=it.a;L+=ot,j+=at,B+=ut,G+=st,D-=ot,$-=at,I-=ut,V-=st,k=k.next,P+=4}E+=o}for(var ct=0;ct<o;ct++){var lt=h[P=ct<<2],ft=h[P+1],ht=h[P+2],pt=h[P+3],yt=d*lt,gt=d*ft,dt=d*ht,vt=d*pt,mt=v*lt,xt=v*ft,bt=v*ht,St=v*pt;b=x;for(var wt=0;wt<d;wt++)b.r=lt,b.g=ft,b.b=ht,b.a=pt,b=b.next;for(var kt=o,Et=0,Pt=0,Ct=0,Rt=0,At=1;At<=u;At++){P=kt+ct<<2;var _t=d-At;mt+=(b.r=lt=h[P])*_t,xt+=(b.g=ft=h[P+1])*_t,bt+=(b.b=ht=h[P+2])*_t,St+=(b.a=pt=h[P+3])*_t,Rt+=lt,Et+=ft,Pt+=ht,Ct+=pt,b=b.next,At<g&&(kt+=o)}P=ct,w=x,k=l;for(var Tt=0;Tt<a;Tt++){var Mt=P<<2;h[Mt+3]=pt=St*C>>R,pt>0?(pt=255/pt,h[Mt]=(mt*C>>R)*pt,h[Mt+1]=(xt*C>>R)*pt,h[Mt+2]=(bt*C>>R)*pt):h[Mt]=h[Mt+1]=h[Mt+2]=0,mt-=yt,xt-=gt,bt-=dt,St-=vt,yt-=w.r,gt-=w.g,dt-=w.b,vt-=w.a,Mt=ct+((Mt=Tt+d)<g?Mt:g)*o<<2,mt+=Rt+=w.r=h[Mt],xt+=Et+=w.g=h[Mt+1],bt+=Pt+=w.b=h[Mt+2],St+=Ct+=w.a=h[Mt+3],w=w.next,yt+=lt=k.r,gt+=ft=k.g,dt+=ht=k.b,vt+=pt=k.a,Rt-=lt,Et-=ft,Pt-=ht,Ct-=pt,k=k.next,P+=o}}return t}(l,0,0,o,a,u),t.getContext("2d").putImageData(l,r,i)}}var Za=function BlurStack(){!function _classCallCheck$1(t,r){if(!(t instanceof r))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};function compressSpaces(t){return t.replace(/(?!\u3000)\s+/gm," ")}function toNumbers(t){return((t||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[]).map(parseFloat)}var Ja=/^[A-Z-]+$/;function normalizeAttributeName(t){return Ja.test(t)?t.toLowerCase():t}function parseExternalUrl(t){var r=t.match(/url\(('([^']+)'|"([^"]+)"|([^'"\)]+))\)/)||[];return r[2]||r[3]||r[4]}var tu=/(\[[^\]]+\])/g,eu=/(#[^\s\+>~\.\[:]+)/g,ru=/(\.[^\s\+>~\.\[:]+)/g,nu=/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi,iu=/(:[\w-]+\([^\)]*\))/gi,ou=/(:[^\s\+>~\.\[:]+)/g,au=/([^\s\+>~\.\[:]+)/g;function findSelectorMatch(t,r){var i=t.match(r);return i?[t.replace(r," "),i.length]:[t,0]}function vectorMagnitude(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))}function vectorsRatio(t,r){return(t[0]*r[0]+t[1]*r[1])/(vectorMagnitude(t)*vectorMagnitude(r))}function vectorsAngle(t,r){return(t[0]*r[1]<t[1]*r[0]?-1:1)*Math.acos(vectorsRatio(t,r))}function CB1(t){return t*t*t}function CB2(t){return 3*t*t*(1-t)}function CB3(t){return 3*t*(1-t)*(1-t)}function CB4(t){return(1-t)*(1-t)*(1-t)}function QB1(t){return t*t}function QB2(t){return 2*t*(1-t)}function QB3(t){return(1-t)*(1-t)}(function createCommonjsModule$1(t,r){return t(r={exports:{}},r.exports),r.exports})((function(t){var r=function(t){var r,i=Object.prototype,o=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",h=a.toStringTag||"@@toStringTag";function wrap(t,r,i,o){var a=r&&r.prototype instanceof Generator?r:Generator,u=Object.create(a.prototype),l=new Context(o||[]);return u._invoke=function makeInvokeMethod(t,r,i){var o=p;return function invoke(a,u){if(o===g)throw new Error("Generator is already running");if(o===d){if("throw"===a)throw u;return doneResult()}for(i.method=a,i.arg=u;;){var l=i.delegate;if(l){var h=maybeInvokeDelegate(l,i);if(h){if(h===v)continue;return h}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(o===p)throw o=d,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o=g;var x=tryCatch(t,r,i);if("normal"===x.type){if(o=i.done?d:y,x.arg===v)continue;return{value:x.arg,done:i.done}}"throw"===x.type&&(o=d,i.method="throw",i.arg=x.arg)}}}(t,i,l),u}function tryCatch(t,r,i){try{return{type:"normal",arg:t.call(r,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=wrap;var p="suspendedStart",y="suspendedYield",g="executing",d="completed",v={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var x={};x[u]=function(){return this};var b=Object.getPrototypeOf,S=b&&b(b(values([])));S&&S!==i&&o.call(S,u)&&(x=S);var w=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(x);function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){t[r]=function(t){return this._invoke(r,t)}}))}function AsyncIterator(t,r){var i;this._invoke=function enqueue(a,u){function callInvokeWithMethodAndArg(){return new r((function(i,l){!function invoke(i,a,u,l){var h=tryCatch(t[i],t,a);if("throw"!==h.type){var p=h.arg,y=p.value;return y&&"object"===_typeof(y)&&o.call(y,"__await")?r.resolve(y.__await).then((function(t){invoke("next",t,u,l)}),(function(t){invoke("throw",t,u,l)})):r.resolve(y).then((function(t){p.value=t,u(p)}),(function(t){return invoke("throw",t,u,l)}))}l(h.arg)}(a,u,i,l)}))}return i=i?i.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,i){var o=t.iterator[i.method];if(o===r){if(i.delegate=null,"throw"===i.method){if(t.iterator.return&&(i.method="return",i.arg=r,maybeInvokeDelegate(t,i),"throw"===i.method))return v;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var a=tryCatch(o,t.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,v;var u=a.arg;return u?u.done?(i[t.resultName]=u.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=r),i.delegate=null,v):u:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,v)}function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(pushTryEntry,this),this.reset(!0)}function values(t){if(t){var i=t[u];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,l=function next(){for(;++a<t.length;)if(o.call(t,a))return next.value=t[a],next.done=!1,next;return next.value=r,next.done=!0,next};return l.next=l}}return{next:doneResult}}function doneResult(){return{value:r,done:!0}}return GeneratorFunction.prototype=w.constructor=GeneratorFunctionPrototype,GeneratorFunctionPrototype.constructor=GeneratorFunction,GeneratorFunctionPrototype[h]=GeneratorFunction.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,h in t||(t[h]="GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),AsyncIterator.prototype[l]=function(){return this},t.AsyncIterator=AsyncIterator,t.async=function(r,i,o,a,u){void 0===u&&(u=Promise);var l=new AsyncIterator(wrap(r,i,o,a),u);return t.isGeneratorFunction(i)?l:l.next().then((function(t){return t.done?t.value:l.next()}))},defineIteratorMethods(w),w[h]="Generator",w[u]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var r=[];for(var i in t)r.push(i);return r.reverse(),function next(){for(;r.length;){var i=r.pop();if(i in t)return next.value=i,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=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(resetTryEntry),!t)for(var i in this)"t"===i.charAt(0)&&o.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=r)},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 i=this;function handle(o,a){return l.type="throw",l.arg=t,i.next=o,a&&(i.method="next",i.arg=r),!!a}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],l=u.completion;if("root"===u.tryLoc)return handle("end");if(u.tryLoc<=this.prev){var h=o.call(u,"catchLoc"),p=o.call(u,"finallyLoc");if(h&&p){if(this.prev<u.catchLoc)return handle(u.catchLoc,!0);if(this.prev<u.finallyLoc)return handle(u.finallyLoc)}else if(h){if(this.prev<u.catchLoc)return handle(u.catchLoc,!0)}else{if(!p)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return handle(u.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&o.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var u=a;break}}u&&("break"===t||"continue"===t)&&u.tryLoc<=r&&r<=u.finallyLoc&&(u=null);var l=u?u.completion:{};return l.type=t,l.arg=r,u?(this.method="next",this.next=u.finallyLoc,v):this.complete(l)},complete:function complete(t,r){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&&r&&(this.next=r),v},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),resetTryEntry(i),v}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc===t){var o=i.completion;if("throw"===o.type){var a=o.arg;resetTryEntry(i)}return a}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,i,o){return this.delegate={iterator:values(t),resultName:i,nextLoc:o},"next"===this.method&&(this.arg=r),v}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}}));var uu=function(){function Property(t,r,i){Ea(this,Property),this.document=t,this.name=r,this.value=i,this.isNormalizedColor=!1}return Pa(Property,[{key:"hasValue",value:function hasValue(){var t=this.value;return null!==t&&""!==t&&0!==t&&void 0!==t}},{key:"isString",value:function isString(t){var r=this.value,i="string"==typeof r;return i&&t?t.test(r):i}},{key:"isUrlDefinition",value:function isUrlDefinition(){return this.isString(/^url\(/)}},{key:"isPixels",value:function isPixels(){if(!this.hasValue())return!1;var t=this.getString();switch(!0){case/px$/.test(t):case/^[0-9]+$/.test(t):return!0;default:return!1}}},{key:"setValue",value:function setValue(t){return this.value=t,this}},{key:"getValue",value:function getValue(t){return void 0===t||this.hasValue()?this.value:t}},{key:"getNumber",value:function getNumber(t){if(!this.hasValue())return void 0===t?0:parseFloat(t);var r=this.value,i=parseFloat(r);return this.isString(/%$/)&&(i/=100),i}},{key:"getString",value:function getString(t){return void 0===t||this.hasValue()?void 0===this.value?"":String(this.value):String(t)}},{key:"getColor",value:function getColor(t){var r=this.getString(t);return this.isNormalizedColor||(this.isNormalizedColor=!0,r=function normalizeColor(t){if(!t.startsWith("rgb"))return t;var r=3;return t.replace(/\d+(\.\d+)?/g,(function(t,i){return r--&&i?String(Math.round(parseFloat(t))):t}))}(r),this.value=r),r}},{key:"getDpi",value:function getDpi(){return 96}},{key:"getRem",value:function getRem(){return this.document.rootEmSize}},{key:"getEm",value:function getEm(){return this.document.emSize}},{key:"getUnits",value:function getUnits(){return this.getString().replace(/[0-9\.\-]/g,"")}},{key:"getPixels",value:function getPixels(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var i="boolean"==typeof t?[void 0,t]:[t],o=ba(i,2),a=o[0],u=o[1],l=this.document.screen.viewPort;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(l.computeSize("x"),l.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(l.computeSize("x"),l.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*l.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*l.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&u:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*l.computeSize(a);default:var h=this.getNumber();return r&&h<1?h*l.computeSize(a):h}}},{key:"getMilliseconds",value:function getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}},{key:"getRadians",value:function getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}},{key:"getDefinition",value:function getDefinition(){var t=this.getString(),r=t.match(/#([^\)'"]+)/);return r&&(r=r[1]),r||(r=t),this.document.definitions[r]}},{key:"getFillStyleDefinition",value:function getFillStyleDefinition(t,r){var i=this.getDefinition();if(!i)return null;if("function"==typeof i.createGradient)return i.createGradient(this.document.ctx,t,r);if("function"==typeof i.createPattern){if(i.getHrefAttribute().hasValue()){var o=i.getAttribute("patternTransform");i=i.getHrefAttribute().getDefinition(),o.hasValue()&&i.getAttribute("patternTransform",!0).setValue(o.value)}return i.createPattern(this.document.ctx,t,r)}return null}},{key:"getTextBaseline",value:function getTextBaseline(){return this.hasValue()?Property.textBaselineMapping[this.getString()]:null}},{key:"addOpacity",value:function addOpacity(t){for(var r=this.getColor(),i=r.length,o=0,a=0;a<i&&(","===r[a]&&o++,3!==o);a++);if(t.hasValue()&&this.isString()&&3!==o){var u=new Fa(r);u.ok&&(u.alpha=t.getNumber(),r=u.toRGBA())}return new Property(this.document,this.name,r)}}],[{key:"empty",value:function empty(t){return new Property(t,"EMPTY","")}}]),Property}();uu.textBaselineMapping={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"};var su=function(){function ViewPort(){Ea(this,ViewPort),this.viewPorts=[]}return Pa(ViewPort,[{key:"clear",value:function clear(){this.viewPorts=[]}},{key:"setCurrent",value:function setCurrent(t,r){this.viewPorts.push({width:t,height:r})}},{key:"removeCurrent",value:function removeCurrent(){this.viewPorts.pop()}},{key:"getCurrent",value:function getCurrent(){var t=this.viewPorts;return t[t.length-1]}},{key:"computeSize",value:function computeSize(t){return"number"==typeof t?t:"x"===t?this.width:"y"===t?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}},{key:"width",get:function get(){return this.getCurrent().width}},{key:"height",get:function get(){return this.getCurrent().height}}]),ViewPort}(),cu=function(){function Point(t,r){Ea(this,Point),this.x=t,this.y=r}return Pa(Point,[{key:"angleTo",value:function angleTo(t){return Math.atan2(t.y-this.y,t.x-this.x)}},{key:"applyTransform",value:function applyTransform(t){var r=this.x,i=this.y,o=r*t[0]+i*t[2]+t[4],a=r*t[1]+i*t[3]+t[5];this.x=o,this.y=a}}],[{key:"parse",value:function parse(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=toNumbers(t),o=ba(i,2),a=o[0],u=void 0===a?r:a,l=o[1],h=void 0===l?r:l;return new Point(u,h)}},{key:"parseScale",value:function parseScale(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=toNumbers(t),o=ba(i,2),a=o[0],u=void 0===a?r:a,l=o[1],h=void 0===l?u:l;return new Point(u,h)}},{key:"parsePath",value:function parsePath(t){for(var r=toNumbers(t),i=r.length,o=[],a=0;a<i;a+=2)o.push(new Point(r[a],r[a+1]));return o}}]),Point}(),lu=function(){function Mouse(t){Ea(this,Mouse),this.screen=t,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}return Pa(Mouse,[{key:"isWorking",value:function isWorking(){return this.working}},{key:"start",value:function start(){if(!this.working){var t=this.screen,r=this.onClick,i=this.onMouseMove,o=t.ctx.canvas;o.onclick=r,o.onmousemove=i,this.working=!0}}},{key:"stop",value:function stop(){if(this.working){var t=this.screen.ctx.canvas;this.working=!1,t.onclick=null,t.onmousemove=null}}},{key:"hasEvents",value:function hasEvents(){return this.working&&this.events.length>0}},{key:"runEvents",value:function runEvents(){if(this.working){var t=this.screen,r=this.events,i=this.eventElements,o=t.ctx.canvas.style;o&&(o.cursor=""),r.forEach((function(t,r){for(var o=t.run,a=i[r];a;)o(a),a=a.parent})),this.events=[],this.eventElements=[]}}},{key:"checkPath",value:function checkPath(t,r){if(this.working&&r){var i=this.events,o=this.eventElements;i.forEach((function(i,a){var u=i.x,l=i.y;!o[a]&&r.isPointInPath&&r.isPointInPath(u,l)&&(o[a]=t)}))}}},{key:"checkBoundingBox",value:function checkBoundingBox(t,r){if(this.working&&r){var i=this.events,o=this.eventElements;i.forEach((function(i,a){var u=i.x,l=i.y;!o[a]&&r.isPointInBox(u,l)&&(o[a]=t)}))}}},{key:"mapXY",value:function mapXY(t,r){for(var i=this.screen,o=i.window,a=i.ctx,u=new cu(t,r),l=a.canvas;l;)u.x-=l.offsetLeft,u.y-=l.offsetTop,l=l.offsetParent;return o.scrollX&&(u.x+=o.scrollX),o.scrollY&&(u.y+=o.scrollY),u}},{key:"onClick",value:function onClick(t){var r=this.mapXY((t||event).clientX,(t||event).clientY),i=r.x,o=r.y;this.events.push({type:"onclick",x:i,y:o,run:function run(t){t.onClick&&t.onClick()}})}},{key:"onMouseMove",value:function onMouseMove(t){var r=this.mapXY((t||event).clientX,(t||event).clientY),i=r.x,o=r.y;this.events.push({type:"onmousemove",x:i,y:o,run:function run(t){t.onMouseMove&&t.onMouseMove()}})}}]),Mouse}(),fu="undefined"!=typeof window?window:null,hu="undefined"!=typeof fetch?fetch.bind(void 0):null,pu=function(){function Screen(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.fetch,o=void 0===i?hu:i,a=r.window,u=void 0===a?fu:a;Ea(this,Screen),this.ctx=t,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new su,this.mouse=new lu(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=u,this.fetch=o}return Pa(Screen,[{key:"wait",value:function wait(t){this.waits.push(t)}},{key:"ready",value:function ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}},{key:"isReady",value:function isReady(){if(this.isReadyLock)return!0;var t=this.waits.every((function(t){return t()}));return t&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=t,t}},{key:"setDefaults",value:function setDefaults(t){t.strokeStyle="rgba(0,0,0,0)",t.lineCap="butt",t.lineJoin="miter",t.miterLimit=4}},{key:"setViewBox",value:function setViewBox(t){var r=t.document,i=t.ctx,o=t.aspectRatio,a=t.width,u=t.desiredWidth,l=t.height,h=t.desiredHeight,p=t.minX,y=void 0===p?0:p,g=t.minY,d=void 0===g?0:g,v=t.refX,x=t.refY,b=t.clip,S=void 0!==b&&b,w=t.clipX,k=void 0===w?0:w,E=t.clipY,P=void 0===E?0:E,C=compressSpaces(o).replace(/^defer\s/,"").split(" "),R=ba(C,2),A=R[0]||"xMidYMid",_=R[1]||"meet",T=a/u,M=l/h,N=Math.min(T,M),O=Math.max(T,M),D=u,$=h;"meet"===_&&(D*=N,$*=N),"slice"===_&&(D*=O,$*=O);var I=new uu(r,"refX",v),V=new uu(r,"refY",x),L=I.hasValue()&&V.hasValue();if(L&&i.translate(-N*I.getPixels("x"),-N*V.getPixels("y")),S){var j=N*k,B=N*P;i.beginPath(),i.moveTo(j,B),i.lineTo(a,B),i.lineTo(a,l),i.lineTo(j,l),i.closePath(),i.clip()}if(!L){var G="meet"===_&&N===M,z="slice"===_&&O===M,U="meet"===_&&N===T,q="slice"===_&&O===T;/^xMid/.test(A)&&(G||z)&&i.translate(a/2-D/2,0),/YMid$/.test(A)&&(U||q)&&i.translate(0,l/2-$/2),/^xMax/.test(A)&&(G||z)&&i.translate(a-D,0),/YMax$/.test(A)&&(U||q)&&i.translate(0,l-$)}switch(!0){case"none"===A:i.scale(T,M);break;case"meet"===_:i.scale(N,N);break;case"slice"===_:i.scale(O,O)}i.translate(-y,-d)}},{key:"start",value:function start(t){var r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.enableRedraw,a=void 0!==o&&o,u=i.ignoreMouse,l=void 0!==u&&u,h=i.ignoreAnimation,p=void 0!==h&&h,y=i.ignoreDimensions,g=void 0!==y&&y,d=i.ignoreClear,v=void 0!==d&&d,x=i.forceRedraw,b=i.scaleWidth,S=i.scaleHeight,w=i.offsetX,k=i.offsetY,E=this.FRAMERATE,P=this.mouse,C=1e3/E;if(this.frameDuration=C,this.readyPromise=new Promise((function(t){r.resolveReady=t})),this.isReady()&&this.render(t,g,v,b,S,w,k),a){var R=Date.now(),A=R,_=0,T=function tick(){R=Date.now(),(_=R-A)>=C&&(A=R-_%C,r.shouldUpdate(p,x)&&(r.render(t,g,v,b,S,w,k),P.runEvents())),r.intervalId=Ia(tick)};l||P.start(),this.intervalId=Ia(T)}}},{key:"stop",value:function stop(){this.intervalId&&(Ia.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}},{key:"shouldUpdate",value:function shouldUpdate(t,r){if(!t){var i=this.frameDuration,shouldUpdate=this.animations.reduce((function(t,r){return r.update(i)||t}),!1);if(shouldUpdate)return!0}return!("function"!=typeof r||!r())||(!(this.isReadyLock||!this.isReady())||!!this.mouse.hasEvents())}},{key:"render",value:function render(t,r,i,o,a,u,l){var h=this.CLIENT_WIDTH,p=this.CLIENT_HEIGHT,y=this.viewPort,g=this.ctx,d=this.isFirstRender,v=g.canvas;y.clear(),v.width&&v.height?y.setCurrent(v.width,v.height):y.setCurrent(h,p);var x=t.getStyle("width"),b=t.getStyle("height");!r&&(d||"number"!=typeof o&&"number"!=typeof a)&&(x.hasValue()&&(v.width=x.getPixels("x"),v.style&&(v.style.width="".concat(v.width,"px"))),b.hasValue()&&(v.height=b.getPixels("y"),v.style&&(v.style.height="".concat(v.height,"px"))));var S=v.clientWidth||v.width,w=v.clientHeight||v.height;if(r&&x.hasValue()&&b.hasValue()&&(S=x.getPixels("x"),w=b.getPixels("y")),y.setCurrent(S,w),"number"==typeof u&&t.getAttribute("x",!0).setValue(u),"number"==typeof l&&t.getAttribute("y",!0).setValue(l),"number"==typeof o||"number"==typeof a){var k=toNumbers(t.getAttribute("viewBox").getString()),E=0,P=0;if("number"==typeof o){var C=t.getStyle("width");C.hasValue()?E=C.getPixels("x")/o:isNaN(k[2])||(E=k[2]/o)}if("number"==typeof a){var R=t.getStyle("height");R.hasValue()?P=R.getPixels("y")/a:isNaN(k[3])||(P=k[3]/a)}E||(E=P),P||(P=E),t.getAttribute("width",!0).setValue(o),t.getAttribute("height",!0).setValue(a);var A=t.getStyle("transform",!0,!0);A.setValue("".concat(A.getString()," scale(").concat(1/E,", ").concat(1/P,")"))}i||g.clearRect(0,0,S,w),t.render(g),d&&(this.isFirstRender=!1)}}]),Screen}();pu.defaultWindow=fu,pu.defaultFetch=hu;var yu=pu.defaultFetch,gu="undefined"!=typeof DOMParser?DOMParser:null,du=function(){function Parser(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.fetch,i=void 0===r?yu:r,o=t.DOMParser,a=void 0===o?gu:o;Ea(this,Parser),this.fetch=i,this.DOMParser=a}var t,r;return Pa(Parser,[{key:"parse",value:(r=wa(Sa.mark((function _callee(t){return Sa.wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:if(!/^</.test(t)){r.next=2;break}return r.abrupt("return",this.parseFromString(t));case 2:return r.abrupt("return",this.load(t));case 3:case"end":return r.stop()}}),_callee,this)}))),function parse(t){return r.apply(this,arguments)})},{key:"parseFromString",value:function parseFromString(t){var r=new this.DOMParser;try{return this.checkDocument(r.parseFromString(t,"image/svg+xml"))}catch(i){return this.checkDocument(r.parseFromString(t,"text/xml"))}}},{key:"checkDocument",value:function checkDocument(t){var r=t.getElementsByTagName("parsererror")[0];if(r)throw new Error(r.textContent);return t}},{key:"load",value:(t=wa(Sa.mark((function _callee2(t){var r,i;return Sa.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.fetch(t);case 2:return r=o.sent,o.next=5,r.text();case 5:return i=o.sent,o.abrupt("return",this.parseFromString(i));case 7:case"end":return o.stop()}}),_callee2,this)}))),function load(r){return t.apply(this,arguments)})}]),Parser}(),vu=function(){function Translate(t,r){Ea(this,Translate),this.type="translate",this.point=null,this.point=cu.parse(r)}return Pa(Translate,[{key:"apply",value:function apply(t){var r=this.point,i=r.x,o=r.y;t.translate(i||0,o||0)}},{key:"unapply",value:function unapply(t){var r=this.point,i=r.x,o=r.y;t.translate(-1*i||0,-1*o||0)}},{key:"applyToPoint",value:function applyToPoint(t){var r=this.point,i=r.x,o=r.y;t.applyTransform([1,0,0,1,i||0,o||0])}}]),Translate}(),mu=function(){function Rotate(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];Ea(this,Rotate),this.type="rotate",this.angle=null,this.cx=0,this.cy=0;var o=toNumbers(r);this.angle=new uu(t,"angle",o[0]),this.cx=(o[1]||0)+(i[0]||0),this.cy=(o[2]||0)+(i[1]||0)}return Pa(Rotate,[{key:"apply",value:function apply(t){var r=this.cx,i=this.cy,o=this.angle;t.translate(r,i),t.rotate(o.getRadians()),t.translate(-r,-i)}},{key:"unapply",value:function unapply(t){var r=this.cx,i=this.cy,o=this.angle;t.translate(r,i),t.rotate(-1*o.getRadians()),t.translate(-r,-i)}},{key:"applyToPoint",value:function applyToPoint(t){var r=this.cx,i=this.cy,o=this.angle.getRadians();t.applyTransform([1,0,0,1,r||0,i||0]),t.applyTransform([Math.cos(o),Math.sin(o),-Math.sin(o),Math.cos(o),0,0]),t.applyTransform([1,0,0,1,-r||0,-i||0])}}]),Rotate}(),xu=function(){function Scale(t,r){Ea(this,Scale),this.type="scale",this.scale=null;var i=cu.parseScale(r);0!==i.x&&0!==i.y||(i.x=1e-8,i.y=1e-8),this.scale=i}return Pa(Scale,[{key:"apply",value:function apply(t){var r=this.scale,i=r.x,o=r.y;t.scale(i,o||i)}},{key:"unapply",value:function unapply(t){var r=this.scale,i=r.x,o=r.y;t.scale(1/i,1/o||i)}},{key:"applyToPoint",value:function applyToPoint(t){var r=this.scale,i=r.x,o=r.y;t.applyTransform([i||0,0,0,o||0,0,0])}}]),Scale}(),bu=function(){function Matrix(t,r){Ea(this,Matrix),this.type="matrix",this.matrix=[],this.matrix=toNumbers(r)}return Pa(Matrix,[{key:"apply",value:function apply(t){var r=this.matrix;t.transform(r[0],r[1],r[2],r[3],r[4],r[5])}},{key:"unapply",value:function unapply(t){var r=this.matrix,i=r[0],o=r[2],a=r[4],u=r[1],l=r[3],h=r[5],p=1/(i*(1*l-0*h)-o*(1*u-0*h)+a*(0*u-0*l));t.transform(p*(1*l-0*h),p*(0*h-1*u),p*(0*a-1*o),p*(1*i-0*a),p*(o*h-a*l),p*(a*u-i*h))}},{key:"applyToPoint",value:function applyToPoint(t){t.applyTransform(this.matrix)}}]),Matrix}();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}}var Su=function(t){za(Skew,bu);var r=function _createSuper(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(Skew);function Skew(t,i){var o;return Ea(this,Skew),(o=r.call(this,t,i)).type="skew",o.angle=null,o.angle=new uu(t,"angle",i),o}return Skew}();function _isNativeReflectConstruct$1(){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}}var wu=function(t){za(SkewX,Su);var r=function _createSuper$1(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$1()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(SkewX);function SkewX(t,i){var o;return Ea(this,SkewX),(o=r.call(this,t,i)).type="skewX",o.matrix=[1,0,Math.tan(o.angle.getRadians()),1,0,0],o}return SkewX}();function _isNativeReflectConstruct$2(){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}}var ku=function(t){za(SkewY,Su);var r=function _createSuper$2(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$2()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(SkewY);function SkewY(t,i){var o;return Ea(this,SkewY),(o=r.call(this,t,i)).type="skewY",o.matrix=[1,Math.tan(o.angle.getRadians()),0,1,0,0],o}return SkewY}();var Eu=function(){function Transform(t,r,i){var o=this;Ea(this,Transform),this.document=t,this.transforms=[];var a=function parseTransforms(t){return compressSpaces(t).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}(r),u=i?toNumbers(i):[];a.forEach((function(t){if("none"!==t){var r=function parseTransform(t){var r=t.split("("),i=ba(r,2),o=i[0],a=i[1];return[o.trim(),a.trim().replace(")","")]}(t),i=ba(r,2),a=i[0],l=i[1],h=Transform.transformTypes[a];void 0!==h&&o.transforms.push(new h(o.document,l,u))}}))}return Pa(Transform,[{key:"apply",value:function apply(t){for(var r=this.transforms,i=r.length,o=0;o<i;o++)r[o].apply(t)}},{key:"unapply",value:function unapply(t){for(var r=this.transforms,i=r.length-1;i>=0;i--)r[i].unapply(t)}},{key:"applyToPoint",value:function applyToPoint(t){for(var r=this.transforms,i=r.length,o=0;o<i;o++)r[o].applyToPoint(t)}}],[{key:"fromElement",value:function fromElement(t,r){var i=r.getStyle("transform",!1,!0),o=r.getStyle("transform-origin",!1,!0);return i.hasValue()?new Transform(t,i.getString(),o.getString()):null}}]),Transform}();Eu.transformTypes={translate:vu,rotate:mu,scale:xu,matrix:bu,skewX:wu,skewY:ku};var Pu=function(){function Element(t,r){var i=this,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Ea(this,Element),this.document=t,this.node=r,this.captureTextNodes=o,this.attributes={},this.styles={},this.stylesSpecificity={},this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],r&&1===r.nodeType){if(Array.from(r.attributes).forEach((function(r){var o=normalizeAttributeName(r.nodeName);i.attributes[o]=new uu(t,o,r.value)})),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue()){var a=this.getAttribute("style").getString().split(";").map((function(t){return t.trim()}));a.forEach((function(r){if(r){var o=r.split(":").map((function(t){return t.trim()})),a=ba(o,2),u=a[0],l=a[1];i.styles[u]=new uu(t,u,l)}}))}var u=t.definitions,l=this.getAttribute("id");l.hasValue()&&(u[l.getValue()]||(u[l.getValue()]=this)),Array.from(r.childNodes).forEach((function(r){if(1===r.nodeType)i.addChild(r);else if(o&&(3===r.nodeType||4===r.nodeType)){var a=t.createTextNode(r);a.getText().length>0&&i.addChild(a)}}))}}return Pa(Element,[{key:"getAttribute",value:function getAttribute(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.attributes[t];if(!i&&r){var o=new uu(this.document,t,"");return this.attributes[t]=o,o}return i||uu.empty(this.document)}},{key:"getHrefAttribute",value:function getHrefAttribute(){for(var t in this.attributes)if("href"===t||/:href$/.test(t))return this.attributes[t];return uu.empty(this.document)}},{key:"getStyle",value:function getStyle(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=this.styles[t];if(o)return o;var a=this.getAttribute(t);if(a&&a.hasValue())return this.styles[t]=a,a;if(!i){var u=this.parent;if(u){var l=u.getStyle(t);if(l&&l.hasValue())return l}}if(r){var h=new uu(this.document,t,"");return this.styles[t]=h,h}return o||uu.empty(this.document)}},{key:"render",value:function render(t){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(t.save(),this.getStyle("mask").hasValue()){var r=this.getStyle("mask").getDefinition();r&&(this.applyEffects(t),r.apply(t,this))}else if("none"!==this.getStyle("filter").getValue("none")){var i=this.getStyle("filter").getDefinition();i&&(this.applyEffects(t),i.apply(t,this))}else this.setContext(t),this.renderChildren(t),this.clearContext(t);t.restore()}}},{key:"setContext",value:function setContext(t){}},{key:"applyEffects",value:function applyEffects(t){var r=Eu.fromElement(this.document,this);r&&r.apply(t);var i=this.getStyle("clip-path",!1,!0);if(i.hasValue()){var o=i.getDefinition();o&&o.apply(t)}}},{key:"clearContext",value:function clearContext(t){}},{key:"renderChildren",value:function renderChildren(t){this.children.forEach((function(r){r.render(t)}))}},{key:"addChild",value:function addChild(t){var r=t instanceof Element?t:this.document.createElement(t);r.parent=this,Element.ignoreChildTypes.includes(r.type)||this.children.push(r)}},{key:"matchesSelector",value:function matchesSelector(t){var r=this.node;if("function"==typeof r.matches)return r.matches(t);var i=r.getAttribute("class");return!(!i||""===i)&&i.split(" ").some((function(r){if(".".concat(r)===t)return!0}))}},{key:"addStylesFromStyleDefinition",value:function addStylesFromStyleDefinition(){var t=this.document,r=t.styles,i=t.stylesSpecificity;for(var o in r)if("@"!==o[0]&&this.matchesSelector(o)){var a=r[o],u=i[o];if(a)for(var l in a){var h=this.stylesSpecificity[l];void 0===h&&(h="000"),u>=h&&(this.styles[l]=a[l],this.stylesSpecificity[l]=u)}}}},{key:"removeStyles",value:function removeStyles(t,r){return r.reduce((function(r,i){var o=t.getStyle(i);if(!o.hasValue())return r;var a=o.getString();return o.setValue(""),[].concat(Ha(r),[[i,a]])}),[])}},{key:"restoreStyles",value:function restoreStyles(t,r){r.forEach((function(r){var i=ba(r,2),o=i[0],a=i[1];t.getStyle(o,!0).setValue(a)}))}}]),Element}();function _isNativeReflectConstruct$3(){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}}Pu.ignoreChildTypes=["title"];var Cu=function(t){za(UnknownElement,Pu);var r=function _createSuper$3(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$3()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(UnknownElement);function UnknownElement(t,i,o){return Ea(this,UnknownElement),r.call(this,t,i,o)}return UnknownElement}();function wrapFontFamily(t){var r=t.trim();return/^('|")/.test(r)?r:'"'.concat(r,'"')}function prepareFontStyle(t){if(!t)return"";var r=t.trim().toLowerCase();switch(r){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return r;default:return/^oblique\s+(-|)\d+deg$/.test(r)?r:""}}function prepareFontWeight(t){if(!t)return"";var r=t.trim().toLowerCase();switch(r){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return r;default:return/^[\d.]+$/.test(r)?r:""}}var Ru=function(){function Font(t,r,i,o,a,u){Ea(this,Font);var l=u?"string"==typeof u?Font.parse(u):u:{};this.fontFamily=a||l.fontFamily,this.fontSize=o||l.fontSize,this.fontStyle=t||l.fontStyle,this.fontWeight=i||l.fontWeight,this.fontVariant=r||l.fontVariant}return Pa(Font,[{key:"toString",value:function toString(){return[prepareFontStyle(this.fontStyle),this.fontVariant,prepareFontWeight(this.fontWeight),this.fontSize,(t=this.fontFamily,void 0===Wi?t:t.trim().split(",").map(wrapFontFamily).join(","))].join(" ").trim();var t}}],[{key:"parse",value:function parse(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0,i="",o="",a="",u="",l="",h=compressSpaces(t).trim().split(" "),p={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return h.forEach((function(t){switch(!0){case!p.fontStyle&&Font.styles.includes(t):"inherit"!==t&&(i=t),p.fontStyle=!0;break;case!p.fontVariant&&Font.variants.includes(t):"inherit"!==t&&(o=t),p.fontStyle=!0,p.fontVariant=!0;break;case!p.fontWeight&&Font.weights.includes(t):"inherit"!==t&&(a=t),p.fontStyle=!0,p.fontVariant=!0,p.fontWeight=!0;break;case!p.fontSize:if("inherit"!==t){var r=t.split("/"),h=ba(r,1);u=h[0]}p.fontStyle=!0,p.fontVariant=!0,p.fontWeight=!0,p.fontSize=!0;break;default:"inherit"!==t&&(l+=t)}})),new Font(i,o,a,u,l,r)}}]),Font}();Ru.styles="normal|italic|oblique|inherit",Ru.variants="normal|small-caps|inherit",Ru.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";var Au=function(){function BoundingBox(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;Ea(this,BoundingBox),this.x1=t,this.y1=r,this.x2=i,this.y2=o,this.addPoint(t,r),this.addPoint(i,o)}return Pa(BoundingBox,[{key:"addPoint",value:function addPoint(t,r){void 0!==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)),void 0!==r&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=r,this.y2=r),r<this.y1&&(this.y1=r),r>this.y2&&(this.y2=r))}},{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){if(t){var r=t.x1,i=t.y1,o=t.x2,a=t.y2;this.addPoint(r,i),this.addPoint(o,a)}}},{key:"sumCubic",value:function sumCubic(t,r,i,o,a){return Math.pow(1-t,3)*r+3*Math.pow(1-t,2)*t*i+3*(1-t)*Math.pow(t,2)*o+Math.pow(t,3)*a}},{key:"bezierCurveAdd",value:function bezierCurveAdd(t,r,i,o,a){var u=6*r-12*i+6*o,l=-3*r+9*i-9*o+3*a,h=3*i-3*r;if(0!==l){var p=Math.pow(u,2)-4*h*l;if(!(p<0)){var y=(-u+Math.sqrt(p))/(2*l);0<y&&y<1&&(t?this.addX(this.sumCubic(y,r,i,o,a)):this.addY(this.sumCubic(y,r,i,o,a)));var g=(-u-Math.sqrt(p))/(2*l);0<g&&g<1&&(t?this.addX(this.sumCubic(g,r,i,o,a)):this.addY(this.sumCubic(g,r,i,o,a)))}}else{if(0===u)return;var d=-h/u;0<d&&d<1&&(t?this.addX(this.sumCubic(d,r,i,o,a)):this.addY(this.sumCubic(d,r,i,o,a)))}}},{key:"addBezierCurve",value:function addBezierCurve(t,r,i,o,a,u,l,h){this.addPoint(t,r),this.addPoint(l,h),this.bezierCurveAdd(!0,t,i,a,l),this.bezierCurveAdd(!1,r,o,u,h)}},{key:"addQuadraticCurve",value:function addQuadraticCurve(t,r,i,o,a,u){var l=t+2/3*(i-t),h=r+2/3*(o-r),p=l+1/3*(a-t),y=h+1/3*(u-r);this.addBezierCurve(t,r,l,p,h,y,a,u)}},{key:"isPointInBox",value:function isPointInBox(t,r){var i=this.x1,o=this.y1,a=this.x2,u=this.y2;return i<=t&&t<=a&&o<=r&&r<=u}},{key:"x",get:function get(){return this.x1}},{key:"y",get:function get(){return this.y1}},{key:"width",get:function get(){return this.x2-this.x1}},{key:"height",get:function get(){return this.y2-this.y1}}]),BoundingBox}();function _isNativeReflectConstruct$4(){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}}var _u=function(t){za(RenderedElement,Pu);var r=function _createSuper$4(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$4()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(RenderedElement);function RenderedElement(){var t;return Ea(this,RenderedElement),(t=r.apply(this,arguments)).modifiedEmSizeStack=!1,t}return Pa(RenderedElement,[{key:"calculateOpacity",value:function calculateOpacity(){for(var t=1,r=this;r;){var i=r.getStyle("opacity",!1,!0);i.hasValue()&&(t*=i.getNumber()),r=r.parent}return t}},{key:"setContext",value:function setContext(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!r){var i=this.getStyle("fill"),o=this.getStyle("fill-opacity"),a=this.getStyle("stroke"),u=this.getStyle("stroke-opacity");if(i.isUrlDefinition()){var l=i.getFillStyleDefinition(this,o);l&&(t.fillStyle=l)}else if(i.hasValue()){"currentColor"===i.getString()&&i.setValue(this.getStyle("color").getColor());var h=i.getColor();"inherit"!==h&&(t.fillStyle="none"===h?"rgba(0,0,0,0)":h)}if(o.hasValue()){var p=new uu(this.document,"fill",t.fillStyle).addOpacity(o).getColor();t.fillStyle=p}if(a.isUrlDefinition()){var y=a.getFillStyleDefinition(this,u);y&&(t.strokeStyle=y)}else if(a.hasValue()){"currentColor"===a.getString()&&a.setValue(this.getStyle("color").getColor());var g=a.getString();"inherit"!==g&&(t.strokeStyle="none"===g?"rgba(0,0,0,0)":g)}if(u.hasValue()){var d=new uu(this.document,"stroke",t.strokeStyle).addOpacity(u).getString();t.strokeStyle=d}var v=this.getStyle("stroke-width");if(v.hasValue()){var x=v.getPixels();t.lineWidth=x||1e-8}var b=this.getStyle("stroke-linecap"),S=this.getStyle("stroke-linejoin"),w=this.getStyle("stroke-miterlimit"),k=this.getStyle("paint-order"),E=this.getStyle("stroke-dasharray"),P=this.getStyle("stroke-dashoffset");if(b.hasValue()&&(t.lineCap=b.getString()),S.hasValue()&&(t.lineJoin=S.getString()),w.hasValue()&&(t.miterLimit=w.getNumber()),k.hasValue()&&(t.paintOrder=k.getValue()),E.hasValue()&&"none"!==E.getString()){var C=toNumbers(E.getString());void 0!==t.setLineDash?t.setLineDash(C):void 0!==t.webkitLineDash?t.webkitLineDash=C:void 0===t.mozDash||1===C.length&&0===C[0]||(t.mozDash=C);var R=P.getPixels();void 0!==t.lineDashOffset?t.lineDashOffset=R:void 0!==t.webkitLineDashOffset?t.webkitLineDashOffset=R:void 0!==t.mozDashOffset&&(t.mozDashOffset=R)}}if(this.modifiedEmSizeStack=!1,void 0!==t.font){var A=this.getStyle("font"),_=this.getStyle("font-style"),T=this.getStyle("font-variant"),M=this.getStyle("font-weight"),N=this.getStyle("font-size"),O=this.getStyle("font-family"),D=new Ru(_.getString(),T.getString(),M.getString(),N.hasValue()?"".concat(N.getPixels(!0),"px"):"",O.getString(),Ru.parse(A.getString(),t.font));_.setValue(D.fontStyle),T.setValue(D.fontVariant),M.setValue(D.fontWeight),N.setValue(D.fontSize),O.setValue(D.fontFamily),t.font=D.toString(),N.isPixels()&&(this.document.emSize=N.getPixels(),this.modifiedEmSizeStack=!0)}r||(this.applyEffects(t),t.globalAlpha=this.calculateOpacity())}},{key:"clearContext",value:function clearContext(t){Ya(Ba(RenderedElement.prototype),"clearContext",this).call(this,t),this.modifiedEmSizeStack&&this.document.popEmSize()}}]),RenderedElement}();function _isNativeReflectConstruct$5(){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}}var Tu=function(t){za(TextElement,_u);var r=function _createSuper$5(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$5()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(TextElement);function TextElement(t,i,o){var a;return Ea(this,TextElement),(a=r.call(this,t,i,(this instanceof TextElement?this.constructor:void 0)===TextElement||o)).type="text",a.x=0,a.y=0,a.measureCache=-1,a}return Pa(TextElement,[{key:"setContext",value:function setContext(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];Ya(Ba(TextElement.prototype),"setContext",this).call(this,t,r);var i=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();i&&(t.textBaseline=i)}},{key:"initializeCoordinates",value:function initializeCoordinates(t){this.x=this.getAttribute("x").getPixels("x"),this.y=this.getAttribute("y").getPixels("y");var r=this.getAttribute("dx"),i=this.getAttribute("dy");r.hasValue()&&(this.x+=r.getPixels("x")),i.hasValue()&&(this.y+=i.getPixels("y")),this.x+=this.getAnchorDelta(t,this,0)}},{key:"getBoundingBox",value:function getBoundingBox(t){var r=this;if("text"!==this.type)return this.getTElementBoundingBox(t);this.initializeCoordinates(t);var i=null;return this.children.forEach((function(o,a){var u=r.getChildBoundingBox(t,r,r,a);i?i.addBoundingBox(u):i=u})),i}},{key:"getFontSize",value:function getFontSize(){var t=this.document,r=this.parent,i=Ru.parse(t.ctx.font).fontSize;return r.getStyle("font-size").getNumber(i)}},{key:"getTElementBoundingBox",value:function getTElementBoundingBox(t){var r=this.getFontSize();return new Au(this.x,this.y-r,this.x+this.measureText(t),this.y)}},{key:"getGlyph",value:function getGlyph(t,r,i){var o=r[i],a=null;if(t.isArabic){var u=r.length,l=r[i-1],h=r[i+1],p="isolated";(0===i||" "===l)&&i<u-2&&" "!==h&&(p="terminal"),i>0&&" "!==l&&i<u-2&&" "!==h&&(p="medial"),i>0&&" "!==l&&(i===u-1||" "===h)&&(p="initial"),void 0!==t.glyphs[o]&&((a=t.glyphs[o][p])||"glyph"!==t.glyphs[o].type||(a=t.glyphs[o]))}else a=t.glyphs[o];return a||(a=t.missingGlyph),a}},{key:"getText",value:function getText(){return""}},{key:"getTextFromNode",value:function getTextFromNode(t){var r=t||this.node,i=Array.from(r.parentNode.childNodes),o=i.indexOf(r),a=i.length-1,u=compressSpaces(r.value||r.text||r.textContent||"");return 0===o&&(u=function trimLeft(t){return t.replace(/^[\n \t]+/,"")}(u)),o===a&&(u=function trimRight(t){return t.replace(/[\n \t]+$/,"")}(u)),u}},{key:"renderChildren",value:function renderChildren(t){var r=this;if("text"===this.type){this.initializeCoordinates(t),this.children.forEach((function(i,o){r.renderChild(t,r,r,o)}));var i=this.document.screen.mouse;i.isWorking()&&i.checkBoundingBox(this,this.getBoundingBox(t))}else this.renderTElementChildren(t)}},{key:"renderTElementChildren",value:function renderTElementChildren(t){var r=this.document,i=this.parent,o=this.getText(),a=i.getStyle("font-family").getDefinition();if(a)for(var u=a.fontFace.unitsPerEm,l=Ru.parse(r.ctx.font),h=i.getStyle("font-size").getNumber(l.fontSize),p=i.getStyle("font-style").getString(l.fontStyle),y=h/u,g=a.isRTL?o.split("").reverse().join(""):o,d=toNumbers(i.getAttribute("dx").getString()),v=g.length,x=0;x<v;x++){var b=this.getGlyph(a,g,x);t.translate(this.x,this.y),t.scale(y,-y);var S=t.lineWidth;t.lineWidth=t.lineWidth*u/h,"italic"===p&&t.transform(1,0,.4,1,0,0),b.render(t),"italic"===p&&t.transform(1,0,-.4,1,0,0),t.lineWidth=S,t.scale(1/y,-1/y),t.translate(-this.x,-this.y),this.x+=h*(b.horizAdvX||a.horizAdvX)/u,void 0===d[x]||isNaN(d[x])||(this.x+=d[x])}else{var w=this.x,k=this.y;"stroke"===t.paintOrder?(t.strokeStyle&&t.strokeText(o,w,k),t.fillStyle&&t.fillText(o,w,k)):(t.fillStyle&&t.fillText(o,w,k),t.strokeStyle&&t.strokeText(o,w,k))}}},{key:"getAnchorDelta",value:function getAnchorDelta(t,r,i){var o=this.getStyle("text-anchor").getString("start");if("start"!==o){for(var a=r.children,u=a.length,l=null,h=0,p=i;p<u&&(l=a[p],!(p>i&&l.getAttribute("x").hasValue()||l.getAttribute("text-anchor").hasValue()));p++)h+=l.measureTextRecursive(t);return-1*("end"===o?h:h/2)}return 0}},{key:"adjustChildCoordinates",value:function adjustChildCoordinates(t,r,i,o){var a=i.children[o];if("function"!=typeof a.measureText)return a;t.save(),a.setContext(t,!0);var u=a.getAttribute("x"),l=a.getAttribute("y"),h=a.getAttribute("dx"),p=a.getAttribute("dy"),y=a.getAttribute("text-anchor").getString("start");if(0===o&&"textNode"!==a.type&&(u.hasValue()||u.setValue(r.getAttribute("x").getValue("0")),l.hasValue()||l.setValue(r.getAttribute("y").getValue("0")),h.hasValue()||h.setValue(r.getAttribute("dx").getValue("0")),p.hasValue()||p.setValue(r.getAttribute("dy").getValue("0"))),u.hasValue()){if(a.x=u.getPixels("x")+r.getAnchorDelta(t,i,o),"start"!==y){var g=a.measureTextRecursive(t);a.x+=-1*("end"===y?g:g/2)}h.hasValue()&&(a.x+=h.getPixels("x"))}else{if("start"!==y){var d=a.measureTextRecursive(t);r.x+=-1*("end"===y?d:d/2)}h.hasValue()&&(r.x+=h.getPixels("x")),a.x=r.x}return r.x=a.x+a.measureText(t),l.hasValue()?(a.y=l.getPixels("y"),p.hasValue()&&(a.y+=p.getPixels("y"))):(p.hasValue()&&(r.y+=p.getPixels("y")),a.y=r.y),r.y=a.y,a.clearContext(t),t.restore(),a}},{key:"getChildBoundingBox",value:function getChildBoundingBox(t,r,i,o){var a=this.adjustChildCoordinates(t,r,i,o),u=a.getBoundingBox(t);return u?(a.children.forEach((function(i,o){var l=r.getChildBoundingBox(t,r,a,o);u.addBoundingBox(l)})),u):null}},{key:"renderChild",value:function renderChild(t,r,i,o){var a=this.adjustChildCoordinates(t,r,i,o);a.render(t),a.children.forEach((function(i,o){r.renderChild(t,r,a,o)}))}},{key:"measureTextRecursive",value:function measureTextRecursive(t){return this.children.reduce((function(r,i){return r+i.measureTextRecursive(t)}),this.measureText(t))}},{key:"measureText",value:function measureText(t){var r=this.measureCache;if(~r)return r;var i=this.getText(),o=this.measureTargetText(t,i);return this.measureCache=o,o}},{key:"measureTargetText",value:function measureTargetText(t,r){if(!r.length)return 0;var i=this.parent,o=i.getStyle("font-family").getDefinition();if(o){for(var a=this.getFontSize(),u=o.isRTL?r.split("").reverse().join(""):r,l=toNumbers(i.getAttribute("dx").getString()),h=u.length,p=0,y=0;y<h;y++){p+=(this.getGlyph(o,u,y).horizAdvX||o.horizAdvX)*a/o.fontFace.unitsPerEm,void 0===l[y]||isNaN(l[y])||(p+=l[y])}return p}if(!t.measureText)return 10*r.length;t.save(),this.setContext(t,!0);var g=t.measureText(r).width;return this.clearContext(t),t.restore(),g}}]),TextElement}();function _isNativeReflectConstruct$6(){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}}var Mu=function(t){za(TSpanElement,Tu);var r=function _createSuper$6(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$6()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(TSpanElement);function TSpanElement(t,i,o){var a;return Ea(this,TSpanElement),(a=r.call(this,t,i,(this instanceof TSpanElement?this.constructor:void 0)===TSpanElement||o)).type="tspan",a.text=a.children.length>0?"":a.getTextFromNode(),a}return Pa(TSpanElement,[{key:"getText",value:function getText(){return this.text}}]),TSpanElement}();function _isNativeReflectConstruct$7(){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}}var Nu=function(t){za(TextNode,Mu);var r=function _createSuper$7(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$7()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(TextNode);function TextNode(){var t;return Ea(this,TextNode),(t=r.apply(this,arguments)).type="textNode",t}return TextNode}();var Ou=function(){function PathParser(t){Ea(this,PathParser),this.control=null,this.start=null,this.current=null,this.command="",this.tokens=[],this.i=-1,this.previousCommand="",this.points=[],this.angles=[],this.tokens=function preparePath(t){return compressSpaces(t.replace(/,/gm," ").replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2").replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2").replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2").replace(/([0-9])([+\-])/gm,"$1 $2").replace(/(\.[0-9]*)(\.)/gm,"$1 $2").replace(/(\.[0-9]*)(\.)/gm,"$1 $2").replace(/([Aa](?:\s+(?:[0-9]*\.)?[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $2 $3 ")).trim()}(t).split(" ")}return Pa(PathParser,[{key:"reset",value:function reset(){this.i=-1,this.command="",this.previousCommand="",this.start=new cu(0,0),this.control=new cu(0,0),this.current=new cu(0,0),this.points=[],this.angles=[]}},{key:"isEnd",value:function isEnd(){return this.i>=this.tokens.length-1}},{key:"isCommandOrEnd",value:function isCommandOrEnd(){if(this.isEnd())return!0;var t=this.i,r=this.tokens;return/^[A-Za-z]$/.test(r[t+1])}},{key:"isRelativeCommand",value: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;default:return!1}}},{key:"getToken",value:function getToken(){return this.i++,this.tokens[this.i]}},{key:"getScalar",value:function getScalar(){return parseFloat(this.getToken())}},{key:"nextCommand",value:function nextCommand(){this.previousCommand=this.command,this.command=this.getToken()}},{key:"getPoint",value:function getPoint(){var t=new cu(this.getScalar(),this.getScalar());return this.makeAbsolute(t)}},{key:"getAsControlPoint",value:function getAsControlPoint(){var t=this.getPoint();return this.control=t,t}},{key:"getAsCurrentPoint",value:function getAsCurrentPoint(){var t=this.getPoint();return this.current=t,t}},{key:"getReflectedControlPoint",value:function getReflectedControlPoint(){var t=this.previousCommand.toLowerCase();if("c"!==t&&"s"!==t&&"q"!==t&&"t"!==t)return this.current;var r=this.current,i=r.x,o=r.y,a=this.control,u=a.x,l=a.y;return new cu(2*i-u,2*o-l)}},{key:"makeAbsolute",value:function makeAbsolute(t){if(this.isRelativeCommand()){var r=this.current,i=r.x,o=r.y;t.x+=i,t.y+=o}return t}},{key:"addMarker",value:function addMarker(t,r,i){var o=this.points,a=this.angles;i&&a.length>0&&!a[a.length-1]&&(a[a.length-1]=o[o.length-1].angleTo(i)),this.addMarkerAngle(t,r?r.angleTo(t):null)}},{key:"addMarkerAngle",value:function addMarkerAngle(t,r){this.points.push(t),this.angles.push(r)}},{key:"getMarkerPoints",value:function getMarkerPoints(){return this.points}},{key:"getMarkerAngles",value:function getMarkerAngles(){for(var t=this.angles,r=t.length,i=0;i<r;i++)if(!t[i])for(var o=i+1;o<r;o++)if(t[o]){t[i]=t[o];break}return t}}]),PathParser}();function _isNativeReflectConstruct$8(){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}}var Du=function(t){za(PathElement,_u);var r=function _createSuper$8(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$8()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(PathElement);function PathElement(t,i,o){var a;return Ea(this,PathElement),(a=r.call(this,t,i,o)).type="path",a.pathParser=null,a.pathParser=new Ou(a.getAttribute("d").getString()),a}return Pa(PathElement,[{key:"path",value:function path(t){var r=this.pathParser,i=new Au;for(r.reset(),t&&t.beginPath();!r.isEnd();)switch(r.nextCommand(),r.command){case"M":case"m":this.pathM(t,i);break;case"L":case"l":this.pathL(t,i);break;case"H":case"h":this.pathH(t,i);break;case"V":case"v":this.pathV(t,i);break;case"C":case"c":this.pathC(t,i);break;case"S":case"s":this.pathS(t,i);break;case"Q":case"q":this.pathQ(t,i);break;case"T":case"t":this.pathT(t,i);break;case"A":case"a":this.pathA(t,i);break;case"Z":case"z":this.pathZ(t,i)}return i}},{key:"getBoundingBox",value:function getBoundingBox(t){return this.path()}},{key:"getMarkers",value:function getMarkers(){var t=this.pathParser,r=t.getMarkerPoints(),i=t.getMarkerAngles();return r.map((function(t,r){return[t,i[r]]}))}},{key:"renderChildren",value:function renderChildren(t){this.path(t),this.document.screen.mouse.checkPath(this,t);var r=this.getStyle("fill-rule");""!==t.fillStyle&&("inherit"!==r.getString("inherit")?t.fill(r.getString()):t.fill()),""!==t.strokeStyle&&t.stroke();var i=this.getMarkers();if(i){var o=i.length-1,a=this.getStyle("marker-start"),u=this.getStyle("marker-mid"),l=this.getStyle("marker-end");if(a.isUrlDefinition()){var h=a.getDefinition(),p=ba(i[0],2),y=p[0],g=p[1];h.render(t,y,g)}if(u.isUrlDefinition())for(var d=u.getDefinition(),v=1;v<o;v++){var x=ba(i[v],2),b=x[0],S=x[1];d.render(t,b,S)}if(l.isUrlDefinition()){var w=l.getDefinition(),k=ba(i[o],2),E=k[0],P=k[1];w.render(t,E,P)}}}},{key:"pathM",value:function pathM(t,r){var i=this.pathParser,o=i.getAsCurrentPoint(),a=o.x,u=o.y;for(i.addMarker(o),r.addPoint(a,u),t&&t.moveTo(a,u),i.start=i.current;!i.isCommandOrEnd();){var l=i.getAsCurrentPoint(),h=l.x,p=l.y;i.addMarker(l,i.start),r.addPoint(h,p),t&&t.lineTo(h,p)}}},{key:"pathL",value:function pathL(t,r){for(var i=this.pathParser;!i.isCommandOrEnd();){var o=i.current,a=i.getAsCurrentPoint(),u=a.x,l=a.y;i.addMarker(a,o),r.addPoint(u,l),t&&t.lineTo(u,l)}}},{key:"pathH",value:function pathH(t,r){for(var i=this.pathParser;!i.isCommandOrEnd();){var o=i.current,a=new cu((i.isRelativeCommand()?o.x:0)+i.getScalar(),o.y);i.addMarker(a,o),i.current=a,r.addPoint(a.x,a.y),t&&t.lineTo(a.x,a.y)}}},{key:"pathV",value:function pathV(t,r){for(var i=this.pathParser;!i.isCommandOrEnd();){var o=i.current,a=new cu(o.x,(i.isRelativeCommand()?o.y:0)+i.getScalar());i.addMarker(a,o),i.current=a,r.addPoint(a.x,a.y),t&&t.lineTo(a.x,a.y)}}},{key:"pathC",value:function pathC(t,r){for(var i=this.pathParser;!i.isCommandOrEnd();){var o=i.current,a=i.getPoint(),u=i.getAsControlPoint(),l=i.getAsCurrentPoint();i.addMarker(l,u,a),r.addBezierCurve(o.x,o.y,a.x,a.y,u.x,u.y,l.x,l.y),t&&t.bezierCurveTo(a.x,a.y,u.x,u.y,l.x,l.y)}}},{key:"pathS",value:function pathS(t,r){for(var i=this.pathParser;!i.isCommandOrEnd();){var o=i.current,a=i.getReflectedControlPoint(),u=i.getAsControlPoint(),l=i.getAsCurrentPoint();i.addMarker(l,u,a),r.addBezierCurve(o.x,o.y,a.x,a.y,u.x,u.y,l.x,l.y),t&&t.bezierCurveTo(a.x,a.y,u.x,u.y,l.x,l.y)}}},{key:"pathQ",value:function pathQ(t,r){for(var i=this.pathParser;!i.isCommandOrEnd();){var o=i.current,a=i.getAsControlPoint(),u=i.getAsCurrentPoint();i.addMarker(u,a,a),r.addQuadraticCurve(o.x,o.y,a.x,a.y,u.x,u.y),t&&t.quadraticCurveTo(a.x,a.y,u.x,u.y)}}},{key:"pathT",value:function pathT(t,r){for(var i=this.pathParser;!i.isCommandOrEnd();){var o=i.current,a=i.getReflectedControlPoint();i.control=a;var u=i.getAsCurrentPoint();i.addMarker(u,a,a),r.addQuadraticCurve(o.x,o.y,a.x,a.y,u.x,u.y),t&&t.quadraticCurveTo(a.x,a.y,u.x,u.y)}}},{key:"pathA",value:function pathA(t,r){for(var i=this.pathParser;!i.isCommandOrEnd();){var o=i.current,a=i.getScalar(),u=i.getScalar(),l=i.getScalar()*(Math.PI/180),h=i.getScalar(),p=i.getScalar(),y=i.getAsCurrentPoint(),g=new cu(Math.cos(l)*(o.x-y.x)/2+Math.sin(l)*(o.y-y.y)/2,-Math.sin(l)*(o.x-y.x)/2+Math.cos(l)*(o.y-y.y)/2),d=Math.pow(g.x,2)/Math.pow(a,2)+Math.pow(g.y,2)/Math.pow(u,2);d>1&&(a*=Math.sqrt(d),u*=Math.sqrt(d));var v=(h===p?-1:1)*Math.sqrt((Math.pow(a,2)*Math.pow(u,2)-Math.pow(a,2)*Math.pow(g.y,2)-Math.pow(u,2)*Math.pow(g.x,2))/(Math.pow(a,2)*Math.pow(g.y,2)+Math.pow(u,2)*Math.pow(g.x,2)));isNaN(v)&&(v=0);var x=new cu(v*a*g.y/u,v*-u*g.x/a),b=new cu((o.x+y.x)/2+Math.cos(l)*x.x-Math.sin(l)*x.y,(o.y+y.y)/2+Math.sin(l)*x.x+Math.cos(l)*x.y),S=vectorsAngle([1,0],[(g.x-x.x)/a,(g.y-x.y)/u]),w=[(g.x-x.x)/a,(g.y-x.y)/u],k=[(-g.x-x.x)/a,(-g.y-x.y)/u],E=vectorsAngle(w,k);vectorsRatio(w,k)<=-1&&(E=Math.PI),vectorsRatio(w,k)>=1&&(E=0);var P=1-p?1:-1,C=S+P*(E/2),R=new cu(b.x+a*Math.cos(C),b.y+u*Math.sin(C));if(i.addMarkerAngle(R,C-P*Math.PI/2),i.addMarkerAngle(y,C-P*Math.PI),r.addPoint(y.x,y.y),t&&!isNaN(S)&&!isNaN(E)){var A=a>u?a:u,_=a>u?1:a/u,T=a>u?u/a:1;t.translate(b.x,b.y),t.rotate(l),t.scale(_,T),t.arc(0,0,A,S,S+E,Boolean(1-p)),t.scale(1/_,1/T),t.rotate(-l),t.translate(-b.x,-b.y)}}}},{key:"pathZ",value:function pathZ(t,r){var i=this.pathParser;t&&r.x1!==r.x2&&r.y1!==r.y2&&t.closePath(),i.current=i.start}}]),PathElement}();function _isNativeReflectConstruct$9(){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}}var $u=function(t){za(SVGElement,_u);var r=function _createSuper$9(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$9()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(SVGElement);function SVGElement(){var t;return Ea(this,SVGElement),(t=r.apply(this,arguments)).type="svg",t.root=!1,t}return Pa(SVGElement,[{key:"clearContext",value:function clearContext(t){Ya(Ba(SVGElement.prototype),"clearContext",this).call(this,t),this.document.screen.viewPort.removeCurrent()}},{key:"setContext",value:function setContext(t){var r=this.document,i=r.screen,o=r.window,a=t.canvas;if(i.setDefaults(t),a.style&&void 0!==t.font&&o&&void 0!==o.getComputedStyle){t.font=o.getComputedStyle(a).getPropertyValue("font");var u=new uu(r,"fontSize",Ru.parse(t.font).fontSize);u.hasValue()&&(r.rootEmSize=u.getPixels("y"),r.emSize=r.rootEmSize)}Ya(Ba(SVGElement.prototype),"setContext",this).call(this,t),this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0),t.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y"));var l=i.viewPort,h=l.width,p=l.height;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var y=this.getAttribute("refX"),g=this.getAttribute("refY"),d=this.getAttribute("viewBox"),v=d.hasValue()?toNumbers(d.getString()):null,x=!this.root&&"visible"!==this.getAttribute("overflow").getValue("hidden"),b=0,S=0,w=0,k=0;v&&(b=v[0],S=v[1]),this.root||(h=this.getStyle("width").getPixels("x"),p=this.getStyle("height").getPixels("y"),"marker"===this.type&&(w=b,k=S,b=0,S=0)),i.viewPort.setCurrent(h,p),v&&(h=v[2],p=v[3]),r.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:h,height:i.viewPort.height,desiredHeight:p,minX:b,minY:S,refX:y.getValue(),refY:g.getValue(),clip:x,clipX:w,clipY:k}),v&&(i.viewPort.removeCurrent(),i.viewPort.setCurrent(h,p))}},{key:"resize",value:function resize(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=this.getAttribute("width",!0),a=this.getAttribute("height",!0),u=this.getAttribute("viewBox"),l=this.getAttribute("style"),h=o.getNumber(0),p=a.getNumber(0);if(i)if("string"==typeof i)this.getAttribute("preserveAspectRatio",!0).setValue(i);else{var y=this.getAttribute("preserveAspectRatio");y.hasValue()&&y.setValue(y.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(o.setValue(t),a.setValue(r),u.hasValue()||u.setValue("0 0 ".concat(h||t," ").concat(p||r)),l.hasValue()){var g=this.getStyle("width"),d=this.getStyle("height");g.hasValue()&&g.setValue("".concat(t,"px")),d.hasValue()&&d.setValue("".concat(r,"px"))}}}]),SVGElement}();function _isNativeReflectConstruct$a(){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}}var Iu=function(t){za(RectElement,Du);var r=function _createSuper$a(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$a()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(RectElement);function RectElement(){var t;return Ea(this,RectElement),(t=r.apply(this,arguments)).type="rect",t}return Pa(RectElement,[{key:"path",value:function path(t){var r=this.getAttribute("x").getPixels("x"),i=this.getAttribute("y").getPixels("y"),o=this.getStyle("width").getPixels("x"),a=this.getStyle("height").getPixels("y"),u=this.getAttribute("rx"),l=this.getAttribute("ry"),h=u.getPixels("x"),p=l.getPixels("y");if(u.hasValue()&&!l.hasValue()&&(p=h),l.hasValue()&&!u.hasValue()&&(h=p),h=Math.min(h,o/2),p=Math.min(p,a/2),t){var y=(Math.sqrt(2)-1)/3*4;t.beginPath(),a>0&&o>0&&(t.moveTo(r+h,i),t.lineTo(r+o-h,i),t.bezierCurveTo(r+o-h+y*h,i,r+o,i+p-y*p,r+o,i+p),t.lineTo(r+o,i+a-p),t.bezierCurveTo(r+o,i+a-p+y*p,r+o-h+y*h,i+a,r+o-h,i+a),t.lineTo(r+h,i+a),t.bezierCurveTo(r+h-y*h,i+a,r,i+a-p+y*p,r,i+a-p),t.lineTo(r,i+p),t.bezierCurveTo(r,i+p-y*p,r+h-y*h,i,r+h,i),t.closePath())}return new Au(r,i,r+o,i+a)}},{key:"getMarkers",value:function getMarkers(){return null}}]),RectElement}();function _isNativeReflectConstruct$b(){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}}var Fu=function(t){za(CircleElement,Du);var r=function _createSuper$b(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$b()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(CircleElement);function CircleElement(){var t;return Ea(this,CircleElement),(t=r.apply(this,arguments)).type="circle",t}return Pa(CircleElement,[{key:"path",value:function path(t){var r=this.getAttribute("cx").getPixels("x"),i=this.getAttribute("cy").getPixels("y"),o=this.getAttribute("r").getPixels();return t&&o>0&&(t.beginPath(),t.arc(r,i,o,0,2*Math.PI,!1),t.closePath()),new Au(r-o,i-o,r+o,i+o)}},{key:"getMarkers",value:function getMarkers(){return null}}]),CircleElement}();function _isNativeReflectConstruct$c(){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}}var Vu=function(t){za(EllipseElement,Du);var r=function _createSuper$c(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$c()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(EllipseElement);function EllipseElement(){var t;return Ea(this,EllipseElement),(t=r.apply(this,arguments)).type="ellipse",t}return Pa(EllipseElement,[{key:"path",value:function path(t){var r=(Math.sqrt(2)-1)/3*4,i=this.getAttribute("rx").getPixels("x"),o=this.getAttribute("ry").getPixels("y"),a=this.getAttribute("cx").getPixels("x"),u=this.getAttribute("cy").getPixels("y");return t&&i>0&&o>0&&(t.beginPath(),t.moveTo(a+i,u),t.bezierCurveTo(a+i,u+r*o,a+r*i,u+o,a,u+o),t.bezierCurveTo(a-r*i,u+o,a-i,u+r*o,a-i,u),t.bezierCurveTo(a-i,u-r*o,a-r*i,u-o,a,u-o),t.bezierCurveTo(a+r*i,u-o,a+i,u-r*o,a+i,u),t.closePath()),new Au(a-i,u-o,a+i,u+o)}},{key:"getMarkers",value:function getMarkers(){return null}}]),EllipseElement}();function _isNativeReflectConstruct$d(){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}}var Lu=function(t){za(LineElement,Du);var r=function _createSuper$d(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$d()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(LineElement);function LineElement(){var t;return Ea(this,LineElement),(t=r.apply(this,arguments)).type="line",t}return Pa(LineElement,[{key:"getPoints",value:function getPoints(){return[new cu(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new cu(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}},{key:"path",value:function path(t){var r=this.getPoints(),i=ba(r,2),o=i[0],a=o.x,u=o.y,l=i[1],h=l.x,p=l.y;return t&&(t.beginPath(),t.moveTo(a,u),t.lineTo(h,p)),new Au(a,u,h,p)}},{key:"getMarkers",value:function getMarkers(){var t=this.getPoints(),r=ba(t,2),i=r[0],o=r[1],a=i.angleTo(o);return[[i,a],[o,a]]}}]),LineElement}();function _isNativeReflectConstruct$e(){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}}var ju=function(t){za(PolylineElement,Du);var r=function _createSuper$e(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$e()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(PolylineElement);function PolylineElement(t,i,o){var a;return Ea(this,PolylineElement),(a=r.call(this,t,i,o)).type="polyline",a.points=[],a.points=cu.parsePath(a.getAttribute("points").getString()),a}return Pa(PolylineElement,[{key:"path",value:function path(t){var r=this.points,i=ba(r,1)[0],o=i.x,a=i.y,u=new Au(o,a);return t&&(t.beginPath(),t.moveTo(o,a)),r.forEach((function(r){var i=r.x,o=r.y;u.addPoint(i,o),t&&t.lineTo(i,o)})),u}},{key:"getMarkers",value:function getMarkers(){var t=this.points,r=t.length-1,i=[];return t.forEach((function(o,a){a!==r&&i.push([o,o.angleTo(t[a+1])])})),i.length>0&&i.push([t[t.length-1],i[i.length-1][1]]),i}}]),PolylineElement}();function _isNativeReflectConstruct$f(){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}}var Bu=function(t){za(PolygonElement,ju);var r=function _createSuper$f(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$f()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(PolygonElement);function PolygonElement(){var t;return Ea(this,PolygonElement),(t=r.apply(this,arguments)).type="polygon",t}return Pa(PolygonElement,[{key:"path",value:function path(t){var r=Ya(Ba(PolygonElement.prototype),"path",this).call(this,t),i=ba(this.points,1)[0],o=i.x,a=i.y;return t&&(t.lineTo(o,a),t.closePath()),r}}]),PolygonElement}();function _isNativeReflectConstruct$g(){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}}var Gu=function(t){za(PatternElement,Pu);var r=function _createSuper$g(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$g()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(PatternElement);function PatternElement(){var t;return Ea(this,PatternElement),(t=r.apply(this,arguments)).type="pattern",t}return Pa(PatternElement,[{key:"createPattern",value:function createPattern(t,r,i){var o=this.getStyle("width").getPixels("x",!0),a=this.getStyle("height").getPixels("y",!0),u=new $u(this.document,null);u.attributes.viewBox=new uu(this.document,"viewBox",this.getAttribute("viewBox").getValue()),u.attributes.width=new uu(this.document,"width","".concat(o,"px")),u.attributes.height=new uu(this.document,"height","".concat(a,"px")),u.attributes.transform=new uu(this.document,"transform",this.getAttribute("patternTransform").getValue()),u.children=this.children;var l=this.document.createCanvas(o,a),h=l.getContext("2d"),p=this.getAttribute("x"),y=this.getAttribute("y");p.hasValue()&&y.hasValue()&&h.translate(p.getPixels("x",!0),y.getPixels("y",!0)),i.hasValue()?this.styles["fill-opacity"]=i:Reflect.deleteProperty(this.styles,"fill-opacity");for(var g=-1;g<=1;g++)for(var d=-1;d<=1;d++)h.save(),u.attributes.x=new uu(this.document,"x",g*l.width),u.attributes.y=new uu(this.document,"y",d*l.height),u.render(h),h.restore();return t.createPattern(l,"repeat")}}]),PatternElement}();function _isNativeReflectConstruct$h(){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}}var zu=function(t){za(MarkerElement,Pu);var r=function _createSuper$h(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$h()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(MarkerElement);function MarkerElement(){var t;return Ea(this,MarkerElement),(t=r.apply(this,arguments)).type="marker",t}return Pa(MarkerElement,[{key:"render",value:function render(t,r,i){if(r){var o=r.x,a=r.y,u=this.getAttribute("orient").getValue("auto"),l=this.getAttribute("markerUnits").getValue("strokeWidth");t.translate(o,a),"auto"===u&&t.rotate(i),"strokeWidth"===l&&t.scale(t.lineWidth,t.lineWidth),t.save();var h=new $u(this.document,null);h.type=this.type,h.attributes.viewBox=new uu(this.document,"viewBox",this.getAttribute("viewBox").getValue()),h.attributes.refX=new uu(this.document,"refX",this.getAttribute("refX").getValue()),h.attributes.refY=new uu(this.document,"refY",this.getAttribute("refY").getValue()),h.attributes.width=new uu(this.document,"width",this.getAttribute("markerWidth").getValue()),h.attributes.height=new uu(this.document,"height",this.getAttribute("markerHeight").getValue()),h.attributes.overflow=new uu(this.document,"overflow",this.getAttribute("overflow").getValue()),h.attributes.fill=new uu(this.document,"fill",this.getAttribute("fill").getColor("black")),h.attributes.stroke=new uu(this.document,"stroke",this.getAttribute("stroke").getValue("none")),h.children=this.children,h.render(t),t.restore(),"strokeWidth"===l&&t.scale(1/t.lineWidth,1/t.lineWidth),"auto"===u&&t.rotate(-i),t.translate(-o,-a)}}}]),MarkerElement}();function _isNativeReflectConstruct$i(){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}}var Uu=function(t){za(DefsElement,Pu);var r=function _createSuper$i(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$i()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(DefsElement);function DefsElement(){var t;return Ea(this,DefsElement),(t=r.apply(this,arguments)).type="defs",t}return Pa(DefsElement,[{key:"render",value:function render(){}}]),DefsElement}();function _isNativeReflectConstruct$j(){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}}var qu=function(t){za(GElement,_u);var r=function _createSuper$j(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$j()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(GElement);function GElement(){var t;return Ea(this,GElement),(t=r.apply(this,arguments)).type="g",t}return Pa(GElement,[{key:"getBoundingBox",value:function getBoundingBox(t){var r=new Au;return this.children.forEach((function(i){r.addBoundingBox(i.getBoundingBox(t))})),r}}]),GElement}();function _isNativeReflectConstruct$k(){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}}var Wu=function(t){za(GradientElement,Pu);var r=function _createSuper$k(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$k()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(GradientElement);function GradientElement(t,i,o){var a;Ea(this,GradientElement),(a=r.call(this,t,i,o)).attributesToInherit=["gradientUnits"],a.stops=[];var u=La(a),l=u.stops;return u.children.forEach((function(t){"stop"===t.type&&l.push(t)})),a}return Pa(GradientElement,[{key:"getGradientUnits",value:function getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}},{key:"createGradient",value:function createGradient(t,r,i){var o=this,a=this;this.getHrefAttribute().hasValue()&&(a=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(a));var u=a.stops,l=this.getGradient(t,r);if(!l)return this.addParentOpacity(i,u[u.length-1].color);if(u.forEach((function(t){l.addColorStop(t.offset,o.addParentOpacity(i,t.color))})),this.getAttribute("gradientTransform").hasValue()){var h=this.document,p=h.screen,y=p.MAX_VIRTUAL_PIXELS,g=p.viewPort,d=ba(g.viewPorts,1)[0],v=new Iu(h,null);v.attributes.x=new uu(h,"x",-y/3),v.attributes.y=new uu(h,"y",-y/3),v.attributes.width=new uu(h,"width",y),v.attributes.height=new uu(h,"height",y);var x=new qu(h,null);x.attributes.transform=new uu(h,"transform",this.getAttribute("gradientTransform").getValue()),x.children=[v];var b=new $u(h,null);b.attributes.x=new uu(h,"x",0),b.attributes.y=new uu(h,"y",0),b.attributes.width=new uu(h,"width",d.width),b.attributes.height=new uu(h,"height",d.height),b.children=[x];var S=h.createCanvas(d.width,d.height),w=S.getContext("2d");return w.fillStyle=l,b.render(w),w.createPattern(S,"no-repeat")}return l}},{key:"inheritStopContainer",value:function inheritStopContainer(t){var r=this;this.attributesToInherit.forEach((function(i){!r.getAttribute(i).hasValue()&&t.getAttribute(i).hasValue()&&r.getAttribute(i,!0).setValue(t.getAttribute(i).getValue())}))}},{key:"addParentOpacity",value:function addParentOpacity(t,r){return t.hasValue()?new uu(this.document,"color",r).addOpacity(t).getColor():r}}]),GradientElement}();function _isNativeReflectConstruct$l(){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}}var Hu=function(t){za(LinearGradientElement,Wu);var r=function _createSuper$l(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$l()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(LinearGradientElement);function LinearGradientElement(t,i,o){var a;return Ea(this,LinearGradientElement),(a=r.call(this,t,i,o)).type="linearGradient",a.attributesToInherit.push("x1","y1","x2","y2"),a}return Pa(LinearGradientElement,[{key:"getGradient",value:function getGradient(t,r){var i="objectBoundingBox"===this.getGradientUnits(),o=i?r.getBoundingBox(t):null;if(i&&!o)return null;this.getAttribute("x1").hasValue()||this.getAttribute("y1").hasValue()||this.getAttribute("x2").hasValue()||this.getAttribute("y2").hasValue()||(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var a=i?o.x+o.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),u=i?o.y+o.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),l=i?o.x+o.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),h=i?o.y+o.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return a===l&&u===h?null:t.createLinearGradient(a,u,l,h)}}]),LinearGradientElement}();function _isNativeReflectConstruct$m(){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}}var Xu=function(t){za(RadialGradientElement,Wu);var r=function _createSuper$m(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$m()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(RadialGradientElement);function RadialGradientElement(t,i,o){var a;return Ea(this,RadialGradientElement),(a=r.call(this,t,i,o)).type="radialGradient",a.attributesToInherit.push("cx","cy","r","fx","fy","fr"),a}return Pa(RadialGradientElement,[{key:"getGradient",value:function getGradient(t,r){var i="objectBoundingBox"===this.getGradientUnits(),o=r.getBoundingBox(t);if(i&&!o)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var a=i?o.x+o.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),u=i?o.y+o.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),l=a,h=u;this.getAttribute("fx").hasValue()&&(l=i?o.x+o.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(h=i?o.y+o.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var p=i?(o.width+o.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),y=this.getAttribute("fr").getPixels();return t.createRadialGradient(l,h,y,a,u,p)}}]),RadialGradientElement}();function _isNativeReflectConstruct$n(){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}}var Yu=function(t){za(StopElement,Pu);var r=function _createSuper$n(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$n()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(StopElement);function StopElement(t,i,o){var a;Ea(this,StopElement),(a=r.call(this,t,i,o)).type="stop";var u=Math.max(0,Math.min(1,a.getAttribute("offset").getNumber())),l=a.getStyle("stop-opacity"),h=a.getStyle("stop-color",!0);return""===h.getString()&&h.setValue("#000"),l.hasValue()&&(h=h.addOpacity(l)),a.offset=u,a.color=h.getColor(),a}return StopElement}();function _isNativeReflectConstruct$o(){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}}var Qu=function(t){za(AnimateElement,Pu);var r=function _createSuper$o(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$o()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(AnimateElement);function AnimateElement(t,i,o){var a;return Ea(this,AnimateElement),(a=r.call(this,t,i,o)).type="animate",a.duration=0,a.initialValue=null,a.initialUnits="",a.removed=!1,a.frozen=!1,t.screen.animations.push(La(a)),a.begin=a.getAttribute("begin").getMilliseconds(),a.maxDuration=a.begin+a.getAttribute("dur").getMilliseconds(),a.from=a.getAttribute("from"),a.to=a.getAttribute("to"),a.values=a.getAttribute("values"),a.values.hasValue()&&a.values.setValue(a.values.getString().split(";")),a}return Pa(AnimateElement,[{key:"getProperty",value:function getProperty(){var t=this.getAttribute("attributeType").getString(),r=this.getAttribute("attributeName").getString();return"CSS"===t?this.parent.getStyle(r,!0):this.parent.getAttribute(r,!0)}},{key:"calcValue",value:function calcValue(){var t=this.initialUnits,r=this.getProgress(),i=r.progress,o=r.from,a=r.to,u=o.getNumber()+(a.getNumber()-o.getNumber())*i;return"%"===t&&(u*=100),"".concat(u).concat(t)}},{key:"update",value:function update(t){var r=this.parent,i=this.getProperty();if(this.initialValue||(this.initialValue=i.getString(),this.initialUnits=i.getUnits()),this.duration>this.maxDuration){var o=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==o||this.frozen){if("remove"===o&&!this.removed)return this.removed=!0,i.setValue(r.animationFrozen?r.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,r.animationFrozen=!0,r.animationFrozenValue=i.getString();return!1}this.duration+=t;var a=!1;if(this.begin<this.duration){var u=this.calcValue(),l=this.getAttribute("type");if(l.hasValue()){var h=l.getString();u="".concat(h,"(").concat(u,")")}i.setValue(u),a=!0}return a}},{key:"getProgress",value:function getProgress(){var t=this.document,r=this.values,i={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(r.hasValue()){var o=i.progress*(r.getValue().length-1),a=Math.floor(o),u=Math.ceil(o);i.from=new uu(t,"from",parseFloat(r.getValue()[a])),i.to=new uu(t,"to",parseFloat(r.getValue()[u])),i.progress=(o-a)/(u-a)}else i.from=this.from,i.to=this.to;return i}}]),AnimateElement}();function _isNativeReflectConstruct$p(){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}}var Ku=function(t){za(AnimateColorElement,Qu);var r=function _createSuper$p(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$p()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(AnimateColorElement);function AnimateColorElement(){var t;return Ea(this,AnimateColorElement),(t=r.apply(this,arguments)).type="animateColor",t}return Pa(AnimateColorElement,[{key:"calcValue",value:function calcValue(){var t=this.getProgress(),r=t.progress,i=t.from,o=t.to,a=new Fa(i.getColor()),u=new Fa(o.getColor());if(a.ok&&u.ok){var l=a.r+(u.r-a.r)*r,h=a.g+(u.g-a.g)*r,p=a.b+(u.b-a.b)*r;return"rgb(".concat(parseInt(l,10),", ").concat(parseInt(h,10),", ").concat(parseInt(p,10),")")}return this.getAttribute("from").getColor()}}]),AnimateColorElement}();function _isNativeReflectConstruct$q(){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}}var Zu=function(t){za(AnimateTransformElement,Qu);var r=function _createSuper$q(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$q()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(AnimateTransformElement);function AnimateTransformElement(){var t;return Ea(this,AnimateTransformElement),(t=r.apply(this,arguments)).type="animateTransform",t}return Pa(AnimateTransformElement,[{key:"calcValue",value:function calcValue(){var t=this.getProgress(),r=t.progress,i=t.from,o=t.to,a=toNumbers(i.getString()),u=toNumbers(o.getString());return a.map((function(t,i){return t+(u[i]-t)*r})).join(" ")}}]),AnimateTransformElement}();function _createForOfIteratorHelper(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=function _unsupportedIterableToArray$1(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray$1(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray$1(t,r)}(t))){var r=0,i=function F(){};return{s:i,n:function n(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,u=!0,l=!1;return{s:function s(){o=t[Symbol.iterator]()},n:function n(){var t=o.next();return u=t.done,t},e:function e(t){l=!0,a=t},f:function f(){try{u||null==o.return||o.return()}finally{if(l)throw a}}}}function _arrayLikeToArray$1(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function _isNativeReflectConstruct$r(){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}}var Ju=function(t){za(FontElement,Pu);var r=function _createSuper$r(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$r()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(FontElement);function FontElement(t,i,o){var a;Ea(this,FontElement),(a=r.call(this,t,i,o)).type="font",a.glyphs={},a.horizAdvX=a.getAttribute("horiz-adv-x").getNumber();var u,l=t.definitions,h=_createForOfIteratorHelper(La(a).children);try{for(h.s();!(u=h.n()).done;){var p=u.value;switch(p.type){case"font-face":a.fontFace=p;var y=p.getStyle("font-family");y.hasValue()&&(l[y.getString()]=La(a));break;case"missing-glyph":a.missingGlyph=p;break;case"glyph":var g=p;g.arabicForm?(a.isRTL=!0,a.isArabic=!0,void 0===a.glyphs[g.unicode]&&(a.glyphs[g.unicode]={}),a.glyphs[g.unicode][g.arabicForm]=g):a.glyphs[g.unicode]=g}}}catch(t){h.e(t)}finally{h.f()}return a}return Pa(FontElement,[{key:"render",value:function render(){}}]),FontElement}();function _isNativeReflectConstruct$s(){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}}var ts=function(t){za(FontFaceElement,Pu);var r=function _createSuper$s(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$s()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(FontFaceElement);function FontFaceElement(t,i,o){var a;return Ea(this,FontFaceElement),(a=r.call(this,t,i,o)).type="font-face",a.ascent=a.getAttribute("ascent").getNumber(),a.descent=a.getAttribute("descent").getNumber(),a.unitsPerEm=a.getAttribute("units-per-em").getNumber(),a}return FontFaceElement}();function _isNativeReflectConstruct$t(){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}}var es=function(t){za(MissingGlyphElement,Du);var r=function _createSuper$t(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$t()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(MissingGlyphElement);function MissingGlyphElement(){var t;return Ea(this,MissingGlyphElement),(t=r.apply(this,arguments)).type="missing-glyph",t.horizAdvX=0,t}return MissingGlyphElement}();function _isNativeReflectConstruct$u(){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}}var rs=function(t){za(GlyphElement,Du);var r=function _createSuper$u(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$u()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(GlyphElement);function GlyphElement(t,i,o){var a;return Ea(this,GlyphElement),(a=r.call(this,t,i,o)).type="glyph",a.horizAdvX=a.getAttribute("horiz-adv-x").getNumber(),a.unicode=a.getAttribute("unicode").getString(),a.arabicForm=a.getAttribute("arabic-form").getString(),a}return GlyphElement}();function _isNativeReflectConstruct$v(){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}}var ns=function(t){za(TRefElement,Tu);var r=function _createSuper$v(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$v()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(TRefElement);function TRefElement(){var t;return Ea(this,TRefElement),(t=r.apply(this,arguments)).type="tref",t}return Pa(TRefElement,[{key:"getText",value:function getText(){var t=this.getHrefAttribute().getDefinition();if(t){var r=t.children[0];if(r)return r.getText()}return""}}]),TRefElement}();function _isNativeReflectConstruct$w(){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}}var is=function(t){za(AElement,Tu);var r=function _createSuper$w(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$w()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(AElement);function AElement(t,i,o){var a;Ea(this,AElement),(a=r.call(this,t,i,o)).type="a";var u=i.childNodes,l=u[0],h=u.length>0&&Array.from(u).every((function(t){return 3===t.nodeType}));return a.hasText=h,a.text=h?a.getTextFromNode(l):"",a}return Pa(AElement,[{key:"getText",value:function getText(){return this.text}},{key:"renderChildren",value:function renderChildren(t){if(this.hasText){Ya(Ba(AElement.prototype),"renderChildren",this).call(this,t);var r=this.document,i=this.x,o=this.y,a=r.screen.mouse,u=new uu(r,"fontSize",Ru.parse(r.ctx.font).fontSize);a.isWorking()&&a.checkBoundingBox(this,new Au(i,o-u.getPixels("y"),i+this.measureText(t),o))}else if(this.children.length>0){var l=new qu(this.document,null);l.children=this.children,l.parent=this,l.render(t)}}},{key:"onClick",value:function onClick(){var t=this.document.window;t&&t.open(this.getHrefAttribute().getString())}},{key:"onMouseMove",value:function onMouseMove(){this.document.ctx.canvas.style.cursor="pointer"}}]),AElement}();function _createForOfIteratorHelper$1(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=function _unsupportedIterableToArray$1$1(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray$1$1(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray$1$1(t,r)}(t))){var r=0,i=function F(){};return{s:i,n:function n(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,u=!0,l=!1;return{s:function s(){o=t[Symbol.iterator]()},n:function n(){var t=o.next();return u=t.done,t},e:function e(t){l=!0,a=t},f:function f(){try{u||null==o.return||o.return()}finally{if(l)throw a}}}}function _arrayLikeToArray$1$1(t,r){(null==r||r>t.length)&&(r=t.length);for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function _isNativeReflectConstruct$x(){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}}var os=function(t){za(TextPathElement,Tu);var r=function _createSuper$x(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$x()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(TextPathElement);function TextPathElement(t,i,o){var a;Ea(this,TextPathElement),(a=r.call(this,t,i,o)).type="textPath",a.textWidth=0,a.textHeight=0,a.pathLength=-1,a.glyphInfo=null,a.letterSpacingCache=[],a.measuresCache=new Map([["",0]]);var u=a.getHrefAttribute().getDefinition();return a.text=a.getTextFromNode(),a.dataArray=a.parsePathData(u),a}return Pa(TextPathElement,[{key:"getText",value:function getText(){return this.text}},{key:"path",value:function path(t){var r=this.dataArray;t&&t.beginPath(),r.forEach((function(r){var i=r.command,o=r.points;switch(i){case"L":t&&t.lineTo(o[0],o[1]);break;case"M":t&&t.moveTo(o[0],o[1]);break;case"C":t&&t.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]);break;case"Q":t&&t.quadraticCurveTo(o[0],o[1],o[2],o[3]);break;case"A":var a=o[0],u=o[1],l=o[2],h=o[3],p=o[4],y=o[5],g=o[6],d=o[7],v=l>h?l:h,x=l>h?1:l/h,b=l>h?h/l:1;t&&(t.translate(a,u),t.rotate(g),t.scale(x,b),t.arc(0,0,v,p,p+y,Boolean(1-d)),t.scale(1/x,1/b),t.rotate(-g),t.translate(-a,-u));break;case"z":t&&t.closePath()}}))}},{key:"renderChildren",value:function renderChildren(t){this.setTextData(t),t.save();var r=this.parent.getStyle("text-decoration").getString(),i=this.getFontSize(),o=this.glyphInfo,a=t.fillStyle;"underline"===r&&t.beginPath(),o.forEach((function(a,u){var l=a.p0,h=a.p1,p=a.text;t.save(),t.translate(l.x,l.y),t.rotate(o[u].rotation),t.fillStyle&&t.fillText(p,0,0),t.strokeStyle&&t.strokeText(p,0,0),t.restore(),"underline"===r&&(0===u&&t.moveTo(l.x,l.y+i/8),t.lineTo(h.x,h.y+i/5))})),"underline"===r&&(t.lineWidth=i/20,t.strokeStyle=a,t.stroke(),t.closePath()),t.restore()}},{key:"getLetterSpacingAt",value:function getLetterSpacingAt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[t]||0}},{key:"findSegmentToFitChar",value:function findSegmentToFitChar(t,r,i,o,a,u,l,h){var p=u,y=this.measureText(t,l);" "===l&&"justify"===r&&i<o&&(y+=(o-i)/a),h>-1&&(p+=this.getLetterSpacingAt(h));var g=this.textHeight/20,d={p0:this.getEquidistantPointOnPath(p,g),p1:this.getEquidistantPointOnPath(p+y,g)};return{offset:p+=y,segment:d}}},{key:"measureText",value:function measureText(t,r){var i=this.measuresCache,o=r||this.getText();if(i.has(o))return i.get(o);var a=this.measureTargetText(t,o);return i.set(o,a),a}},{key:"setTextData",value:function setTextData(t){var r=this;if(!this.glyphInfo){var i=this.getText(),o=i.split(""),a=i.split(" ").length-1,u=toNumbers(this.parent.getAttribute("dx").getString("0")),l=this.parent.getStyle("text-anchor").getString("start"),h=this.getStyle("letter-spacing"),p=this.parent.getStyle("letter-spacing"),y=0;h.hasValue()&&"inherit"!==h.getValue()?h.hasValue()&&"initial"!==h.getValue()&&"unset"!==h.getValue()&&(y=h.getPixels()):y=p.getPixels();var g=[],d=i.length;this.letterSpacingCache=g;for(var v=0;v<d;v++)g.push(void 0!==u[v]?u[v]:y);var x=g.reduce((function(t,r){return t+r||0}),0);this.textWidth=this.measureText(t),this.textHeight=this.getFontSize();var b=Math.max(this.textWidth+x,0);this.glyphInfo=[];var S=this.getPathLength(),w=this.getStyle("startOffset").getNumber(0)*S,k=0;"middle"!==l&&"center"!==l||(k=-b/2),"end"!==l&&"right"!==l||(k=-b),k+=w,o.forEach((function(i,u){var h=r.findSegmentToFitChar(t,l,b,S,a,k,i,u),p=h.offset,y=h.segment;if(k=p,y.p0&&y.p1){var g=r.getLineLength(y.p0.x,y.p0.y,y.p1.x,y.p1.y),d=r.getPointOnLine(0+g/2,y.p0.x,y.p0.y,y.p1.x,y.p1.y),v=Math.atan2(y.p1.y-y.p0.y,y.p1.x-y.p0.x);r.glyphInfo.push({transposeX:d.x,transposeY:d.y,text:o[u],p0:y.p0,p1:y.p1,rotation:v})}}))}}},{key:"parsePathData",value:function parsePathData(t){if(this.pathLength=-1,!t)return[];var r=[],i=t.pathParser;for(i.reset();!i.isEnd();){var o=i.current,a=o?o.x:0,u=o?o.y:0,l="",h=[];i.nextCommand();var p=i.command.toUpperCase();switch(i.command){case"M":case"m":l=this.pathM(i,h);break;case"L":case"l":l=this.pathL(i,h);break;case"H":case"h":l=this.pathH(i,h);break;case"V":case"v":l=this.pathV(i,h);break;case"C":case"c":this.pathC(i,h);break;case"S":case"s":l=this.pathS(i,h);break;case"Q":case"q":this.pathQ(i,h);break;case"T":case"t":l=this.pathT(i,h);break;case"A":case"a":h=this.pathA(i);break;case"Z":case"z":i.current=i.start}"Z"!==p?r.push({command:l||p,points:h,start:{x:a,y:u},pathLength:this.calcLength(a,u,l||p,h)}):r.push({command:"z",points:[],pathLength:0})}return r}},{key:"pathM",value:function pathM(t,r){var i=t.getAsCurrentPoint();for(r.push(i.x,i.y),t.start=t.current;!t.isCommandOrEnd();){var o=t.getAsCurrentPoint();return r.push(o.x,o.y),"L"}}},{key:"pathL",value:function pathL(t,r){for(;!t.isCommandOrEnd();){var i=t.getAsCurrentPoint();r.push(i.x,i.y)}return"L"}},{key:"pathH",value:function pathH(t,r){for(;!t.isCommandOrEnd();){var i=t.current,o=new cu((t.isRelativeCommand()?i.x:0)+t.getScalar(),i.y);r.push(o.x,o.y),t.current=o}return"L"}},{key:"pathV",value:function pathV(t,r){for(;!t.isCommandOrEnd();){var i=t.current,o=new cu(i.x,(t.isRelativeCommand()?i.y:0)+t.getScalar());r.push(o.x,o.y),t.current=o}return"L"}},{key:"pathC",value:function pathC(t,r){for(;!t.isCommandOrEnd();){var i=t.getPoint(),o=t.getAsControlPoint(),a=t.getAsCurrentPoint();r.push(i.x,i.y,o.x,o.y,a.x,a.y)}}},{key:"pathS",value:function pathS(t,r){for(;!t.isCommandOrEnd();){var i=t.getReflectedControlPoint(),o=t.getAsControlPoint(),a=t.getAsCurrentPoint();r.push(i.x,i.y,o.x,o.y,a.x,a.y)}return"C"}},{key:"pathQ",value:function pathQ(t,r){for(;!t.isCommandOrEnd();){var i=t.getAsControlPoint(),o=t.getAsCurrentPoint();r.push(i.x,i.y,o.x,o.y)}}},{key:"pathT",value:function pathT(t,r){for(;!t.isCommandOrEnd();){var i=t.getReflectedControlPoint();t.control=i;var o=t.getAsCurrentPoint();r.push(i.x,i.y,o.x,o.y)}return"Q"}},{key:"pathA",value:function pathA(t){for(;!t.isCommandOrEnd();){var r=t.current,i=t.getScalar(),o=t.getScalar(),a=t.getScalar()*(Math.PI/180),u=t.getScalar(),l=t.getScalar(),h=t.getAsCurrentPoint(),p=new cu(Math.cos(a)*(r.x-h.x)/2+Math.sin(a)*(r.y-h.y)/2,-Math.sin(a)*(r.x-h.x)/2+Math.cos(a)*(r.y-h.y)/2),y=Math.pow(p.x,2)/Math.pow(i,2)+Math.pow(p.y,2)/Math.pow(o,2);y>1&&(i*=Math.sqrt(y),o*=Math.sqrt(y));var g=(u===l?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(o,2)-Math.pow(i,2)*Math.pow(p.y,2)-Math.pow(o,2)*Math.pow(p.x,2))/(Math.pow(i,2)*Math.pow(p.y,2)+Math.pow(o,2)*Math.pow(p.x,2)));isNaN(g)&&(g=0);var d=new cu(g*i*p.y/o,g*-o*p.x/i),v=new cu((r.x+h.x)/2+Math.cos(a)*d.x-Math.sin(a)*d.y,(r.y+h.y)/2+Math.sin(a)*d.x+Math.cos(a)*d.y),x=vectorsAngle([1,0],[(p.x-d.x)/i,(p.y-d.y)/o]),b=[(p.x-d.x)/i,(p.y-d.y)/o],S=[(-p.x-d.x)/i,(-p.y-d.y)/o],w=vectorsAngle(b,S);return vectorsRatio(b,S)<=-1&&(w=Math.PI),vectorsRatio(b,S)>=1&&(w=0),0===l&&w>0&&(w-=2*Math.PI),1===l&&w<0&&(w+=2*Math.PI),[v.x,v.y,i,o,x,w,a,l]}}},{key:"calcLength",value:function calcLength(t,r,i,o){var a=0,u=null,l=null,h=0;switch(i){case"L":return this.getLineLength(t,r,o[0],o[1]);case"C":for(a=0,u=this.getPointOnCubicBezier(0,t,r,o[0],o[1],o[2],o[3],o[4],o[5]),h=.01;h<=1;h+=.01)l=this.getPointOnCubicBezier(h,t,r,o[0],o[1],o[2],o[3],o[4],o[5]),a+=this.getLineLength(u.x,u.y,l.x,l.y),u=l;return a;case"Q":for(a=0,u=this.getPointOnQuadraticBezier(0,t,r,o[0],o[1],o[2],o[3]),h=.01;h<=1;h+=.01)l=this.getPointOnQuadraticBezier(h,t,r,o[0],o[1],o[2],o[3]),a+=this.getLineLength(u.x,u.y,l.x,l.y),u=l;return a;case"A":a=0;var p=o[4],y=o[5],g=o[4]+y,d=Math.PI/180;if(Math.abs(p-g)<d&&(d=Math.abs(p-g)),u=this.getPointOnEllipticalArc(o[0],o[1],o[2],o[3],p,0),y<0)for(h=p-d;h>g;h-=d)l=this.getPointOnEllipticalArc(o[0],o[1],o[2],o[3],h,0),a+=this.getLineLength(u.x,u.y,l.x,l.y),u=l;else for(h=p+d;h<g;h+=d)l=this.getPointOnEllipticalArc(o[0],o[1],o[2],o[3],h,0),a+=this.getLineLength(u.x,u.y,l.x,l.y),u=l;return l=this.getPointOnEllipticalArc(o[0],o[1],o[2],o[3],g,0),a+=this.getLineLength(u.x,u.y,l.x,l.y)}return 0}},{key:"getPointOnLine",value:function getPointOnLine(t,r,i,o,a){var u=arguments.length>5&&void 0!==arguments[5]?arguments[5]:r,l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:i,h=(a-i)/(o-r+1e-8),p=Math.sqrt(t*t/(1+h*h));o<r&&(p*=-1);var y=h*p,g=null;if(o===r)g={x:u,y:l+y};else if((l-i)/(u-r+1e-8)===h)g={x:u+p,y:l+y};else{var d=0,v=0,x=this.getLineLength(r,i,o,a);if(x<1e-8)return null;var b=(u-r)*(o-r)+(l-i)*(a-i);d=r+(b/=x*x)*(o-r),v=i+b*(a-i);var S=this.getLineLength(u,l,d,v),w=Math.sqrt(t*t-S*S);p=Math.sqrt(w*w/(1+h*h)),o<r&&(p*=-1),g={x:d+p,y:v+(y=h*p)}}return g}},{key:"getPointOnPath",value:function getPointOnPath(t){var r=this.getPathLength(),i=0,o=null;if(t<-5e-5||t-5e-5>r)return null;var a,u=_createForOfIteratorHelper$1(this.dataArray);try{for(u.s();!(a=u.n()).done;){var l=a.value;if(!l||!(l.pathLength<5e-5||i+l.pathLength+5e-5<t)){var h=t-i,p=0;switch(l.command){case"L":o=this.getPointOnLine(h,l.start.x,l.start.y,l.points[0],l.points[1],l.start.x,l.start.y);break;case"A":var y=l.points[4],g=l.points[5],d=l.points[4]+g;if(p=y+h/l.pathLength*g,g<0&&p<d||g>=0&&p>d)break;o=this.getPointOnEllipticalArc(l.points[0],l.points[1],l.points[2],l.points[3],p,l.points[6]);break;case"C":(p=h/l.pathLength)>1&&(p=1),o=this.getPointOnCubicBezier(p,l.start.x,l.start.y,l.points[0],l.points[1],l.points[2],l.points[3],l.points[4],l.points[5]);break;case"Q":(p=h/l.pathLength)>1&&(p=1),o=this.getPointOnQuadraticBezier(p,l.start.x,l.start.y,l.points[0],l.points[1],l.points[2],l.points[3])}if(o)return o;break}i+=l.pathLength}}catch(t){u.e(t)}finally{u.f()}return null}},{key:"getLineLength",value:function getLineLength(t,r,i,o){return Math.sqrt((i-t)*(i-t)+(o-r)*(o-r))}},{key:"getPathLength",value:function getPathLength(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce((function(t,r){return r.pathLength>0?t+r.pathLength:t}),0)),this.pathLength}},{key:"getPointOnCubicBezier",value:function getPointOnCubicBezier(t,r,i,o,a,u,l,h,p){return{x:h*CB1(t)+u*CB2(t)+o*CB3(t)+r*CB4(t),y:p*CB1(t)+l*CB2(t)+a*CB3(t)+i*CB4(t)}}},{key:"getPointOnQuadraticBezier",value:function getPointOnQuadraticBezier(t,r,i,o,a,u,l){return{x:u*QB1(t)+o*QB2(t)+r*QB3(t),y:l*QB1(t)+a*QB2(t)+i*QB3(t)}}},{key:"getPointOnEllipticalArc",value:function getPointOnEllipticalArc(t,r,i,o,a,u){var l=Math.cos(u),h=Math.sin(u),p=i*Math.cos(a),y=o*Math.sin(a);return{x:t+(p*l-y*h),y:r+(p*h+y*l)}}},{key:"buildEquidistantCache",value:function buildEquidistantCache(t,r){var i=this.getPathLength(),o=r||.25,a=t||i/100;if(!this.equidistantCache||this.equidistantCache.step!==a||this.equidistantCache.precision!==o){this.equidistantCache={step:a,precision:o,points:[]};for(var u=0,l=0;l<=i;l+=o){var h=this.getPointOnPath(l),p=this.getPointOnPath(l+o);h&&p&&((u+=this.getLineLength(h.x,h.y,p.x,p.y))>=a&&(this.equidistantCache.points.push({x:h.x,y:h.y,distance:l}),u-=a))}}}},{key:"getEquidistantPointOnPath",value:function getEquidistantPointOnPath(t,r,i){if(this.buildEquidistantCache(r,i),t<0||t-this.getPathLength()>5e-5)return null;var o=Math.round(t/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[o]||null}}]),TextPathElement}();function _isNativeReflectConstruct$y(){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}}var as=function(t){za(ImageElement,_u);var r,i,o=function _createSuper$y(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$y()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(ImageElement);function ImageElement(t,r,i){var a;Ea(this,ImageElement),(a=o.call(this,t,r,i)).type="image",a.loaded=!1;var u=a.getHrefAttribute().getString();if(!u)return ja(a);var l=/\.svg$/.test(u);return t.images.push(La(a)),l?a.loadSvg(u):a.loadImage(u),a.isSvg=l,a}return Pa(ImageElement,[{key:"loadImage",value:(i=wa(Sa.mark((function _callee(t){var r;return Sa.wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,this.document.createImage(t);case 3:r=i.sent,this.image=r,i.next=10;break;case 7:i.prev=7,i.t0=i.catch(0),console.error('Error while loading image "'.concat(t,'":'),i.t0);case 10:this.loaded=!0;case 11:case"end":return i.stop()}}),_callee,this,[[0,7]])}))),function loadImage(t){return i.apply(this,arguments)})},{key:"loadSvg",value:(r=wa(Sa.mark((function _callee2(t){var r,i;return Sa.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,this.document.fetch(t);case 3:return r=o.sent,o.next=6,r.text();case 6:i=o.sent,this.image=i,o.next=13;break;case 10:o.prev=10,o.t0=o.catch(0),console.error('Error while loading image "'.concat(t,'":'),o.t0);case 13:this.loaded=!0;case 14:case"end":return o.stop()}}),_callee2,this,[[0,10]])}))),function loadSvg(t){return r.apply(this,arguments)})},{key:"renderChildren",value:function renderChildren(t){var r=this.document,i=this.image,o=this.loaded,a=this.getAttribute("x").getPixels("x"),u=this.getAttribute("y").getPixels("y"),l=this.getStyle("width").getPixels("x"),h=this.getStyle("height").getPixels("y");if(o&&i&&l&&h){if(t.save(),this.isSvg)r.canvg.forkString(t,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:a,offsetY:u,scaleWidth:l,scaleHeight:h}).render();else{var p=this.image;t.translate(a,u),r.setViewBox({ctx:t,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:l,desiredWidth:p.width,height:h,desiredHeight:p.height}),this.loaded&&(void 0===p.complete||p.complete)&&t.drawImage(p,0,0)}t.restore()}}},{key:"getBoundingBox",value:function getBoundingBox(){var t=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),i=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y");return new Au(t,r,t+i,r+o)}}]),ImageElement}();function _isNativeReflectConstruct$z(){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}}var us=function(t){za(SymbolElement,_u);var r=function _createSuper$z(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$z()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(SymbolElement);function SymbolElement(){var t;return Ea(this,SymbolElement),(t=r.apply(this,arguments)).type="symbol",t}return Pa(SymbolElement,[{key:"render",value:function render(t){}}]),SymbolElement}(),ss=function(){function SVGFontLoader(t){Ea(this,SVGFontLoader),this.document=t,this.loaded=!1,t.fonts.push(this)}var t;return Pa(SVGFontLoader,[{key:"load",value:(t=wa(Sa.mark((function _callee(t,r){var i,o,a;return Sa.wrap((function _callee$(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,i=this.document,u.next=4,i.canvg.parser.load(r);case 4:o=u.sent,a=o.getElementsByTagName("font"),Array.from(a).forEach((function(r){var o=i.createElement(r);i.definitions[t]=o})),u.next=12;break;case 9:u.prev=9,u.t0=u.catch(0),console.error('Error while loading font "'.concat(r,'":'),u.t0);case 12:this.loaded=!0;case 13:case"end":return u.stop()}}),_callee,this,[[0,9]])}))),function load(r,i){return t.apply(this,arguments)})}]),SVGFontLoader}();function _isNativeReflectConstruct$A(){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}}var cs=function(t){za(StyleElement,Pu);var r=function _createSuper$A(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$A()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(StyleElement);function StyleElement(t,i,o){var a;return Ea(this,StyleElement),(a=r.call(this,t,i,o)).type="style",compressSpaces(Array.from(i.childNodes).map((function(t){return t.data})).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")).split("}").forEach((function(r){var i=r.trim();if(i){var o=i.split("{"),a=o[0].split(","),u=o[1].split(";");a.forEach((function(r){var i=r.trim();if(i){var o=t.styles[i]||{};if(u.forEach((function(r){var i=r.indexOf(":"),a=r.substr(0,i).trim(),u=r.substr(i+1,r.length-i).trim();a&&u&&(o[a]=new uu(t,a,u))})),t.styles[i]=o,t.stylesSpecificity[i]=function getSelectorSpecificity(t){var r=[0,0,0],i=t.replace(/:not\(([^\)]*)\)/g," $1 ").replace(/{[\s\S]*/gm," "),o=0,a=findSelectorMatch(i,tu),u=ba(a,2);i=u[0],o=u[1],r[1]+=o;var l=findSelectorMatch(i,eu),h=ba(l,2);i=h[0],o=h[1],r[0]+=o;var p=findSelectorMatch(i,ru),y=ba(p,2);i=y[0],o=y[1],r[1]+=o;var g=findSelectorMatch(i,nu),d=ba(g,2);i=d[0],o=d[1],r[2]+=o;var v=findSelectorMatch(i,iu),x=ba(v,2);i=x[0],o=x[1],r[1]+=o;var b=findSelectorMatch(i,ou),S=ba(b,2);i=S[0],o=S[1],r[1]+=o;var w=findSelectorMatch(i=i.replace(/[\*\s\+>~]/g," ").replace(/[#\.]/g," "),au),k=ba(w,2);return i=k[0],o=k[1],r[2]+=o,r.join("")}(i),"@font-face"===i){var a=o["font-family"].getString().replace(/"|'/g,"");o.src.getString().split(",").forEach((function(r){if(r.indexOf('format("svg")')>0){var i=parseExternalUrl(r);i&&new ss(t).load(a,i)}}))}}}))}})),a}return StyleElement}();function _isNativeReflectConstruct$B(){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}}cs.parseExternalUrl=parseExternalUrl;var ls=function(t){za(UseElement,_u);var r=function _createSuper$B(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$B()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(UseElement);function UseElement(){var t;return Ea(this,UseElement),(t=r.apply(this,arguments)).type="use",t}return Pa(UseElement,[{key:"setContext",value:function setContext(t){Ya(Ba(UseElement.prototype),"setContext",this).call(this,t);var r=this.getAttribute("x"),i=this.getAttribute("y");r.hasValue()&&t.translate(r.getPixels("x"),0),i.hasValue()&&t.translate(0,i.getPixels("y"))}},{key:"path",value:function path(t){var r=this.element;r&&r.path(t)}},{key:"renderChildren",value:function renderChildren(t){var r=this.document,i=this.element;if(i){var o=i;if("symbol"===i.type&&((o=new $u(r,null)).attributes.viewBox=new uu(r,"viewBox",i.getAttribute("viewBox").getString()),o.attributes.preserveAspectRatio=new uu(r,"preserveAspectRatio",i.getAttribute("preserveAspectRatio").getString()),o.attributes.overflow=new uu(r,"overflow",i.getAttribute("overflow").getString()),o.children=i.children),"svg"===o.type){var a=this.getStyle("width",!1,!0),u=this.getStyle("height",!1,!0);a.hasValue()&&(o.attributes.width=new uu(r,"width",a.getString())),u.hasValue()&&(o.attributes.height=new uu(r,"height",u.getString()))}var l=o.parent;o.parent=this,o.render(t),o.parent=l}}},{key:"getBoundingBox",value:function getBoundingBox(t){var r=this.element;return r?r.getBoundingBox(t):null}},{key:"elementTransform",value:function elementTransform(){var t=this.document,r=this.element;return Eu.fromElement(t,r)}},{key:"element",get:function get(){return this._element||(this._element=this.getHrefAttribute().getDefinition()),this._element}}]),UseElement}();function _isNativeReflectConstruct$C(){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 imGet(t,r,i,o,a,u){return t[i*o*4+4*r+u]}function imSet(t,r,i,o,a,u,l){t[i*o*4+4*r+u]=l}function m(t,r,i){var o=t[r];return o*(o<0?i-255:i)}function c(t,r,i,o){return r+Math.cos(t)*i+Math.sin(t)*o}var fs=function(t){za(FeColorMatrixElement,Pu);var r=function _createSuper$C(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$C()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(FeColorMatrixElement);function FeColorMatrixElement(t,i,o){var a;Ea(this,FeColorMatrixElement),(a=r.call(this,t,i,o)).type="feColorMatrix";var u=toNumbers(a.getAttribute("values").getString());switch(a.getAttribute("type").getString("matrix")){case"saturate":var l=u[0];u=[.213+.787*l,.715-.715*l,.072-.072*l,0,0,.213-.213*l,.715+.285*l,.072-.072*l,0,0,.213-.213*l,.715-.715*l,.072+.928*l,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var h=u[0]*Math.PI/180;u=[c(h,.213,.787,-.213),c(h,.715,-.715,-.715),c(h,.072,-.072,.928),0,0,c(h,.213,-.213,.143),c(h,.715,.285,.14),c(h,.072,-.072,-.283),0,0,c(h,.213,-.213,-.787),c(h,.715,-.715,.715),c(h,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":u=[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 a.matrix=u,a.includeOpacity=a.getAttribute("includeOpacity").hasValue(),a}return Pa(FeColorMatrixElement,[{key:"apply",value:function apply(t,r,i,o,a){for(var u=this.includeOpacity,l=this.matrix,h=t.getImageData(0,0,o,a),p=0;p<a;p++)for(var y=0;y<o;y++){var g=imGet(h.data,y,p,o,0,0),d=imGet(h.data,y,p,o,0,1),v=imGet(h.data,y,p,o,0,2),x=imGet(h.data,y,p,o,0,3),b=m(l,0,g)+m(l,1,d)+m(l,2,v)+m(l,3,x)+m(l,4,1),S=m(l,5,g)+m(l,6,d)+m(l,7,v)+m(l,8,x)+m(l,9,1),w=m(l,10,g)+m(l,11,d)+m(l,12,v)+m(l,13,x)+m(l,14,1),k=m(l,15,g)+m(l,16,d)+m(l,17,v)+m(l,18,x)+m(l,19,1);u&&(b=S=w=0,k*=x/255),imSet(h.data,y,p,o,0,0,b),imSet(h.data,y,p,o,0,1,S),imSet(h.data,y,p,o,0,2,w),imSet(h.data,y,p,o,0,3,k)}t.clearRect(0,0,o,a),t.putImageData(h,0,0)}}]),FeColorMatrixElement}();function _isNativeReflectConstruct$D(){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}}var hs=function(t){za(MaskElement,Pu);var r=function _createSuper$D(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$D()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(MaskElement);function MaskElement(){var t;return Ea(this,MaskElement),(t=r.apply(this,arguments)).type="mask",t}return Pa(MaskElement,[{key:"apply",value:function apply(t,r){var i=this.document,o=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),u=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y");if(!u&&!l){var h=new Au;this.children.forEach((function(r){h.addBoundingBox(r.getBoundingBox(t))})),o=Math.floor(h.x1),a=Math.floor(h.y1),u=Math.floor(h.width),l=Math.floor(h.height)}var p=this.removeStyles(r,MaskElement.ignoreStyles),y=i.createCanvas(o+u,a+l),g=y.getContext("2d");i.screen.setDefaults(g),this.renderChildren(g),new fs(i,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(g,0,0,o+u,a+l);var d=i.createCanvas(o+u,a+l),v=d.getContext("2d");i.screen.setDefaults(v),r.render(v),v.globalCompositeOperation="destination-in",v.fillStyle=g.createPattern(y,"no-repeat"),v.fillRect(0,0,o+u,a+l),t.fillStyle=v.createPattern(d,"no-repeat"),t.fillRect(0,0,o+u,a+l),this.restoreStyles(r,p)}},{key:"render",value:function render(t){}}]),MaskElement}();function _isNativeReflectConstruct$E(){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}}hs.ignoreStyles=["mask","transform","clip-path"];var ps=function noop(){},ys=function(t){za(ClipPathElement,Pu);var r=function _createSuper$E(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$E()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(ClipPathElement);function ClipPathElement(){var t;return Ea(this,ClipPathElement),(t=r.apply(this,arguments)).type="clipPath",t}return Pa(ClipPathElement,[{key:"apply",value:function apply(t){var r=this.document,i=Reflect.getPrototypeOf(t),o=t.beginPath,a=t.closePath;i&&(i.beginPath=ps,i.closePath=ps),Reflect.apply(o,t,[]),this.children.forEach((function(o){if(void 0!==o.path){var u=void 0!==o.elementTransform?o.elementTransform():null;u||(u=Eu.fromElement(r,o)),u&&u.apply(t),o.path(t),i&&(i.closePath=a),u&&u.unapply(t)}})),Reflect.apply(a,t,[]),t.clip(),i&&(i.beginPath=o,i.closePath=a)}},{key:"render",value:function render(t){}}]),ClipPathElement}();function _isNativeReflectConstruct$F(){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}}var gs=function(t){za(FilterElement,Pu);var r=function _createSuper$F(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$F()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(FilterElement);function FilterElement(){var t;return Ea(this,FilterElement),(t=r.apply(this,arguments)).type="filter",t}return Pa(FilterElement,[{key:"apply",value:function apply(t,r){var i=this.document,o=this.children,a=r.getBoundingBox(t);if(a){var u=0,l=0;o.forEach((function(t){var r=t.extraFilterDistance||0;u=Math.max(u,r),l=Math.max(l,r)}));var h=Math.floor(a.width),p=Math.floor(a.height),y=h+2*u,g=p+2*l;if(!(y<1||g<1)){var d=Math.floor(a.x),v=Math.floor(a.y),x=this.removeStyles(r,FilterElement.ignoreStyles),b=i.createCanvas(y,g),S=b.getContext("2d");i.screen.setDefaults(S),S.translate(-d+u,-v+l),r.render(S),o.forEach((function(t){"function"==typeof t.apply&&t.apply(S,0,0,y,g)})),t.drawImage(b,0,0,y,g,d-u,v-l,y,g),this.restoreStyles(r,x)}}}},{key:"render",value:function render(t){}}]),FilterElement}();function _isNativeReflectConstruct$G(){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 _isNativeReflectConstruct$H(){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 _isNativeReflectConstruct$I(){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 _isNativeReflectConstruct$J(){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 _isNativeReflectConstruct$K(){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 _isNativeReflectConstruct$L(){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}}gs.ignoreStyles=["filter","transform","clip-path"];var ds={svg:$u,rect:Iu,circle:Fu,ellipse:Vu,line:Lu,polyline:ju,polygon:Bu,path:Du,pattern:Gu,marker:zu,defs:Uu,linearGradient:Hu,radialGradient:Xu,stop:Yu,animate:Qu,animateColor:Ku,animateTransform:Zu,font:Ju,"font-face":ts,"missing-glyph":es,glyph:rs,text:Tu,tspan:Mu,tref:ns,a:is,textPath:os,image:as,g:qu,symbol:us,style:cs,use:ls,mask:hs,clipPath:ys,filter:gs,feDropShadow:function(t){za(FeDropShadowElement,Pu);var r=function _createSuper$G(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$G()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(FeDropShadowElement);function FeDropShadowElement(t,i,o){var a;return Ea(this,FeDropShadowElement),(a=r.call(this,t,i,o)).type="feDropShadow",a.addStylesFromStyleDefinition(),a}return Pa(FeDropShadowElement,[{key:"apply",value:function apply(t,r,i,o,a){}}]),FeDropShadowElement}(),feMorphology:function(t){za(FeMorphologyElement,Pu);var r=function _createSuper$H(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$H()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(FeMorphologyElement);function FeMorphologyElement(){var t;return Ea(this,FeMorphologyElement),(t=r.apply(this,arguments)).type="feMorphology",t}return Pa(FeMorphologyElement,[{key:"apply",value:function apply(t,r,i,o,a){}}]),FeMorphologyElement}(),feComposite:function(t){za(FeCompositeElement,Pu);var r=function _createSuper$I(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$I()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(FeCompositeElement);function FeCompositeElement(){var t;return Ea(this,FeCompositeElement),(t=r.apply(this,arguments)).type="feComposite",t}return Pa(FeCompositeElement,[{key:"apply",value:function apply(t,r,i,o,a){}}]),FeCompositeElement}(),feColorMatrix:fs,feGaussianBlur:function(t){za(FeGaussianBlurElement,Pu);var r=function _createSuper$J(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$J()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(FeGaussianBlurElement);function FeGaussianBlurElement(t,i,o){var a;return Ea(this,FeGaussianBlurElement),(a=r.call(this,t,i,o)).type="feGaussianBlur",a.blurRadius=Math.floor(a.getAttribute("stdDeviation").getNumber()),a.extraFilterDistance=a.blurRadius,a}return Pa(FeGaussianBlurElement,[{key:"apply",value:function apply(t,r,i,o,a){var u=this.document,l=this.blurRadius,h=u.window?u.window.document.body:null,p=t.canvas;p.id=u.getUniqueId(),h&&(p.style.display="none",h.appendChild(p)),processCanvasRGBA(p,r,i,o,a,l),h&&h.removeChild(p)}}]),FeGaussianBlurElement}(),title:function(t){za(TitleElement,Pu);var r=function _createSuper$K(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$K()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(TitleElement);function TitleElement(){var t;return Ea(this,TitleElement),(t=r.apply(this,arguments)).type="title",t}return TitleElement}(),desc:function(t){za(DescElement,Pu);var r=function _createSuper$L(t){return function(){var r,i=Ba(t);if(_isNativeReflectConstruct$L()){var o=Ba(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return ja(this,r)}}(DescElement);function DescElement(){var t;return Ea(this,DescElement),(t=r.apply(this,arguments)).type="desc",t}return DescElement}()};function ownKeys$1(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.push.apply(i,o)}return i}function _createImage(){return(_createImage=wa(Sa.mark((function _callee(t){var r,i,o=arguments;return Sa.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return r=o.length>1&&void 0!==o[1]&&o[1],i=document.createElement("img"),r&&(i.crossOrigin="Anonymous"),a.abrupt("return",new Promise((function(r,o){i.onload=function(){r(i)},i.onerror=function(){o()},i.src=t})));case 4:case"end":return a.stop()}}),_callee)})))).apply(this,arguments)}var vs=function(){function Document(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.rootEmSize,o=void 0===i?12:i,a=r.emSize,u=void 0===a?12:a,l=r.createCanvas,h=void 0===l?Document.createCanvas:l,p=r.createImage,y=void 0===p?Document.createImage:p,g=r.anonymousCrossOrigin;Ea(this,Document),this.canvg=t,this.definitions={},this.styles={},this.stylesSpecificity={},this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=t.screen,this.rootEmSize=o,this.emSize=u,this.createCanvas=h,this.createImage=this.bindCreateImage(y,g),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}return Pa(Document,[{key:"bindCreateImage",value:function bindCreateImage(t,r){return"boolean"==typeof r?function(i,o){return t(i,"boolean"==typeof o?o:r)}:t}},{key:"popEmSize",value:function popEmSize(){this.emSizeStack.pop()}},{key:"getUniqueId",value:function getUniqueId(){return"canvg".concat(++this.uniqueId)}},{key:"isImagesLoaded",value:function isImagesLoaded(){return this.images.every((function(t){return t.loaded}))}},{key:"isFontsLoaded",value:function isFontsLoaded(){return this.fonts.every((function(t){return t.loaded}))}},{key:"createDocumentElement",value:function createDocumentElement(t){var r=this.createElement(t.documentElement);return r.root=!0,r.addStylesFromStyleDefinition(),this.documentElement=r,r}},{key:"createElement",value:function createElement(t){var r=t.nodeName.replace(/^[^:]+:/,""),i=Document.elementTypes[r];return void 0!==i?new i(this,t):new Cu(this,t)}},{key:"createTextNode",value:function createTextNode(t){return new Nu(this,t)}},{key:"setViewBox",value:function setViewBox(t){this.screen.setViewBox(function _objectSpread(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$1(Object(i),!0).forEach((function(r){ka(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ownKeys$1(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}return t}({document:this},t))}},{key:"window",get:function get(){return this.screen.window}},{key:"fetch",get:function get(){return this.screen.fetch}},{key:"ctx",get:function get(){return this.screen.ctx}},{key:"emSize",get:function get(){var t=this.emSizeStack;return t[t.length-1]},set:function set(t){this.emSizeStack.push(t)}}]),Document}();function ownKeys$1$1(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))),i.push.apply(i,o)}return i}function _objectSpread$1(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?ownKeys$1$1(Object(i),!0).forEach((function(r){ka(t,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ownKeys$1$1(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}return t}vs.createCanvas=function createCanvas(t,r){var i=document.createElement("canvas");return i.width=t,i.height=r,i},vs.createImage=function createImage(t){return _createImage.apply(this,arguments)},vs.elementTypes=ds;var ms=function(){function Canvg(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Ea(this,Canvg),this.parser=new du(i),this.screen=new pu(t,i),this.options=i;var o=new vs(this,i),a=o.createDocumentElement(r);this.document=o,this.documentElement=a}var t,r;return Pa(Canvg,[{key:"fork",value:function fork(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Canvg.from(t,r,_objectSpread$1({},this.options,{},i))}},{key:"forkString",value:function forkString(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Canvg.fromString(t,r,_objectSpread$1({},this.options,{},i))}},{key:"ready",value:function ready(){return this.screen.ready()}},{key:"isReady",value:function isReady(){return this.screen.isReady()}},{key:"render",value:(r=wa(Sa.mark((function _callee(){var t,r=arguments;return Sa.wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:{},this.start(_objectSpread$1({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},t)),i.next=4,this.ready();case 4:this.stop();case 5:case"end":return i.stop()}}),_callee,this)}))),function render(){return r.apply(this,arguments)})},{key:"start",value:function start(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=this.documentElement,i=this.screen,o=this.options;i.start(r,_objectSpread$1({enableRedraw:!0},o,{},t))}},{key:"stop",value:function stop(){this.screen.stop()}},{key:"resize",value:function resize(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(t,r,i)}}],[{key:"from",value:(t=wa(Sa.mark((function _callee2(t,r){var i,o,a,u=arguments;return Sa.wrap((function _callee2$(l){for(;;)switch(l.prev=l.next){case 0:return i=u.length>2&&void 0!==u[2]?u[2]:{},o=new du(i),l.next=4,o.parse(r);case 4:return a=l.sent,l.abrupt("return",new Canvg(t,a,i));case 6:case"end":return l.stop()}}),_callee2)}))),function from(r,i){return t.apply(this,arguments)})},{key:"fromString",value:function fromString(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=new du(i),a=o.parseFromString(r);return new Canvg(t,a,i)}}]),Canvg}();function __variableDynamicImportRuntime0__(t){switch(t){case"./locale/en.js":return Promise.resolve().then((function(){return Ss}));case"./locale/zh-CN.js":return Promise.resolve().then((function(){return ws}));default:return Promise.reject(new Error("Unknown variable dynamic import: "+t))}}var xs=function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function _callee(t){var r;return regeneratorRuntime.wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,__variableDynamicImportRuntime0__("./locale/".concat(encodeURIComponent(t),".js"));case 3:r=i.sent,i.next=12;break;case 6:return i.prev=6,i.t0=i.catch(0),console.error("Missing translation (".concat(t,") - using 'en'")),i.next=11,Promise.resolve().then((function(){return Ss}));case 11:r=i.sent;case 12:return i.abrupt("return",r.default);case 13:case"end":return i.stop()}}),_callee,null,[[0,6]])})));return function loadExtensionTranslation(r){return t.apply(this,arguments)}}(),bs={name:"server_opensave",init:function init(t){var r=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee6(){var i,o,a,u,l,h,p,y,g,d,v,x,b,S,w,k,E,P,C;return regeneratorRuntime.wrap((function _callee6$(R){for(;;)switch(R.prev=R.next){case 0:return C=function _rebuildInput(t){t.empty();var r=i('<input type="file" name="svg_file">').appendTo(t);function submit(){return _submit.apply(this,arguments)}function _submit(){return(_submit=_asyncToGenerator(regeneratorRuntime.mark((function _callee5(){return regeneratorRuntime.wrap((function _callee5$(r){for(;;)switch(r.prev=r.next){case 0:return t.submit(),C(t),r.next=4,i.process_cancel(l.uploading);case 4:w=!0,i("#dialog_box").hide();case 6:case"end":return r.stop()}}),_callee5)})))).apply(this,arguments)}t[0]===k[0]?r.change(_asyncToGenerator(regeneratorRuntime.mark((function _callee3(){return regeneratorRuntime.wrap((function _callee3$(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,u.openPrep();case 2:if(r.sent){r.next=6;break}return C(t),r.abrupt("return");case 6:return r.next=8,submit();case 8:case"end":return r.stop()}}),_callee3)})))):r.change(_asyncToGenerator(regeneratorRuntime.mark((function _callee4(){return regeneratorRuntime.wrap((function _callee4$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,submit();case 2:case"end":return t.stop()}}),_callee4)}))))},b=function _clientDownloadSuppor(t,r,o){return!p&&!y&&(!(""!==i("<a>")[0].download)&&(i("<a>hidden</a>").attr({download:(t||"image")+r,href:o}).css("display","none").appendTo("body")[0].click(),!0))},x=function _xhtmlEscape(t){return t.replace(/&(?!amp;)/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")},v=function _getFileNameFromTitle(){return d.getDocumentTitle().trim().replace(/[/\\:*?"<>|]/g,"_")},i=t.$,o=t.decode64,a=t.encode64,u=r,R.next=8,xs(u.curPrefs.lang);case 8:if(l=R.sent,h=u.curConfig,p=h.avoidClientSide,y=h.avoidClientSideDownload,g=h.avoidClientSideOpen,d=u.canvas,"./filesave.php",S="./filesave.php",w=!1,i('<iframe name="output_frame" title="'.concat(l.hiddenframe,'"\n style="width: 0; height: 0;" src="data:text/html;base64,PGh0bWw+"/>')).appendTo("body"),u.setCustomHandlers({save:function save(t,r){var o='<?xml version="1.0" encoding="UTF-8"?>\n'+r,u=v();b(u,".svg","data:image/svg+xml;charset=UTF-8;base64,"+a(o))||i("<form>").attr({method:"post",action:"./filesave.php",target:"output_frame"}).append('\n <input type="hidden" name="output_svg" value="'.concat(x(o),'">\n <input type="hidden" name="filename" value="').concat(x(u),'">\n ')).appendTo("body").submit().remove()},exportPDF:function exportPDF(t,r){var o=v(),a=r.output;b(o,".pdf",a)||i("<form>").attr({method:"post",action:S,target:"output_frame"}).append('\n <input type="hidden" name="output_img" value="'.concat(a,'">\n <input type="hidden" name="mime" value="application/pdf">\n <input type="hidden" name="filename" value="').concat(x(o),'">\n ')).appendTo("body").submit().remove()},exportImage:function exportImage(t,r){return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var t,o,a,u,l,h,p,y,g;return regeneratorRuntime.wrap((function _callee2$(w){for(;;)switch(w.prev=w.next){case 0:return t=r.issues,o=r.mimeType,a=r.quality,i("#export_canvas").length||i("<canvas>",{id:"export_canvas"}).hide().appendTo("body"),(u=i("#export_canvas")[0]).width=d.contentW,u.height=d.contentH,w.next=7,ms(u,r.svg);case 7:if(l=a?u.toDataURL(o,a):u.toDataURL(o),p="",t.length&&(h="\n • ",p+="\n\n\n • "+t.join(h)),!p.length){w.next=13;break}return w.next=13,i.alert(p);case 13:if(y=v(),g="."+r.type.toLowerCase(),!b(y,g,l)){w.next=17;break}return w.abrupt("return");case 17:i("<form>").attr({method:"post",action:S,target:"output_frame"}).append('\n <input type="hidden" name="output_img" value="'.concat(l,'">\n <input type="hidden" name="mime" value="').concat(o,'">\n <input type="hidden" name="filename" value="').concat(x(y),'">\n ')).appendTo("body").submit().remove();case 18:case"end":return w.stop()}}),_callee2)})))()}}),!window.FileReader||g){R.next=16;break}return R.abrupt("return");case 16:"./fileopen.php?type=load_svg","./fileopen.php?type=import_svg","./fileopen.php?type=import_img",u.processFile=function(t,r){var a;if(w)w=!1;else switch(i("#dialog_box").hide(),"import_img"!==r&&(a=o(t)),r){case"load_svg":d.clear(),d.setSvgString(a),u.updateCanvas();break;case"import_svg":d.importSvgString(a),u.updateCanvas();break;case"import_img":d.setGoodImage(t)}},(k=i("<form>")).attr({enctype:"multipart/form-data",method:"post",action:"./fileopen.php?type=load_svg",target:"output_frame"}),E=k.clone().attr("action","./fileopen.php?type=import_svg"),P=k.clone().attr("action","./fileopen.php?type=import_img"),C(k),C(E),C(P),i("#tool_open").show().prepend(k),i("#tool_import").show().prepend(E),i("#tool_image").prepend(P);case 30:case"end":return R.stop()}}),_callee6)})))()}},Ss=Object.freeze({__proto__:null,default:{uploading:"Uploading...",hiddenframe:"Opensave frame to store hidden values"}}),ws=Object.freeze({__proto__:null,default:{uploading:"正在上传...",hiddenframe:"Opensave frame to store hidden values"}});export default bs;
//# sourceMappingURL=ext-server_opensave.js.map