UNPKG

@senx/discovery-plugin-marauder

Version:

Discovery plugin - Marauder's map

55 lines 215 kB
var __extends=this&&this.__extends||function(){var r=function(e,t){r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,e){r.__proto__=e}||function(r,e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))r[t]=e[t]};return r(e,t)};return function(e,t){if(typeof t!=="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}();var __generator=this&&this.__generator||function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(r){return function(e){return u([r,e])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(t=0)),t)try{if(n=1,i&&(a=s[0]&2?i["return"]:s[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;if(i=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;i=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){t.label=s[1];break}if(s[0]===6&&t.label<a[1]){t.label=a[1];a=s;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(s);break}if(a[2])t.ops.pop();t.trys.pop();continue}s=e.call(r,t)}catch(r){s=[6,r];i=0}finally{n=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(r,e,t){if(t||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++){if(a||!(n in e)){if(!a)a=Array.prototype.slice.call(e,0,n);a[n]=e[n]}}return r.concat(a||Array.prototype.slice.call(e))};import{g as global$l}from"./global-57908b51.js";import{c as commonjsGlobal,g as getDefaultExportFromCjs}from"./lodash-d98cd4b5.js";import{_ as _typeof$1}from"./discovery-dashboard.discovery-tile-result-e6f9769e.js";import"./index-7d8b9e81.js";import"./utils-2db7dc60.js";import"./types-7e267e33.js";import"./color-lib-3865b9f3.js";import"./lang-utils-ab937efb.js";import"./PluginManager-6fd5134d.js";function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var cachedSetTimeout=defaultSetTimout;var cachedClearTimeout=defaultClearTimeout;if(typeof global$l.setTimeout==="function"){cachedSetTimeout=setTimeout}if(typeof global$l.clearTimeout==="function"){cachedClearTimeout=clearTimeout}function runTimeout(r){if(cachedSetTimeout===setTimeout){return setTimeout(r,0)}if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout){cachedSetTimeout=setTimeout;return setTimeout(r,0)}try{return cachedSetTimeout(r,0)}catch(e){try{return cachedSetTimeout.call(null,r,0)}catch(e){return cachedSetTimeout.call(this,r,0)}}}function runClearTimeout(r){if(cachedClearTimeout===clearTimeout){return clearTimeout(r)}if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout){cachedClearTimeout=clearTimeout;return clearTimeout(r)}try{return cachedClearTimeout(r)}catch(e){try{return cachedClearTimeout.call(null,r)}catch(e){return cachedClearTimeout.call(this,r)}}}var queue$4=[];var draining=false;var currentQueue;var queueIndex=-1;function cleanUpNextTick(){if(!draining||!currentQueue){return}draining=false;if(currentQueue.length){queue$4=currentQueue.concat(queue$4)}else{queueIndex=-1}if(queue$4.length){drainQueue()}}function drainQueue(){if(draining){return}var r=runTimeout(cleanUpNextTick);draining=true;var e=queue$4.length;while(e){currentQueue=queue$4;queue$4=[];while(++queueIndex<e){if(currentQueue){currentQueue[queueIndex].run()}}queueIndex=-1;e=queue$4.length}currentQueue=null;draining=false;runClearTimeout(r)}function nextTick(r){var e=new Array(arguments.length-1);if(arguments.length>1){for(var t=1;t<arguments.length;t++){e[t-1]=arguments[t]}}queue$4.push(new Item(r,e));if(queue$4.length===1&&!draining){runTimeout(drainQueue)}}function Item(r,e){this.fun=r;this.array=e}Item.prototype.run=function(){this.fun.apply(null,this.array)};var title="browser";var platform="browser";var browser=true;var env={};var argv=[];var version$1="";var versions$1={};var release={};var config={};function noop$2(){}var on=noop$2;var addListener=noop$2;var once=noop$2;var off=noop$2;var removeListener=noop$2;var removeAllListeners=noop$2;var emit=noop$2;function binding(r){throw new Error("process.binding is not supported")}function cwd(){return"/"}function chdir(r){throw new Error("process.chdir is not supported")}function umask(){return 0}var performance$1=global$l.performance||{};var performanceNow$1=performance$1.now||performance$1.mozNow||performance$1.msNow||performance$1.oNow||performance$1.webkitNow||function(){return(new Date).getTime()};function hrtime(r){var e=performanceNow$1.call(performance$1)*.001;var t=Math.floor(e);var n=Math.floor(e%1*1e9);if(r){t=t-r[0];n=n-r[1];if(n<0){t--;n+=1e9}}return[t,n]}var startTime=new Date;function uptime(){var r=new Date;var e=r-startTime;return e/1e3}var browser$1={nextTick:nextTick,title:title,browser:browser,env:env,argv:argv,version:version$1,versions:versions$1,on:on,addListener:addListener,once:once,off:off,removeListener:removeListener,removeAllListeners:removeAllListeners,emit:emit,binding:binding,cwd:cwd,chdir:chdir,umask:umask,hrtime:hrtime,platform:platform,release:release,config:config,uptime:uptime};var process$4=browser$1;var check=function(r){return r&&r.Math===Math&&r};var global$k=check(typeof globalThis=="object"&&globalThis)||check(typeof window=="object"&&window)||check(typeof self=="object"&&self)||check(typeof commonjsGlobal=="object"&&commonjsGlobal)||check(typeof commonjsGlobal=="object"&&commonjsGlobal)||function(){return this}()||Function("return this")();var objectGetOwnPropertyDescriptor={};var fails$l=function(r){try{return!!r()}catch(r){return true}};var fails$k=fails$l;var descriptors=!fails$k((function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}));var fails$j=fails$l;var functionBindNative=!fails$j((function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}));var NATIVE_BIND$3=functionBindNative;var call$j=Function.prototype.call;var functionCall=NATIVE_BIND$3?call$j.bind(call$j):function(){return call$j.apply(call$j,arguments)};var objectPropertyIsEnumerable={};var $propertyIsEnumerable={}.propertyIsEnumerable;var getOwnPropertyDescriptor$4=Object.getOwnPropertyDescriptor;var NASHORN_BUG=getOwnPropertyDescriptor$4&&!$propertyIsEnumerable.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function r(e){var t=getOwnPropertyDescriptor$4(this,e);return!!t&&t.enumerable}:$propertyIsEnumerable;var createPropertyDescriptor$3=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}};var NATIVE_BIND$2=functionBindNative;var FunctionPrototype$2=Function.prototype;var call$i=FunctionPrototype$2.call;var uncurryThisWithBind=NATIVE_BIND$2&&FunctionPrototype$2.bind.bind(call$i,call$i);var functionUncurryThis=NATIVE_BIND$2?uncurryThisWithBind:function(r){return function(){return call$i.apply(r,arguments)}};var uncurryThis$o=functionUncurryThis;var toString$b=uncurryThis$o({}.toString);var stringSlice$7=uncurryThis$o("".slice);var classofRaw$2=function(r){return stringSlice$7(toString$b(r),8,-1)};var uncurryThis$n=functionUncurryThis;var fails$i=fails$l;var classof$8=classofRaw$2;var $Object$4=Object;var split=uncurryThis$n("".split);var indexedObject=fails$i((function(){return!$Object$4("z").propertyIsEnumerable(0)}))?function(r){return classof$8(r)==="String"?split(r,""):$Object$4(r)}:$Object$4;var isNullOrUndefined$7=function(r){return r===null||r===undefined};var isNullOrUndefined$6=isNullOrUndefined$7;var $TypeError$f=TypeError;var requireObjectCoercible$b=function(r){if(isNullOrUndefined$6(r))throw new $TypeError$f("Can't call method on "+r);return r};var IndexedObject$1=indexedObject;var requireObjectCoercible$a=requireObjectCoercible$b;var toIndexedObject$5=function(r){return IndexedObject$1(requireObjectCoercible$a(r))};var documentAll=typeof document=="object"&&document.all;var isCallable$l=typeof documentAll=="undefined"&&documentAll!==undefined?function(r){return typeof r=="function"||r===documentAll}:function(r){return typeof r=="function"};var isCallable$k=isCallable$l;var isObject$b=function(r){return typeof r=="object"?r!==null:isCallable$k(r)};var global$j=global$k;var isCallable$j=isCallable$l;var aFunction=function(r){return isCallable$j(r)?r:undefined};var getBuiltIn$6=function(r,e){return arguments.length<2?aFunction(global$j[r]):global$j[r]&&global$j[r][e]};var uncurryThis$m=functionUncurryThis;var objectIsPrototypeOf=uncurryThis$m({}.isPrototypeOf);var engineUserAgent=typeof navigator!="undefined"&&String(navigator.userAgent)||"";var global$i=global$k;var userAgent$3=engineUserAgent;var process$3=global$i.process;var Deno$1=global$i.Deno;var versions=process$3&&process$3.versions||Deno$1&&Deno$1.version;var v8=versions&&versions.v8;var match,version;if(v8){match=v8.split(".");version=match[0]>0&&match[0]<4?1:+(match[0]+match[1])}if(!version&&userAgent$3){match=userAgent$3.match(/Edge\/(\d+)/);if(!match||match[1]>=74){match=userAgent$3.match(/Chrome\/(\d+)/);if(match)version=+match[1]}}var engineV8Version=version;var V8_VERSION$1=engineV8Version;var fails$h=fails$l;var global$h=global$k;var $String$5=global$h.String;var symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$h((function(){var r=Symbol("symbol detection");return!$String$5(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&V8_VERSION$1&&V8_VERSION$1<41}));var NATIVE_SYMBOL$1=symbolConstructorDetection;var useSymbolAsUid=NATIVE_SYMBOL$1&&!Symbol.sham&&typeof Symbol.iterator=="symbol";var getBuiltIn$5=getBuiltIn$6;var isCallable$i=isCallable$l;var isPrototypeOf$3=objectIsPrototypeOf;var USE_SYMBOL_AS_UID$1=useSymbolAsUid;var $Object$3=Object;var isSymbol$2=USE_SYMBOL_AS_UID$1?function(r){return typeof r=="symbol"}:function(r){var e=getBuiltIn$5("Symbol");return isCallable$i(e)&&isPrototypeOf$3(e.prototype,$Object$3(r))};var $String$4=String;var tryToString$4=function(r){try{return $String$4(r)}catch(r){return"Object"}};var isCallable$h=isCallable$l;var tryToString$3=tryToString$4;var $TypeError$e=TypeError;var aCallable$9=function(r){if(isCallable$h(r))return r;throw new $TypeError$e(tryToString$3(r)+" is not a function")};var aCallable$8=aCallable$9;var isNullOrUndefined$5=isNullOrUndefined$7;var getMethod$6=function(r,e){var t=r[e];return isNullOrUndefined$5(t)?undefined:aCallable$8(t)};var call$h=functionCall;var isCallable$g=isCallable$l;var isObject$a=isObject$b;var $TypeError$d=TypeError;var ordinaryToPrimitive$1=function(r,e){var t,n;if(e==="string"&&isCallable$g(t=r.toString)&&!isObject$a(n=call$h(t,r)))return n;if(isCallable$g(t=r.valueOf)&&!isObject$a(n=call$h(t,r)))return n;if(e!=="string"&&isCallable$g(t=r.toString)&&!isObject$a(n=call$h(t,r)))return n;throw new $TypeError$d("Can't convert object to primitive value")};var sharedStore={exports:{}};var global$g=global$k;var defineProperty$6=Object.defineProperty;var defineGlobalProperty$3=function(r,e){try{defineProperty$6(global$g,r,{value:e,configurable:true,writable:true})}catch(t){global$g[r]=e}return e};var globalThis$1=global$k;var defineGlobalProperty$2=defineGlobalProperty$3;var SHARED="__core-js_shared__";var store$3=sharedStore.exports=globalThis$1[SHARED]||defineGlobalProperty$2(SHARED,{});(store$3.versions||(store$3.versions=[])).push({version:"3.37.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"});var store$2=sharedStore.exports;var shared$4=function(r,e){return store$2[r]||(store$2[r]=e||{})};var requireObjectCoercible$9=requireObjectCoercible$b;var $Object$2=Object;var toObject$4=function(r){return $Object$2(requireObjectCoercible$9(r))};var uncurryThis$l=functionUncurryThis;var toObject$3=toObject$4;var hasOwnProperty=uncurryThis$l({}.hasOwnProperty);var hasOwnProperty_1=Object.hasOwn||function r(e,t){return hasOwnProperty(toObject$3(e),t)};var uncurryThis$k=functionUncurryThis;var id$1=0;var postfix=Math.random();var toString$a=uncurryThis$k(1..toString);var uid$2=function(r){return"Symbol("+(r===undefined?"":r)+")_"+toString$a(++id$1+postfix,36)};var global$f=global$k;var shared$3=shared$4;var hasOwn$a=hasOwnProperty_1;var uid$1=uid$2;var NATIVE_SYMBOL=symbolConstructorDetection;var USE_SYMBOL_AS_UID=useSymbolAsUid;var Symbol$1=global$f.Symbol;var WellKnownSymbolsStore=shared$3("wks");var createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$1["for"]||Symbol$1:Symbol$1&&Symbol$1.withoutSetter||uid$1;var wellKnownSymbol$i=function(r){if(!hasOwn$a(WellKnownSymbolsStore,r)){WellKnownSymbolsStore[r]=NATIVE_SYMBOL&&hasOwn$a(Symbol$1,r)?Symbol$1[r]:createWellKnownSymbol("Symbol."+r)}return WellKnownSymbolsStore[r]};var call$g=functionCall;var isObject$9=isObject$b;var isSymbol$1=isSymbol$2;var getMethod$5=getMethod$6;var ordinaryToPrimitive=ordinaryToPrimitive$1;var wellKnownSymbol$h=wellKnownSymbol$i;var $TypeError$c=TypeError;var TO_PRIMITIVE=wellKnownSymbol$h("toPrimitive");var toPrimitive$2=function(r,e){if(!isObject$9(r)||isSymbol$1(r))return r;var t=getMethod$5(r,TO_PRIMITIVE);var n;if(t){if(e===undefined)e="default";n=call$g(t,r,e);if(!isObject$9(n)||isSymbol$1(n))return n;throw new $TypeError$c("Can't convert object to primitive value")}if(e===undefined)e="number";return ordinaryToPrimitive(r,e)};var toPrimitive$1=toPrimitive$2;var isSymbol=isSymbol$2;var toPropertyKey$3=function(r){var e=toPrimitive$1(r,"string");return isSymbol(e)?e:e+""};var global$e=global$k;var isObject$8=isObject$b;var document$3=global$e.document;var EXISTS$1=isObject$8(document$3)&&isObject$8(document$3.createElement);var documentCreateElement$2=function(r){return EXISTS$1?document$3.createElement(r):{}};var DESCRIPTORS$a=descriptors;var fails$g=fails$l;var createElement$1=documentCreateElement$2;var ie8DomDefine=!DESCRIPTORS$a&&!fails$g((function(){return Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a!==7}));var DESCRIPTORS$9=descriptors;var call$f=functionCall;var propertyIsEnumerableModule=objectPropertyIsEnumerable;var createPropertyDescriptor$2=createPropertyDescriptor$3;var toIndexedObject$4=toIndexedObject$5;var toPropertyKey$2=toPropertyKey$3;var hasOwn$9=hasOwnProperty_1;var IE8_DOM_DEFINE$1=ie8DomDefine;var $getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$9?$getOwnPropertyDescriptor$1:function r(e,t){e=toIndexedObject$4(e);t=toPropertyKey$2(t);if(IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$1(e,t)}catch(r){}if(hasOwn$9(e,t))return createPropertyDescriptor$2(!call$f(propertyIsEnumerableModule.f,e,t),e[t])};var objectDefineProperty={};var DESCRIPTORS$8=descriptors;var fails$f=fails$l;var v8PrototypeDefineBug=DESCRIPTORS$8&&fails$f((function(){return Object.defineProperty((function(){}),"prototype",{value:42,writable:false}).prototype!==42}));var isObject$7=isObject$b;var $String$3=String;var $TypeError$b=TypeError;var anObject$f=function(r){if(isObject$7(r))return r;throw new $TypeError$b($String$3(r)+" is not an object")};var DESCRIPTORS$7=descriptors;var IE8_DOM_DEFINE=ie8DomDefine;var V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug;var anObject$e=anObject$f;var toPropertyKey$1=toPropertyKey$3;var $TypeError$a=TypeError;var $defineProperty=Object.defineProperty;var $getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;var ENUMERABLE="enumerable";var CONFIGURABLE$1="configurable";var WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$7?V8_PROTOTYPE_DEFINE_BUG$1?function r(e,t,n){anObject$e(e);t=toPropertyKey$1(t);anObject$e(n);if(typeof e==="function"&&t==="prototype"&&"value"in n&&WRITABLE in n&&!n[WRITABLE]){var i=$getOwnPropertyDescriptor(e,t);if(i&&i[WRITABLE]){e[t]=n.value;n={configurable:CONFIGURABLE$1 in n?n[CONFIGURABLE$1]:i[CONFIGURABLE$1],enumerable:ENUMERABLE in n?n[ENUMERABLE]:i[ENUMERABLE],writable:false}}}return $defineProperty(e,t,n)}:$defineProperty:function r(e,t,n){anObject$e(e);t=toPropertyKey$1(t);anObject$e(n);if(IE8_DOM_DEFINE)try{return $defineProperty(e,t,n)}catch(r){}if("get"in n||"set"in n)throw new $TypeError$a("Accessors not supported");if("value"in n)e[t]=n.value;return e};var DESCRIPTORS$6=descriptors;var definePropertyModule$3=objectDefineProperty;var createPropertyDescriptor$1=createPropertyDescriptor$3;var createNonEnumerableProperty$5=DESCRIPTORS$6?function(r,e,t){return definePropertyModule$3.f(r,e,createPropertyDescriptor$1(1,t))}:function(r,e,t){r[e]=t;return r};var makeBuiltIn$3={exports:{}};var DESCRIPTORS$5=descriptors;var hasOwn$8=hasOwnProperty_1;var FunctionPrototype$1=Function.prototype;var getDescriptor=DESCRIPTORS$5&&Object.getOwnPropertyDescriptor;var EXISTS=hasOwn$8(FunctionPrototype$1,"name");var PROPER=EXISTS&&function r(){}.name==="something";var CONFIGURABLE=EXISTS&&(!DESCRIPTORS$5||DESCRIPTORS$5&&getDescriptor(FunctionPrototype$1,"name").configurable);var functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE};var uncurryThis$j=functionUncurryThis;var isCallable$f=isCallable$l;var store$1=sharedStore.exports;var functionToString=uncurryThis$j(Function.toString);if(!isCallable$f(store$1.inspectSource)){store$1.inspectSource=function(r){return functionToString(r)}}var inspectSource$3=store$1.inspectSource;var global$d=global$k;var isCallable$e=isCallable$l;var WeakMap$1=global$d.WeakMap;var weakMapBasicDetection=isCallable$e(WeakMap$1)&&/native code/.test(String(WeakMap$1));var shared$2=shared$4;var uid=uid$2;var keys=shared$2("keys");var sharedKey$3=function(r){return keys[r]||(keys[r]=uid(r))};var hiddenKeys$4={};var NATIVE_WEAK_MAP=weakMapBasicDetection;var global$c=global$k;var isObject$6=isObject$b;var createNonEnumerableProperty$4=createNonEnumerableProperty$5;var hasOwn$7=hasOwnProperty_1;var shared$1=sharedStore.exports;var sharedKey$2=sharedKey$3;var hiddenKeys$3=hiddenKeys$4;var OBJECT_ALREADY_INITIALIZED="Object already initialized";var TypeError$2=global$c.TypeError;var WeakMap=global$c.WeakMap;var set$1,get,has;var enforce=function(r){return has(r)?get(r):set$1(r,{})};var getterFor=function(r){return function(e){var t;if(!isObject$6(e)||(t=get(e)).type!==r){throw new TypeError$2("Incompatible receiver, "+r+" required")}return t}};if(NATIVE_WEAK_MAP||shared$1.state){var store=shared$1.state||(shared$1.state=new WeakMap);store.get=store.get;store.has=store.has;store.set=store.set;set$1=function(r,e){if(store.has(r))throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);e.facade=r;store.set(r,e);return e};get=function(r){return store.get(r)||{}};has=function(r){return store.has(r)}}else{var STATE=sharedKey$2("state");hiddenKeys$3[STATE]=true;set$1=function(r,e){if(hasOwn$7(r,STATE))throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);e.facade=r;createNonEnumerableProperty$4(r,STATE,e);return e};get=function(r){return hasOwn$7(r,STATE)?r[STATE]:{}};has=function(r){return hasOwn$7(r,STATE)}}var internalState={set:set$1,get:get,has:has,enforce:enforce,getterFor:getterFor};var uncurryThis$i=functionUncurryThis;var fails$e=fails$l;var isCallable$d=isCallable$l;var hasOwn$6=hasOwnProperty_1;var DESCRIPTORS$4=descriptors;var CONFIGURABLE_FUNCTION_NAME$1=functionName.CONFIGURABLE;var inspectSource$2=inspectSource$3;var InternalStateModule$2=internalState;var enforceInternalState=InternalStateModule$2.enforce;var getInternalState$2=InternalStateModule$2.get;var $String$2=String;var defineProperty$5=Object.defineProperty;var stringSlice$6=uncurryThis$i("".slice);var replace$3=uncurryThis$i("".replace);var join=uncurryThis$i([].join);var CONFIGURABLE_LENGTH=DESCRIPTORS$4&&!fails$e((function(){return defineProperty$5((function(){}),"length",{value:8}).length!==8}));var TEMPLATE=String(String).split("String");var makeBuiltIn$2=makeBuiltIn$3.exports=function(r,e,t){if(stringSlice$6($String$2(e),0,7)==="Symbol("){e="["+replace$3($String$2(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"}if(t&&t.getter)e="get "+e;if(t&&t.setter)e="set "+e;if(!hasOwn$6(r,"name")||CONFIGURABLE_FUNCTION_NAME$1&&r.name!==e){if(DESCRIPTORS$4)defineProperty$5(r,"name",{value:e,configurable:true});else r.name=e}if(CONFIGURABLE_LENGTH&&t&&hasOwn$6(t,"arity")&&r.length!==t.arity){defineProperty$5(r,"length",{value:t.arity})}try{if(t&&hasOwn$6(t,"constructor")&&t.constructor){if(DESCRIPTORS$4)defineProperty$5(r,"prototype",{writable:false})}else if(r.prototype)r.prototype=undefined}catch(r){}var n=enforceInternalState(r);if(!hasOwn$6(n,"source")){n.source=join(TEMPLATE,typeof e=="string"?e:"")}return r};Function.prototype.toString=makeBuiltIn$2((function r(){return isCallable$d(this)&&getInternalState$2(this).source||inspectSource$2(this)}),"toString");var isCallable$c=isCallable$l;var definePropertyModule$2=objectDefineProperty;var makeBuiltIn$1=makeBuiltIn$3.exports;var defineGlobalProperty$1=defineGlobalProperty$3;var defineBuiltIn$7=function(r,e,t,n){if(!n)n={};var i=n.enumerable;var a=n.name!==undefined?n.name:e;if(isCallable$c(t))makeBuiltIn$1(t,a,n);if(n.global){if(i)r[e]=t;else defineGlobalProperty$1(e,t)}else{try{if(!n.unsafe)delete r[e];else if(r[e])i=true}catch(r){}if(i)r[e]=t;else definePropertyModule$2.f(r,e,{value:t,enumerable:false,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return r};var objectGetOwnPropertyNames={};var ceil=Math.ceil;var floor$1=Math.floor;var mathTrunc=Math.trunc||function r(e){var t=+e;return(t>0?floor$1:ceil)(t)};var trunc=mathTrunc;var toIntegerOrInfinity$4=function(r){var e=+r;return e!==e||e===0?0:trunc(e)};var toIntegerOrInfinity$3=toIntegerOrInfinity$4;var max$1=Math.max;var min$5=Math.min;var toAbsoluteIndex$1=function(r,e){var t=toIntegerOrInfinity$3(r);return t<0?max$1(t+e,0):min$5(t,e)};var toIntegerOrInfinity$2=toIntegerOrInfinity$4;var min$4=Math.min;var toLength$6=function(r){var e=toIntegerOrInfinity$2(r);return e>0?min$4(e,9007199254740991):0};var toLength$5=toLength$6;var lengthOfArrayLike$3=function(r){return toLength$5(r.length)};var toIndexedObject$3=toIndexedObject$5;var toAbsoluteIndex=toAbsoluteIndex$1;var lengthOfArrayLike$2=lengthOfArrayLike$3;var createMethod$3=function(r){return function(e,t,n){var i=toIndexedObject$3(e);var a=lengthOfArrayLike$2(i);if(a===0)return!r&&-1;var o=toAbsoluteIndex(n,a);var s;if(r&&t!==t)while(a>o){s=i[o++];if(s!==s)return true}else for(;a>o;o++){if((r||o in i)&&i[o]===t)return r||o||0}return!r&&-1}};var arrayIncludes={includes:createMethod$3(true),indexOf:createMethod$3(false)};var uncurryThis$h=functionUncurryThis;var hasOwn$5=hasOwnProperty_1;var toIndexedObject$2=toIndexedObject$5;var indexOf$1=arrayIncludes.indexOf;var hiddenKeys$2=hiddenKeys$4;var push$2=uncurryThis$h([].push);var objectKeysInternal=function(r,e){var t=toIndexedObject$2(r);var n=0;var i=[];var a;for(a in t)!hasOwn$5(hiddenKeys$2,a)&&hasOwn$5(t,a)&&push$2(i,a);while(e.length>n)if(hasOwn$5(t,a=e[n++])){~indexOf$1(i,a)||push$2(i,a)}return i};var enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"];var internalObjectKeys$1=objectKeysInternal;var enumBugKeys$2=enumBugKeys$3;var hiddenKeys$1=enumBugKeys$2.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function r(e){return internalObjectKeys$1(e,hiddenKeys$1)};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var getBuiltIn$4=getBuiltIn$6;var uncurryThis$g=functionUncurryThis;var getOwnPropertyNamesModule=objectGetOwnPropertyNames;var getOwnPropertySymbolsModule=objectGetOwnPropertySymbols;var anObject$d=anObject$f;var concat$1=uncurryThis$g([].concat);var ownKeys$4=getBuiltIn$4("Reflect","ownKeys")||function r(e){var t=getOwnPropertyNamesModule.f(anObject$d(e));var n=getOwnPropertySymbolsModule.f;return n?concat$1(t,n(e)):t};var hasOwn$4=hasOwnProperty_1;var ownKeys$3=ownKeys$4;var getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor;var definePropertyModule$1=objectDefineProperty;var copyConstructorProperties$1=function(r,e,t){var n=ownKeys$3(e);var i=definePropertyModule$1.f;var a=getOwnPropertyDescriptorModule.f;for(var o=0;o<n.length;o++){var s=n[o];if(!hasOwn$4(r,s)&&!(t&&hasOwn$4(t,s))){i(r,s,a(e,s))}}};var fails$d=fails$l;var isCallable$b=isCallable$l;var replacement=/#|\.prototype\./;var isForced$2=function(r,e){var t=data[normalize(r)];return t===POLYFILL?true:t===NATIVE?false:isCallable$b(e)?fails$d(e):!!e};var normalize=isForced$2.normalize=function(r){return String(r).replace(replacement,".").toLowerCase()};var data=isForced$2.data={};var NATIVE=isForced$2.NATIVE="N";var POLYFILL=isForced$2.POLYFILL="P";var isForced_1=isForced$2;var global$b=global$k;var getOwnPropertyDescriptor$3=objectGetOwnPropertyDescriptor.f;var createNonEnumerableProperty$3=createNonEnumerableProperty$5;var defineBuiltIn$6=defineBuiltIn$7;var defineGlobalProperty=defineGlobalProperty$3;var copyConstructorProperties=copyConstructorProperties$1;var isForced$1=isForced_1;var _export=function(r,e){var t=r.target;var n=r.global;var i=r.stat;var a,o,s,u,c,f;if(n){o=global$b}else if(i){o=global$b[t]||defineGlobalProperty(t,{})}else{o=global$b[t]&&global$b[t].prototype}if(o)for(s in e){c=e[s];if(r.dontCallGetSet){f=getOwnPropertyDescriptor$3(o,s);u=f&&f.value}else u=o[s];a=isForced$1(n?s:t+(i?".":"#")+s,r.forced);if(!a&&u!==undefined){if(typeof c==typeof u)continue;copyConstructorProperties(c,u)}if(r.sham||u&&u.sham){createNonEnumerableProperty$3(c,"sham",true)}defineBuiltIn$6(o,s,c,r)}};var global$a=global$k;var classof$7=classofRaw$2;var engineIsNode=classof$7(global$a.process)==="process";var uncurryThis$f=functionUncurryThis;var aCallable$7=aCallable$9;var functionUncurryThisAccessor=function(r,e,t){try{return uncurryThis$f(aCallable$7(Object.getOwnPropertyDescriptor(r,e)[t]))}catch(r){}};var isObject$5=isObject$b;var isPossiblePrototype$1=function(r){return isObject$5(r)||r===null};var isPossiblePrototype=isPossiblePrototype$1;var $String$1=String;var $TypeError$9=TypeError;var aPossiblePrototype$1=function(r){if(isPossiblePrototype(r))return r;throw new $TypeError$9("Can't set "+$String$1(r)+" as a prototype")};var uncurryThisAccessor=functionUncurryThisAccessor;var isObject$4=isObject$b;var requireObjectCoercible$8=requireObjectCoercible$b;var aPossiblePrototype=aPossiblePrototype$1;var objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var r=false;var e={};var t;try{t=uncurryThisAccessor(Object.prototype,"__proto__","set");t(e,[]);r=e instanceof Array}catch(r){}return function e(n,i){requireObjectCoercible$8(n);aPossiblePrototype(i);if(!isObject$4(n))return n;if(r)t(n,i);else n.__proto__=i;return n}}():undefined);var defineProperty$4=objectDefineProperty.f;var hasOwn$3=hasOwnProperty_1;var wellKnownSymbol$g=wellKnownSymbol$i;var TO_STRING_TAG$2=wellKnownSymbol$g("toStringTag");var setToStringTag$4=function(r,e,t){if(r&&!t)r=r.prototype;if(r&&!hasOwn$3(r,TO_STRING_TAG$2)){defineProperty$4(r,TO_STRING_TAG$2,{configurable:true,value:e})}};var makeBuiltIn=makeBuiltIn$3.exports;var defineProperty$3=objectDefineProperty;var defineBuiltInAccessor$1=function(r,e,t){if(t.get)makeBuiltIn(t.get,e,{getter:true});if(t.set)makeBuiltIn(t.set,e,{setter:true});return defineProperty$3.f(r,e,t)};var getBuiltIn$3=getBuiltIn$6;var defineBuiltInAccessor=defineBuiltInAccessor$1;var wellKnownSymbol$f=wellKnownSymbol$i;var DESCRIPTORS$3=descriptors;var SPECIES$3=wellKnownSymbol$f("species");var setSpecies$1=function(r){var e=getBuiltIn$3(r);if(DESCRIPTORS$3&&e&&!e[SPECIES$3]){defineBuiltInAccessor(e,SPECIES$3,{configurable:true,get:function(){return this}})}};var isPrototypeOf$2=objectIsPrototypeOf;var $TypeError$8=TypeError;var anInstance$1=function(r,e){if(isPrototypeOf$2(e,r))return r;throw new $TypeError$8("Incorrect invocation")};var wellKnownSymbol$e=wellKnownSymbol$i;var TO_STRING_TAG$1=wellKnownSymbol$e("toStringTag");var test$1={};test$1[TO_STRING_TAG$1]="z";var toStringTagSupport=String(test$1)==="[object z]";var TO_STRING_TAG_SUPPORT=toStringTagSupport;var isCallable$a=isCallable$l;var classofRaw$1=classofRaw$2;var wellKnownSymbol$d=wellKnownSymbol$i;var TO_STRING_TAG=wellKnownSymbol$d("toStringTag");var $Object$1=Object;var CORRECT_ARGUMENTS=classofRaw$1(function(){return arguments}())==="Arguments";var tryGet=function(r,e){try{return r[e]}catch(r){}};var classof$6=TO_STRING_TAG_SUPPORT?classofRaw$1:function(r){var e,t,n;return r===undefined?"Undefined":r===null?"Null":typeof(t=tryGet(e=$Object$1(r),TO_STRING_TAG))=="string"?t:CORRECT_ARGUMENTS?classofRaw$1(e):(n=classofRaw$1(e))==="Object"&&isCallable$a(e.callee)?"Arguments":n};var uncurryThis$e=functionUncurryThis;var fails$c=fails$l;var isCallable$9=isCallable$l;var classof$5=classof$6;var getBuiltIn$2=getBuiltIn$6;var inspectSource$1=inspectSource$3;var noop$1=function(){};var construct=getBuiltIn$2("Reflect","construct");var constructorRegExp=/^\s*(?:class|function)\b/;var exec$1=uncurryThis$e(constructorRegExp.exec);var INCORRECT_TO_STRING=!constructorRegExp.test(noop$1);var isConstructorModern=function r(e){if(!isCallable$9(e))return false;try{construct(noop$1,[],e);return true}catch(r){return false}};var isConstructorLegacy=function r(e){if(!isCallable$9(e))return false;switch(classof$5(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return false}try{return INCORRECT_TO_STRING||!!exec$1(constructorRegExp,inspectSource$1(e))}catch(r){return true}};isConstructorLegacy.sham=true;var isConstructor$1=!construct||fails$c((function(){var r;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern((function(){r=true}))||r}))?isConstructorLegacy:isConstructorModern;var isConstructor=isConstructor$1;var tryToString$2=tryToString$4;var $TypeError$7=TypeError;var aConstructor$1=function(r){if(isConstructor(r))return r;throw new $TypeError$7(tryToString$2(r)+" is not a constructor")};var anObject$c=anObject$f;var aConstructor=aConstructor$1;var isNullOrUndefined$4=isNullOrUndefined$7;var wellKnownSymbol$c=wellKnownSymbol$i;var SPECIES$2=wellKnownSymbol$c("species");var speciesConstructor$2=function(r,e){var t=anObject$c(r).constructor;var n;return t===undefined||isNullOrUndefined$4(n=anObject$c(t)[SPECIES$2])?e:aConstructor(n)};var NATIVE_BIND$1=functionBindNative;var FunctionPrototype=Function.prototype;var apply$2=FunctionPrototype.apply;var call$e=FunctionPrototype.call;var functionApply=typeof Reflect=="object"&&Reflect.apply||(NATIVE_BIND$1?call$e.bind(apply$2):function(){return call$e.apply(apply$2,arguments)});var classofRaw=classofRaw$2;var uncurryThis$d=functionUncurryThis;var functionUncurryThisClause=function(r){if(classofRaw(r)==="Function")return uncurryThis$d(r)};var uncurryThis$c=functionUncurryThisClause;var aCallable$6=aCallable$9;var NATIVE_BIND=functionBindNative;var bind$4=uncurryThis$c(uncurryThis$c.bind);var functionBindContext=function(r,e){aCallable$6(r);return e===undefined?r:NATIVE_BIND?bind$4(r,e):function(){return r.apply(e,arguments)}};var getBuiltIn$1=getBuiltIn$6;var html$2=getBuiltIn$1("document","documentElement");var uncurryThis$b=functionUncurryThis;var arraySlice$1=uncurryThis$b([].slice);var $TypeError$6=TypeError;var validateArgumentsLength$1=function(r,e){if(r<e)throw new $TypeError$6("Not enough arguments");return r};var userAgent$2=engineUserAgent;var engineIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);var global$9=global$k;var apply$1=functionApply;var bind$3=functionBindContext;var isCallable$8=isCallable$l;var hasOwn$2=hasOwnProperty_1;var fails$b=fails$l;var html$1=html$2;var arraySlice=arraySlice$1;var createElement=documentCreateElement$2;var validateArgumentsLength=validateArgumentsLength$1;var IS_IOS$1=engineIsIos;var IS_NODE$4=engineIsNode;var set=global$9.setImmediate;var clear=global$9.clearImmediate;var process$2=global$9.process;var Dispatch=global$9.Dispatch;var Function$1=global$9.Function;var MessageChannel=global$9.MessageChannel;var String$1=global$9.String;var counter=0;var queue$3={};var ONREADYSTATECHANGE="onreadystatechange";var $location,defer,channel,port;fails$b((function(){$location=global$9.location}));var run=function(r){if(hasOwn$2(queue$3,r)){var e=queue$3[r];delete queue$3[r];e()}};var runner=function(r){return function(){run(r)}};var eventListener=function(r){run(r.data)};var globalPostMessageDefer=function(r){global$9.postMessage(String$1(r),$location.protocol+"//"+$location.host)};if(!set||!clear){set=function r(e){validateArgumentsLength(arguments.length,1);var t=isCallable$8(e)?e:Function$1(e);var n=arraySlice(arguments,1);queue$3[++counter]=function(){apply$1(t,undefined,n)};defer(counter);return counter};clear=function r(e){delete queue$3[e]};if(IS_NODE$4){defer=function(r){process$2.nextTick(runner(r))}}else if(Dispatch&&Dispatch.now){defer=function(r){Dispatch.now(runner(r))}}else if(MessageChannel&&!IS_IOS$1){channel=new MessageChannel;port=channel.port2;channel.port1.onmessage=eventListener;defer=bind$3(port.postMessage,port)}else if(global$9.addEventListener&&isCallable$8(global$9.postMessage)&&!global$9.importScripts&&$location&&$location.protocol!=="file:"&&!fails$b(globalPostMessageDefer)){defer=globalPostMessageDefer;global$9.addEventListener("message",eventListener,false)}else if(ONREADYSTATECHANGE in createElement("script")){defer=function(r){html$1.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html$1.removeChild(this);run(r)}}}else{defer=function(r){setTimeout(runner(r),0)}}}var task$1={set:set,clear:clear};var global$8=global$k;var DESCRIPTORS$2=descriptors;var getOwnPropertyDescriptor$2=Object.getOwnPropertyDescriptor;var safeGetBuiltIn$1=function(r){if(!DESCRIPTORS$2)return global$8[r];var e=getOwnPropertyDescriptor$2(global$8,r);return e&&e.value};var Queue$2=function(){this.head=null;this.tail=null};Queue$2.prototype={add:function(r){var e={item:r,next:null};var t=this.tail;if(t)t.next=e;else this.head=e;this.tail=e},get:function(){var r=this.head;if(r){var e=this.head=r.next;if(e===null)this.tail=null;return r.item}}};var queue$2=Queue$2;var userAgent$1=engineUserAgent;var engineIsIosPebble=/ipad|iphone|ipod/i.test(userAgent$1)&&typeof Pebble!="undefined";var userAgent=engineUserAgent;var engineIsWebosWebkit=/web0s(?!.*chrome)/i.test(userAgent);var global$7=global$k;var safeGetBuiltIn=safeGetBuiltIn$1;var bind$2=functionBindContext;var macrotask=task$1.set;var Queue$1=queue$2;var IS_IOS=engineIsIos;var IS_IOS_PEBBLE=engineIsIosPebble;var IS_WEBOS_WEBKIT=engineIsWebosWebkit;var IS_NODE$3=engineIsNode;var MutationObserver=global$7.MutationObserver||global$7.WebKitMutationObserver;var document$2=global$7.document;var process$1=global$7.process;var Promise$1=global$7.Promise;var microtask$1=safeGetBuiltIn("queueMicrotask");var notify$1,toggle,node$1,promise,then;if(!microtask$1){var queue$1=new Queue$1;var flush=function(){var r,e;if(IS_NODE$3&&(r=process$1.domain))r.exit();while(e=queue$1.get())try{e()}catch(r){if(queue$1.head)notify$1();throw r}if(r)r.enter()};if(!IS_IOS&&!IS_NODE$3&&!IS_WEBOS_WEBKIT&&MutationObserver&&document$2){toggle=true;node$1=document$2.createTextNode("");new MutationObserver(flush).observe(node$1,{characterData:true});notify$1=function(){node$1.data=toggle=!toggle}}else if(!IS_IOS_PEBBLE&&Promise$1&&Promise$1.resolve){promise=Promise$1.resolve(undefined);promise.constructor=Promise$1;then=bind$2(promise.then,promise);notify$1=function(){then(flush)}}else if(IS_NODE$3){notify$1=function(){process$1.nextTick(flush)}}else{macrotask=bind$2(macrotask,global$7);notify$1=function(){macrotask(flush)}}microtask$1=function(r){if(!queue$1.head)notify$1();queue$1.add(r)}}var microtask_1=microtask$1;var hostReportErrors$1=function(r,e){try{arguments.length===1?console.error(r):console.error(r,e)}catch(r){}};var perform$3=function(r){try{return{error:false,value:r()}}catch(r){return{error:true,value:r}}};var global$6=global$k;var promiseNativeConstructor=global$6.Promise;var engineIsDeno=typeof Deno=="object"&&Deno&&typeof Deno.version=="object";var IS_DENO$1=engineIsDeno;var IS_NODE$2=engineIsNode;var engineIsBrowser=!IS_DENO$1&&!IS_NODE$2&&typeof window=="object"&&typeof document=="object";var global$5=global$k;var NativePromiseConstructor$3=promiseNativeConstructor;var isCallable$7=isCallable$l;var isForced=isForced_1;var inspectSource=inspectSource$3;var wellKnownSymbol$b=wellKnownSymbol$i;var IS_BROWSER=engineIsBrowser;var IS_DENO=engineIsDeno;var V8_VERSION=engineV8Version;var SPECIES$1=wellKnownSymbol$b("species");var SUBCLASSING=false;var NATIVE_PROMISE_REJECTION_EVENT$1=isCallable$7(global$5.PromiseRejectionEvent);var FORCED_PROMISE_CONSTRUCTOR$5=isForced("Promise",(function(){var r=inspectSource(NativePromiseConstructor$3);var e=r!==String(NativePromiseConstructor$3);if(!e&&V8_VERSION===66)return true;if(!V8_VERSION||V8_VERSION<51||!/native code/.test(r)){var t=new NativePromiseConstructor$3((function(r){r(1)}));var n=function(r){r((function(){}),(function(){}))};var i=t.constructor={};i[SPECIES$1]=n;SUBCLASSING=t.then((function(){}))instanceof n;if(!SUBCLASSING)return true}return!e&&(IS_BROWSER||IS_DENO)&&!NATIVE_PROMISE_REJECTION_EVENT$1}));var promiseConstructorDetection={CONSTRUCTOR:FORCED_PROMISE_CONSTRUCTOR$5,REJECTION_EVENT:NATIVE_PROMISE_REJECTION_EVENT$1,SUBCLASSING:SUBCLASSING};var newPromiseCapability$2={};var aCallable$5=aCallable$9;var $TypeError$5=TypeError;var PromiseCapability=function(r){var e,t;this.promise=new r((function(r,n){if(e!==undefined||t!==undefined)throw new $TypeError$5("Bad Promise constructor");e=r;t=n}));this.resolve=aCallable$5(e);this.reject=aCallable$5(t)};newPromiseCapability$2.f=function(r){return new PromiseCapability(r)};var $$e=_export;var IS_NODE$1=engineIsNode;var global$4=global$k;var call$d=functionCall;var defineBuiltIn$5=defineBuiltIn$7;var setPrototypeOf$1=objectSetPrototypeOf;var setToStringTag$3=setToStringTag$4;var setSpecies=setSpecies$1;var aCallable$4=aCallable$9;var isCallable$6=isCallable$l;var isObject$3=isObject$b;var anInstance=anInstance$1;var speciesConstructor$1=speciesConstructor$2;var task=task$1.set;var microtask=microtask_1;var hostReportErrors=hostReportErrors$1;var perform$2=perform$3;var Queue=queue$2;var InternalStateModule$1=internalState;var NativePromiseConstructor$2=promiseNativeConstructor;var PromiseConstructorDetection=promiseConstructorDetection;var newPromiseCapabilityModule$3=newPromiseCapability$2;var PROMISE="Promise";var FORCED_PROMISE_CONSTRUCTOR$4=PromiseConstructorDetection.CONSTRUCTOR;var NATIVE_PROMISE_REJECTION_EVENT=PromiseConstructorDetection.REJECTION_EVENT;var NATIVE_PROMISE_SUBCLASSING=PromiseConstructorDetection.SUBCLASSING;var getInternalPromiseState=InternalStateModule$1.getterFor(PROMISE);var setInternalState$1=InternalStateModule$1.set;var NativePromisePrototype$1=NativePromiseConstructor$2&&NativePromiseConstructor$2.prototype;var PromiseConstructor=NativePromiseConstructor$2;var PromisePrototype=NativePromisePrototype$1;var TypeError$1=global$4.TypeError;var document$1=global$4.document;var process=global$4.process;var newPromiseCapability$1=newPromiseCapabilityModule$3.f;var newGenericPromiseCapability=newPromiseCapability$1;var DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$4.dispatchEvent);var UNHANDLED_REJECTION="unhandledrejection";var REJECTION_HANDLED="rejectionhandled";var PENDING=0;var FULFILLED=1;var REJECTED=2;var HANDLED=1;var UNHANDLED=2;var Internal,OwnPromiseCapability,PromiseWrapper,nativeThen;var isThenable=function(r){var e;return isObject$3(r)&&isCallable$6(e=r.then)?e:false};var callReaction=function(r,e){var t=e.value;var n=e.state===FULFILLED;var i=n?r.ok:r.fail;var a=r.resolve;var o=r.reject;var s=r.domain;var u,c,f;try{if(i){if(!n){if(e.rejection===UNHANDLED)onHandleUnhandled(e);e.rejection=HANDLED}if(i===true)u=t;else{if(s)s.enter();u=i(t);if(s){s.exit();f=true}}if(u===r.promise){o(new TypeError$1("Promise-chain cycle"))}else if(c=isThenable(u)){call$d(c,u,a,o)}else a(u)}else o(t)}catch(r){if(s&&!f)s.exit();o(r)}};var notify=function(r,e){if(r.notified)return;r.notified=true;microtask((function(){var t=r.reactions;var n;while(n=t.get()){callReaction(n,r)}r.notified=false;if(e&&!r.rejection)onUnhandled(r)}))};var dispatchEvent=function(r,e,t){var n,i;if(DISPATCH_EVENT){n=document$1.createEvent("Event");n.promise=e;n.reason=t;n.initEvent(r,false,true);global$4.dispatchEvent(n)}else n={promise:e,reason:t};if(!NATIVE_PROMISE_REJECTION_EVENT&&(i=global$4["on"+r]))i(n);else if(r===UNHANDLED_REJECTION)hostReportErrors("Unhandled promise rejection",t)};var onUnhandled=function(r){call$d(task,global$4,(function(){var e=r.facade;var t=r.value;var n=isUnhandled(r);var i;if(n){i=perform$2((function(){if(IS_NODE$1){process.emit("unhandledRejection",t,e)}else dispatchEvent(UNHANDLED_REJECTION,e,t)}));r.rejection=IS_NODE$1||isUnhandled(r)?UNHANDLED:HANDLED;if(i.error)throw i.value}}))};var isUnhandled=function(r){return r.rejection!==HANDLED&&!r.parent};var onHandleUnhandled=function(r){call$d(task,global$4,(function(){var e=r.facade;if(IS_NODE$1){process.emit("rejectionHandled",e)}else dispatchEvent(REJECTION_HANDLED,e,r.value)}))};var bind$1=function(r,e,t){return function(n){r(e,n,t)}};var internalReject=function(r,e,t){if(r.done)return;r.done=true;if(t)r=t;r.value=e;r.state=REJECTED;notify(r,true)};var internalResolve=function(r,e,t){if(r.done)return;r.done=true;if(t)r=t;try{if(r.facade===e)throw new TypeError$1("Promise can't be resolved itself");var n=isThenable(e);if(n){microtask((function(){var t={done:false};try{call$d(n,e,bind$1(internalResolve,t,r),bind$1(internalReject,t,r))}catch(e){internalReject(t,e,r)}}))}else{r.value=e;r.state=FULFILLED;notify(r,false)}}catch(e){internalReject({done:false},e,r)}};if(FORCED_PROMISE_CONSTRUCTOR$4){PromiseConstructor=function r(e){anInstance(this,PromisePrototype);aCallable$4(e);call$d(Internal,this);var t=getInternalPromiseState(this);try{e(bind$1(internalResolve,t),bind$1(internalReject,t))}catch(r){internalReject(t,r)}};PromisePrototype=PromiseConstructor.prototype;Internal=function r(e){setInternalState$1(this,{type:PROMISE,done:false,notified:false,parent:false,reactions:new Queue,rejection:false,state:PENDING,value:undefined})};Internal.prototype=defineBuiltIn$5(PromisePrototype,"then",(function r(e,t){var n=getInternalPromiseState(this);var i=newPromiseCapability$1(speciesConstructor$1(this,PromiseConstructor));n.parent=true;i.ok=isCallable$6(e)?e:true;i.fail=isCallable$6(t)&&t;i.domain=IS_NODE$1?process.domain:undefined;if(n.state===PENDING)n.reactions.add(i);else microtask((function(){callReaction(i,n)}));return i.promise}));OwnPromiseCapability=function(){var r=new Internal;var e=getInternalPromiseState(r);this.promise=r;this.resolve=bind$1(internalResolve,e);this.reject=bind$1(internalReject,e)};newPromiseCapabilityModule$3.f=newPromiseCapability$1=function(r){return r===PromiseConstructor||r===PromiseWrapper?new OwnPromiseCapability(r):newGenericPromiseCapability(r)};if(isCallable$6(NativePromiseConstructor$2)&&NativePromisePrototype$1!==Object.prototype){nativeThen=NativePromisePrototype$1.then;if(!NATIVE_PROMISE_SUBCLASSING){defineBuiltIn$5(NativePromisePrototype$1,"then",(function r(e,t){var n=this;return new PromiseConstructor((function(r,e){call$d(nativeThen,n,r,e)})).then(e,t)}),{unsafe:true})}try{delete NativePromisePrototype$1.constructor}catch(r){}if(setPrototypeOf$1){setPrototypeOf$1(NativePromisePrototype$1,PromisePrototype)}}}$$e({global:true,constructor:true,wrap:true,forced:FORCED_PROMISE_CONSTRUCTOR$4},{Promise:PromiseConstructor});setToStringTag$3(PromiseConstructor,PROMISE,false);setSpecies(PROMISE);var iterators={};var wellKnownSymbol$a=wellKnownSymbol$i;var Iterators$4=iterators;var ITERATOR$5=wellKnownSymbol$a("iterator");var ArrayPrototype$1=Array.prototype;var isArrayIteratorMethod$1=function(r){return r!==undefined&&(Iterators$4.Array===r||ArrayPrototype$1[ITERATOR$5]===r)};var classof$4=classof$6;var getMethod$4=getMethod$6;var isNullOrUndefined$3=isNullOrUndefined$7;var Iterators$3=iterators;var wellKnownSymbol$9=wellKnownSymbol$i;var ITERATOR$4=wellKnownSymbol$9("iterator");var getIteratorMethod$2=function(r){if(!isNullOrUndefined$3(r))return getMethod$4(r,ITERATOR$4)||getMethod$4(r,"@@iterator")||Iterators$3[classof$4(r)]};var call$c=functionCall;var aCallable$3=aCallable$9;var anObject$b=anObject$f;var tryToString$1=tryToString$4;var getIteratorMethod$1=getIteratorMethod$2;var $TypeError$4=TypeError;var getIterator$1=function(r,e){var t=arguments.length<2?getIteratorMethod$1(r):e;if(aCallable$3(t))return anObject$b(call$c(t,r));throw new $TypeError$4(tryToString$1(r)+" is not iterable")};var call$b=functionCall;var anObject$a=anObject$f;var getMethod$3=getMethod$6;var iteratorClose$1=function(r,e,t){var n,i;anObject$a(r);try{n=getMethod$3(r,"return");if(!n){if(e==="throw")throw t;return t}n=call$b(n,r)}catch(r){i=true;n=r}if(e==="throw")throw t;if(i)throw n;anObject$a(n);return t};var bind=functionBindContext;var call$a=functionCall;var anObject$9=anObject$f;var tryToString=tryToString$4;var isArrayIteratorMethod=isArrayIteratorMethod$1;var lengthOfArrayLike$1=lengthOfArrayLike$3;var isPrototypeOf$1=objectIsPrototypeOf;var getIterator=getIterator$1;var getIteratorMethod=getIteratorMethod$2;var iteratorClose=iteratorClose$1;var $TypeError$3=TypeError;var Result=function(r,e){this.stopped=r;this.result=e};var ResultPrototype=Result.prototype;var iterate$2=function(r,e,t){var n=t&&t.that;var i=!!(t&&t.AS_ENTRIES);var a=!!(t&&t.IS_RECORD);var o=!!(t&&t.IS_ITERATOR);var s=!!(t&&t.INTERRUPTED);var u=bind(e,n);var c,f,l,v,h,$,d;var p=function(r){if(c)iteratorClose(c,"normal",r);return new Result(true,r)};var y=function(r){if(i){anObject$9(r);return s?u(r[0],r[1],p):u(r[0],r[1])}return s?u(r,p):u(r)};if(a){c=r.iterator}else if(o){c=r}else{f=getIteratorMethod(r);if(!f)throw new $TypeError$3(tryToString(r)+" is not iterable");if(isArrayIteratorMethod(f)){for(l=0,v=lengthOfArrayLike$1(r);v>l;l++){h=y(r[l]);if(h&&isPrototypeOf$1(ResultPrototype,h))return h}return new Result(false)}c=getIterator(r,f)}$=a?r.next:c.next;while(!(d=call$a($,c)).done){try{h=y(d.value)}catch(r){iteratorClose(c,"throw",r)}if(typeof h=="object"&&h&&isPrototypeOf$1(ResultPrototype,h))return h}return new Result(false)};var wellKnownSymbol$8=wellKnownSymbol$i;var ITERATOR$3=wellKnownSymbol$8("iterator");var SAFE_CLOSING=false;try{var called=0;var iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=true}};iteratorWithReturn[ITERATOR$3]=function(){return this};Array.from(iteratorWithReturn,(function(){throw 2}))}catch(r){}var checkCorrectnessOfIteration$1=function(r,e){try{if(!e&&!SAFE_CLOSING)return false}catch(r){return false}var t=false;try{var n={};n[ITERATOR$3]=function(){return{next:function(){return{done:t=true}}}};r(n)}catch(r){}return t};var NativePromiseConstructor$1=promiseNativeConstructor;var checkCorrectnessOfIteration=checkCorrectnessOfIteration$1;var FORCED_PROMISE_CONSTRUCTOR$3=promiseConstructorDetection.CONSTRUCTOR;var promiseStaticsIncorrectIteration=FORCED_PROMISE_CONSTRUCTOR$3||!checkCorrectnessOfIteration((function(r){NativePromiseConstructor$1.all(r).then(undefined,(function(){}))}));var $$d=_export;var call$9=functionCall;var aCallable$2=aCallable$9;var newPromiseCapabilityModule$2=newPromiseCapability$2;var perform$1=perform$3;var iterate$1=iterate$2;var PROMISE_STATICS_INCORRECT_ITERATION$1=promiseStaticsIncorrectIteration;$$d({target:"Promise",stat:true,forced:PROMISE_STATICS_INCORRECT_ITERATION$1},{all:function r(e){var t=this;var n=newPromiseCapabilityModule$2.f(t);var i=n.resolve;var a=n.reject;var o=perform$1((function(){var r=aCallable$2(t.resolve);var n=[];var o=0;var s=1;iterate$1(e,(function(e){var u=o++;var c=false;s++;call$9(r,t,e).then((function(r){if(c)return;c=true;n[u]=r;--s||i(n)}),a)}));--s||i(n)}));if(o.error)a(o.value);return n.promise}});var $$c=_export;var FORCED_PROMISE_CONSTRUCTOR$2=promiseConstructorDetection.CONSTRUCTOR;var NativePromiseConstructor=promiseNativeConstructor;var getBuiltIn=getBuiltIn$6;var isCallable$5=isCallable$l;var defineBuiltIn$4=defineBuiltIn$7;var NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype;$$c({target:"Promise",proto:true,forced:FORCED_PROMISE_CONSTRUCTOR$2,real:true},{catch:function(r){return this.then(undefined,r)}});if(isCallable$5(NativePromiseConstructor)){var method=getBuiltIn("Promise").prototype["catch"];if(NativePromisePrototype["catch"]!==method){defineBuiltIn$4(NativePromisePrototype,"catch",method,{unsafe:true})}}var $$b=_export;var call$8=functionCall;var aCallable$1=aCallable$9;var newPromiseCapabilityModule$1=newPromiseCapability$2;var perform=perform$3;var iterate=iterate$2;var PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration;$$b({target:"Promise",stat:true,forced:PROMISE_STATICS_INCORRECT_ITERATION},{race:function r(e){var t=this;var n=newPromiseCapabilityModule$1.f(t);var i=n.reject;var a=perform((function(){var r=aCallable$1(t.resolve);iterate(e,(function(e){call$8(r,t,e).then(n.resolve,i)}))}));if(a.error)i(a.value);return n.promise}});var $$a=_export;var newPromiseCapabilityModule=newPromiseCapability$2;var FORCED_PROMISE_CONSTRUCTOR$1=promiseConstructorDetection.CONSTRUCTOR;$$a({target:"Promise",stat:true,forced:FORCED_PROMISE_CONSTRUCTOR$1},{reject:function r(e){var t=newPromiseCapabilityModule.f(this);var n=t.reject;n(e);return t.promise}});var anObject$8=anObject$f;var isObject$2=isObject$b;var newPromiseCapability=newPromiseCapability$2;var promiseResolve$1=function(r,e){anObject$8(r);if(isObject$2(e)&&e.constructor===r)return e;var t=newPromiseCapability.f(r);var n=t.resolve;n(e);return t.promise};var $$9=_export;var FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR;var promiseResolve=promiseResolve$1;$$9({target:"Promise",stat:true,forced:FORCED_PROMISE_CONSTRUCTOR},{resolve:function r(e){return promiseResolve(this,e)}});var asyncToGenerator={exports:{}};(function(r){function e(r,e,t,n,i,a,o){try{var s=r[a](o),u=s.value}catch(r){return void t(r)}s.done?e(u):Promise.resolve(u).then(n,i)}function t(r){return function(){var t=this,n=arguments;return new Promise((function(i,a){var o=r.apply(t,n);function s(r){e(o,i,a,s,u,"next",r)}function u(r){e(o,i,a,s,u,"throw",r)}s(void 0)}))}}r.exports=t,r.exports.__esModule=true,r.exports["default"]=r.exports})(asyncToGenerator);var _asyncToGenerator=getDefaultExportFromCjs(asyncToGenerator.exports);var classof$3=classof$6;var $String=String;var toString$9=function(r){if(classof$3(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return $String(r)};var anObject$7=anObject$f;var regexpFlags$1=function(){var r=anObject$7(this);var e="";if(r.hasIndices)e+="d";if(r.global)e+="g";if(r.ignoreCase)e+="i";if(r.multiline)e+="m";if(r.dotAll)e+="s";if(r.unicode)e+="u";if(r.unicodeSets)e+="v";if(r.sticky)e+="y";return e};var fails$a=fails$l;var global$3=global$k;var $RegExp$2=global$3.RegExp;var UNSUPPORTED_Y$2=fails$a((function(){var r=$RegExp$2("a","y");r.lastIndex=2;return r.exec("abcd")!==null}));var MISSED_STICKY=UNSUPPORTED_Y$2||fails$a((function(){return!$RegExp$2("a","y").sticky}));var BROKEN_CARET=UNSUPPORTED_Y$2||fails$a((function(){var r=$RegExp$2("^r","gy");r.lastIndex=2;return r.exec("str")!==null}));var regexpStickyHelpers={BROKEN_CARET:BROKEN_CARET,MISSED_STICKY:MISSED_STICKY,UNSUPPORTED_Y:UNSUPPORTED_Y$2};var objectDefineProperties={};var internalObjectKeys=objectKeysInternal;var enumBugKeys$1=enumBugKeys$3;var objectKeys$1=Object.keys||function r(e){return internalObjectKeys(e,enumBugKeys$1)};var DESCRIPTORS$1=descriptors;var V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug;var definePropertyModule=objectDefineProperty;var anObject$6=anObject$f;var toIndexedObject$1=toIndexedObject$5;var objectKeys=objectKeys$1;objectDefineProperties.f=DESCRIPTORS$1&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function r(e,t){anObject$6(e);var n=toIndexedObject$1(t);var i=objectKeys(t);var a=i.length;var o=0;var s;while(a>o)definePropertyModule.f(e,s=i[o++],n[s]);return e};var anObject$5=anObject$f;var definePropertiesModule=objectDefineProperties;var enumBugKeys=enumBugKeys$3;var hiddenKeys=hiddenKeys$4;var html=html$2;var documentCreateElement$1=documentCreateElement$2;var sharedKey$1=sharedKey$3;var GT=">";var LT="<";var PROTOTYPE="prototype";var SCRIPT="script";var IE_PROTO$1=sharedKey$1("IE_PROTO");var EmptyConstructor=function(){};var scriptTag=function(r){return LT+SCRIPT+GT+r+LT+"/"+SCRIPT+GT};var NullProtoObjectViaActiveX=function(r){r.write(scriptTag(""));r.close();var e=r.parentWindow.Object;r=null;return e};var NullProtoObjectViaIFrame=function(){var r=documentCreateElement$1("iframe");var e="java"+SCRIPT+":";var t;r.style.display="none";html.appendChild(r);r.src=String(e);t=r.contentWindow.document;t.open();t.write(scriptTag("document.F=Object"));t.close();return t.F};var activeXDocument;var NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(r){}NullProtoObject=typeof document!="undefined"?document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame():NullProtoObjectViaActiveX(activeXDocument);var r=enumBugKeys.length;while(r--)delete NullProtoObject[PROTOTYPE][enumBugKeys[r]];return NullProtoObject()};hiddenKeys[IE_PROTO$1]=true;var objectCreate=Object.create||function r(e,t){var n;if(e!==null){EmptyConstructor[PROTOTYPE]=anObject$5(e);n=new EmptyConstructor;EmptyConstructor[PROTOTYPE]=null;n[IE_PROTO$1]=e}else n=NullProtoObject();return t===undefined?n:definePropertiesModule.f(n,t)};var fails$9=fails$l;var global$2=global$k;var $RegExp$1=global$2.RegExp;var regexpUnsupportedDotAll=fails$9((function(){var r=$RegExp$1(".","s");return!(r.dotAll&&r.test("\n")&&r.flags==="s")}));var fails$8=fails$l;var global$1=global$k;var $RegExp=global$1.RegExp;var regexpUnsupportedNcg=fails$8((function(){var r=$RegExp("(?<a>b)","g");return r.exec("b").groups.a!=="b"||"b".replace(r,"$<a>c")!=="bc"}));var call$7=functionCall;var uncurryThis$a=functionUncurryThis;var toString$8=toString$9;var regexpFlags=regexpFlags$1;var stickyHelpers$1=regexpStickyHelpers;var shared=shared$4;var create$2=objectCreate;var getInternalState$1=internalState.get;var UNSUPPORTED_DOT_ALL=regexpUnsupportedDotAll;var UNSUPPORTED_NCG=regexpUnsupportedNcg;var nativeReplace=shared("native-string-replace",String.prototype.replace);var nativeExec=RegExp.prototype.exec;var patchedExec=nativeExec;var charAt$3=uncurryThis$a("".charAt);var indexOf=uncurryThis$a("".indexOf);var replace$2=uncurryThis$a("".replace);var stringSlice$5=uncurryThis$a("".slice);var UPDATES_LAST_INDEX_WRONG=function(){var r=/a/;var e=/b*/g;call$7(nativeExec,r,"a");call$7(nativeExec,e,"a");return r.lastIndex!==0||e.lastIndex!==0}();var UNSUPPORTED_Y$1=stickyHelpers$1.BROKEN_CARET;var NPCG_INCLUDED=/()??/.exec("")[1]!==undefined;var PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y$1||UNSUPPORTED_DOT_ALL||UNSUPPORTED_NCG;if(PATCH){patchedExec=function r(e){var t=this;var n=getInternalState$1(t);var i=toString$8(e);var a=n.raw;var o,s,u,c,f,l,v;if(a){a.lastIndex=t.lastIndex;o=call$7(patchedExec,a,i);t.lastIndex=a.lastIndex;return o}var h=n.groups;var $=UNSUPPORTED_Y$1&&t.sticky;var d=call$7(regexpFlags,t);var p=t.source;var y=0;var b=i;if($){d=replace$2(d,"y","");if(indexOf(d,"g")===-1){d+="g"}b=stringSlice$5(i,t.lastIndex);if(t.lastIndex>0&&(!t.multiline||t.multiline&&charAt$3(i,t.lastIndex-1)!=="\n")){p="(?: "+p+")";b=" "+b;y++}s=new RegExp("^(?:"+p+")",d)}if(NPCG_INCLUDED){s=new RegExp("^"+p+"$(?!\\s)",d)}if(UPDATES_LAST_INDEX_WRONG)u=t.lastIndex;c=call$7(nativeExec,$?s:t,b);if($){if(c){c.input=stringSlice$5(c.input,y);c[0]=stringSlice$5(c[0],y);c.index=t.lastIndex;t.lastIndex+=c[0].length}else t.lastIndex=0}else if(UPDATES_LAST_INDEX_WRONG&&c){t.lastIndex=t.global?c.index+c[0].length:u}if(NPCG_INCLUDED&&c&&c.length>1){call$7(nativeReplace,c[0],s,(function(){for(f=1;f<arguments.length-2;f++){if(arguments[f]===undefined)c[f]=undefined}}))}if(c&&h){c.groups=l=create$2(null);for(f=0;f<h.length;f++){v=h[f];l[v[0]]=c[v[1]]}}return c}}var regexpExec$2=patchedExec;var $$8=_export;var exec=regexpExec$2;$$8({target:"RegExp",proto:true,forced:/./.exec!==exec},{exec:exec});var call$6=functionCall;var defineBuiltIn$3=defineBuiltIn$7;var regexpExec$1=regexpExec$2;var fails$7=fails$l;var wellKnownSymbol$7=wellKnownSymbol$i;var createNonEnumerableProperty$2=createNonEnumerableProperty$5;var SPECIES=wellKnownSymbol$7("species");var RegExpPrototype$2=RegExp.prototype;var fixRegexpWellKnownSymbolLogic=function(r,e,t,n){var i=wellKnownSymbol$7(r);var a=!fails$7((function(){var e={};e[i]=function(){return 7};return""[r](e)!==7}));var o=a&&!fails$7((function(){var e=false;var t=/a/;if(r==="split"){t={};t.constructor={};t.constructor[SPECIES]=function(){return t};t.flags="";t[i]=/./[i]}t.exec=function(){e=true;return null};t[i]("");return!e}));if(!a||!o||t){var s=/./[i];var u=e(i,""[r],(function(r,e,t,n,i){var o=e.exec;if(o===regexpExec$1||o===RegExpPrototype$2.exec){if(a&&!i){return{done:true,value:call$6(s,e,t,n)}}return{done:true,value:call$6(r,t,e,n)}}return{done:false}}));defineBuiltIn$3(String.prototype,r,u[0]);defineBuiltIn$3(RegExpPrototype$2,i,u[1])}if(n)createNonEnumerableProperty$2(RegExpPrototype$2[i],"sham",true)};var uncurryThis$9=functionUncurryThis;var toIntegerOrInfinity$1=toIntegerOrInfinity$4;var toString$7=toString$9;var requireObjectCoercible$7=requireObjectCoercible$b;var charAt$2=uncurryThis$9("".charAt);var charCodeAt=uncurryThis$9("".charCodeAt);var stringSlice$4=uncurryThis$9("".slice);var createMethod$2=function(r){return function(e,t){var n=toString$7(requireObjectCoercible$7(e));var i=toIntegerOrInfinity$1(t);var a=n.length;var o,s;if(i<0||i>=a)return r?"":undefined;o=charCodeAt(n,i);return o<55296||o>56319||i+1===a||(s=charCodeAt(n,i+1))<56320||s>57343?r?charAt$2(n,i):o:r?stringSlice$4(n,i,i+2):(o-55296<<10)+(s-56320)+65536}};var stringMultibyte={codeAt:createMethod$2(false),charAt:createMethod$2(true)};var charAt$1=stringMultibyte.charAt;var advanceStringIndex$3=function(r,e,t){return e+(t?charAt$1(r,e).length:1)};var call$5=functionCall;var anObject$4=anObject$f;var isCallable$4=isCallable$l;var classof$2=classofRaw$2;var regexpExec=regexpExec$2;var $TypeError$2=TypeError;var regexpExecAbstract=function(r,e){var t=r.exec;if(isCallable$4(t)){var n=call$5(t,r,e);if(n!==null)anObject$4(n);return n}if(classof$2(r)==="RegExp")return call$5(regexpExec,r,e);throw new $TypeError$2("RegExp#exec called on incompatible receiver")};var call$4=functionCall;var fixRegExpWellKnownSymbolLogic$2=fixRegexpWellKnownSymbolLogic;var anObject$3=anObject$f;var isNullOrUndefined$2=isNullOrUndefined$7;var toLength$4=toLength$6;var toString$6=toString$9;var requireObjectCoercible$6=requireObjectCoercible$b;var getMethod$2=getMethod$6;var advanceStringIndex$2=advanceStringIndex$3;var regExpExec$2=regexpExecAbstract;fixRegExpWellKnownSymbolLogic$2("match",(function(r,e,t){return[function e(t){var n=requireObjectCoercible$6(this);var i=isNullOrUndefined$2(t)?undefined:getMethod$2(t,r);return i?call$4(i,t,n):new RegExp(t)[r](toString$6(n))},function(r){var n=anObject$3(this);var i=toString$6(r);var a=t(e,n,i);if(a.done)return a.value;if(!n.global)return regExpExec$2(n,i);var o=n.unicode;n.lastIndex=0;var s=[];var u=0;var c;while((c=regExpExec$2(n,i))!==null){var f=toString$6(c[0]);s[u]=f;if(f==="")n.lastIndex=advanceStringIndex$2(i,toLength$4(n.lastIndex),o);u++}return u===0?null:s}]}));var uncurryThis$8=functionUncurryThis;var toObject$2=toObject$4;var floor=Math.floor;var charAt=uncurryThis$8("".charAt);var replace$1=uncurryThis$8("".replace);var stringSlice$3=uncurryThis$8("".slice);var SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d{1,2}|<[^>]*>)/g;var SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d{1,2})/g;var getSubstitution$1=function(r,e,t,n,i,a){var o=t+r.length;var s=n.length;var u=SUBSTITUTION_SYMBOLS_NO_NAMED;if(i!==undefined){i=toObject$2(i);u=SUBSTITUTION_SYMBOLS}return replace$1(a,u,(function(a,u){var c;switch(charAt(u,0)){case"$":return"$";case"&":return r;case"`":return stringSlice$3(e,0,t);case"'":return stringSlice$3(e,o);case"<":c=i[stringSlice$3(u,1,-1)];break;default:var f=+u;if(f===0)return a;if(f>s){var l=floor(f/10);if(l===0)return a;if(l<=s)return n[l-1]===undefined?charAt(u,1):n[l-1]+charAt(u,1);return a}c=n[f-1]}return c===undefined?"":c}))};var apply=functionApply;var call$3=functionCall;var uncurryThis$7=functionUncurryThis;var fixRegExpWellKnownSymbolLogic$1=fixRegexpWellKnownSymbolLogic;var fails$6=fails$l;var anObject$2=anObject$f;var isCallable$3=isCallable$l;var isNullOrUndefined$1=isNullOrUndefined$7;var toIntegerOrInfinity=toIntegerOrInfinity$4;var toLength$3=toLength$6;var toString$5=toString$9;var requireObjectCoercible$5=requireObjectCoercible$b;var advanceStringIndex$1=advanceStringIndex$3;var getMethod$1=getMethod$6;var getSubstitution=getSubstitution$1;var regExpExec$1=regexpExecAbstract;var wellKnownSymbol$6=wellKnownSymbol$i;var REPLACE=wellKnownSymbol$6("replace");var max=Math.max;var min$3=Math.min;var concat=uncurryThis$7([].concat);var push$1=uncurryThis$7([].push);var stringIndexOf$1=uncurryThis$7("".indexOf);var stringSlice$2=uncurryThis$7("".slice);var maybeToString=function(r){return r===undefined?r:String(r)};var REPLACE_KEEPS_$0=function(){return"a".replace(/./,"$0")==="$0"}();var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=function(){if(/./[REPLACE]){return/./[REPLACE]("a","$0")===""}return false}();var REPLACE_SUPPORTS_NAMED_GROUPS=!fails$6((function(){var r=/./;r.exec=function(){var r=[];r.groups={a:"7"};return r};return"".replace(r,"$<a>")!=="7"}));fixRegExpWellKnownSymbolLogic$1("replace",(function(r,e,t){var n=REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE?"$":"$0";return[function r(t,n){var i=requireObjectCoercible$5(this);var a=isNullOrUndefined$1(t)?undefined:getMethod$1(t,REPLACE);return a?call$3(a,t,i,n):call$3(e,toString$5(i),t,n)},function(r,i){var a=anObject$2(this);var o=toString$5(r);if(typeof i=="string"&&stringIndexOf$1(i,n)===-1&&stringIndexOf$1(i,"$<")===-1){var s=t(e,a,o,i);if(s.done)return s.value}var u=isCallable$3(i);if(!u)i=toString$5(i);var c=a.global;var f;if(c){f=a.unicode;a.lastIndex=0}var l=[];var v;while(true){v=regExpExec$1(a,o);if(v===null)break;push$1(l,v);if(!c)break;var h=toString$5(v[0]);if(h==="")a.lastIndex=advanceStringIndex$1(o,toLength$3(a.lastIndex),f)}var $="";var d=0;for(var p=0;p<l.length;p++){v=l[p];var y=toString$5(v[0]);var b=max(min$3(toIntegerOrInfinity(v.index),o.length),0);var m=[];var g;for(var E=1;E<v.length;E++)push$1(m,maybeToString(v[E]));var O=v.groups;if(u){var S=concat([y],m,b,o);if(O!==undefined)push$1(S,O);g=toString$5(apply(i,undefined,S))}else{g=getSubstitution(y,o,b,m,O,i)}if(b>=d){$+=stringSlice$2(o,d,b)+g;d=b+y.length}}return $+stringSlice$2(o,d)}]}),!REPLACE_SUPPORTS_NAMED_GROUPS||!REPLACE_KEEPS_$0||REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);var isObject$1=isObject$b;var classof$1=classofRaw$2;var wellKnownSymbol$5=wellKnownSymbol$i;var MATCH$1=wellKnownSymbol$5("match");var isRegexp=function(r){var e;return isObject$1(r)&&((e=r[MATCH$1])!==undefined?!!e:classof$1(r)==="RegExp")};var isRegExp=isRegexp;var $TypeError$1=TypeError;var notARegexp=function(r){if(isRegExp(r)){throw new $TypeError$1("The method doesn't accept regular expressions")}return r};var wellKnownSymbol$4=wellKnownSymbol$i;var MATCH=wellKnownSymbol$4("match");var correctIsRegexpLogic=function(r){var e=/./;try{"/./"[r](e)}catch(t){try{e[MATCH]=false;return"/./"[r](e)}catch(r){}}return false};var $$7=_export;var uncurryThis$6=functionUncurryThisClause;var getOwnPropertyDescriptor$1=objectGetOwnPropertyDescriptor.f;var toLength$2=toLength$6;var toString$4=toString$9;var notARegExp$2=notARegexp;var requireObjectCoercible$4=requireObjectCoercible$b;var correctIsRegExpLogic$2=correctIsRegexpLogic;var stringSlice$1=uncurryThis$6("".slice);var min$2=Math.min;var CORRECT_IS_REGEXP_LOGIC$1=correctIsRegExpLogic$2("startsWith");var MDN_POLYFILL_BUG$1=!CORRECT_IS_REGEXP_LOGIC$1&&!!function(){var r=getOwnPropertyDescriptor$1(String.prototype,"startsWith");return r&&!r.writable}();$$7({target:"String",proto:true,forced:!MDN_POLYFILL_BUG$1&&!CORRECT_IS_REGEXP_LOGIC$1},{startsWith:function r(e){var t=toString$4(requireObjectCoercible$4(this));notARegExp$2(e);var n=toLength$2(min$2(arguments.length>1?arguments[1]:undefined,t.length));var i=toString$4(e);return stringSlice$1(t,n,n+i.length)===i}});var wellKnownSymbol$3=wellKnownSymbol$i;var create$1=objectCreate;var defineProperty$2=objectDefineProperty.f;var UNSCOPABLES=wellKnownSymbol$3("unscopables");var ArrayPrototype=Array.prototype;if(ArrayPrototype[UNSCOPABLES]===undefined){defineProperty$2(ArrayPrototype,UNSCOPABLES,{configurable:true,value:create$1(null)})}var addToUnscopables$1=function(r){ArrayPrototype[UNSCOPABLES][r]=true};var fails$5=fails$l;var correctPrototypeGetter=!fails$5((function(){function r(){}r.prototype.constructor=null;return Object.getPrototypeOf(new r)!==r.prototype}));var hasOwn$1=hasOwnProperty_1;var isCallable$2=isCallable$l;var toObject$1=toObject$4;var sharedKey=sharedKey$3;var CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter;var IE_PROTO=sharedKey("IE_PROTO");var $Object=Object;var ObjectPrototype=$Object.prototype;var objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER?$Object.getPrototypeOf:function(r){var e=toObject$1(r);if(hasOwn$1(e,IE_PROTO))return e[IE_PROTO];var t=e.constructor;if(isCallable$2(t)&&e instanceof t){return t.prototype}return e instanceof $Object?ObjectPrototype:null};var fails$4=fails$l;var isCallable$1=isCallable$l;var isObject=isObject$b;var getPrototypeOf$1=objectGetPrototypeOf;var defineBuiltIn$2=defineBuiltIn$7;var wellKnownSymbol$2=wellKnownSymbol$i;var ITERATOR$2=wellKnownSymbol$2("iterator");var BUGGY_SAFARI_ITERATORS$1=false;var IteratorPrototype$2,PrototypeOfArrayIteratorPrototype,arrayIterator;if([].keys){arrayIterator=[].keys();if(!("next"in arrayIterator))BUGGY_SAFARI_ITERATORS$1=true;else{PrototypeOfArrayIteratorPrototype=getPrototypeOf$1(getPrototypeOf$1(arrayIterator));if(PrototypeOfArrayIteratorPrototype!==Object.prototype)IteratorPrototype$2=PrototypeOfArrayIteratorPrototype}}var NEW_ITERATOR_PROTOTYPE=!isObject(IteratorPrototype$2)||fails$4((function(){var r={};return IteratorPrototype$2[ITERATOR$2].call(r)!==r}));if(NEW_ITERATOR_PROTOTYPE)IteratorPrototype$2={};if(!isCallable$1(IteratorPrototype$2[ITERATOR$2])){defineBuiltIn$2(IteratorPrototype$2,ITERATOR$2,(function(){return this}))}var iteratorsCore={IteratorPrototype:IteratorPrototype$2,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1};var IteratorPrototype$1=iteratorsCore.IteratorPrototype;var create=objectCreate;var createPropertyDescriptor=createPropertyDescriptor$3;var setToStringTag$2=setToStringTag$4;var Iterators$2=iterators;var returnThis$1=function(){return this};var iteratorCreateConstructor=function(r,e,t,n){var i=e+" Iterator";r.prototype=create(IteratorPrototype$1,{next:createPropertyDescriptor(+!n,t)});setToStringTag$2(r,i,false);Iterators$2[i]=returnThis$1;return r};var $$6=_export;var call$2=functionCall;var FunctionName=functionName;var isCallable=isCallable$l;var createIteratorConstructor=iteratorCreateConstructor;var getPrototypeOf=objectGetPrototypeOf;var setPrototypeOf=objectSetPrototypeOf;var setToStringTag$1=setToStringTag$4;var createNonEnumerableProperty$1=createNonEnumerableProperty$5;var defineBuiltIn$1=defineBuiltIn$7;var wellKnownSymbol$1=wellKnownSymbol$i;var Iterators$1=iterators;var IteratorsCore=iteratorsCore;var PROPER_FUNCTION_NAME$2=FunctionName.PROPER;var CONFIGURABLE_FUNCTION_NAME=FunctionName.CONFIGURABLE;var IteratorPrototype=IteratorsCore.IteratorPrototype;var BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS;var ITERATOR$1=wellKnownSymbol$1("iterator");var KEYS="keys";var VALUES="values";var ENTRIES="entries";var returnThis=function(){return this};var iteratorDefine=function(r,e,t,n,i,a,o){createIteratorConstructor(t,e,n);var s=function(r){if(r===i&&v)return v;if(!BUGGY_SAFARI_ITERATORS&&r&&r in f)return f[r];switch(r){case KEYS:return function e(){return new t(this,r)};case VALUES:return function e(){return new t(this,r)};case ENTRIES:return function e(){return new t(this,r)}}return function(){return new t(this)}};var u=e+" Iterator";var c=false;var f=r.prototype;var l=f[ITERATOR$1]||f["@@iterator"]||i&&f[i];var v=!BUGGY_SAFARI_ITERATORS&&l||s(i);var h=e==="Array"?f.entries||l:l;var $,d,p;if(h){$=getPrototypeOf(h.call(new r));if($!==Object.prototype&&$.next){if(getPrototypeOf($)!==IteratorPrototype){if(setPrototypeOf){setPrototypeOf($,IteratorPrototype)}else if(!isCallable($[ITERATOR$1])){defineBuiltIn$1($,ITERATOR$1,returnThis)}}setToStringTag$1($,u,true)}}if(PROPER_FUNCTION_NAME$2&&i===VALUES&&l&&l.name!==VALUES){if(CONFIGURABLE_FUNCTION_NAME){createNonEnumerableProperty$1(f,"name",VALUES)}else{c=true;v=function r(){return call$2(l,this)}}}if(i){d={values:s(VALUES),keys:a?v:s(KEYS),entries:s(ENTRIES)};if(o)for(p in d){if(BUGGY_SAFARI_ITERATORS||c||!(p in f)){defineBuiltIn$1(f,p,d[p])}}else $$6({target:e,proto:true,forced:BUGGY_SAFARI_ITERATORS||c},d)}if(f[ITERATOR$1]!==v){defineBuiltIn$1(f,ITERATOR$1,v,{name:i})}Iterators$1[e]=v;return d};var createIterResultObject$1=function(r,e){return{value:r,done:e}};var toIndexedObject=toIndexedObject$5;var addToUnscopables=addToUnscopables$1;var Iterators=iterators;var InternalStateModule=internalState;var defineProperty$1=objectDefineProperty.f;var defineIterator=iteratorDefine;var createIterResultObject=createIterResultObject$1;var DESCRIPTORS=descriptors;var ARRAY_ITERATOR="Array Iterator";var setInternalState=InternalStateModule.set;var getInternalState=InternalStateModule.getterFor(ARRAY_ITERATOR);var es_array_iterator=defineIterator(Array,"Array",(function(r,e){setInternalState(this,{type:ARRAY_ITERATOR,target:toIndexedObject(r),index:0,kind:e})}),(function(){var r=getInternalState(this);var e=r.target;var t=r.index++;if(!e||t>=e.length){r.target=undefined;return createIterResultObject(undefined,true)}switch(r.kind){case"keys":return createIterResultObject(t,false);case"values":return createIterResultObject(e[t],false)}return createIterResultObject([t,e[t]],false)}),"values");var values=Iterators.Arguments=Iterators.Array;addToUnscopables("keys");addToUnscopables("values");addToUnscopables("entries");if(DESCRIPTORS&&values.name!=="values")try{defineProperty$1(values,"name",{value:"values"})}catch(r){}var domIterables={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};var documentCreateElement=documentCreateElement$2;var classList=documentCreateElement("span").classList;var DOMTokenListPrototype$1=classList&&classList.constructor&&classList.constructor.prototype;var domTokenListPrototype=DOMTokenListPrototype$1===Object.prototype?undefined:DOMTokenListPrototype$1;var global=global$k;var DOMIterables=domIterables;var DOMTokenListPrototype=domTokenListPrototype;var ArrayIteratorMethods=es_array_iterator;var createNonEnumerableProperty=createNonEnumerableProperty$5;var setToStringTag=setToStringTag$4;var wellKnownSymbol=wellKnownSymbol$i;var ITERATOR=wellKnownSymbol("iterator");var ArrayValues=ArrayIteratorMethods.values;var handlePrototype=function(r,e){if(r){if(r[ITERATOR]!==ArrayValues)try{createNonEnumerableProperty(r,ITERATOR,ArrayValues)}catch(e){r[ITERATOR]=ArrayValues}setToStringTag(r,e,true);if(DOMIterables[e])for(var t in ArrayIteratorMethods){if(r[t]!==ArrayIteratorMethods[t])try{createNonEnumerableProperty(r,t,ArrayIteratorMethods[t])}catch(e){r[t]=ArrayIteratorMethods[t]}}}};for(var COLLECTION_NAME in DOMIterables){handlePrototype(global[COLLECTION_NAME]&&global[COLLECTION_NAME].prototype,COLLECTION_NAME)}handlePrototype(DOMTokenListPrototype,"DOMTokenList");var defineProperty={exports:{}};var toPropertyKey={exports:{}};var toPrimitive={exports:{}};(function(r){var e=_typeof$1.exports["default"];function t(r,t){if("object"!=e(r)||!r)return r;var n=r[Symbol.toPrimitive];if(void 0!==n){var i=n.call(r,t||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(r)}r.exports=t,r.exports.__esModule=true,r.exports["default"]=r.exports})(toPrimitive);(function(r){var e=_typeof$1.exports["default"];var t=toPrimitive.exports;function n(r){var n=t(r,"string");return"symbol"==e(n)?n:n+""}r.exports=n,r.exports.__esModule=true,r.exports["default"]=r.exports})(toPropertyKey);(function(r){var e=toPropertyKey.exports;function t(r,t,n){return(t=e(t))in r?Object.defineProperty(r,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[t]=n,r}r.exports=t,r.exports.__esModule=true,r.exports["default"]=r.exports})(defineProperty);var _defineProperty=getDefaultExportFromCjs(defineProperty.exports);var aCallable=aCallable$9;var toObject=toObject$4;var IndexedObject=indexedObject;var lengthOfArrayLike=lengthOfArrayLike$3;var $TypeError=TypeError;var REDUCE_EMPTY="Reduce of empty array with no initial value";var createMethod$1=function(r){return function(e,t,n,i){var a=toObject(e);var o=IndexedObject(a);var s=lengthOfArrayLike(a);aCallable(t);if(s===0&&n<2)throw new $TypeError(REDUCE_EMPTY);var u=r?s-1:0;var c=r?-1:1;if(n<2)while(true){if(u in o){i=o[u];u+=c;break}u+=c;if(r?u<0:s<=u){throw new $TypeError(REDUCE_EMPTY)}}for(;r?u>=0:s>u;u+=c)if(u in o){i=t(i,o[u],u,a)}return i}};var arrayReduce={left:createMethod$1(false),right:createMethod$1(true)};var fails$3=fails$l;var arrayMethodIsStrict$2=function(r,e){var t=[][r];return!!t&&fails$3((function(){t.call(null,e||function(){return 1},1)}))};var $$5=_export;var $reduce=arrayReduce.left;var arrayMethodIsStrict$1=arrayMethodIsStrict$2;var CHROME_VERSION=engineV8Version;var IS_NODE=engineIsNode;var CHROME_BUG=!IS_NODE&&CHROME_VERSION>79&&CHROME_VERSION<83;var FORCED$1=CHROME_BUG||!arrayMethodIsStrict$1("reduce");$$5({target:"Array",proto:true,forced:FORCED$1},{reduce:function r(e){var t=arguments.length;return $reduce(this,e,t,t>1?arguments[1]:undefined)}});var $$4=_export;var uncurryThis$5=functionUncurryThisClause;var getOwnPropertyDescriptor=objectGetOwnPropertyDescriptor.f;var toLength$1=toLength$6;var toString$3=toString$9;var notARegExp$1=notARegexp;var requireObjectCoercible$3=requireObjectCoercible$b;var correctIsRegExpLogic$1=correctIsRegexpLogic;var slice=uncurryThis$5("".slice);var min$1=Math.min;var CORRECT_IS_REGEXP_LOGIC=correctIsRegExpLogic$1("endsWith");var MDN_POLYFILL_BUG=!CORRECT_IS_REGEXP_LOGIC&&!!function(){var r=getOwnPropertyDescriptor(String.prototype,"endsWith");return r&&!r.writable}();$$4({target:"String",proto:true,forced:!MDN_POLYFILL_BUG&&!CORRECT_IS_REGEXP_LOGIC},{endsWith:function r(e){var t=toString$3(requireObjectCoercible$3(this));notARegExp$1(e);var n=arguments.length>1?arguments[1]:undefined;var i=t.length;var a=n===undefined?i:min$1(toLength$1(n),i);var o=toString$3(e);return slice(t,a-o.length,a)===o}});var call$1=functionCall;var uncurryThis$4=functionUncurryThis;var fixRegExpWellKnownSymbolLogic=fixRegexpWellKnownSymbolLogic;var anObject$1=anObject$f;var isNullOrUndefined=isNullOrUndefined$7;var requireObjectCoercible$2=requireObjectCoercible$b;var speciesConstructor=speciesConstructor$2;var advanceStringIndex=advanceStringIndex$3;var toLength=toLength$6;var toString$2=toString$9;var getMethod=getMethod$6;var regExpExec=regexpExecAbstract;var stickyHelpers=regexpStickyHelpers;var fails$2=fails$l;var UNSUPPORTED_Y=stickyHelpers.UNSUPPORTED_Y;var MAX_UINT32=4294967295;var min=Math.min;var push=uncurryThis$4([].push);var stringSlice=uncurryThis$4("".slice);var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC=!fails$2((function(){var r=/(?:)/;var e=r.exec;r.exec=function(){return e.apply(this,arguments)};var t="ab".split(r);return t.length!==2||t[0]!=="a"||t[1]!=="b"}));var BUGGY="abbc".split(/(b)*/)[1]==="c"||"test".split(/(?:)/,-1).length!==4||"ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||".".split(/()()/).length>1||"".split(/.?/).length;fixRegExpWellKnownSymbolLogic("split",(function(r,e,t){var n="0".split(undefined,0).length?function(r,t){return r===undefined&&t===0?[]:call$1(e,this,r,t)}:e;return[function e(t,i){var a=requireObjectCoercible$2(this);var o=isNullOrUndefined(t)?undefined:getMethod(t,r);return o?call$1(o,t,a,i):call$1(n,toString$2(a),t,i)},function(r,i){var a=anObject$1(this);var o=toString$2(r);if(!BUGGY){var s=t(n,a,o,i,n!==e);if(s.done)return s.value}var u=speciesConstructor(a,RegExp);var c=a.unicode;var f=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(UNSUPPORTED_Y?"g":"y");var l=new u(UNSUPPORTED_Y?"^(?:"+a.source+")":a,f);var v=i===undefined?MAX_UINT32:i>>>0;if(v===0)return[];if(o.length===0)return regExpExec(l,o)===null?[o]:[];var h=0;var $=0;var d=[];while($<o.length){l.lastIndex=UNSUPPORTED_Y?0:$;var p=regExpExec(l,UNSUPPORTED_Y?stringSlice(o,$):o);var y;if(p===null||(y=min(toLength(l.lastIndex+(UNSUPPORTED_Y?$:0)),o.length))===h){$=advanceStringIndex(o,$,c)}else{push(d,stringSlice(o,h,$));if(d.length===v)return d;for(var b=1;b<=p.length-1;b++){push(d,p[b]);if(d.length===v)return d}$=h=y}}push(d,stringSlice(o,h));return d}]}),BUGGY||!SPLIT_WORKS_WITH_OVERWRITTEN_EXEC,UNSUPPORTED_Y);var raf$1={exports:{}};var performanceNow={exports:{}};(function(){var r,e,t,n,i,a;if(typeof performance!=="undefined"&&performance!==null&&performance.now){performanceNow.exports=function(){return performance.now()}}else if(typeof process$4!=="undefined"&&process$4!==null&&process$4.hrtime){performanceNow.exports=function(){return(r()-i)/1e6};e=process$4.hrtime;r=function(){var r;r=e();return r[0]*1e9+r[1]};n=r();a=process$4.uptime()*1e9;i=n-a}else if(Date.now){performanceNow.exports=function(){return Date.now()-t};t=Date.now()}else{performanceNow.exports=function(){return(new Date).getTime()-t};t=(new Date).getTime()}}).call(commonjsGlobal);var now=performanceNow.exports,root=typeof window==="undefined"?commonjsGlobal:window,vendors=["moz","webkit"],suffix="AnimationFrame",raf=root["request"+suffix],caf=root["cancel"+suffix]||root["cancelRequest"+suffix];for(var i$1=0;!raf&&i$1<vendors.length;i$1++){raf=root[vendors[i$1]+"Request"+suffix];caf=root[vendors[i$1]+"Cancel"+suffix]||root[vendors[i$1]+"CancelRequest"+suffix]}if(!raf||!caf){var last=0,id=0,queue=[],frameDuration=1e3/60;raf=function(r){if(queue.length===0){var e=now(),t=Math.max(0,frameDuration-(e-last));last=t+e;setTimeout((function(){var r=queue.slice(0);queue.length=0;for(var e=0;e<r.length;e++){if(!r[e].cancelled){try{r[e].callback(last)}catch(r){setTimeout((function(){throw r}),0)}}}}),Math.round(t))}queue.push({handle:++id,callback:r,cancelled:false});return id};caf=function(r){for(var e=0;e<queue.length;e++){if(queue[e].handle===r){queue[e].cancelled=true}}}}raf$1.exports=function(r){return raf.call(root,r)};raf$1.exports.cancel=function(){caf.apply(root,arguments)};raf$1.exports.polyfill=function(r){if(!r){r=root}r.requestAnimationFrame=raf;r.cancelAnimationFrame=caf};var requestAnimationFrame=raf$1.exports;var whitespaces$2="\t\n\v\f\r      "+"           \u2028\u2029\ufeff";var uncurryThis$3=functionUncurryThis;var requireObjectCoercible$1=requireObjectCoercible$b;var toString$1=toString$9;var whitespaces$1=whitespaces$2;var replace=uncurryThis$3("".replace);var ltrim=RegExp("^["+whitespaces$1+"]+");var rtrim=RegExp("(^|[^"+whitespaces$1+"])["+whitespaces$1+"]+$");var createMethod=function(r){return function(e){var t=toString$1(requireObjectCoercible$1(e));if(r&1)t=replace(t,ltrim,"");if(r&2)t=replace(t,rtrim,"$1");return t}};var stringTrim={start:createMethod(1),end:createMethod(2),trim:createMethod(3)};var PROPER_FUNCTION_NAME$1=functionName.PROPER;var fails$1=fails$l;var whitespaces=whitespaces$2;var non="​…᠎";var stringTrimForced=function(r){return fails$1((function(){return!!whitespaces[r]()||non[r]()!==non||PROPER_FUNCTION_NAME$1&&whitespaces[r].name!==r}))};var $$3=_export;var $trim=stringTrim.trim;var forcedStringTrimMethod=stringTrimForced;$$3({target:"String",proto:true,forced:forcedStringTrimMethod("trim")},{trim:function r(){return $trim(this)}});var rgbcolor=function(r){this.ok=false;this.alpha=1;if(r.charAt(0)=="#"){r=r.substr(1,6)}r=r.replace(/ /g,"");r=r.toLowerCase();var e={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"};r=e[r]||r;var t=[{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(r){return[parseInt(r[1]),parseInt(r[2]),parseInt(r[3]),parseFloat(r[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(r){return[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(r){return[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(r){return[parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)]}}];for(var n=0;n<t.length;n++){var i=t[n].re;var a=t[n].process;var o=i.exec(r);if(o){var s=a(o);this.r=s[0];this.g=s[1];this.b=s[2];if(s.length>3){this.alpha=s[3]}this.ok=true}}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 r=this.r.toString(16);var e=this.g.toString(16);var t=this.b.toString(16);if(r.length==1)r="0"+r;if(e.length==1)e="0"+e;if(t.length==1)t="0"+t;return"#"+r+e+t};this.getHelpXML=function(){var r=new Array;for(var n=0;n<t.length;n++){var i=t[n].example;for(var a=0;a<i.length;a++){r[r.length]=i[a]}}for(var o in e){r[r.length]=o}var s=document.createElement("ul");s.setAttribute("id","rgbcolor-examples");for(var n=0;n<r.length;n++){try{var u=document.createElement("li");var c=new RGBColor(r[n]);var f=document.createElement("div");f.style.cssText="margin: 3px; "+"border: 1px solid black; "+"background:"+c.toHex()+"; "+"color:"+c.toHex();f.appendChild(document.createTextNode("test"));var l=document.createTextNode(" "+r[n]+" -> "+c.toRGB()+" -> "+c.toHex());u.appendChild(f);u.appendChild(l);s.appendChild(u)}catch(r){}}return s}};var $$2=_export;var uncurryThis$2=functionUncurryThisClause;var $indexOf=arrayIncludes.indexOf;var arrayMethodIsStrict=arrayMethodIsStrict$2;var nativeIndexOf=uncurryThis$2([].indexOf);var NEGATIVE_ZERO=!!nativeIndexOf&&1/nativeIndexOf([1],1,-0)<0;var FORCED=NEGATIVE_ZERO||!arrayMethodIsStrict("indexOf");$$2({target:"Array",proto:true,forced:FORCED},{indexOf:function r(e){var t=arguments.length>1?arguments[1]:undefined;return NEGATIVE_ZERO?nativeIndexOf(this,e,t)||0:$indexOf(this,e,t)}});var $$1=_export;var uncurryThis$1=functionUncurryThis;var notARegExp=notARegexp;var requireObjectCoercible=requireObjectCoercible$b;var toString=toString$9;var correctIsRegExpLogic=correctIsRegexpLogic;var stringIndexOf=uncurryThis$1("".indexOf);$$1({target:"String",proto:true,forced:!correctIsRegExpLogic("includes")},{includes:function r(e){return!!~stringIndexOf(toString(requireObjectCoercible(this)),toString(notARegExp(e)),arguments.length>1?arguments[1]:undefined)}});var classof=classofRaw$2;var isArray$1=Array.isArray||function r(e){return classof(e)==="Array"};var $=_export;var uncurryThis=functionUncurryThis;var isArray=isArray$1;var nativeReverse=uncurryThis([].reverse);var test=[1,2];$({target:"Array",proto:true,forced:String(test)===String(test.reverse())},{reverse:function r(){if(isArray(this))this.length=this.length;return nativeReverse(this)}});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,e){r.__proto__=e}||function(r,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])})(r,e)};function r(r,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function e(r){var e="";Array.isArray(r)||(r=[r]);for(var t=0;t<r.length;t++){var n=r[t];if(n.type===_.CLOSE_PATH)e+="z";else if(n.type===_.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===_.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===_.MOVE_TO)e+=(n.relative?"m":"M")+n.x+" "+n.y;else if(n.type===_.LINE_TO)e+=(n.relative?"l":"L")+n.x+" "+n.y;else if(n.type===_.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+" "+n.y1+" "+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===_.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===_.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+" "+n.y1+" "+n.x+" "+n.y;else if(n.type===_.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+" "+n.y;else{if(n.type!==_.ARC)throw new Error('Unexpected command type "'+n.type+'" at index '+t+".");e+=(n.relative?"a":"A")+n.rX+" "+n.rY+" "+n.xRot+" "+ +n.lArcFlag+" "+ +n.sweepFlag+" "+n.x+" "+n.y}}return e}function i(r,e){var t=r[0],n=r[1];return[t*Math.cos(e)-n*Math.sin(e),t*Math.sin(e)+n*Math.cos(e)]}function a(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];for(var t=0;t<r.length;t++)if("number"!=typeof r[t])throw new Error("assertNumbers arguments["+t+"] is not a number. "+typeof r[t]+" == typeof "+r[t]);return!0}var n=Math.PI;function o(r,e,t){r.lArcFlag=0===r.lArcFlag?0:1,r.sweepFlag=0===r.sweepFlag?0:1;var a=r.rX,o=r.rY,s=r.x,u=r.y;a=Math.abs(r.rX),o=Math.abs(r.rY);var c=i([(e-s)/2,(t-u)/2],-r.xRot/180*n),f=c[0],l=c[1],v=Math.pow(f,2)/Math.pow(a,2)+Math.pow(l,2)/Math.pow(o,2);1<v&&(a*=Math.sqrt(v),o*=Math.sqrt(v)),r.rX=a,r.rY=o;var h=Math.pow(a,2)*Math.pow(l,2)+Math.pow(o,2)*Math.pow(f,2),$=(r.lArcFlag!==r.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(a,2)*Math.pow(o,2)-h)/h)),d=a*l/o*$,p=-o*f/a*$,y=i([d,p],r.xRot/180*n);r.cX=y[0]+(e+s)/2,r.cY=y[1]+(t+u)/2,r.phi1=Math.atan2((l-p)/o,(f-d)/a),r.phi2=Math.atan2((-l-p)/o,(-f-d)/a),0===r.sweepFlag&&r.phi2>r.phi1&&(r.phi2-=2*n),1===r.sweepFlag&&r.phi2<r.phi1&&(r.phi2+=2*n),r.phi1*=180/n,r.phi2*=180/n}function s(r,e,t){a(r,e,t);var n=r*r+e*e-t*t;if(0>n)return[];if(0===n)return[[r*t/(r*r+e*e),e*t/(r*r+e*e)]];var i=Math.sqrt(n);return[[(r*t+e*i)/(r*r+e*e),(e*t-r*i)/(r*r+e*e)],[(r*t-e*i)/(r*r+e*e),(e*t+r*i)/(r*r+e*e)]]}var u,h=Math.PI/180;function c$1(r,e,t){return(1-t)*r+t*e}function y(r,e,t,i){return r+Math.cos(i/180*n)*e+Math.sin(i/180*n)*t}function p(r,e,t,n){var i=1e-6,a=e-r,o=t-e,s=3*a+3*(n-t)-6*o,u=6*(o-a),c=3*a;return Math.abs(s)<i?[-c/u]:function(r,e,t){void 0===t&&(t=1e-6);var n=r*r/4-e;if(n<-t)return[];if(n<=t)return[-r/2];var i=Math.sqrt(n);return[-r/2-i,-r/2+i]}(u/s,c/s,i)}function m$1(r,e,t,n,i){var a=1-i;return r*(a*a*a)+e*(3*a*a*i)+t*(3*a*i*i)+n*(i*i*i)}!function(r){function e(){return u((function(r,e,t){return r.relative&&(void 0!==r.x1&&(r.x1+=e),void 0!==r.y1&&(r.y1+=t),void 0!==r.x2&&(r.x2+=e),void 0!==r.y2&&(r.y2+=t),void 0!==r.x&&(r.x+=e),void 0!==r.y&&(r.y+=t),r.relative=!1),r}))}function t(){var r=NaN,e=NaN,t=NaN,n=NaN;return u((function(i,a,o){return i.type&_.SMOOTH_CURVE_TO&&(i.type=_.CURVE_TO,r=isNaN(r)?a:r,e=isNaN(e)?o:e,i.x1=i.relative?a-r:2*a-r,i.y1=i.relative?o-e:2*o-e),i.type&_.CURVE_TO?(r=i.relative?a+i.x2:i.x2,e=i.relative?o+i.y2:i.y2):(r=NaN,e=NaN),i.type&_.SMOOTH_QUAD_TO&&(i.type=_.QUAD_TO,t=isNaN(t)?a:t,n=isNaN(n)?o:n,i.x1=i.relative?a-t:2*a-t,i.y1=i.relative?o-n:2*o-n),i.type&_.QUAD_TO?(t=i.relative?a+i.x1:i.x1,n=i.relative?o+i.y1:i.y1):(t=NaN,n=NaN),i}))}function n(){var r=NaN,e=NaN;return u((function(t,n,i){if(t.type&_.SMOOTH_QUAD_TO&&(t.type=_.QUAD_TO,r=isNaN(r)?n:r,e=isNaN(e)?i:e,t.x1=t.relative?n-r:2*n-r,t.y1=t.relative?i-e:2*i-e),t.type&_.QUAD_TO){r=t.relative?n+t.x1:t.x1,e=t.relative?i+t.y1:t.y1;var a=t.x1,o=t.y1;t.type=_.CURVE_TO,t.x1=((t.relative?0:n)+2*a)/3,t.y1=((t.relative?0:i)+2*o)/3,t.x2=(t.x+2*a)/3,t.y2=(t.y+2*o)/3}else r=NaN,e=NaN;return t}))}function u(r){var e=0,t=0,n=NaN,i=NaN;return function(a){if(isNaN(n)&&!(a.type&_.MOVE_TO))throw new Error("path must start with moveto");var o=r(a,e,t,n,i);return a.type&_.CLOSE_PATH&&(e=n,t=i),void 0!==a.x&&(e=a.relative?e+a.x:a.x),void 0!==a.y&&(t=a.relative?t+a.y:a.y),a.type&_.MOVE_TO&&(n=e,i=t),o}}function c(r,e,t,n,i,o){return a(r,e,t,n,i,o),u((function(a,s,u,c){var f=a.x1,l=a.x2,v=a.relative&&!isNaN(c),h=void 0!==a.x?a.x:v?0:s,$=void 0!==a.y?a.y:v?0:u;function d(r){return r*r}a.type&_.HORIZ_LINE_TO&&0!==e&&(a.type=_.LINE_TO,a.y=a.relative?0:u),a.type&_.VERT_LINE_TO&&0!==t&&(a.type=_.LINE_TO,a.x=a.relative?0:s),void 0!==a.x&&(a.x=a.x*r+$*t+(v?0:i)),void 0!==a.y&&(a.y=h*e+a.y*n+(v?0:o)),void 0!==a.x1&&(a.x1=a.x1*r+a.y1*t+(v?0:i)),void 0!==a.y1&&(a.y1=f*e+a.y1*n+(v?0:o)),void 0!==a.x2&&(a.x2=a.x2*r+a.y2*t+(v?0:i)),void 0!==a.y2&&(a.y2=l*e+a.y2*n+(v?0:o));var p=r*n-e*t;if(void 0!==a.xRot&&(1!==r||0!==e||0!==t||1!==n))if(0===p)delete a.rX,delete a.rY,delete a.xRot,delete a.lArcFlag,delete a.sweepFlag,a.type=_.LINE_TO;else{var y=a.xRot*Math.PI/180,b=Math.sin(y),m=Math.cos(y),g=1/d(a.rX),E=1/d(a.rY),O=d(m)*g+d(b)*E,S=2*b*m*(g-E),P=d(b)*g+d(m)*E,T=O*n*n-S*e*n+P*e*e,I=S*(r*n+e*t)-2*(O*t*n+P*r*e),w=O*t*t-S*r*t+P*r*r,R=(Math.atan2(I,T-w)+Math.PI)%Math.PI/2,C=Math.sin(R),N=Math.cos(R);a.rX=Math.abs(p)/Math.sqrt(T*d(N)+I*C*N+w*d(C)),a.rY=Math.abs(p)/Math.sqrt(T*d(C)-I*C*N+w*d(N)),a.xRot=180*R/Math.PI}return void 0!==a.sweepFlag&&0>p&&(a.sweepFlag=+!a.sweepFlag),a}))}function f(){return function(r){var e={};for(var t in r)e[t]=r[t];return e}}r.ROUND=function(r){function e(e){return Math.round(e*r)/r}return void 0===r&&(r=1e13),a(r),function(r){return void 0!==r.x1&&(r.x1=e(r.x1)),void 0!==r.y1&&(r.y1=e(r.y1)),void 0!==r.x2&&(r.x2=e(r.x2)),void 0!==r.y2&&(r.y2=e(r.y2)),void 0!==r.x&&(r.x=e(r.x)),void 0!==r.y&&(r.y=e(r.y)),void 0!==r.rX&&(r.rX=e(r.rX)),void 0!==r.rY&&(r.rY=e(r.rY)),r}},r.TO_ABS=e,r.TO_REL=function(){return u((function(r,e,t){return r.relative||(void 0!==r.x1&&(r.x1-=e),void 0!==r.y1&&(r.y1-=t),void 0!==r.x2&&(r.x2-=e),void 0!==r.y2&&(r.y2-=t),void 0!==r.x&&(r.x-=e),void 0!==r.y&&(r.y-=t),r.relative=!0),r}))},r.NORMALIZE_HVZ=function(r,e,t){return void 0===r&&(r=!0),void 0===e&&(e=!0),void 0===t&&(t=!0),u((function(n,i,a,o,s){if(isNaN(o)&&!(n.type&_.MOVE_TO))throw new Error("path must start with moveto");return e&&n.type&_.HORIZ_LINE_TO&&(n.type=_.LINE_TO,n.y=n.relative?0:a),t&&n.type&_.VERT_LINE_TO&&(n.type=_.LINE_TO,n.x=n.relative?0:i),r&&n.type&_.CLOSE_PATH&&(n.type=_.LINE_TO,n.x=n.relative?o-i:o,n.y=n.relative?s-a:s),n.type&_.ARC&&(0===n.rX||0===n.rY)&&(n.type=_.LINE_TO,delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag),n}))},r.NORMALIZE_ST=t,r.QT_TO_C=n,r.INFO=u,r.SANITIZE=function(r){void 0===r&&(r=0),a(r);var e=NaN,t=NaN,n=NaN,i=NaN;return u((function(a,o,s,u,c){var f=Math.abs,l=!1,v=0,h=0;if(a.type&_.SMOOTH_CURVE_TO&&(v=isNaN(e)?0:o-e,h=isNaN(t)?0:s-t),a.type&(_.CURVE_TO|_.SMOOTH_CURVE_TO)?(e=a.relative?o+a.x2:a.x2,t=a.relative?s+a.y2:a.y2):(e=NaN,t=NaN),a.type&_.SMOOTH_QUAD_TO?(n=isNaN(n)?o:2*o-n,i=isNaN(i)?s:2*s-i):a.type&_.QUAD_TO?(n=a.relative?o+a.x1:a.x1,i=a.relative?s+a.y1:a.y2):(n=NaN,i=NaN),a.type&_.LINE_COMMANDS||a.type&_.ARC&&(0===a.rX||0===a.rY||!a.lArcFlag)||a.type&_.CURVE_TO||a.type&_.SMOOTH_CURVE_TO||a.type&_.QUAD_TO||a.type&_.SMOOTH_QUAD_TO){var $=void 0===a.x?0:a.relative?a.x:a.x-o,d=void 0===a.y?0:a.relative?a.y:a.y-s;v=isNaN(n)?void 0===a.x1?v:a.relative?a.x:a.x1-o:n-o,h=isNaN(i)?void 0===a.y1?h:a.relative?a.y:a.y1-s:i-s;var p=void 0===a.x2?0:a.relative?a.x:a.x2-o,y=void 0===a.y2?0:a.relative?a.y:a.y2-s;f($)<=r&&f(d)<=r&&f(v)<=r&&f(h)<=r&&f(p)<=r&&f(y)<=r&&(l=!0)}return a.type&_.CLOSE_PATH&&f(o-u)<=r&&f(s-c)<=r&&(l=!0),l?[]:a}))},r.MATRIX=c,r.ROTATE=function(r,e,t){void 0===e&&(e=0),void 0===t&&(t=0),a(r,e,t);var n=Math.sin(r),i=Math.cos(r);return c(i,n,-n,i,e-e*i+t*n,t-e*n-t*i)},r.TRANSLATE=function(r,e){return void 0===e&&(e=0),a(r,e),c(1,0,0,1,r,e)},r.SCALE=function(r,e){return void 0===e&&(e=r),a(r,e),c(r,0,0,e,0,0)},r.SKEW_X=function(r){return a(r),c(1,0,Math.atan(r),1,0,0)},r.SKEW_Y=function(r){return a(r),c(1,Math.atan(r),0,1,0,0)},r.X_AXIS_SYMMETRY=function(r){return void 0===r&&(r=0),a(r),c(-1,0,0,1,r,0)},r.Y_AXIS_SYMMETRY=function(r){return void 0===r&&(r=0),a(r),c(1,0,0,-1,0,r)},r.A_TO_C=function(){return u((function(r,e,t){return _.ARC===r.type?function(r,e,t){var n,a,s,u;r.cX||o(r,e,t);for(var c=Math.min(r.phi1,r.phi2),f=Math.max(r.phi1,r.phi2)-c,l=Math.ceil(f/90),v=new Array(l),$=e,d=t,p=0;p<l;p++){var y=c$1(r.phi1,r.phi2,p/l),b=c$1(r.phi1,r.phi2,(p+1)/l),m=b-y,g=4/3*Math.tan(m*h/4),E=[Math.cos(y*h)-g*Math.sin(y*h),Math.sin(y*h)+g*Math.cos(y*h)],O=E[0],S=E[1],P=[Math.cos(b*h),Math.sin(b*h)],T=P[0],I=P[1],w=[T+g*Math.sin(b*h),I-g*Math.cos(b*h)],R=w[0],C=w[1];v[p]={relative:r.relative,type:_.CURVE_TO};var N=function(e,t){var n=i([e*r.rX,t*r.rY],r.xRot),a=n[0],o=n[1];return[r.cX+a,r.cY+o]};n=N(O,S),v[p].x1=n[0],v[p].y1=n[1],a=N(R,C),v[p].x2=a[0],v[p].y2=a[1],s=N(T,I),v[p].x=s[0],v[p].y=s[1],r.relative&&(v[p].x1-=$,v[p].y1-=d,v[p].x2-=$,v[p].y2-=d,v[p].x-=$,v[p].y-=d),$=(u=[v[p].x,v[p].y])[0],d=u[1]}return v}(r,r.relative?0:e,r.relative?0:t):r}))},r.ANNOTATE_ARCS=function(){return u((function(r,e,t){return r.relative&&(e=0,t=0),_.ARC===r.type&&o(r,e,t),r}))},r.CLONE=f,r.CALCULATE_BOUNDS=function(){var r=function(r){var e={};for(var t in r)e[t]=r[t];return e},i=e(),a=n(),c=t(),f=u((function(e,t,n){var u=c(a(i(r(e))));function l(r){r>f.maxX&&(f.maxX=r),r<f.minX&&(f.minX=r)}function v(r){r>f.maxY&&(f.maxY=r),r<f.minY&&(f.minY=r)}if(u.type&_.DRAWING_COMMANDS&&(l(t),v(n)),u.type&_.HORIZ_LINE_TO&&l(u.x),u.type&_.VERT_LINE_TO&&v(u.y),u.type&_.LINE_TO&&(l(u.x),v(u.y)),u.type&_.CURVE_TO){l(u.x),v(u.y);for(var h=0,$=p(t,u.x1,u.x2,u.x);h<$.length;h++){0<(M=$[h])&&1>M&&l(m$1(t,u.x1,u.x2,u.x,M))}for(var d=0,b=p(n,u.y1,u.y2,u.y);d<b.length;d++){0<(M=b[d])&&1>M&&v(m$1(n,u.y1,u.y2,u.y,M))}}if(u.type&_.ARC){l(u.x),v(u.y),o(u,t,n);for(var m=u.xRot/180*Math.PI,g=Math.cos(m)*u.rX,E=Math.sin(m)*u.rX,O=-Math.sin(m)*u.rY,S=Math.cos(m)*u.rY,P=u.phi1<u.phi2?[u.phi1,u.phi2]:-180>u.phi2?[u.phi2+360,u.phi1+360]:[u.phi2,u.phi1],T=P[0],I=P[1],w=function(r){var e=r[0],t=r[1],n=180*Math.atan2(t,e)/Math.PI;return n<T?n+360:n},R=0,C=s(O,-g,0).map(w);R<C.length;R++){(M=C[R])>T&&M<I&&l(y(u.cX,g,O,M))}for(var N=0,x=s(S,-E,0).map(w);N<x.length;N++){var M;(M=x[N])>T&&M<I&&v(y(u.cY,E,S,M))}}return e}));return f.minX=1/0,f.maxX=-1/0,f.minY=1/0,f.maxY=-1/0,f}}(u||(u={}));var O,l=function(){function r(){}return r.prototype.round=function(r){return this.transform(u.ROUND(r))},r.prototype.toAbs=function(){return this.transform(u.TO_ABS())},r.prototype.toRel=function(){return this.transform(u.TO_REL())},r.prototype.normalizeHVZ=function(r,e,t){return this.transform(u.NORMALIZE_HVZ(r,e,t))},r.prototype.normalizeST=function(){return this.transform(u.NORMALIZE_ST())},r.prototype.qtToC=function(){return this.transform(u.QT_TO_C())},r.prototype.aToC=function(){return this.transform(u.A_TO_C())},r.prototype.sanitize=function(r){return this.transform(u.SANITIZE(r))},r.prototype.translate=function(r,e){return this.transform(u.TRANSLATE(r,e))},r.prototype.scale=function(r,e){return this.transform(u.SCALE(r,e))},r.prototype.rotate=function(r,e,t){return this.transform(u.ROTATE(r,e,t))},r.prototype.matrix=function(r,e,t,n,i,a){return this.transform(u.MATRIX(r,e,t,n,i,a))},r.prototype.skewX=function(r){return this.transform(u.SKEW_X(r))},r.prototype.skewY=function(r){return this.transform(u.SKEW_Y(r))},r.prototype.xSymmetry=function(r){return this.transform(u.X_AXIS_SYMMETRY(r))},r.prototype.ySymmetry=function(r){return this.transform(u.Y_AXIS_SYMMETRY(r))},r.prototype.annotateArcs=function(){return this.transform(u.ANNOTATE_ARCS())},r}(),T=function(r){return" "===r||"\t"===r||"\r"===r||"\n"===r},v=function(r){return"0".charCodeAt(0)<=r.charCodeAt(0)&&r.charCodeAt(0)<="9".charCodeAt(0)},f=function(e){function t(){var r=e.call(this)||this;return r.curNumber="",r.curCommandType=-1,r.curCommandRelative=!1,r.canParseCommandOrComma=!0,r.curNumberHasExp=!1,r.curNumberHasExpDigits=!1,r.curNumberHasDecimal=!1,r.curArgs=[],r}return r(t,e),t.prototype.finish=function(r){if(void 0===r&&(r=[]),this.parse(" ",r),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return r},t.prototype.parse=function(r,e){var t=this;void 0===e&&(e=[]);for(var n=function(r){e.push(r),t.curArgs.length=0,t.canParseCommandOrComma=!0},i=0;i<r.length;i++){var a=r[i],o=!(this.curCommandType!==_.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),s=v(a)&&("0"===this.curNumber&&"0"===a||o);if(!v(a)||s)if("e"!==a&&"E"!==a)if("-"!==a&&"+"!==a||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==a||this.curNumberHasExp||this.curNumberHasDecimal||o){if(this.curNumber&&-1!==this.curCommandType){var u=Number(this.curNumber);if(isNaN(u))throw new SyntaxError("Invalid number ending at "+i);if(this.curCommandType===_.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>u)throw new SyntaxError('Expected positive number, got "'+u+'" at index "'+i+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+i+'"');this.curArgs.push(u),this.curArgs.length===N[this.curCommandType]&&(_.HORIZ_LINE_TO===this.curCommandType?n({type:_.HORIZ_LINE_TO,relative:this.curCommandRelative,x:u}):_.VERT_LINE_TO===this.curCommandType?n({type:_.VERT_LINE_TO,relative:this.curCommandRelative,y:u}):this.curCommandType===_.MOVE_TO||this.curCommandType===_.LINE_TO||this.curCommandType===_.SMOOTH_QUAD_TO?(n({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),_.MOVE_TO===this.curCommandType&&(this.curCommandType=_.LINE_TO)):this.curCommandType===_.CURVE_TO?n({type:_.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===_.SMOOTH_CURVE_TO?n({type:_.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.QUAD_TO?n({type:_.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===_.ARC&&n({type:_.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!T(a))if(","===a&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==a&&"-"!==a&&"."!==a)if(s)this.curNumber=a,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+i+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+a+'" at index '+i+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==a&&"Z"!==a)if("h"===a||"H"===a)this.curCommandType=_.HORIZ_LINE_TO,this.curCommandRelative="h"===a;else if("v"===a||"V"===a)this.curCommandType=_.VERT_LINE_TO,this.curCommandRelative="v"===a;else if("m"===a||"M"===a)this.curCommandType=_.MOVE_TO,this.curCommandRelative="m"===a;else if("l"===a||"L"===a)this.curCommandType=_.LINE_TO,this.curCommandRelative="l"===a;else if("c"===a||"C"===a)this.curCommandType=_.CURVE_TO,this.curCommandRelative="c"===a;else if("s"===a||"S"===a)this.curCommandType=_.SMOOTH_CURVE_TO,this.curCommandRelative="s"===a;else if("q"===a||"Q"===a)this.curCommandType=_.QUAD_TO,this.curCommandRelative="q"===a;else if("t"===a||"T"===a)this.curCommandType=_.SMOOTH_QUAD_TO,this.curCommandRelative="t"===a;else{if("a"!==a&&"A"!==a)throw new SyntaxError('Unexpected character "'+a+'" at index '+i+".");this.curCommandType=_.ARC,this.curCommandRelative="a"===a}else e.push({type:_.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=a,this.curNumberHasDecimal="."===a}else this.curNumber+=a,this.curNumberHasDecimal=!0;else this.curNumber+=a;else this.curNumber+=a,this.curNumberHasExp=!0;else this.curNumber+=a,this.curNumberHasExpDigits=this.curNumberHasExp}return e},t.prototype.transform=function(r){return Object.create(this,{parse:{value:function(e,t){void 0===t&&(t=[]);for(var n=0,i=Object.getPrototypeOf(this).parse.call(this,e);n<i.length;n++){var a=i[n],o=r(a);Array.isArray(o)?t.push.apply(t,o):t.push(o)}return t}}})},t}(l),_=function(t){function n(r){var e=t.call(this)||this;return e.commands="string"==typeof r?n.parse(r):r,e}return r(n,t),n.prototype.encode=function(){return n.encode(this.commands)},n.prototype.getBounds=function(){var r=u.CALCULATE_BOUNDS();return this.transform(r),r},n.prototype.transform=function(r){for(var e=[],t=0,n=this.commands;t<n.length;t++){var i=r(n[t]);Array.isArray(i)?e.push.apply(e,i):e.push(i)}return this.commands=e,this},n.encode=function(r){return e(r)},n.parse=function(r){var e=new f,t=[];return e.parse(r,t),e.finish(t),t},n.CLOSE_PATH=1,n.MOVE_TO=2,n.HORIZ_LINE_TO=4,n.VERT_LINE_TO=8,n.LINE_TO=16,n.CURVE_TO=32,n.SMOOTH_CURVE_TO=64,n.QUAD_TO=128,n.SMOOTH_QUAD_TO=256,n.ARC=512,n.LINE_COMMANDS=n.LINE_TO|n.HORIZ_LINE_TO|n.VERT_LINE_TO,n.DRAWING_COMMANDS=n.HORIZ_LINE_TO|n.VERT_LINE_TO|n.LINE_TO|n.CURVE_TO|n.SMOOTH_CURVE_TO|n.QUAD_TO|n.SMOOTH_QUAD_TO|n.ARC,n}(l),N=((O={})[_.MOVE_TO]=2,O[_.LINE_TO]=2,O[_.HORIZ_LINE_TO]=1,O[_.VERT_LINE_TO]=1,O[_.CLOSE_PATH]=0,O[_.QUAD_TO]=4,O[_.SMOOTH_QUAD_TO]=2,O[_.CURVE_TO]=6,O[_.SMOOTH_CURVE_TO]=4,O[_.ARC]=7,O);var call=functionCall;var hasOwn=hasOwnProperty_1;var isPrototypeOf=objectIsPrototypeOf;var regExpFlags=regexpFlags$1;var RegExpPrototype$1=RegExp.prototype;var regexpGetFlags=function(r){var e=r.flags;return e===undefined&&!("flags"in RegExpPrototype$1)&&!hasOwn(r,"flags")&&isPrototypeOf(RegExpPrototype$1,r)?call(regExpFlags,r):e};var PROPER_FUNCTION_NAME=functionName.PROPER;var defineBuiltIn=defineBuiltIn$7;var anObject=anObject$f;var $toString=toString$9;var fails=fails$l;var getRegExpFlags=regexpGetFlags;var TO_STRING="toString";var RegExpPrototype=RegExp.prototype;var nativeToString=RegExpPrototype[TO_STRING];var NOT_GENERIC=fails((function(){return nativeToString.call({source:"a",flags:"b"})!=="/a/b"}));var INCORRECT_NAME=PROPER_FUNCTION_NAME&&nativeToString.name!==TO_STRING;if(NOT_GENERIC||INCORRECT_NAME){defineBuiltIn(RegExpPrototype,TO_STRING,(function r(){var e=anObject(this);var t=$toString(e.source);var n=$toString(getRegExpFlags(e));return"/"+t+"/"+n}),{unsafe:true})}function _typeof(r){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function(r){return typeof r}}else{_typeof=function(r){return r&&typeof Symbol==="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r}}return _typeof(r)}function _classCallCheck(r,e){if(!(r instanceof e)){throw new TypeError("Cannot call a class as a function")}}
/**
* StackBlur - a fast almost Gaussian Blur For Canvas
*
* In case you find this class useful - especially in commercial projects -
* I am not totally unhappy for a small donation to my PayPal account
* mario@quasimondo.de
*
* Or support me on flattr:
* {@link https://flattr.com/thing/72791/StackBlur-a-fast-almost-Gaussian-Blur-Effect-for-CanvasJavascript}.
*
* @module StackBlur
* @author Mario Klingemann
* Contact: mario@quasimondo.com
* Website: {@link http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html}
* Twitter: @quasimondo
*
* @copyright (c) 2010 Mario Klingemann
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/var mulTable=[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];var shgTable=[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 getImageDataFromCanvas(r,e,t,n,i){if(typeof r==="string"){r=document.getElementById(r)}if(!r||_typeof(r)!=="object"||!("getContext"in r)){throw new TypeError("Expecting canvas with `getContext` method "+"in processCanvasRGB(A) calls!")}var a=r.getContext("2d");try{return a.getImageData(e,t,n,i)}catch(r){throw new Error("unable to access image data: "+r)}}function processCanvasRGBA(r,e,t,n,i,a){if(isNaN(a)||a<1){return}a|=0;var o=getImageDataFromCanvas(r,e,t,n,i);o=processImageDataRGBA(o,e,t,n,i,a);r.getContext("2d").putImageData(o,e,t)}function processImageDataRGBA(r,e,t,n,i,a){var o=r.data;var s=2*a+1;var u=n-1;var c=i-1;var f=a+1;var l=f*(f+1)/2;var v=new BlurStack;var h=v;var $;for(var d=1;d<s;d++){h=h.next=new BlurStack;if(d===f){$=h}}h.next=v;var p=null,y=null,b=0,m=0;var g=mulTable[a];var E=shgTable[a];for(var O=0;O<i;O++){h=v;var S=o[m],P=o[m+1],T=o[m+2],I=o[m+3];for(var w=0;w<f;w++){h.r=S;h.g=P;h.b=T;h.a=I;h=h.next}var _=0,R=0,C=0,N=0,x=f*S,M=f*P,A=f*T,j=f*I,D=l*S,U=l*P,k=l*T,B=l*I;for(var L=1;L<f;L++){var G=m+((u<L?u:L)<<2);var F=o[G],K=o[G+1],V=o[G+2],q=o[G+3];var Y=f-L;D+=(h.r=F)*Y;U+=(h.g=K)*Y;k+=(h.b=V)*Y;B+=(h.a=q)*Y;_+=F;R+=K;C+=V;N+=q;h=h.next}p=v;y=$;for(var W=0;W<n;W++){var H=B*g>>>E;o[m+3]=H;if(H!==0){var X=255/H;o[m]=(D*g>>>E)*X;o[m+1]=(U*g>>>E)*X;o[m+2]=(k*g>>>E)*X}else{o[m]=o[m+1]=o[m+2]=0}D-=x;U-=M;k-=A;B-=j;x-=p.r;M-=p.g;A-=p.b;j-=p.a;var Q=W+a+1;Q=b+(Q<u?Q:u)<<2;_+=p.r=o[Q];R+=p.g=o[Q+1];C+=p.b=o[Q+2];N+=p.a=o[Q+3];D+=_;U+=R;k+=C;B+=N;p=p.next;var z=y,Z=z.r,J=z.g,rr=z.b,er=z.a;x+=Z;M+=J;A+=rr;j+=er;_-=Z;R-=J;C-=rr;N-=er;y=y.next;m+=4}b+=n}for(var tr=0;tr<n;tr++){m=tr<<2;var nr=o[m],ir=o[m+1],ar=o[m+2],or=o[m+3],sr=f*nr,ur=f*ir,cr=f*ar,fr=f*or,lr=l*nr,vr=l*ir,hr=l*ar,$r=l*or;h=v;for(var dr=0;dr<f;dr++){h.r=nr;h.g=ir;h.b=ar;h.a=or;h=h.next}var pr=n;var yr=0,br=0,mr=0,gr=0;for(var Er=1;Er<=a;Er++){m=pr+tr<<2;var Or=f-Er;lr+=(h.r=nr=o[m])*Or;vr+=(h.g=ir=o[m+1])*Or;hr+=(h.b=ar=o[m+2])*Or;$r+=(h.a=or=o[m+3])*Or;gr+=nr;yr+=ir;br+=ar;mr+=or;h=h.next;if(Er<c){pr+=n}}m=tr;p=v;y=$;for(var Sr=0;Sr<i;Sr++){var Pr=m<<2;o[Pr+3]=or=$r*g>>>E;if(or>0){or=255/or;o[Pr]=(lr*g>>>E)*or;o[Pr+1]=(vr*g>>>E)*or;o[Pr+2]=(hr*g>>>E)*or}else{o[Pr]=o[Pr+1]=o[Pr+2]=0}lr-=sr;vr-=ur;hr-=cr;$r-=fr;sr-=p.r;ur-=p.g;cr-=p.b;fr-=p.a;Pr=tr+((Pr=Sr+f)<c?Pr:c)*n<<2;lr+=gr+=p.r=o[Pr];vr+=yr+=p.g=o[Pr+1];hr+=br+=p.b=o[Pr+2];$r+=mr+=p.a=o[Pr+3];p=p.next;sr+=nr=y.r;ur+=ir=y.g;cr+=ar=y.b;fr+=or=y.a;gr-=nr;yr-=ir;br-=ar;mr-=or;y=y.next;m+=n}}return r}var BlurStack=function r(){_classCallCheck(this,r);this.r=0;this.g=0;this.b=0;this.a=0;this.next=null};function offscreen(){var r=(arguments.length>0&&arguments[0]!==undefined?arguments[0]:{}).DOMParser;var e={window:null,ignoreAnimation:true,ignoreMouse:true,DOMParser:r,createCanvas:function(r,e){return new OffscreenCanvas(r,e)},createImage:function(r){return _asyncToGenerator((function(){var e,t,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,fetch(r)];case 1:e=i.sent();return[4,e.blob()];case 2:t=i.sent();return[4,createImageBitmap(t)];case 3:n=i.sent();return[2,n]}}))}))()}};if(typeof DOMParser!=="undefined"||typeof r==="undefined"){Reflect.deleteProperty(e,"DOMParser")}return e}function node(r){var e=r.DOMParser,t=r.canvas,n=r.fetch;return{window:null,ignoreAnimation:true,ignoreMouse:true,DOMParser:e,fetch:n,createCanvas:t.createCanvas,createImage:t.loadImage}}var index=Object.freeze({__proto__:null,offscreen:offscreen,node:node});function compressSpaces(r){return r.replace(/(?!\u3000)\s+/gm," ")}function trimLeft(r){return r.replace(/^[\n \t]+/,"")}function trimRight(r){return r.replace(/[\n \t]+$/,"")}function toNumbers(r){var e=(r||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[];return e.map(parseFloat)}var allUppercase=/^[A-Z-]+$/;function normalizeAttributeName(r){if(allUppercase.test(r)){return r.toLowerCase()}return r}function parseExternalUrl(r){var e=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(r)||[];return e[2]||e[3]||e[4]}function normalizeColor(r){if(!r.startsWith("rgb")){return r}var e=3;var t=r.replace(/\d+(\.\d+)?/g,(function(r,t){return e--&&t?String(Math.round(parseFloat(r))):r}));return t}var attributeRegex=/(\[[^\]]+\])/g;var idRegex=/(#[^\s+>~.[:]+)/g;var classRegex=/(\.[^\s+>~.[:]+)/g;var pseudoElementRegex=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi;var pseudoClassWithBracketsRegex=/(:[\w-]+\([^)]*\))/gi;var pseudoClassRegex=/(:[^\s+>~.[:]+)/g;var elementRegex=/([^\s+>~.[:]+)/g;function findSelectorMatch(r,e){var t=e.exec(r);if(!t){return[r,0]}return[r.replace(e," "),t.length]}function getSelectorSpecificity(r){var e,t,n,i,a,o,s;var u=[0,0,0];var c=r.replace(/:not\(([^)]*)\)/g,"     $1 ").replace(/{[\s\S]*/gm," ");var f=0;e=findSelectorMatch(c,attributeRegex),c=e[0],f=e[1];u[1]+=f;t=findSelectorMatch(c,idRegex),c=t[0],f=t[1];u[0]+=f;n=findSelectorMatch(c,classRegex),c=n[0],f=n[1];u[1]+=f;i=findSelectorMatch(c,pseudoElementRegex),c=i[0],f=i[1];u[2]+=f;a=findSelectorMatch(c,pseudoClassWithBracketsRegex),c=a[0],f=a[1];u[1]+=f;o=findSelectorMatch(c,pseudoClassRegex),c=o[0],f=o[1];u[1]+=f;c=c.replace(/[*\s+>~]/g," ").replace(/[#.]/g," ");s=findSelectorMatch(c,elementRegex),c=s[0],f=s[1];u[2]+=f;return u.join("")}var PSEUDO_ZERO=1e-8;function vectorMagnitude(r){return Math.sqrt(Math.pow(r[0],2)+Math.pow(r[1],2))}function vectorsRatio(r,e){return(r[0]*e[0]+r[1]*e[1])/(vectorMagnitude(r)*vectorMagnitude(e))}function vectorsAngle(r,e){return(r[0]*e[1]<r[1]*e[0]?-1:1)*Math.acos(vectorsRatio(r,e))}function CB1(r){return r*r*r}function CB2(r){return 3*r*r*(1-r)}function CB3(r){return 3*r*(1-r)*(1-r)}function CB4(r){return(1-r)*(1-r)*(1-r)}function QB1(r){return r*r}function QB2(r){return 2*r*(1-r)}function QB3(r){return(1-r)*(1-r)}var Property=function(){function r(r,e,t){this.document=r;this.name=e;this.value=t;this.isNormalizedColor=false}r.empty=function(e){return new r(e,"EMPTY","")};r.prototype.split=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:" ";var t=this,n=t.document,i=t.name;return compressSpaces(this.getString()).trim().split(e).map((function(e){return new r(n,i,e)}))};r.prototype.hasValue=function(r){var e=this.value;return e!==null&&e!==""&&(r||e!==0)&&typeof e!=="undefined"};r.prototype.isString=function(r){var e=this.value;var t=typeof e==="string";if(!t||!r){return t}return r.test(e)};r.prototype.isUrlDefinition=function(){return this.isString(/^url\(/)};r.prototype.isPixels=function(){if(!this.hasValue()){return false}var r=this.getString();switch(true){case r.endsWith("px"):case/^[0-9]+$/.test(r):return true;default:return false}};r.prototype.setValue=function(r){this.value=r;return this};r.prototype.getValue=function(r){if(typeof r==="undefined"||this.hasValue()){return this.value}return r};r.prototype.getNumber=function(r){if(!this.hasValue()){if(typeof r==="undefined"){return 0}return parseFloat(r)}var e=this.value;var t=parseFloat(e);if(this.isString(/%$/)){t/=100}return t};r.prototype.getString=function(r){if(typeof r==="undefined"||this.hasValue()){return typeof this.value==="undefined"?"":String(this.value)}return String(r)};r.prototype.getColor=function(r){var e=this.getString(r);if(this.isNormalizedColor){return e}this.isNormalizedColor=true;e=normalizeColor(e);this.value=e;return e};r.prototype.getDpi=function(){return 96};r.prototype.getRem=function(){return this.document.rootEmSize};r.prototype.getEm=function(){return this.document.emSize};r.prototype.getUnits=function(){return this.getString().replace(/[0-9.-]/g,"")};r.prototype.getPixels=function(r){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!this.hasValue()){return 0}var t=typeof r==="boolean"?[undefined,r]:[r],n=t[0],i=t[1];var a=this.document.screen.viewPort;switch(true){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(a.computeSize("x"),a.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(a.computeSize("x"),a.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*a.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*a.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 this.getNumber()*15;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(/%$/)&&i:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*a.computeSize(n);default:{var o=this.getNumber();if(e&&o<1){return o*a.computeSize(n)}return o}}};r.prototype.getMilliseconds=function(){if(!this.hasValue()){return 0}if(this.isString(/ms$/)){return this.getNumber()}return this.getNumber()*1e3};r.prototype.getRadians=function(){if(!this.hasValue()){return 0}switch(true){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)}};r.prototype.getDefinition=function(){var r=this.getString();var e=/#([^)'"]+)/.exec(r);if(e){e=e[1]}if(!e){e=r}return this.document.definitions[e]};r.prototype.getFillStyleDefinition=function(r,e){var t=this.getDefinition();if(!t){return null}if(typeof t.createGradient==="function"){return t.createGradient(this.document.ctx,r,e)}if(typeof t.createPattern==="function"){if(t.getHrefAttribute().hasValue()){var n=t.getAttribute("patternTransform");t=t.getHrefAttribute().getDefinition();if(n.hasValue()){t.getAttribute("patternTransform",true).setValue(n.value)}}return t.createPattern(this.document.ctx,r,e)}return null};r.prototype.getTextBaseline=function(){if(!this.hasValue()){return null}return r.textBaselineMapping[this.getString()]};r.prototype.addOpacity=function(e){var t=this.getColor();var n=t.length;var i=0;for(var a=0;a<n;a++){if(t[a]===","){i++}if(i===3){break}}if(e.hasValue()&&this.isString()&&i!==3){var o=new rgbcolor(t);if(o.ok){o.alpha=e.getNumber();t=o.toRGBA()}}return new r(this.document,this.name,t)};return r}();Property.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 ViewPort=function(){function r(){this.viewPorts=[]}r.prototype.clear=function(){this.viewPorts=[]};r.prototype.setCurrent=function(r,e){this.viewPorts.push({width:r,height:e})};r.prototype.removeCurrent=function(){this.viewPorts.pop()};r.prototype.getCurrent=function(){var r=this.viewPorts;return r[r.length-1]};Object.defineProperty(r.prototype,"width",{get:function(){return this.getCurrent().width},enumerable:false,configurable:true});Object.defineProperty(r.prototype,"height",{get:function(){return this.getCurrent().height},enumerable:false,configurable:true});r.prototype.computeSize=function(r){if(typeof r==="number"){return r}if(r==="x"){return this.width}if(r==="y"){return this.height}return Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)};return r}();var Point=function(){function r(r,e){this.x=r;this.y=e}r.parse=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var n=toNumbers(e),i=n[0],a=i===void 0?t:i,o=n[1],s=o===void 0?t:o;return new r(a,s)};r.parseScale=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var n=toNumbers(e),i=n[0],a=i===void 0?t:i,o=n[1],s=o===void 0?a:o;return new r(a,s)};r.parsePath=function(e){var t=toNumbers(e);var n=t.length;var i=[];for(var a=0;a<n;a+=2){i.push(new r(t[a],t[a+1]))}return i};r.prototype.angleTo=function(r){return Math.atan2(r.y-this.y,r.x-this.x)};r.prototype.applyTransform=function(r){var e=this,t=e.x,n=e.y;var i=t*r[0]+n*r[2]+r[4];var a=t*r[1]+n*r[3]+r[5];this.x=i;this.y=a};return r}();var Mouse=function(){function r(r){this.screen=r;this.working=false;this.events=[];this.eventElements=[];this.onClick=this.onClick.bind(this);this.onMouseMove=this.onMouseMove.bind(this)}r.prototype.isWorking=function(){return this.working};r.prototype.start=function(){if(this.working){return}var r=this,e=r.screen,t=r.onClick,n=r.onMouseMove;var i=e.ctx.canvas;i.onclick=t;i.onmousemove=n;this.working=true};r.prototype.stop=function(){if(!this.working){return}var r=this.screen.ctx.canvas;this.working=false;r.onclick=null;r.onmousemove=null};r.prototype.hasEvents=function(){return this.working&&this.events.length>0};r.prototype.runEvents=function(){if(!this.working){return}var r=this,e=r.screen,t=r.events,n=r.eventElements;var i=e.ctx.canvas.style;if(i){i.cursor=""}t.forEach((function(r,e){var t=r.run;var i=n[e];while(i){t(i);i=i.parent}}));this.events=[];this.eventElements=[]};r.prototype.checkPath=function(r,e){if(!this.working||!e){return}var t=this,n=t.events,i=t.eventElements;n.forEach((function(t,n){var a=t.x,o=t.y;if(!i[n]&&e.isPointInPath&&e.isPointInPath(a,o)){i[n]=r}}))};r.prototype.checkBoundingBox=function(r,e){if(!this.working||!e){return}var t=this,n=t.events,i=t.eventElements;n.forEach((function(t,n){var a=t.x,o=t.y;if(!i[n]&&e.isPointInBox(a,o)){i[n]=r}}))};r.prototype.mapXY=function(r,e){var t=this.screen,n=t.window,i=t.ctx;var a=new Point(r,e);var o=i.canvas;while(o){a.x-=o.offsetLeft;a.y-=o.offsetTop;o=o.offsetParent}if(n.scrollX){a.x+=n.scrollX}if(n.scrollY){a.y+=n.scrollY}return a};r.prototype.onClick=function(r){var e=this.mapXY(r.clientX,r.clientY),t=e.x,n=e.y;this.events.push({type:"onclick",x:t,y:n,run:function(r){if(r.onClick){r.onClick()}}})};r.prototype.onMouseMove=function(r){var e=this.mapXY(r.clientX,r.clientY),t=e.x,n=e.y;this.events.push({type:"onmousemove",x:t,y:n,run:function(r){if(r.onMouseMove){r.onMouseMove()}}})};return r}();var defaultWindow=typeof window!=="undefined"?window:null;var defaultFetch$1=typeof fetch!=="undefined"?fetch.bind(undefined):null;var Screen=function(){function r(r){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},t=e.fetch,n=t===void 0?defaultFetch$1:t,i=e.window,a=i===void 0?defaultWindow:i;this.ctx=r;this.FRAMERATE=30;this.MAX_VIRTUAL_PIXELS=3e4;this.CLIENT_WIDTH=800;this.CLIENT_HEIGHT=600;this.viewPort=new ViewPort;this.mouse=new Mouse(this);this.animations=[];this.waits=[];this.frameDuration=0;this.isReadyLock=false;this.isFirstRender=true;this.intervalId=null;this.window=a;this.fetch=n}r.prototype.wait=function(r){this.waits.push(r)};r.prototype.ready=function(){if(!this.readyPromise){return Promise.resolve()}return this.readyPromise};r.prototype.isReady=function(){if(this.isReadyLock){return true}var r=this.waits.every((function(r){return r()}));if(r){this.waits=[];if(this.resolveReady){this.resolveReady()}}this.isReadyLock=r;return r};r.prototype.setDefaults=function(r){r.strokeStyle="rgba(0,0,0,0)";r.lineCap="butt";r.lineJoin="miter";r.miterLimit=4};r.prototype.setViewBox=function(r){var e=r.document,t=r.ctx,n=r.aspectRatio,i=r.width,a=r.desiredWidth,o=r.height,s=r.desiredHeight,u=r.minX,c=u===void 0?0:u,f=r.minY,l=f===void 0?0:f,v=r.refX,h=r.refY,$=r.clip,d=$===void 0?false:$,p=r.clipX,y=p===void 0?0:p,b=r.clipY,m=b===void 0?0:b;var g=compressSpaces(n).replace(/^defer\s/,"");var E=g.split(" "),O=E[0],S=E[1];var P=O||"xMidYMid";var T=S||"meet";var I=i/a;var w=o/s;var _=Math.min(I,w);var R=Math.max(I,w);var C=a;var N=s;if(T==="meet"){C*=_;N*=_}if(T==="slice"){C*=R;N*=R}var x=new Property(e,"refX",v);var M=new Property(e,"refY",h);var A=x.hasValue()&&M.hasValue();if(A){t.translate(-_*x.getPixels("x"),-_*M.getPixels("y"))}if(d){var j=_*y;var D=_*m;t.beginPath();t.moveTo(j,D);t.lineTo(i,D);t.lineTo(i,o);t.lineTo(j,o);t.closePath();t.clip()}if(!A){var U=T==="meet"&&_===w;var k=T==="slice"&&R===w;var B=T==="meet"&&_===I;var L=T==="slice"&&R===I;if(P.startsWith("xMid")&&(U||k)){t.translate(i/2-C/2,0)}if(P.endsWith("YMid")&&(B||L)){t.translate(0,o/2-N/2)}if(P.startsWith("xMax")&&(U||k)){t.translate(i-C,0)}if(P.endsWith("YMax")&&(B||L)){t.translate(0,o-N)}}switch(true){case P==="none":t.scale(I,w);break;case T==="meet":t.scale(_,_);break;case T==="slice":t.scale(R,R);break}t.translate(-c,-l)};r.prototype.start=function(r){var e=this;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=t.enableRedraw,i=n===void 0?false:n,a=t.ignoreMouse,o=a===void 0?false:a,s=t.ignoreAnimation,u=s===void 0?false:s,c=t.ignoreDimensions,f=c===void 0?false:c,l=t.ignoreClear,v=l===void 0?false:l,h=t.forceRedraw,$=t.scaleWidth,d=t.scaleHeight,p=t.offsetX,y=t.offsetY;var b=this,m=b.FRAMERATE,g=b.mouse;var E=1e3/m;this.frameDuration=E;this.readyPromise=new Promise((function(r){e.resolveReady=r}));if(this.isReady()){this.render(r,f,v,$,d,p,y)}if(!i){return}var O=Date.now();var S=O;var P=0;var T=function(){O=Date.now();P=O-S;if(P>=E){S=O-P%E;if(e.shouldUpdate(u,h)){e.render(r,f,v,$,d,p,y);g.runEvents()}}e.intervalId=requestAnimationFrame(T)};if(!o){g.start()}this.intervalId=requestAnimationFrame(T)};r.prototype.stop=function(){if(this.intervalId){requestAnimationFrame.cancel(this.intervalId);this.intervalId=null}this.mouse.stop()};r.prototype.shouldUpdate=function(r,e){if(!r){var t=this.frameDuration;var n=this.animations.reduce((function(r,e){return e.update(t)||r}),false);if(n){return true}}if(typeof e==="function"&&e()){return true}if(!this.isReadyLock&&this.isReady()){return true}if(this.mouse.hasEvents()){return true}return false};r.prototype.render=function(r,e,t,n,i,a,o){var s=this,u=s.CLIENT_WIDTH,c=s.CLIENT_HEIGHT,f=s.viewPort,l=s.ctx,v=s.isFirstRender;var h=l.canvas;f.clear();if(h.width&&h.height){f.setCurrent(h.width,h.height)}else{f.setCurrent(u,c)}var $=r.getStyle("width");var d=r.getStyle("height");if(!e&&(v||typeof n!=="number"&&typeof i!=="number")){if($.hasValue()){h.width=$.getPixels("x");if(h.style){h.style.width="".concat(h.width,"px")}}if(d.hasValue()){h.height=d.getPixels("y");if(h.style){h.style.height="".concat(h.height,"px")}}}var p=h.clientWidth||h.width;var y=h.clientHeight||h.height;if(e&&$.hasValue()&&d.hasValue()){p=$.getPixels("x");y=d.getPixels("y")}f.setCurrent(p,y);if(typeof a==="number"){r.getAttribute("x",true).setValue(a)}if(typeof o==="number"){r.getAttribute("y",true).setValue(o)}if(typeof n==="number"||typeof i==="number"){var b=toNumbers(r.getAttribute("viewBox").getString());var m=0;var g=0;if(typeof n==="number"){var E=r.getStyle("width");if(E.hasValue()){m=E.getPixels("x")/n}else if(!isNaN(b[2])){m=b[2]/n}}if(typeof i==="number"){var O=r.getStyle("height");if(O.hasValue()){g=O.getPixels("y")/i}else if(!isNaN(b[3])){g=b[3]/i}}if(!m){m=g}if(!g){g=m}r.getAttribute("width",true).setValue(n);r.getAttribute("height",true).setValue(i);var S=r.getStyle("transform",true,true);S.setValue("".concat(S.getString()," scale(").concat(1/m,", ").concat(1/g,")"))}if(!t){l.clearRect(0,0,p,y)}r.render(l);if(v){this.isFirstRender=false}};return r}();Screen.defaultWindow=defaultWindow;Screen.defaultFetch=defaultFetch$1;var defaultFetch=Screen.defaultFetch;var DefaultDOMParser=typeof DOMParser!=="undefined"?DOMParser:null;var Parser=function(){function r(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=r.fetch,t=e===void 0?defaultFetch:e,n=r.DOMParser,i=n===void 0?DefaultDOMParser:n;this.fetch=t;this.DOMParser=i}r.prototype.parse=function(r){var e=this;return _asyncToGenerator((function(){return __generator(this,(function(t){if(r.startsWith("<")){return[2,e.parseFromString(r)]}return[2,e.load(r)]}))}))()};r.prototype.parseFromString=function(r){var e=new this.DOMParser;try{return this.checkDocument(e.parseFromString(r,"image/svg+xml"))}catch(t){return this.checkDocument(e.parseFromString(r,"text/xml"))}};r.prototype.checkDocument=function(r){var e=r.getElementsByTagName("parsererror")[0];if(e){throw new Error(e.textContent)}return r};r.prototype.load=function(r){var e=this;return _asyncToGenerator((function(){var t,n;return __generator(this,(function(i){switch(i.label){case 0:return[4,e.fetch(r)];case 1:t=i.sent();return[4,t.text()];case 2:n=i.sent();return[2,e.parseFromString(n)]}}))}))()};return r}();var Translate=function(){function r(r,e){this.type="translate";this.point=null;this.point=Point.parse(e)}r.prototype.apply=function(r){var e=this.point,t=e.x,n=e.y;r.translate(t||0,n||0)};r.prototype.unapply=function(r){var e=this.point,t=e.x,n=e.y;r.translate(-1*t||0,-1*n||0)};r.prototype.applyToPoint=function(r){var e=this.point,t=e.x,n=e.y;r.applyTransform([1,0,0,1,t||0,n||0])};return r}();var Rotate=function(){function r(r,e,t){this.type="rotate";this.angle=null;this.originX=null;this.originY=null;this.cx=0;this.cy=0;var n=toNumbers(e);this.angle=new Property(r,"angle",n[0]);this.originX=t[0];this.originY=t[1];this.cx=n[1]||0;this.cy=n[2]||0}r.prototype.apply=function(r){var e=this,t=e.cx,n=e.cy,i=e.originX,a=e.originY,o=e.angle;var s=t+i.getPixels("x");var u=n+a.getPixels("y");r.translate(s,u);r.rotate(o.getRadians());r.translate(-s,-u)};r.prototype.unapply=function(r){var e=this,t=e.cx,n=e.cy,i=e.originX,a=e.originY,o=e.angle;var s=t+i.getPixels("x");var u=n+a.getPixels("y");r.translate(s,u);r.rotate(-1*o.getRadians());r.translate(-s,-u)};r.prototype.applyToPoint=function(r){var e=this,t=e.cx,n=e.cy,i=e.angle;var a=i.getRadians();r.applyTransform([1,0,0,1,t||0,n||0]);r.applyTransform([Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0]);r.applyTransform([1,0,0,1,-t||0,-n||0])};return r}();var Scale=function(){function r(r,e,t){this.type="scale";this.scale=null;this.originX=null;this.originY=null;var n=Point.parseScale(e);if(n.x===0||n.y===0){n.x=PSEUDO_ZERO;n.y=PSEUDO_ZERO}this.scale=n;this.originX=t[0];this.originY=t[1]}r.prototype.apply=function(r){var e=this,t=e.scale,n=t.x,i=t.y,a=e.originX,o=e.originY;var s=a.getPixels("x");var u=o.getPixels("y");r.translate(s,u);r.scale(n,i||n);r.translate(-s,-u)};r.prototype.unapply=function(r){var e=this,t=e.scale,n=t.x,i=t.y,a=e.originX,o=e.originY;var s=a.getPixels("x");var u=o.getPixels("y");r.translate(s,u);r.scale(1/n,1/i||n);r.translate(-s,-u)};r.prototype.applyToPoint=function(r){var e=this.scale,t=e.x,n=e.y;r.applyTransform([t||0,0,0,n||0,0,0])};return r}();var Matrix=function(){function r(r,e,t){this.type="matrix";this.matrix=[];this.originX=null;this.originY=null;this.matrix=toNumbers(e);this.originX=t[0];this.originY=t[1]}r.prototype.apply=function(r){var e=this,t=e.originX,n=e.originY,i=e.matrix;var a=t.getPixels("x");var o=n.getPixels("y");r.translate(a,o);r.transform(i[0],i[1],i[2],i[3],i[4],i[5]);r.translate(-a,-o)};r.prototype.unapply=function(r){var e=this,t=e.originX,n=e.originY,i=e.matrix;var a=i[0];var o=i[2];var s=i[4];var u=i[1];var c=i[3];var f=i[5];var l=0;var v=0;var h=1;var $=1/(a*(c*h-f*v)-o*(u*h-f*l)+s*(u*v-c*l));var d=t.getPixels("x");var p=n.getPixels("y");r.translate(d,p);r.transform($*(c*h-f*v),$*(f*l-u*h),$*(s*v-o*h),$*(a*h-s*l),$*(o*f-s*c),$*(s*u-a*f));r.translate(-d,-p)};r.prototype.applyToPoint=function(r){r.applyTransform(this.matrix)};return r}();var Skew=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="skew";i.angle=null;i.angle=new Property(e,"angle",t);return i}return e}(Matrix);var SkewX=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="skewX";i.matrix=[1,0,Math.tan(i.angle.getRadians()),1,0,0];return i}return e}(Skew);var SkewY=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="skewY";i.matrix=[1,Math.tan(i.angle.getRadians()),0,1,0,0];return i}return e}(Skew);function parseTransforms(r){return compressSpaces(r).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}function parseTransform(r){var e=r.split("("),t=e[0],n=e[1];return[t.trim(),n.trim().replace(")","")]}var Transform=function(){function r(e,t,n){var i=this;this.document=e;this.transforms=[];var a=parseTransforms(t);a.forEach((function(e){if(e==="none"){return}var t=parseTransform(e),a=t[0],o=t[1];var s=r.transformTypes[a];if(typeof s!=="undefined"){i.transforms.push(new s(i.document,o,n))}}))}r.fromElement=function(e,t){var n=t.getStyle("transform",false,true);var i=t.getStyle("transform-origin",false,true).split(),a=i[0],o=i[1],s=o===void 0?a:o;var u=[a,s];if(n.hasValue()){return new r(e,n.getString(),u)}return null};r.prototype.apply=function(r){var e=this.transforms;var t=e.length;for(var n=0;n<t;n++){e[n].apply(r)}};r.prototype.unapply=function(r){var e=this.transforms;var t=e.length;for(var n=t-1;n>=0;n--){e[n].unapply(r)}};r.prototype.applyToPoint=function(r){var e=this.transforms;var t=e.length;for(var n=0;n<t;n++){e[n].applyToPoint(r)}};return r}();Transform.transformTypes={translate:Translate,rotate:Rotate,scale:Scale,matrix:Matrix,skewX:SkewX,skewY:SkewY};var Element=function(){function r(r,e){var t=this;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;this.document=r;this.node=e;this.captureTextNodes=n;this.attributes={};this.styles={};this.stylesSpecificity={};this.animationFrozen=false;this.animationFrozenValue="";this.parent=null;this.children=[];if(!e||e.nodeType!==1){return}Array.from(e.attributes).forEach((function(e){var n=normalizeAttributeName(e.nodeName);t.attributes[n]=new Property(r,n,e.value)}));this.addStylesFromStyleDefinition();if(this.getAttribute("style").hasValue()){var i=this.getAttribute("style").getString().split(";").map((function(r){return r.trim()}));i.forEach((function(e){if(!e){return}var n=e.split(":").map((function(r){return r.trim()})),i=n[0],a=n[1];t.styles[i]=new Property(r,i,a)}))}var a=r.definitions;var o=this.getAttribute("id");if(o.hasValue()){if(!a[o.getString()]){a[o.getString()]=this}}Array.from(e.childNodes).forEach((function(e){if(e.nodeType===1){t.addChild(e)}else if(n&&(e.nodeType===3||e.nodeType===4)){var i=r.createTextNode(e);if(i.getText().length>0){t.addChild(i)}}}))}r.prototype.getAttribute=function(r){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var t=this.attributes[r];if(!t&&e){var n=new Property(this.document,r,"");this.attributes[r]=n;return n}return t||Property.empty(this.document)};r.prototype.getHrefAttribute=function(){for(var r in this.attributes){if(r==="href"||r.endsWith(":href")){return this.attributes[r]}}return Property.empty(this.document)};r.prototype.getStyle=function(r){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var n=this.styles[r];if(n){return n}var i=this.getAttribute(r);if(i!==null&&i!==void 0&&i.hasValue()){this.styles[r]=i;return i}if(!t){var a=this.parent;if(a){var o=a.getStyle(r);if(o!==null&&o!==void 0&&o.hasValue()){return o}}}if(e){var s=new Property(this.document,r,"");this.styles[r]=s;return s}return n||Property.empty(this.document)};r.prototype.render=function(r){if(this.getStyle("display").getString()==="none"||this.getStyle("visibility").getString()==="hidden"){return}r.save();if(this.getStyle("mask").hasValue()){var e=this.getStyle("mask").getDefinition();if(e){this.applyEffects(r);e.apply(r,this)}}else if(this.getStyle("filter").getValue("none")!=="none"){var t=this.getStyle("filter").getDefinition();if(t){this.applyEffects(r);t.apply(r,this)}}else{this.setContext(r);this.renderChildren(r);this.clearContext(r)}r.restore()};r.prototype.setContext=function(r){};r.prototype.applyEffects=function(r){var e=Transform.fromElement(this.document,this);if(e){e.apply(r)}var t=this.getStyle("clip-path",false,true);if(t.hasValue()){var n=t.getDefinition();if(n){n.apply(r)}}};r.prototype.clearContext=function(r){};r.prototype.renderChildren=function(r){this.children.forEach((function(e){e.render(r)}))};r.prototype.addChild=function(e){var t=e instanceof r?e:this.document.createElement(e);t.parent=this;if(!r.ignoreChildTypes.includes(t.type)){this.children.push(t)}};r.prototype.matchesSelector=function(r){var e;var t=this.node;if(typeof t.matches==="function"){return t.matches(r)}var n=(e=t.getAttribute)===null||e===void 0?void 0:e.call(t,"class");if(!n||n===""){return false}return n.split(" ").some((function(e){return".".concat(e)===r}))};r.prototype.addStylesFromStyleDefinition=function(){var r=this.document,e=r.styles,t=r.stylesSpecificity;for(var n in e){if(!n.startsWith("@")&&this.matchesSelector(n)){var i=e[n];var a=t[n];if(i){for(var o in i){var s=this.stylesSpecificity[o];if(typeof s==="undefined"){s="000"}if(a>=s){this.styles[o]=i[o];this.stylesSpecificity[o]=a}}}}}};r.prototype.removeStyles=function(r,e){var t=e.reduce((function(e,t){var n=r.getStyle(t);if(!n.hasValue()){return e}var i=n.getString();n.setValue("");return __spreadArray(__spreadArray([],e,true),[[t,i]],false)}),[]);return t};r.prototype.restoreStyles=function(r,e){e.forEach((function(e){var t=e[0],n=e[1];r.getStyle(t,true).setValue(n)}))};r.prototype.isFirstChild=function(){var r;return((r=this.parent)===null||r===void 0?void 0:r.children.indexOf(this))===0};return r}();Element.ignoreChildTypes=["title"];var UnknownElement=function(r){__extends(e,r);function e(e,t,n){return r.call(this,e,t,n)||this}return e}(Element);function wrapFontFamily(r){var e=r.trim();return/^('|")/.test(e)?e:'"'.concat(e,'"')}function prepareFontFamily(r){return typeof process$4==="undefined"?r:r.trim().split(",").map(wrapFontFamily).join(",")}function prepareFontStyle(r){if(!r){return""}var e=r.trim().toLowerCase();switch(e){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return e;default:if(/^oblique\s+(-|)\d+deg$/.test(e)){return e}return""}}function prepareFontWeight(r){if(!r){return""}var e=r.trim().toLowerCase();switch(e){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return e;default:if(/^[\d.]+$/.test(e)){return e}return""}}var Font=function(){function r(e,t,n,i,a,o){var s=o?typeof o==="string"?r.parse(o):o:{};this.fontFamily=a||s.fontFamily;this.fontSize=i||s.fontSize;this.fontStyle=e||s.fontStyle;this.fontWeight=n||s.fontWeight;this.fontVariant=t||s.fontVariant}r.parse=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var t=arguments.length>1?arguments[1]:undefined;var n="";var i="";var a="";var o="";var s="";var u=compressSpaces(e).trim().split(" ");var c={fontSize:false,fontStyle:false,fontWeight:false,fontVariant:false};u.forEach((function(e){switch(true){case!c.fontStyle&&r.styles.includes(e):if(e!=="inherit"){n=e}c.fontStyle=true;break;case!c.fontVariant&&r.variants.includes(e):if(e!=="inherit"){i=e}c.fontStyle=true;c.fontVariant=true;break;case!c.fontWeight&&r.weights.includes(e):if(e!=="inherit"){a=e}c.fontStyle=true;c.fontVariant=true;c.fontWeight=true;break;case!c.fontSize:if(e!=="inherit"){o=e.split("/")[0]}c.fontStyle=true;c.fontVariant=true;c.fontWeight=true;c.fontSize=true;break;default:if(e!=="inherit"){s+=e}}}));return new r(n,i,a,o,s,t)};r.prototype.toString=function(){return[prepareFontStyle(this.fontStyle),this.fontVariant,prepareFontWeight(this.fontWeight),this.fontSize,prepareFontFamily(this.fontFamily)].join(" ").trim()};return r}();Font.styles="normal|italic|oblique|inherit";Font.variants="normal|small-caps|inherit";Font.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit";var BoundingBox=function(){function r(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:Number.NaN;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Number.NaN;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:Number.NaN;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:Number.NaN;this.x1=r;this.y1=e;this.x2=t;this.y2=n;this.addPoint(r,e);this.addPoint(t,n)}Object.defineProperty(r.prototype,"x",{get:function(){return this.x1},enumerable:false,configurable:true});Object.defineProperty(r.prototype,"y",{get:function(){return this.y1},enumerable:false,configurable:true});Object.defineProperty(r.prototype,"width",{get:function(){return this.x2-this.x1},enumerable:false,configurable:true});Object.defineProperty(r.prototype,"height",{get:function(){return this.y2-this.y1},enumerable:false,configurable:true});r.prototype.addPoint=function(r,e){if(typeof r!=="undefined"){if(isNaN(this.x1)||isNaN(this.x2)){this.x1=r;this.x2=r}if(r<this.x1){this.x1=r}if(r>this.x2){this.x2=r}}if(typeof e!=="undefined"){if(isNaN(this.y1)||isNaN(this.y2)){this.y1=e;this.y2=e}if(e<this.y1){this.y1=e}if(e>this.y2){this.y2=e}}};r.prototype.addX=function(r){this.addPoint(r,null)};r.prototype.addY=function(r){this.addPoint(null,r)};r.prototype.addBoundingBox=function(r){if(!r){return}var e=r.x1,t=r.y1,n=r.x2,i=r.y2;this.addPoint(e,t);this.addPoint(n,i)};r.prototype.sumCubic=function(r,e,t,n,i){return Math.pow(1-r,3)*e+3*Math.pow(1-r,2)*r*t+3*(1-r)*Math.pow(r,2)*n+Math.pow(r,3)*i};r.prototype.bezierCurveAdd=function(r,e,t,n,i){var a=6*e-12*t+6*n;var o=-3*e+9*t-9*n+3*i;var s=3*t-3*e;if(o===0){if(a===0){return}var u=-s/a;if(0<u&&u<1){if(r){this.addX(this.sumCubic(u,e,t,n,i))}else{this.addY(this.sumCubic(u,e,t,n,i))}}return}var c=Math.pow(a,2)-4*s*o;if(c<0){return}var f=(-a+Math.sqrt(c))/(2*o);if(0<f&&f<1){if(r){this.addX(this.sumCubic(f,e,t,n,i))}else{this.addY(this.sumCubic(f,e,t,n,i))}}var l=(-a-Math.sqrt(c))/(2*o);if(0<l&&l<1){if(r){this.addX(this.sumCubic(l,e,t,n,i))}else{this.addY(this.sumCubic(l,e,t,n,i))}}};r.prototype.addBezierCurve=function(r,e,t,n,i,a,o,s){this.addPoint(r,e);this.addPoint(o,s);this.bezierCurveAdd(true,r,t,i,o);this.bezierCurveAdd(false,e,n,a,s)};r.prototype.addQuadraticCurve=function(r,e,t,n,i,a){var o=r+2/3*(t-r);var s=e+2/3*(n-e);var u=o+1/3*(i-r);var c=s+1/3*(a-e);this.addBezierCurve(r,e,o,u,s,c,i,a)};r.prototype.isPointInBox=function(r,e){var t=this,n=t.x1,i=t.y1,a=t.x2,o=t.y2;return n<=r&&r<=a&&i<=e&&e<=o};return r}();var PathParser=function(r){__extends(e,r);function e(e){var t=r.call(this,e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,""))||this;t.control=null;t.start=null;t.current=null;t.command=null;t.commands=t.commands;t.i=-1;t.previousCommand=null;t.points=[];t.angles=[];return t}e.prototype.reset=function(){this.i=-1;this.command=null;this.previousCommand=null;this.start=new Point(0,0);this.control=new Point(0,0);this.current=new Point(0,0);this.points=[];this.angles=[]};e.prototype.isEnd=function(){var r=this,e=r.i,t=r.commands;return e>=t.length-1};e.prototype.next=function(){var r=this.commands[++this.i];this.previousCommand=this.command;this.command=r;return r};e.prototype.getPoint=function(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"x";var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"y";var t=new Point(this.command[r],this.command[e]);return this.makeAbsolute(t)};e.prototype.getAsControlPoint=function(r,e){var t=this.getPoint(r,e);this.control=t;return t};e.prototype.getAsCurrentPoint=function(r,e){var t=this.getPoint(r,e);this.current=t;return t};e.prototype.getReflectedControlPoint=function(){var r=this.previousCommand.type;if(r!==_.CURVE_TO&&r!==_.SMOOTH_CURVE_TO&&r!==_.QUAD_TO&&r!==_.SMOOTH_QUAD_TO){return this.current}var e=this,t=e.current,n=t.x,i=t.y,a=e.control,o=a.x,s=a.y;var u=new Point(2*n-o,2*i-s);return u};e.prototype.makeAbsolute=function(r){if(this.command.relative){var e=this.current,t=e.x,n=e.y;r.x+=t;r.y+=n}return r};e.prototype.addMarker=function(r,e,t){var n=this,i=n.points,a=n.angles;if(t&&a.length>0&&!a[a.length-1]){a[a.length-1]=i[i.length-1].angleTo(t)}this.addMarkerAngle(r,e?e.angleTo(r):null)};e.prototype.addMarkerAngle=function(r,e){this.points.push(r);this.angles.push(e)};e.prototype.getMarkerPoints=function(){return this.points};e.prototype.getMarkerAngles=function(){var r=this.angles;var e=r.length;for(var t=0;t<e;t++){if(!r[t]){for(var n=t+1;n<e;n++){if(r[n]){r[t]=r[n];break}}}}return r};return e}(_);var RenderedElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.modifiedEmSizeStack=false;return e}e.prototype.calculateOpacity=function(){var r=1;var e=this;while(e){var t=e.getStyle("opacity",false,true);if(t.hasValue(true)){r*=t.getNumber()}e=e.parent}return r};e.prototype.setContext=function(r){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!e){var t=this.getStyle("fill");var n=this.getStyle("fill-opacity");var i=this.getStyle("stroke");var a=this.getStyle("stroke-opacity");if(t.isUrlDefinition()){var o=t.getFillStyleDefinition(this,n);if(o){r.fillStyle=o}}else if(t.hasValue()){if(t.getString()==="currentColor"){t.setValue(this.getStyle("color").getColor())}var s=t.getColor();if(s!=="inherit"){r.fillStyle=s==="none"?"rgba(0,0,0,0)":s}}if(n.hasValue()){var u=new Property(this.document,"fill",r.fillStyle).addOpacity(n).getColor();r.fillStyle=u}if(i.isUrlDefinition()){var c=i.getFillStyleDefinition(this,a);if(c){r.strokeStyle=c}}else if(i.hasValue()){if(i.getString()==="currentColor"){i.setValue(this.getStyle("color").getColor())}var f=i.getString();if(f!=="inherit"){r.strokeStyle=f==="none"?"rgba(0,0,0,0)":f}}if(a.hasValue()){var l=new Property(this.document,"stroke",r.strokeStyle).addOpacity(a).getString();r.strokeStyle=l}var v=this.getStyle("stroke-width");if(v.hasValue()){var h=v.getPixels();r.lineWidth=!h?PSEUDO_ZERO:h}var $=this.getStyle("stroke-linecap");var d=this.getStyle("stroke-linejoin");var p=this.getStyle("stroke-miterlimit");var y=this.getStyle("stroke-dasharray");var b=this.getStyle("stroke-dashoffset");if($.hasValue()){r.lineCap=$.getString()}if(d.hasValue()){r.lineJoin=d.getString()}if(p.hasValue()){r.miterLimit=p.getNumber()}if(y.hasValue()&&y.getString()!=="none"){var m=toNumbers(y.getString());if(typeof r.setLineDash!=="undefined"){r.setLineDash(m)}else if(typeof r.webkitLineDash!=="undefined"){r.webkitLineDash=m}else if(typeof r.mozDash!=="undefined"&&!(m.length===1&&m[0]===0)){r.mozDash=m}var g=b.getPixels();if(typeof r.lineDashOffset!=="undefined"){r.lineDashOffset=g}else if(typeof r.webkitLineDashOffset!=="undefined"){r.webkitLineDashOffset=g}else if(typeof r.mozDashOffset!=="undefined"){r.mozDashOffset=g}}}this.modifiedEmSizeStack=false;if(typeof r.font!=="undefined"){var E=this.getStyle("font");var O=this.getStyle("font-style");var S=this.getStyle("font-variant");var P=this.getStyle("font-weight");var T=this.getStyle("font-size");var I=this.getStyle("font-family");var w=new Font(O.getString(),S.getString(),P.getString(),T.hasValue()?"".concat(T.getPixels(true),"px"):"",I.getString(),Font.parse(E.getString(),r.font));O.setValue(w.fontStyle);S.setValue(w.fontVariant);P.setValue(w.fontWeight);T.setValue(w.fontSize);I.setValue(w.fontFamily);r.font=w.toString();if(T.isPixels()){this.document.emSize=T.getPixels();this.modifiedEmSizeStack=true}}if(!e){this.applyEffects(r);r.globalAlpha=this.calculateOpacity()}};e.prototype.clearContext=function(e){r.prototype.clearContext.call(this,e);if(this.modifiedEmSizeStack){this.document.popEmSize()}};return e}(Element);var PathElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="path";i.pathParser=null;i.pathParser=new PathParser(i.getAttribute("d").getString());return i}e.prototype.path=function(r){var e=this.pathParser;var t=new BoundingBox;e.reset();if(r){r.beginPath()}while(!e.isEnd()){switch(e.next().type){case PathParser.MOVE_TO:this.pathM(r,t);break;case PathParser.LINE_TO:this.pathL(r,t);break;case PathParser.HORIZ_LINE_TO:this.pathH(r,t);break;case PathParser.VERT_LINE_TO:this.pathV(r,t);break;case PathParser.CURVE_TO:this.pathC(r,t);break;case PathParser.SMOOTH_CURVE_TO:this.pathS(r,t);break;case PathParser.QUAD_TO:this.pathQ(r,t);break;case PathParser.SMOOTH_QUAD_TO:this.pathT(r,t);break;case PathParser.ARC:this.pathA(r,t);break;case PathParser.CLOSE_PATH:this.pathZ(r,t);break}}return t};e.prototype.getBoundingBox=function(r){return this.path()};e.prototype.getMarkers=function(){var r=this.pathParser;var e=r.getMarkerPoints();var t=r.getMarkerAngles();var n=e.map((function(r,e){return[r,t[e]]}));return n};e.prototype.renderChildren=function(r){this.path(r);this.document.screen.mouse.checkPath(this,r);var e=this.getStyle("fill-rule");if(r.fillStyle!==""){if(e.getString("inherit")!=="inherit"){r.fill(e.getString())}else{r.fill()}}if(r.strokeStyle!==""){if(this.getAttribute("vector-effect").getString()==="non-scaling-stroke"){r.save();r.setTransform(1,0,0,1,0,0);r.stroke();r.restore()}else{r.stroke()}}var t=this.getMarkers();if(t){var n=t.length-1;var i=this.getStyle("marker-start");var a=this.getStyle("marker-mid");var o=this.getStyle("marker-end");if(i.isUrlDefinition()){var s=i.getDefinition();var u=t[0],c=u[0],f=u[1];s.render(r,c,f)}if(a.isUrlDefinition()){var l=a.getDefinition();for(var v=1;v<n;v++){var h=t[v],$=h[0],d=h[1];l.render(r,$,d)}}if(o.isUrlDefinition()){var p=o.getDefinition();var y=t[n],b=y[0],m=y[1];p.render(r,b,m)}}};e.pathM=function(r){var e=r.getAsCurrentPoint();r.start=r.current;return{point:e}};e.prototype.pathM=function(r,t){var n=this.pathParser;var i=e.pathM(n).point;var a=i.x,o=i.y;n.addMarker(i);t.addPoint(a,o);if(r){r.moveTo(a,o)}};e.pathL=function(r){var e=r.current;var t=r.getAsCurrentPoint();return{current:e,point:t}};e.prototype.pathL=function(r,t){var n=this.pathParser;var i=e.pathL(n),a=i.current,o=i.point;var s=o.x,u=o.y;n.addMarker(o,a);t.addPoint(s,u);if(r){r.lineTo(s,u)}};e.pathH=function(r){var e=r.current,t=r.command;var n=new Point((t.relative?e.x:0)+t.x,e.y);r.current=n;return{current:e,point:n}};e.prototype.pathH=function(r,t){var n=this.pathParser;var i=e.pathH(n),a=i.current,o=i.point;var s=o.x,u=o.y;n.addMarker(o,a);t.addPoint(s,u);if(r){r.lineTo(s,u)}};e.pathV=function(r){var e=r.current,t=r.command;var n=new Point(e.x,(t.relative?e.y:0)+t.y);r.current=n;return{current:e,point:n}};e.prototype.pathV=function(r,t){var n=this.pathParser;var i=e.pathV(n),a=i.current,o=i.point;var s=o.x,u=o.y;n.addMarker(o,a);t.addPoint(s,u);if(r){r.lineTo(s,u)}};e.pathC=function(r){var e=r.current;var t=r.getPoint("x1","y1");var n=r.getAsControlPoint("x2","y2");var i=r.getAsCurrentPoint();return{current:e,point:t,controlPoint:n,currentPoint:i}};e.prototype.pathC=function(r,t){var n=this.pathParser;var i=e.pathC(n),a=i.current,o=i.point,s=i.controlPoint,u=i.currentPoint;n.addMarker(u,s,o);t.addBezierCurve(a.x,a.y,o.x,o.y,s.x,s.y,u.x,u.y);if(r){r.bezierCurveTo(o.x,o.y,s.x,s.y,u.x,u.y)}};e.pathS=function(r){var e=r.current;var t=r.getReflectedControlPoint();var n=r.getAsControlPoint("x2","y2");var i=r.getAsCurrentPoint();return{current:e,point:t,controlPoint:n,currentPoint:i}};e.prototype.pathS=function(r,t){var n=this.pathParser;var i=e.pathS(n),a=i.current,o=i.point,s=i.controlPoint,u=i.currentPoint;n.addMarker(u,s,o);t.addBezierCurve(a.x,a.y,o.x,o.y,s.x,s.y,u.x,u.y);if(r){r.bezierCurveTo(o.x,o.y,s.x,s.y,u.x,u.y)}};e.pathQ=function(r){var e=r.current;var t=r.getAsControlPoint("x1","y1");var n=r.getAsCurrentPoint();return{current:e,controlPoint:t,currentPoint:n}};e.prototype.pathQ=function(r,t){var n=this.pathParser;var i=e.pathQ(n),a=i.current,o=i.controlPoint,s=i.currentPoint;n.addMarker(s,o,o);t.addQuadraticCurve(a.x,a.y,o.x,o.y,s.x,s.y);if(r){r.quadraticCurveTo(o.x,o.y,s.x,s.y)}};e.pathT=function(r){var e=r.current;var t=r.getReflectedControlPoint();r.control=t;var n=r.getAsCurrentPoint();return{current:e,controlPoint:t,currentPoint:n}};e.prototype.pathT=function(r,t){var n=this.pathParser;var i=e.pathT(n),a=i.current,o=i.controlPoint,s=i.currentPoint;n.addMarker(s,o,o);t.addQuadraticCurve(a.x,a.y,o.x,o.y,s.x,s.y);if(r){r.quadraticCurveTo(o.x,o.y,s.x,s.y)}};e.pathA=function(r){var e=r.current,t=r.command;var n=t.rX,i=t.rY,a=t.xRot,o=t.lArcFlag,s=t.sweepFlag;var u=a*(Math.PI/180);var c=r.getAsCurrentPoint();var f=new Point(Math.cos(u)*(e.x-c.x)/2+Math.sin(u)*(e.y-c.y)/2,-Math.sin(u)*(e.x-c.x)/2+Math.cos(u)*(e.y-c.y)/2);var l=Math.pow(f.x,2)/Math.pow(n,2)+Math.pow(f.y,2)/Math.pow(i,2);if(l>1){n*=Math.sqrt(l);i*=Math.sqrt(l)}var v=(o===s?-1:1)*Math.sqrt((Math.pow(n,2)*Math.pow(i,2)-Math.pow(n,2)*Math.pow(f.y,2)-Math.pow(i,2)*Math.pow(f.x,2))/(Math.pow(n,2)*Math.pow(f.y,2)+Math.pow(i,2)*Math.pow(f.x,2)));if(isNaN(v)){v=0}var h=new Point(v*n*f.y/i,v*-i*f.x/n);var $=new Point((e.x+c.x)/2+Math.cos(u)*h.x-Math.sin(u)*h.y,(e.y+c.y)/2+Math.sin(u)*h.x+Math.cos(u)*h.y);var d=vectorsAngle([1,0],[(f.x-h.x)/n,(f.y-h.y)/i]);var p=[(f.x-h.x)/n,(f.y-h.y)/i];var y=[(-f.x-h.x)/n,(-f.y-h.y)/i];var b=vectorsAngle(p,y);if(vectorsRatio(p,y)<=-1){b=Math.PI}if(vectorsRatio(p,y)>=1){b=0}return{currentPoint:c,rX:n,rY:i,sweepFlag:s,xAxisRotation:u,centp:$,a1:d,ad:b}};e.prototype.pathA=function(r,t){var n=this.pathParser;var i=e.pathA(n),a=i.currentPoint,o=i.rX,s=i.rY,u=i.sweepFlag,c=i.xAxisRotation,f=i.centp,l=i.a1,v=i.ad;var h=1-u?1:-1;var $=l+h*(v/2);var d=new Point(f.x+o*Math.cos($),f.y+s*Math.sin($));n.addMarkerAngle(d,$-h*Math.PI/2);n.addMarkerAngle(a,$-h*Math.PI);t.addPoint(a.x,a.y);if(r&&!isNaN(l)&&!isNaN(v)){var p=o>s?o:s;var y=o>s?1:o/s;var b=o>s?s/o:1;r.translate(f.x,f.y);r.rotate(c);r.scale(y,b);r.arc(0,0,p,l,l+v,Boolean(1-u));r.scale(1/y,1/b);r.rotate(-c);r.translate(-f.x,-f.y)}};e.pathZ=function(r){r.current=r.start};e.prototype.pathZ=function(r,t){e.pathZ(this.pathParser);if(r){if(t.x1!==t.x2&&t.y1!==t.y2){r.closePath()}}};return e}(RenderedElement);var GlyphElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="glyph";i.horizAdvX=i.getAttribute("horiz-adv-x").getNumber();i.unicode=i.getAttribute("unicode").getString();i.arabicForm=i.getAttribute("arabic-form").getString();return i}return e}(PathElement);var TextElement=function(r){__extends(e,r);function e(t,n,i){var a=this.constructor;var o=r.call(this,t,n,a===e?true:i)||this;o.type="text";o.x=0;o.y=0;o.measureCache=-1;return o}e.prototype.setContext=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;r.prototype.setContext.call(this,e,t);var n=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();if(n){e.textBaseline=n}};e.prototype.initializeCoordinates=function(){this.x=0;this.y=0;this.leafTexts=[];this.textChunkStart=0;this.minX=Number.POSITIVE_INFINITY;this.maxX=Number.NEGATIVE_INFINITY};e.prototype.getBoundingBox=function(r){var e=this;if(this.type!=="text"){return this.getTElementBoundingBox(r)}this.initializeCoordinates();this.adjustChildCoordinatesRecursive(r);var t=null;this.children.forEach((function(n,i){var a=e.getChildBoundingBox(r,e,e,i);if(!t){t=a}else{t.addBoundingBox(a)}}));return t};e.prototype.getFontSize=function(){var r=this,e=r.document,t=r.parent;var n=Font.parse(e.ctx.font).fontSize;var i=t.getStyle("font-size").getNumber(n);return i};e.prototype.getTElementBoundingBox=function(r){var e=this.getFontSize();return new BoundingBox(this.x,this.y-e,this.x+this.measureText(r),this.y)};e.prototype.getGlyph=function(r,e,t){var n=e[t];var i=null;if(r.isArabic){var a=e.length;var o=e[t-1];var s=e[t+1];var u="isolated";if((t===0||o===" ")&&t<a-1&&s!==" "){u="terminal"}if(t>0&&o!==" "&&t<a-1&&s!==" "){u="medial"}if(t>0&&o!==" "&&(t===a-1||s===" ")){u="initial"}if(typeof r.glyphs[n]!=="undefined"){var c=r.glyphs[n];i=c instanceof GlyphElement?c:c[u]}}else{i=r.glyphs[n]}if(!i){i=r.missingGlyph}return i};e.prototype.getText=function(){return""};e.prototype.getTextFromNode=function(r){var e=r||this.node;var t=Array.from(e.parentNode.childNodes);var n=t.indexOf(e);var i=t.length-1;var a=compressSpaces(e.textContent||"");if(n===0){a=trimLeft(a)}if(n===i){a=trimRight(a)}return a};e.prototype.renderChildren=function(r){var e=this;if(this.type!=="text"){this.renderTElementChildren(r);return}this.initializeCoordinates();this.adjustChildCoordinatesRecursive(r);this.children.forEach((function(t,n){e.renderChild(r,e,e,n)}));var t=this.document.screen.mouse;if(t.isWorking()){t.checkBoundingBox(this,this.getBoundingBox(r))}};e.prototype.renderTElementChildren=function(r){var e=this,t=e.document,n=e.parent;var i=this.getText();var a=n.getStyle("font-family").getDefinition();if(a){var o=a.fontFace.unitsPerEm;var s=Font.parse(t.ctx.font);var u=n.getStyle("font-size").getNumber(s.fontSize);var c=n.getStyle("font-style").getString(s.fontStyle);var f=u/o;var l=a.isRTL?i.split("").reverse().join(""):i;var v=toNumbers(n.getAttribute("dx").getString());var h=l.length;for(var $=0;$<h;$++){var d=this.getGlyph(a,l,$);r.translate(this.x,this.y);r.scale(f,-f);var p=r.lineWidth;r.lineWidth=r.lineWidth*o/u;if(c==="italic"){r.transform(1,0,.4,1,0,0)}d.render(r);if(c==="italic"){r.transform(1,0,-.4,1,0,0)}r.lineWidth=p;r.scale(1/f,-1/f);r.translate(-this.x,-this.y);this.x+=u*(d.horizAdvX||a.horizAdvX)/o;if(typeof v[$]!=="undefined"&&!isNaN(v[$])){this.x+=v[$]}}return}var y=this,b=y.x,m=y.y;if(r.fillStyle){r.fillText(i,b,m)}if(r.strokeStyle){r.strokeText(i,b,m)}};e.prototype.applyAnchoring=function(){if(this.textChunkStart>=this.leafTexts.length){return}var r=this.leafTexts[this.textChunkStart];var e=r.getStyle("text-anchor").getString("start");var t=false;var n=0;if(e==="start"&&!t||e==="end"&&t){n=r.x-this.minX}else if(e==="end"&&!t||e==="start"&&t){n=r.x-this.maxX}else{n=r.x-(this.minX+this.maxX)/2}for(var i=this.textChunkStart;i<this.leafTexts.length;i++){this.leafTexts[i].x+=n}this.minX=Number.POSITIVE_INFINITY;this.maxX=Number.NEGATIVE_INFINITY;this.textChunkStart=this.leafTexts.length};e.prototype.adjustChildCoordinatesRecursive=function(r){var e=this;this.children.forEach((function(t,n){e.adjustChildCoordinatesRecursiveCore(r,e,e,n)}));this.applyAnchoring()};e.prototype.adjustChildCoordinatesRecursiveCore=function(r,e,t,n){var i=t.children[n];if(i.children.length>0){i.children.forEach((function(t,n){e.adjustChildCoordinatesRecursiveCore(r,e,i,n)}))}else{this.adjustChildCoordinates(r,e,t,n)}};e.prototype.adjustChildCoordinates=function(r,e,t,n){var i=t.children[n];if(typeof i.measureText!=="function"){return i}r.save();i.setContext(r,true);var a=i.getAttribute("x");var o=i.getAttribute("y");var s=i.getAttribute("dx");var u=i.getAttribute("dy");var c=i.getStyle("font-family").getDefinition();var f=Boolean(c)&&c.isRTL;if(n===0){if(!a.hasValue()){a.setValue(i.getInheritedAttribute("x"))}if(!o.hasValue()){o.setValue(i.getInheritedAttribute("y"))}if(!s.hasValue()){s.setValue(i.getInheritedAttribute("dx"))}if(!u.hasValue()){u.setValue(i.getInheritedAttribute("dy"))}}var l=i.measureText(r);if(f){e.x-=l}if(a.hasValue()){e.applyAnchoring();i.x=a.getPixels("x");if(s.hasValue()){i.x+=s.getPixels("x")}}else{if(s.hasValue()){e.x+=s.getPixels("x")}i.x=e.x}e.x=i.x;if(!f){e.x+=l}if(o.hasValue()){i.y=o.getPixels("y");if(u.hasValue()){i.y+=u.getPixels("y")}}else{if(u.hasValue()){e.y+=u.getPixels("y")}i.y=e.y}e.y=i.y;e.leafTexts.push(i);e.minX=Math.min(e.minX,i.x,i.x+l);e.maxX=Math.max(e.maxX,i.x,i.x+l);i.clearContext(r);r.restore();return i};e.prototype.getChildBoundingBox=function(r,e,t,n){var i=t.children[n];if(typeof i.getBoundingBox!=="function"){return null}var a=i.getBoundingBox(r);if(!a){return null}i.children.forEach((function(t,n){var o=e.getChildBoundingBox(r,e,i,n);a.addBoundingBox(o)}));return a};e.prototype.renderChild=function(r,e,t,n){var i=t.children[n];i.render(r);i.children.forEach((function(t,n){e.renderChild(r,e,i,n)}))};e.prototype.measureText=function(r){var e=this.measureCache;if(~e){return e}var t=this.getText();var n=this.measureTargetText(r,t);this.measureCache=n;return n};e.prototype.measureTargetText=function(r,e){if(!e.length){return 0}var t=this.parent;var n=t.getStyle("font-family").getDefinition();if(n){var i=this.getFontSize();var a=n.isRTL?e.split("").reverse().join(""):e;var o=toNumbers(t.getAttribute("dx").getString());var s=a.length;var u=0;for(var c=0;c<s;c++){var f=this.getGlyph(n,a,c);u+=(f.horizAdvX||n.horizAdvX)*i/n.fontFace.unitsPerEm;if(typeof o[c]!=="undefined"&&!isNaN(o[c])){u+=o[c]}}return u}if(!r.measureText){return e.length*10}r.save();this.setContext(r,true);var l=r.measureText(e).width;this.clearContext(r);r.restore();return l};e.prototype.getInheritedAttribute=function(r){var t=this;while(t instanceof e&&t.isFirstChild()){var n=t.parent.getAttribute(r);if(n.hasValue(true)){return n.getValue("0")}t=t.parent}return null};return e}(RenderedElement);var TSpanElement=function(r){__extends(e,r);function e(t,n,i){var a=this.constructor;var o=r.call(this,t,n,a===e?true:i)||this;o.type="tspan";o.text=o.children.length>0?"":o.getTextFromNode();return o}e.prototype.getText=function(){return this.text};return e}(TextElement);var TextNode=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="textNode";return e}return e}(TSpanElement);var SVGElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="svg";e.root=false;return e}e.prototype.setContext=function(e){var t;var n=this.document;var i=n.screen,a=n.window;var o=e.canvas;i.setDefaults(e);if(o.style&&typeof e.font!=="undefined"&&a&&typeof a.getComputedStyle!=="undefined"){e.font=a.getComputedStyle(o).getPropertyValue("font");var s=new Property(n,"fontSize",Font.parse(e.font).fontSize);if(s.hasValue()){n.rootEmSize=s.getPixels("y");n.emSize=n.rootEmSize}}if(!this.getAttribute("x").hasValue()){this.getAttribute("x",true).setValue(0)}if(!this.getAttribute("y").hasValue()){this.getAttribute("y",true).setValue(0)}var u=i.viewPort,c=u.width,f=u.height;if(!this.getStyle("width").hasValue()){this.getStyle("width",true).setValue("100%")}if(!this.getStyle("height").hasValue()){this.getStyle("height",true).setValue("100%")}if(!this.getStyle("color").hasValue()){this.getStyle("color",true).setValue("black")}var l=this.getAttribute("refX");var v=this.getAttribute("refY");var h=this.getAttribute("viewBox");var $=h.hasValue()?toNumbers(h.getString()):null;var d=!this.root&&this.getStyle("overflow").getValue("hidden")!=="visible";var p=0;var y=0;var b=0;var m=0;if($){p=$[0];y=$[1]}if(!this.root){c=this.getStyle("width").getPixels("x");f=this.getStyle("height").getPixels("y");if(this.type==="marker"){b=p;m=y;p=0;y=0}}i.viewPort.setCurrent(c,f);if(this.node&&(!this.parent||((t=this.node.parentNode)===null||t===void 0?void 0:t.nodeName)==="foreignObject")&&this.getStyle("transform",false,true).hasValue()&&!this.getStyle("transform-origin",false,true).hasValue()){this.getStyle("transform-origin",true,true).setValue("50% 50%")}r.prototype.setContext.call(this,e);e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y"));if($){c=$[2];f=$[3]}n.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:c,height:i.viewPort.height,desiredHeight:f,minX:p,minY:y,refX:l.getValue(),refY:v.getValue(),clip:d,clipX:b,clipY:m});if($){i.viewPort.removeCurrent();i.viewPort.setCurrent(c,f)}};e.prototype.clearContext=function(e){r.prototype.clearContext.call(this,e);this.document.screen.viewPort.removeCurrent()};e.prototype.resize=function(r){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:r;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var n=this.getAttribute("width",true);var i=this.getAttribute("height",true);var a=this.getAttribute("viewBox");var o=this.getAttribute("style");var s=n.getNumber(0);var u=i.getNumber(0);if(t){if(typeof t==="string"){this.getAttribute("preserveAspectRatio",true).setValue(t)}else{var c=this.getAttribute("preserveAspectRatio");if(c.hasValue()){c.setValue(c.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}}}n.setValue(r);i.setValue(e);if(!a.hasValue()){a.setValue("0 0 ".concat(s||r," ").concat(u||e))}if(o.hasValue()){var f=this.getStyle("width");var l=this.getStyle("height");if(f.hasValue()){f.setValue("".concat(r,"px"))}if(l.hasValue()){l.setValue("".concat(e,"px"))}}};return e}(RenderedElement);var RectElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="rect";return e}e.prototype.path=function(r){var e=this.getAttribute("x").getPixels("x");var t=this.getAttribute("y").getPixels("y");var n=this.getStyle("width",false,true).getPixels("x");var i=this.getStyle("height",false,true).getPixels("y");var a=this.getAttribute("rx");var o=this.getAttribute("ry");var s=a.getPixels("x");var u=o.getPixels("y");if(a.hasValue()&&!o.hasValue()){u=s}if(o.hasValue()&&!a.hasValue()){s=u}s=Math.min(s,n/2);u=Math.min(u,i/2);if(r){var c=4*((Math.sqrt(2)-1)/3);r.beginPath();if(i>0&&n>0){r.moveTo(e+s,t);r.lineTo(e+n-s,t);r.bezierCurveTo(e+n-s+c*s,t,e+n,t+u-c*u,e+n,t+u);r.lineTo(e+n,t+i-u);r.bezierCurveTo(e+n,t+i-u+c*u,e+n-s+c*s,t+i,e+n-s,t+i);r.lineTo(e+s,t+i);r.bezierCurveTo(e+s-c*s,t+i,e,t+i-u+c*u,e,t+i-u);r.lineTo(e,t+u);r.bezierCurveTo(e,t+u-c*u,e+s-c*s,t,e+s,t);r.closePath()}}return new BoundingBox(e,t,e+n,t+i)};e.prototype.getMarkers=function(){return null};return e}(PathElement);var CircleElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="circle";return e}e.prototype.path=function(r){var e=this.getAttribute("cx").getPixels("x");var t=this.getAttribute("cy").getPixels("y");var n=this.getAttribute("r").getPixels();if(r&&n>0){r.beginPath();r.arc(e,t,n,0,Math.PI*2,false);r.closePath()}return new BoundingBox(e-n,t-n,e+n,t+n)};e.prototype.getMarkers=function(){return null};return e}(PathElement);var EllipseElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="ellipse";return e}e.prototype.path=function(r){var e=4*((Math.sqrt(2)-1)/3);var t=this.getAttribute("rx").getPixels("x");var n=this.getAttribute("ry").getPixels("y");var i=this.getAttribute("cx").getPixels("x");var a=this.getAttribute("cy").getPixels("y");if(r&&t>0&&n>0){r.beginPath();r.moveTo(i+t,a);r.bezierCurveTo(i+t,a+e*n,i+e*t,a+n,i,a+n);r.bezierCurveTo(i-e*t,a+n,i-t,a+e*n,i-t,a);r.bezierCurveTo(i-t,a-e*n,i-e*t,a-n,i,a-n);r.bezierCurveTo(i+e*t,a-n,i+t,a-e*n,i+t,a);r.closePath()}return new BoundingBox(i-t,a-n,i+t,a+n)};e.prototype.getMarkers=function(){return null};return e}(PathElement);var LineElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="line";return e}e.prototype.getPoints=function(){return[new Point(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new Point(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]};e.prototype.path=function(r){var e=this.getPoints(),t=e[0],n=t.x,i=t.y,a=e[1],o=a.x,s=a.y;if(r){r.beginPath();r.moveTo(n,i);r.lineTo(o,s)}return new BoundingBox(n,i,o,s)};e.prototype.getMarkers=function(){var r=this.getPoints(),e=r[0],t=r[1];var n=e.angleTo(t);return[[e,n],[t,n]]};return e}(PathElement);var PolylineElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="polyline";i.points=[];i.points=Point.parsePath(i.getAttribute("points").getString());return i}e.prototype.path=function(r){var e=this.points;var t=e[0],n=t.x,i=t.y;var a=new BoundingBox(n,i);if(r){r.beginPath();r.moveTo(n,i)}e.forEach((function(e){var t=e.x,n=e.y;a.addPoint(t,n);if(r){r.lineTo(t,n)}}));return a};e.prototype.getMarkers=function(){var r=this.points;var e=r.length-1;var t=[];r.forEach((function(n,i){if(i===e){return}t.push([n,n.angleTo(r[i+1])])}));if(t.length>0){t.push([r[r.length-1],t[t.length-1][1]])}return t};return e}(PathElement);var PolygonElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="polygon";return e}e.prototype.path=function(e){var t=r.prototype.path.call(this,e);var n=this.points[0],i=n.x,a=n.y;if(e){e.lineTo(i,a);e.closePath()}return t};return e}(PolylineElement);var PatternElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="pattern";return e}e.prototype.createPattern=function(r,e,t){var n=this.getStyle("width").getPixels("x",true);var i=this.getStyle("height").getPixels("y",true);var a=new SVGElement(this.document,null);a.attributes.viewBox=new Property(this.document,"viewBox",this.getAttribute("viewBox").getValue());a.attributes.width=new Property(this.document,"width","".concat(n,"px"));a.attributes.height=new Property(this.document,"height","".concat(i,"px"));a.attributes.transform=new Property(this.document,"transform",this.getAttribute("patternTransform").getValue());a.children=this.children;var o=this.document.createCanvas(n,i);var s=o.getContext("2d");var u=this.getAttribute("x");var c=this.getAttribute("y");if(u.hasValue()&&c.hasValue()){s.translate(u.getPixels("x",true),c.getPixels("y",true))}if(t.hasValue()){this.styles["fill-opacity"]=t}else{Reflect.deleteProperty(this.styles,"fill-opacity")}for(var f=-1;f<=1;f++){for(var l=-1;l<=1;l++){s.save();a.attributes.x=new Property(this.document,"x",f*o.width);a.attributes.y=new Property(this.document,"y",l*o.height);a.render(s);s.restore()}}var v=r.createPattern(o,"repeat");return v};return e}(Element);var MarkerElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="marker";return e}e.prototype.render=function(r,e,t){if(!e){return}var n=e.x,i=e.y;var a=this.getAttribute("orient").getString("auto");var o=this.getAttribute("markerUnits").getString("strokeWidth");r.translate(n,i);if(a==="auto"){r.rotate(t)}if(o==="strokeWidth"){r.scale(r.lineWidth,r.lineWidth)}r.save();var s=new SVGElement(this.document,null);s.type=this.type;s.attributes.viewBox=new Property(this.document,"viewBox",this.getAttribute("viewBox").getValue());s.attributes.refX=new Property(this.document,"refX",this.getAttribute("refX").getValue());s.attributes.refY=new Property(this.document,"refY",this.getAttribute("refY").getValue());s.attributes.width=new Property(this.document,"width",this.getAttribute("markerWidth").getValue());s.attributes.height=new Property(this.document,"height",this.getAttribute("markerHeight").getValue());s.attributes.overflow=new Property(this.document,"overflow",this.getAttribute("overflow").getValue());s.attributes.fill=new Property(this.document,"fill",this.getAttribute("fill").getColor("black"));s.attributes.stroke=new Property(this.document,"stroke",this.getAttribute("stroke").getValue("none"));s.children=this.children;s.render(r);r.restore();if(o==="strokeWidth"){r.scale(1/r.lineWidth,1/r.lineWidth)}if(a==="auto"){r.rotate(-t)}r.translate(-n,-i)};return e}(Element);var DefsElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="defs";return e}e.prototype.render=function(){};return e}(Element);var GElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="g";return e}e.prototype.getBoundingBox=function(r){var e=new BoundingBox;this.children.forEach((function(t){e.addBoundingBox(t.getBoundingBox(r))}));return e};return e}(RenderedElement);var GradientElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.attributesToInherit=["gradientUnits"];i.stops=[];var a=i,o=a.stops,s=a.children;s.forEach((function(r){if(r.type==="stop"){o.push(r)}}));return i}e.prototype.getGradientUnits=function(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")};e.prototype.createGradient=function(r,e,t){var n=this;var i=this;if(this.getHrefAttribute().hasValue()){i=this.getHrefAttribute().getDefinition();this.inheritStopContainer(i)}var a=i.stops;var o=this.getGradient(r,e);if(!o){return this.addParentOpacity(t,a[a.length-1].color)}a.forEach((function(r){o.addColorStop(r.offset,n.addParentOpacity(t,r.color))}));if(this.getAttribute("gradientTransform").hasValue()){var s=this.document;var u=s.screen,c=u.MAX_VIRTUAL_PIXELS,f=u.viewPort;var l=f.viewPorts[0];var v=new RectElement(s,null);v.attributes.x=new Property(s,"x",-c/3);v.attributes.y=new Property(s,"y",-c/3);v.attributes.width=new Property(s,"width",c);v.attributes.height=new Property(s,"height",c);var h=new GElement(s,null);h.attributes.transform=new Property(s,"transform",this.getAttribute("gradientTransform").getValue());h.children=[v];var $=new SVGElement(s,null);$.attributes.x=new Property(s,"x",0);$.attributes.y=new Property(s,"y",0);$.attributes.width=new Property(s,"width",l.width);$.attributes.height=new Property(s,"height",l.height);$.children=[h];var d=s.createCanvas(l.width,l.height);var p=d.getContext("2d");p.fillStyle=o;$.render(p);return p.createPattern(d,"no-repeat")}return o};e.prototype.inheritStopContainer=function(r){var e=this;this.attributesToInherit.forEach((function(t){if(!e.getAttribute(t).hasValue()&&r.getAttribute(t).hasValue()){e.getAttribute(t,true).setValue(r.getAttribute(t).getValue())}}))};e.prototype.addParentOpacity=function(r,e){if(r.hasValue()){var t=new Property(this.document,"color",e);return t.addOpacity(r).getColor()}return e};return e}(Element);var LinearGradientElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="linearGradient";i.attributesToInherit.push("x1","y1","x2","y2");return i}e.prototype.getGradient=function(r,e){var t=this.getGradientUnits()==="objectBoundingBox";var n=t?e.getBoundingBox(r):null;if(t&&!n){return null}if(!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()){this.getAttribute("x1",true).setValue(0);this.getAttribute("y1",true).setValue(0);this.getAttribute("x2",true).setValue(1);this.getAttribute("y2",true).setValue(0)}var i=t?n.x+n.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x");var a=t?n.y+n.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y");var o=t?n.x+n.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x");var s=t?n.y+n.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");if(i===o&&a===s){return null}return r.createLinearGradient(i,a,o,s)};return e}(GradientElement);var RadialGradientElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="radialGradient";i.attributesToInherit.push("cx","cy","r","fx","fy","fr");return i}e.prototype.getGradient=function(r,e){var t=this.getGradientUnits()==="objectBoundingBox";var n=e.getBoundingBox(r);if(t&&!n){return null}if(!this.getAttribute("cx").hasValue()){this.getAttribute("cx",true).setValue("50%")}if(!this.getAttribute("cy").hasValue()){this.getAttribute("cy",true).setValue("50%")}if(!this.getAttribute("r").hasValue()){this.getAttribute("r",true).setValue("50%")}var i=t?n.x+n.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x");var a=t?n.y+n.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y");var o=i;var s=a;if(this.getAttribute("fx").hasValue()){o=t?n.x+n.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")}if(this.getAttribute("fy").hasValue()){s=t?n.y+n.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y")}var u=t?(n.width+n.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels();var c=this.getAttribute("fr").getPixels();return r.createRadialGradient(o,s,c,i,a,u)};return e}(GradientElement);var StopElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="stop";var a=Math.max(0,Math.min(1,i.getAttribute("offset").getNumber()));var o=i.getStyle("stop-opacity");var s=i.getStyle("stop-color",true);if(s.getString()===""){s.setValue("#000")}if(o.hasValue()){s=s.addOpacity(o)}i.offset=a;i.color=s.getColor();return i}return e}(Element);var AnimateElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="animate";i.duration=0;i.initialValue=null;i.initialUnits="";i.removed=false;i.frozen=false;e.screen.animations.push(i);i.begin=i.getAttribute("begin").getMilliseconds();i.maxDuration=i.begin+i.getAttribute("dur").getMilliseconds();i.from=i.getAttribute("from");i.to=i.getAttribute("to");i.values=new Property(e,"values",null);var a=i.getAttribute("values");if(a.hasValue()){i.values.setValue(a.getString().split(";"))}return i}e.prototype.getProperty=function(){var r=this.getAttribute("attributeType").getString();var e=this.getAttribute("attributeName").getString();if(r==="CSS"){return this.parent.getStyle(e,true)}return this.parent.getAttribute(e,true)};e.prototype.calcValue=function(){var r=this.initialUnits;var e=this.getProgress(),t=e.progress,n=e.from,i=e.to;var a=n.getNumber()+(i.getNumber()-n.getNumber())*t;if(r==="%"){a*=100}return"".concat(a).concat(r)};e.prototype.update=function(r){var e=this.parent;var t=this.getProperty();if(!this.initialValue){this.initialValue=t.getString();this.initialUnits=t.getUnits()}if(this.duration>this.maxDuration){var n=this.getAttribute("fill").getString("remove");if(this.getAttribute("repeatCount").getString()==="indefinite"||this.getAttribute("repeatDur").getString()==="indefinite"){this.duration=0}else if(n==="freeze"&&!this.frozen){this.frozen=true;e.animationFrozen=true;e.animationFrozenValue=t.getString()}else if(n==="remove"&&!this.removed){this.removed=true;t.setValue(e.animationFrozen?e.animationFrozenValue:this.initialValue);return true}return false}this.duration+=r;var i=false;if(this.begin<this.duration){var a=this.calcValue();var o=this.getAttribute("type");if(o.hasValue()){var s=o.getString();a="".concat(s,"(").concat(a,")")}t.setValue(a);i=true}return i};e.prototype.getProgress=function(){var r=this,e=r.document,t=r.values;var n={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(t.hasValue()){var i=n.progress*(t.getValue().length-1);var a=Math.floor(i);var o=Math.ceil(i);n.from=new Property(e,"from",parseFloat(t.getValue()[a]));n.to=new Property(e,"to",parseFloat(t.getValue()[o]));n.progress=(i-a)/(o-a)}else{n.from=this.from;n.to=this.to}return n};return e}(Element);var AnimateColorElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="animateColor";return e}e.prototype.calcValue=function(){var r=this.getProgress(),e=r.progress,t=r.from,n=r.to;var i=new rgbcolor(t.getColor());var a=new rgbcolor(n.getColor());if(i.ok&&a.ok){var o=i.r+(a.r-i.r)*e;var s=i.g+(a.g-i.g)*e;var u=i.b+(a.b-i.b)*e;return"rgb(".concat(Math.floor(o),", ").concat(Math.floor(s),", ").concat(Math.floor(u),")")}return this.getAttribute("from").getColor()};return e}(AnimateElement);var AnimateTransformElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="animateTransform";return e}e.prototype.calcValue=function(){var r=this.getProgress(),e=r.progress,t=r.from,n=r.to;var i=toNumbers(t.getString());var a=toNumbers(n.getString());var o=i.map((function(r,t){var n=a[t];return r+(n-r)*e})).join(" ");return o};return e}(AnimateElement);var FontElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="font";i.glyphs={};i.horizAdvX=i.getAttribute("horiz-adv-x").getNumber();var a=e.definitions;var o=i.children;for(var s=0,u=o;s<u.length;s++){var c=u[s];switch(c.type){case"font-face":{i.fontFace=c;var f=c.getStyle("font-family");if(f.hasValue()){a[f.getString()]=i}break}case"missing-glyph":i.missingGlyph=c;break;case"glyph":{var l=c;if(l.arabicForm){i.isRTL=true;i.isArabic=true;if(typeof i.glyphs[l.unicode]==="undefined"){i.glyphs[l.unicode]={}}i.glyphs[l.unicode][l.arabicForm]=l}else{i.glyphs[l.unicode]=l}break}}}return i}e.prototype.render=function(){};return e}(Element);var FontFaceElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="font-face";i.ascent=i.getAttribute("ascent").getNumber();i.descent=i.getAttribute("descent").getNumber();i.unitsPerEm=i.getAttribute("units-per-em").getNumber();return i}return e}(Element);var MissingGlyphElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="missing-glyph";e.horizAdvX=0;return e}return e}(PathElement);var TRefElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="tref";return e}e.prototype.getText=function(){var r=this.getHrefAttribute().getDefinition();if(r){var e=r.children[0];if(e){return e.getText()}}return""};return e}(TextElement);var AElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="a";var a=t.childNodes;var o=a[0];var s=a.length>0&&Array.from(a).every((function(r){return r.nodeType===3}));i.hasText=s;i.text=s?i.getTextFromNode(o):"";return i}e.prototype.getText=function(){return this.text};e.prototype.renderChildren=function(e){if(this.hasText){r.prototype.renderChildren.call(this,e);var t=this,n=t.document,i=t.x,a=t.y;var o=n.screen.mouse;var s=new Property(n,"fontSize",Font.parse(n.ctx.font).fontSize);if(o.isWorking()){o.checkBoundingBox(this,new BoundingBox(i,a-s.getPixels("y"),i+this.measureText(e),a))}}else if(this.children.length>0){var u=new GElement(this.document,null);u.children=this.children;u.parent=this;u.render(e)}};e.prototype.onClick=function(){var r=this.document.window;if(r){r.open(this.getHrefAttribute().getString())}};e.prototype.onMouseMove=function(){var r=this.document.ctx;r.canvas.style.cursor="pointer"};return e}(TextElement);function ownKeys$2(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);if(e){n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}t.push.apply(t,n)}return t}function _objectSpread$2(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};if(e%2){ownKeys$2(Object(t),true).forEach((function(e){_defineProperty(r,e,t[e])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(r,Object.getOwnPropertyDescriptors(t))}else{ownKeys$2(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}}return r}var TextPathElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="textPath";i.textWidth=0;i.textHeight=0;i.pathLength=-1;i.glyphInfo=null;i.letterSpacingCache=[];i.measuresCache=new Map([["",0]]);var a=i.getHrefAttribute().getDefinition();i.text=i.getTextFromNode();i.dataArray=i.parsePathData(a);return i}e.prototype.getText=function(){return this.text};e.prototype.path=function(r){var e=this.dataArray;if(r){r.beginPath()}e.forEach((function(e){var t=e.type,n=e.points;switch(t){case PathParser.LINE_TO:if(r){r.lineTo(n[0],n[1])}break;case PathParser.MOVE_TO:if(r){r.moveTo(n[0],n[1])}break;case PathParser.CURVE_TO:if(r){r.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}break;case PathParser.QUAD_TO:if(r){r.quadraticCurveTo(n[0],n[1],n[2],n[3])}break;case PathParser.ARC:{var i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],c=n[5],f=n[6],l=n[7];var v=o>s?o:s;var h=o>s?1:o/s;var $=o>s?s/o:1;if(r){r.translate(i,a);r.rotate(f);r.scale(h,$);r.arc(0,0,v,u,u+c,Boolean(1-l));r.scale(1/h,1/$);r.rotate(-f);r.translate(-i,-a)}break}case PathParser.CLOSE_PATH:if(r){r.closePath()}break}}))};e.prototype.renderChildren=function(r){this.setTextData(r);r.save();var e=this.parent.getStyle("text-decoration").getString();var t=this.getFontSize();var n=this.glyphInfo;var i=r.fillStyle;if(e==="underline"){r.beginPath()}n.forEach((function(n,i){var a=n.p0,o=n.p1,s=n.rotation,u=n.text;r.save();r.translate(a.x,a.y);r.rotate(s);if(r.fillStyle){r.fillText(u,0,0)}if(r.strokeStyle){r.strokeText(u,0,0)}r.restore();if(e==="underline"){if(i===0){r.moveTo(a.x,a.y+t/8)}r.lineTo(o.x,o.y+t/5)}}));if(e==="underline"){r.lineWidth=t/20;r.strokeStyle=i;r.stroke();r.closePath()}r.restore()};e.prototype.getLetterSpacingAt=function(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return this.letterSpacingCache[r]||0};e.prototype.findSegmentToFitChar=function(r,e,t,n,i,a,o,s,u){var c=a;var f=this.measureText(r,s);if(s===" "&&e==="justify"&&t<n){f+=(n-t)/i}if(u>-1){c+=this.getLetterSpacingAt(u)}var l=this.textHeight/20;var v=this.getEquidistantPointOnPath(c,l,0);var h=this.getEquidistantPointOnPath(c+f,l,0);var $={p0:v,p1:h};var d=v&&h?Math.atan2(h.y-v.y,h.x-v.x):0;if(o){var p=Math.cos(Math.PI/2+d)*o;var y=Math.cos(-d)*o;$.p0=_objectSpread$2(_objectSpread$2({},v),{},{x:v.x+p,y:v.y+y});$.p1=_objectSpread$2(_objectSpread$2({},h),{},{x:h.x+p,y:h.y+y})}c+=f;return{offset:c,segment:$,rotation:d}};e.prototype.measureText=function(r,e){var t=this.measuresCache;var n=e||this.getText();if(t.has(n)){return t.get(n)}var i=this.measureTargetText(r,n);t.set(n,i);return i};e.prototype.setTextData=function(r){var e=this;if(this.glyphInfo){return}var t=this.getText();var n=t.split("");var i=t.split(" ").length-1;var a=this.parent.getAttribute("dx").split().map((function(r){return r.getPixels("x")}));var o=this.parent.getAttribute("dy").getPixels("y");var s=this.parent.getStyle("text-anchor").getString("start");var u=this.getStyle("letter-spacing");var c=this.parent.getStyle("letter-spacing");var f=0;if(!u.hasValue()||u.getValue()==="inherit"){f=c.getPixels()}else if(u.hasValue()){if(u.getValue()!=="initial"&&u.getValue()!=="unset"){f=u.getPixels()}}var l=[];var v=t.length;this.letterSpacingCache=l;for(var h=0;h<v;h++){l.push(typeof a[h]!=="undefined"?a[h]:f)}var $=l.reduce((function(r,e,t){return t===0?0:r+e||0}),0);var d=this.measureText(r);var p=Math.max(d+$,0);this.textWidth=d;this.textHeight=this.getFontSize();this.glyphInfo=[];var y=this.getPathLength();var b=this.getStyle("startOffset").getNumber(0)*y;var m=0;if(s==="middle"||s==="center"){m=-p/2}if(s==="end"||s==="right"){m=-p}m+=b;n.forEach((function(t,a){var u=e.findSegmentToFitChar(r,s,p,y,i,m,o,t,a),c=u.offset,f=u.segment,l=u.rotation;m=c;if(!f.p0||!f.p1){return}e.glyphInfo.push({text:n[a],p0:f.p0,p1:f.p1,rotation:l})}))};e.prototype.parsePathData=function(r){this.pathLength=-1;if(!r){return[]}var e=[];var t=r.pathParser;t.reset();while(!t.isEnd()){var n=t.current;var i=n?n.x:0;var a=n?n.y:0;var o=t.next();var s=o.type;var u=[];switch(o.type){case PathParser.MOVE_TO:this.pathM(t,u);break;case PathParser.LINE_TO:s=this.pathL(t,u);break;case PathParser.HORIZ_LINE_TO:s=this.pathH(t,u);break;case PathParser.VERT_LINE_TO:s=this.pathV(t,u);break;case PathParser.CURVE_TO:this.pathC(t,u);break;case PathParser.SMOOTH_CURVE_TO:s=this.pathS(t,u);break;case PathParser.QUAD_TO:this.pathQ(t,u);break;case PathParser.SMOOTH_QUAD_TO:s=this.pathT(t,u);break;case PathParser.ARC:u=this.pathA(t);break;case PathParser.CLOSE_PATH:PathElement.pathZ(t);break}if(o.type!==PathParser.CLOSE_PATH){e.push({type:s,points:u,start:{x:i,y:a},pathLength:this.calcLength(i,a,s,u)})}else{e.push({type:PathParser.CLOSE_PATH,points:[],pathLength:0})}}return e};e.prototype.pathM=function(r,e){var t=PathElement.pathM(r).point,n=t.x,i=t.y;e.push(n,i)};e.prototype.pathL=function(r,e){var t=PathElement.pathL(r).point,n=t.x,i=t.y;e.push(n,i);return PathParser.LINE_TO};e.prototype.pathH=function(r,e){var t=PathElement.pathH(r).point,n=t.x,i=t.y;e.push(n,i);return PathParser.LINE_TO};e.prototype.pathV=function(r,e){var t=PathElement.pathV(r).point,n=t.x,i=t.y;e.push(n,i);return PathParser.LINE_TO};e.prototype.pathC=function(r,e){var t=PathElement.pathC(r),n=t.point,i=t.controlPoint,a=t.currentPoint;e.push(n.x,n.y,i.x,i.y,a.x,a.y)};e.prototype.pathS=function(r,e){var t=PathElement.pathS(r),n=t.point,i=t.controlPoint,a=t.currentPoint;e.push(n.x,n.y,i.x,i.y,a.x,a.y);return PathParser.CURVE_TO};e.prototype.pathQ=function(r,e){var t=PathElement.pathQ(r),n=t.controlPoint,i=t.currentPoint;e.push(n.x,n.y,i.x,i.y)};e.prototype.pathT=function(r,e){var t=PathElement.pathT(r),n=t.controlPoint,i=t.currentPoint;e.push(n.x,n.y,i.x,i.y);return PathParser.QUAD_TO};e.prototype.pathA=function(r){var e=PathElement.pathA(r),t=e.rX,n=e.rY,i=e.sweepFlag,a=e.xAxisRotation,o=e.centp,s=e.a1,u=e.ad;if(i===0&&u>0){u-=2*Math.PI}if(i===1&&u<0){u+=2*Math.PI}return[o.x,o.y,t,n,s,u,a,i]};e.prototype.calcLength=function(r,e,t,n){var i=0;var a=null;var o=null;var s=0;switch(t){case PathParser.LINE_TO:return this.getLineLength(r,e,n[0],n[1]);case PathParser.CURVE_TO:i=0;a=this.getPointOnCubicBezier(0,r,e,n[0],n[1],n[2],n[3],n[4],n[5]);for(s=.01;s<=1;s+=.01){o=this.getPointOnCubicBezier(s,r,e,n[0],n[1],n[2],n[3],n[4],n[5]);i+=this.getLineLength(a.x,a.y,o.x,o.y);a=o}return i;case PathParser.QUAD_TO:i=0;a=this.getPointOnQuadraticBezier(0,r,e,n[0],n[1],n[2],n[3]);for(s=.01;s<=1;s+=.01){o=this.getPointOnQuadraticBezier(s,r,e,n[0],n[1],n[2],n[3]);i+=this.getLineLength(a.x,a.y,o.x,o.y);a=o}return i;case PathParser.ARC:{i=0;var u=n[4];var c=n[5];var f=n[4]+c;var l=Math.PI/180;if(Math.abs(u-f)<l){l=Math.abs(u-f)}a=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],u,0);if(c<0){for(s=u-l;s>f;s-=l){o=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],s,0);i+=this.getLineLength(a.x,a.y,o.x,o.y);a=o}}else{for(s=u+l;s<f;s+=l){o=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],s,0);i+=this.getLineLength(a.x,a.y,o.x,o.y);a=o}}o=this.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],f,0);i+=this.getLineLength(a.x,a.y,o.x,o.y);return i}}return 0};e.prototype.getPointOnLine=function(r,e,t,n,i){var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:e;var o=arguments.length>6&&arguments[6]!==undefined?arguments[6]:t;var s=(i-t)/(n-e+PSEUDO_ZERO);var u=Math.sqrt(r*r/(1+s*s));if(n<e){u*=-1}var c=s*u;var f=null;if(n===e){f={x:a,y:o+c}}else if((o-t)/(a-e+PSEUDO_ZERO)===s){f={x:a+u,y:o+c}}else{var l=0;var v=0;var h=this.getLineLength(e,t,n,i);if(h<PSEUDO_ZERO){return null}var $=(a-e)*(n-e)+(o-t)*(i-t);$/=h*h;l=e+$*(n-e);v=t+$*(i-t);var d=this.getLineLength(a,o,l,v);var p=Math.sqrt(r*r-d*d);u=Math.sqrt(p*p/(1+s*s));if(n<e){u*=-1}c=s*u;f={x:l+u,y:v+c}}return f};e.prototype.getPointOnPath=function(r){var e=this.getPathLength();var t=0;var n=null;if(r<-5e-5||r-5e-5>e){return null}var i=this.dataArray;for(var a=0,o=i;a<o.length;a++){var s=o[a];if(s&&(s.pathLength<5e-5||t+s.pathLength+5e-5<r)){t+=s.pathLength;continue}var u=r-t;var c=0;switch(s.type){case PathParser.LINE_TO:n=this.getPointOnLine(u,s.start.x,s.start.y,s.points[0],s.points[1],s.start.x,s.start.y);break;case PathParser.ARC:{var f=s.points[4];var l=s.points[5];var v=s.points[4]+l;c=f+u/s.pathLength*l;if(l<0&&c<v||l>=0&&c>v){break}n=this.getPointOnEllipticalArc(s.points[0],s.points[1],s.points[2],s.points[3],c,s.points[6]);break}case PathParser.CURVE_TO:c=u/s.pathLength;if(c>1){c=1}n=this.getPointOnCubicBezier(c,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3],s.points[4],s.points[5]);break;case PathParser.QUAD_TO:c=u/s.pathLength;if(c>1){c=1}n=this.getPointOnQuadraticBezier(c,s.start.x,s.start.y,s.points[0],s.points[1],s.points[2],s.points[3]);break}if(n){return n}break}return null};e.prototype.getLineLength=function(r,e,t,n){return Math.sqrt((t-r)*(t-r)+(n-e)*(n-e))};e.prototype.getPathLength=function(){if(this.pathLength===-1){this.pathLength=this.dataArray.reduce((function(r,e){return e.pathLength>0?r+e.pathLength:r}),0)}return this.pathLength};e.prototype.getPointOnCubicBezier=function(r,e,t,n,i,a,o,s,u){var c=s*CB1(r)+a*CB2(r)+n*CB3(r)+e*CB4(r);var f=u*CB1(r)+o*CB2(r)+i*CB3(r)+t*CB4(r);return{x:c,y:f}};e.prototype.getPointOnQuadraticBezier=function(r,e,t,n,i,a,o){var s=a*QB1(r)+n*QB2(r)+e*QB3(r);var u=o*QB1(r)+i*QB2(r)+t*QB3(r);return{x:s,y:u}};e.prototype.getPointOnEllipticalArc=function(r,e,t,n,i,a){var o=Math.cos(a);var s=Math.sin(a);var u={x:t*Math.cos(i),y:n*Math.sin(i)};return{x:r+(u.x*o-u.y*s),y:e+(u.x*s+u.y*o)}};e.prototype.buildEquidistantCache=function(r,e){var t=this.getPathLength();var n=e||.25;var i=r||t/100;if(!this.equidistantCache||this.equidistantCache.step!==i||this.equidistantCache.precision!==n){this.equidistantCache={step:i,precision:n,points:[]};var a=0;for(var o=0;o<=t;o+=n){var s=this.getPointOnPath(o);var u=this.getPointOnPath(o+n);if(!s||!u){continue}a+=this.getLineLength(s.x,s.y,u.x,u.y);if(a>=i){this.equidistantCache.points.push({x:s.x,y:s.y,distance:o});a-=i}}}};e.prototype.getEquidistantPointOnPath=function(r,e,t){this.buildEquidistantCache(e,t);if(r<0||r-this.getPathLength()>5e-5){return null}var n=Math.round(r/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[n]||null};return e}(TextElement);var dataUriRegex=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i;var ImageElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="image";i.loaded=false;var a=i.getHrefAttribute().getString();if(!a){return i}var o=a.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(a);e.images.push(i);if(!o){void i.loadImage(a)}else{void i.loadSvg(a)}i.isSvg=o;return i}e.prototype.loadImage=function(r){var e=this;return _asyncToGenerator((function(){var t,n;return __generator(this,(function(i){switch(i.label){case 0:i.trys.push([0,2,,3]);return[4,e.document.createImage(r)];case 1:t=i.sent();e.image=t;return[3,3];case 2:n=i.sent();console.error('Error while loading image "'.concat(r,'":'),n);return[3,3];case 3:e.loaded=true;return[2]}}))}))()};e.prototype.loadSvg=function(r){var e=this;return _asyncToGenerator((function(){var t,n,i,a,o;return __generator(this,(function(s){switch(s.label){case 0:t=dataUriRegex.exec(r);if(!t)return[3,1];n=t[5];if(t[4]==="base64"){e.image=atob(n)}else{e.image=decodeURIComponent(n)}return[3,5];case 1:s.trys.push([1,4,,5]);return[4,e.document.fetch(r)];case 2:i=s.sent();return[4,i.text()];case 3:a=s.sent();e.image=a;return[3,5];case 4:o=s.sent();console.error('Error while loading image "'.concat(r,'":'),o);return[3,5];case 5:e.loaded=true;return[2]}}))}))()};e.prototype.renderChildren=function(r){var e=this,t=e.document,n=e.image,i=e.loaded;var a=this.getAttribute("x").getPixels("x");var o=this.getAttribute("y").getPixels("y");var s=this.getStyle("width").getPixels("x");var u=this.getStyle("height").getPixels("y");if(!i||!n||!s||!u){return}r.save();r.translate(a,o);if(this.isSvg){var c=t.canvg.forkString(r,this.image,{ignoreMouse:true,ignoreAnimation:true,ignoreDimensions:true,ignoreClear:true,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:u});c.document.documentElement.parent=this;void c.render()}else{var f=this.image;t.setViewBox({ctx:r,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:f.width,height:u,desiredHeight:f.height});if(this.loaded){if(typeof f.complete==="undefined"||f.complete){r.drawImage(f,0,0)}}}r.restore()};e.prototype.getBoundingBox=function(){var r=this.getAttribute("x").getPixels("x");var e=this.getAttribute("y").getPixels("y");var t=this.getStyle("width").getPixels("x");var n=this.getStyle("height").getPixels("y");return new BoundingBox(r,e,r+t,e+n)};return e}(RenderedElement);var SymbolElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="symbol";return e}e.prototype.render=function(r){};return e}(RenderedElement);var SVGFontLoader=function(){function r(r){this.document=r;this.loaded=false;r.fonts.push(this)}r.prototype.load=function(r,e){var t=this;return _asyncToGenerator((function(){var n,i,a,o;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);n=t.document;return[4,n.canvg.parser.load(e)];case 1:i=s.sent();a=i.getElementsByTagName("font");Array.from(a).forEach((function(e){var t=n.createElement(e);n.definitions[r]=t}));return[3,3];case 2:o=s.sent();console.error('Error while loading font "'.concat(e,'":'),o);return[3,3];case 3:t.loaded=true;return[2]}}))}))()};return r}();var StyleElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="style";var a=compressSpaces(Array.from(t.childNodes).map((function(r){return r.textContent})).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,""));var o=a.split("}");o.forEach((function(r){var t=r.trim();if(!t){return}var n=t.split("{");var i=n[0].split(",");var a=n[1].split(";");i.forEach((function(r){var t=r.trim();if(!t){return}var n=e.styles[t]||{};a.forEach((function(r){var t=r.indexOf(":");var i=r.substr(0,t).trim();var a=r.substr(t+1,r.length-t).trim();if(i&&a){n[i]=new Property(e,i,a)}}));e.styles[t]=n;e.stylesSpecificity[t]=getSelectorSpecificity(t);if(t==="@font-face"){var i=n["font-family"].getString().replace(/"|'/g,"");var o=n.src.getString().split(",");o.forEach((function(r){if(r.indexOf('format("svg")')>0){var t=parseExternalUrl(r);if(t){void new SVGFontLoader(e).load(i,t)}}}))}}))}));return i}return e}(Element);StyleElement.parseExternalUrl=parseExternalUrl;var UseElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="use";return e}e.prototype.setContext=function(e){r.prototype.setContext.call(this,e);var t=this.getAttribute("x");var n=this.getAttribute("y");if(t.hasValue()){e.translate(t.getPixels("x"),0)}if(n.hasValue()){e.translate(0,n.getPixels("y"))}};e.prototype.path=function(r){var e=this.element;if(e){e.path(r)}};e.prototype.renderChildren=function(r){var e=this,t=e.document,n=e.element;if(n){var i=n;if(n.type==="symbol"){i=new SVGElement(t,null);i.attributes.viewBox=new Property(t,"viewBox",n.getAttribute("viewBox").getString());i.attributes.preserveAspectRatio=new Property(t,"preserveAspectRatio",n.getAttribute("preserveAspectRatio").getString());i.attributes.overflow=new Property(t,"overflow",n.getAttribute("overflow").getString());i.children=n.children;n.styles.opacity=new Property(t,"opacity",this.calculateOpacity())}if(i.type==="svg"){var a=this.getStyle("width",false,true);var o=this.getStyle("height",false,true);if(a.hasValue()){i.attributes.width=new Property(t,"width",a.getString())}if(o.hasValue()){i.attributes.height=new Property(t,"height",o.getString())}}var s=i.parent;i.parent=this;i.render(r);i.parent=s}};e.prototype.getBoundingBox=function(r){var e=this.element;if(e){return e.getBoundingBox(r)}return null};e.prototype.elementTransform=function(){var r=this,e=r.document,t=r.element;return Transform.fromElement(e,t)};Object.defineProperty(e.prototype,"element",{get:function(){if(!this.cachedElement){this.cachedElement=this.getHrefAttribute().getDefinition()}return this.cachedElement},enumerable:false,configurable:true});return e}(RenderedElement);function imGet(r,e,t,n,i,a){return r[t*n*4+e*4+a]}function imSet(r,e,t,n,i,a,o){r[t*n*4+e*4+a]=o}function m(r,e,t){var n=r[e];return n*t}function c(r,e,t,n){return e+Math.cos(r)*t+Math.sin(r)*n}var FeColorMatrixElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="feColorMatrix";var a=toNumbers(i.getAttribute("values").getString());switch(i.getAttribute("type").getString("matrix")){case"saturate":{var o=a[0];a=[.213+.787*o,.715-.715*o,.072-.072*o,0,0,.213-.213*o,.715+.285*o,.072-.072*o,0,0,.213-.213*o,.715-.715*o,.072+.928*o,0,0,0,0,0,1,0,0,0,0,0,1];break}case"hueRotate":{var s=a[0]*Math.PI/180;a=[c(s,.213,.787,-.213),c(s,.715,-.715,-.715),c(s,.072,-.072,.928),0,0,c(s,.213,-.213,.143),c(s,.715,.285,.14),c(s,.072,-.072,-.283),0,0,c(s,.213,-.213,-.787),c(s,.715,-.715,.715),c(s,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break}case"luminanceToAlpha":a=[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];break}i.matrix=a;i.includeOpacity=i.getAttribute("includeOpacity").hasValue();return i}e.prototype.apply=function(r,e,t,n,i){var a=this,o=a.includeOpacity,s=a.matrix;var u=r.getImageData(0,0,n,i);for(var c=0;c<i;c++){for(var f=0;f<n;f++){var l=imGet(u.data,f,c,n,i,0);var v=imGet(u.data,f,c,n,i,1);var h=imGet(u.data,f,c,n,i,2);var $=imGet(u.data,f,c,n,i,3);var d=m(s,0,l)+m(s,1,v)+m(s,2,h)+m(s,3,$)+m(s,4,1);var p=m(s,5,l)+m(s,6,v)+m(s,7,h)+m(s,8,$)+m(s,9,1);var y=m(s,10,l)+m(s,11,v)+m(s,12,h)+m(s,13,$)+m(s,14,1);var b=m(s,15,l)+m(s,16,v)+m(s,17,h)+m(s,18,$)+m(s,19,1);if(o){d=0;p=0;y=0;b*=$/255}imSet(u.data,f,c,n,i,0,d);imSet(u.data,f,c,n,i,1,p);imSet(u.data,f,c,n,i,2,y);imSet(u.data,f,c,n,i,3,b)}}r.clearRect(0,0,n,i);r.putImageData(u,0,0)};return e}(Element);var MaskElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="mask";return e}e.prototype.apply=function(r,t){var n=this.document;var i=this.getAttribute("x").getPixels("x");var a=this.getAttribute("y").getPixels("y");var o=this.getStyle("width").getPixels("x");var s=this.getStyle("height").getPixels("y");if(!o&&!s){var u=new BoundingBox;this.children.forEach((function(e){u.addBoundingBox(e.getBoundingBox(r))}));i=Math.floor(u.x1);a=Math.floor(u.y1);o=Math.floor(u.width);s=Math.floor(u.height)}var c=this.removeStyles(t,e.ignoreStyles);var f=n.createCanvas(i+o,a+s);var l=f.getContext("2d");n.screen.setDefaults(l);this.renderChildren(l);new FeColorMatrixElement(n,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(l,0,0,i+o,a+s);var v=n.createCanvas(i+o,a+s);var h=v.getContext("2d");n.screen.setDefaults(h);t.render(h);h.globalCompositeOperation="destination-in";h.fillStyle=l.createPattern(f,"no-repeat");h.fillRect(0,0,i+o,a+s);r.fillStyle=h.createPattern(v,"no-repeat");r.fillRect(0,0,i+o,a+s);this.restoreStyles(t,c)};e.prototype.render=function(r){};return e}(Element);MaskElement.ignoreStyles=["mask","transform","clip-path"];var noop=function(){};var ClipPathElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="clipPath";return e}e.prototype.apply=function(r){var e=this.document;var t=Reflect.getPrototypeOf(r);var n=r.beginPath,i=r.closePath;if(t){t.beginPath=noop;t.closePath=noop}Reflect.apply(n,r,[]);this.children.forEach((function(n){if(typeof n.path==="undefined"){return}var a=typeof n.elementTransform!=="undefined"?n.elementTransform():null;if(!a){a=Transform.fromElement(e,n)}if(a){a.apply(r)}n.path(r);if(t){t.closePath=i}if(a){a.unapply(r)}}));Reflect.apply(i,r,[]);r.clip();if(t){t.beginPath=n;t.closePath=i}};e.prototype.render=function(r){};return e}(Element);var FilterElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="filter";return e}e.prototype.apply=function(r,t){var n=this,i=n.document,a=n.children;var o=t.getBoundingBox(r);if(!o){return}var s=0;var u=0;a.forEach((function(r){var e=r.extraFilterDistance||0;s=Math.max(s,e);u=Math.max(u,e)}));var c=Math.floor(o.width);var f=Math.floor(o.height);var l=c+2*s;var v=f+2*u;if(l<1||v<1){return}var h=Math.floor(o.x);var $=Math.floor(o.y);var d=this.removeStyles(t,e.ignoreStyles);var p=i.createCanvas(l,v);var y=p.getContext("2d");i.screen.setDefaults(y);y.translate(-h+s,-$+u);t.render(y);a.forEach((function(r){if(typeof r.apply==="function"){r.apply(y,0,0,l,v)}}));r.drawImage(p,0,0,l,v,h-s,$-u,l,v);this.restoreStyles(t,d)};e.prototype.render=function(r){};return e}(Element);FilterElement.ignoreStyles=["filter","transform","clip-path"];var FeDropShadowElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="feDropShadow";i.addStylesFromStyleDefinition();return i}e.prototype.apply=function(r,e,t,n,i){};return e}(Element);var FeMorphologyElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="feMorphology";return e}e.prototype.apply=function(r,e,t,n,i){};return e}(Element);var FeCompositeElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="feComposite";return e}e.prototype.apply=function(r,e,t,n,i){};return e}(Element);var FeGaussianBlurElement=function(r){__extends(e,r);function e(e,t,n){var i=r.call(this,e,t,n)||this;i.type="feGaussianBlur";i.blurRadius=Math.floor(i.getAttribute("stdDeviation").getNumber());i.extraFilterDistance=i.blurRadius;return i}e.prototype.apply=function(r,e,t,n,i){var a=this,o=a.document,s=a.blurRadius;var u=o.window?o.window.document.body:null;var c=r.canvas;c.id=o.getUniqueId();if(u){c.style.display="none";u.appendChild(c)}processCanvasRGBA(c,e,t,n,i,s);if(u){u.removeChild(c)}};return e}(Element);var TitleElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="title";return e}return e}(Element);var DescElement=function(r){__extends(e,r);function e(){var e=r.apply(this,arguments)||this;e.type="desc";return e}return e}(Element);var elements={svg:SVGElement,rect:RectElement,circle:CircleElement,ellipse:EllipseElement,line:LineElement,polyline:PolylineElement,polygon:PolygonElement,path:PathElement,pattern:PatternElement,marker:MarkerElement,defs:DefsElement,linearGradient:LinearGradientElement,radialGradient:RadialGradientElement,stop:StopElement,animate:AnimateElement,animateColor:AnimateColorElement,animateTransform:AnimateTransformElement,font:FontElement,"font-face":FontFaceElement,"missing-glyph":MissingGlyphElement,glyph:GlyphElement,text:TextElement,tspan:TSpanElement,tref:TRefElement,a:AElement,textPath:TextPathElement,image:ImageElement,g:GElement,symbol:SymbolElement,style:StyleElement,use:UseElement,mask:MaskElement,clipPath:ClipPathElement,filter:FilterElement,feDropShadow:FeDropShadowElement,feMorphology:FeMorphologyElement,feComposite:FeCompositeElement,feColorMatrix:FeColorMatrixElement,feGaussianBlur:FeGaussianBlurElement,title:TitleElement,desc:DescElement};function ownKeys$1(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);if(e){n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}t.push.apply(t,n)}return t}function _objectSpread$1(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};if(e%2){ownKeys$1(Object(t),true).forEach((function(e){_defineProperty(r,e,t[e])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(r,Object.getOwnPropertyDescriptors(t))}else{ownKeys$1(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}}return r}function createCanvas(r,e){var t=document.createElement("canvas");t.width=r;t.height=e;return t}function createImage(r){return _createImage.apply(this,arguments)}function _createImage(){_createImage=_asyncToGenerator((function(r){var e,t;return __generator(this,(function(n){e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;t=document.createElement("img");if(e){t.crossOrigin="Anonymous"}return[2,new Promise((function(e,n){t.onload=function(){e(t)};t.onerror=function(r,e,t,i,a){n(a)};t.src=r}))]}))}));return _createImage.apply(this,arguments)}var Document=function(){function r(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=t.rootEmSize,i=n===void 0?12:n,a=t.emSize,o=a===void 0?12:a,s=t.createCanvas,u=s===void 0?r.createCanvas:s,c=t.createImage,f=c===void 0?r.createImage:c,l=t.anonymousCrossOrigin;this.canvg=e;this.definitions={};this.styles={};this.stylesSpecificity={};this.images=[];this.fonts=[];this.emSizeStack=[];this.uniqueId=0;this.screen=e.screen;this.rootEmSize=i;this.emSize=o;this.createCanvas=u;this.createImage=this.bindCreateImage(f,l);this.screen.wait(this.isImagesLoaded.bind(this));this.screen.wait(this.isFontsLoaded.bind(this))}r.prototype.bindCreateImage=function(r,e){if(typeof e==="boolean"){return function(t,n){return r(t,typeof n==="boolean"?n:e)}}return r};Object.defineProperty(r.prototype,"window",{get:function(){return this.screen.window},enumerable:false,configurable:true});Object.defineProperty(r.prototype,"fetch",{get:function(){return this.screen.fetch},enumerable:false,configurable:true});Object.defineProperty(r.prototype,"ctx",{get:function(){return this.screen.ctx},enumerable:false,configurable:true});Object.defineProperty(r.prototype,"emSize",{get:function(){var r=this.emSizeStack;return r[r.length-1]},set:function(r){var e=this.emSizeStack;e.push(r)},enumerable:false,configurable:true});r.prototype.popEmSize=function(){var r=this.emSizeStack;r.pop()};r.prototype.getUniqueId=function(){return"canvg".concat(++this.uniqueId)};r.prototype.isImagesLoaded=function(){return this.images.every((function(r){return r.loaded}))};r.prototype.isFontsLoaded=function(){return this.fonts.every((function(r){return r.loaded}))};r.prototype.createDocumentElement=function(r){var e=this.createElement(r.documentElement);e.root=true;e.addStylesFromStyleDefinition();this.documentElement=e;return e};r.prototype.createElement=function(e){var t=e.nodeName.replace(/^[^:]+:/,"");var n=r.elementTypes[t];if(typeof n!=="undefined"){return new n(this,e)}return new UnknownElement(this,e)};r.prototype.createTextNode=function(r){return new TextNode(this,r)};r.prototype.setViewBox=function(r){this.screen.setViewBox(_objectSpread$1({document:this},r))};return r}();Document.createCanvas=createCanvas;Document.createImage=createImage;Document.elementTypes=elements;function ownKeys(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);if(e){n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}t.push.apply(t,n)}return t}function _objectSpread(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};if(e%2){ownKeys(Object(t),true).forEach((function(e){_defineProperty(r,e,t[e])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(r,Object.getOwnPropertyDescriptors(t))}else{ownKeys(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}}return r}var Canvg=function(){function r(r,e){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};this.parser=new Parser(t);this.screen=new Screen(r,t);this.options=t;var n=new Document(this,t);var i=n.createDocumentElement(e);this.document=n;this.documentElement=i}r.from=function(e,t){var n=arguments;return _asyncToGenerator((function(){var i,a,o;return __generator(this,(function(s){switch(s.label){case 0:i=n.length>2&&n[2]!==undefined?n[2]:{};a=new Parser(i);return[4,a.parse(t)];case 1:o=s.sent();return[2,new r(e,o,i)]}}))}))()};r.fromString=function(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var i=new Parser(n);var a=i.parseFromString(t);return new r(e,a,n)};r.prototype.fork=function(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return r.from(e,t,_objectSpread(_objectSpread({},this.options),n))};r.prototype.forkString=function(e,t){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return r.fromString(e,t,_objectSpread(_objectSpread({},this.options),n))};r.prototype.ready=function(){return this.screen.ready()};r.prototype.isReady=function(){return this.screen.isReady()};r.prototype.render=function(){var r=arguments,e=this;return _asyncToGenerator((function(){var t;return __generator(this,(function(n){switch(n.label){case 0:t=r.length>0&&r[0]!==undefined?r[0]:{};e.start(_objectSpread({enableRedraw:true,ignoreAnimation:true,ignoreMouse:true},t));return[4,e.ready()];case 1:n.sent();e.stop();return[2]}}))}))()};r.prototype.start=function(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=this,t=e.documentElement,n=e.screen,i=e.options;n.start(t,_objectSpread(_objectSpread({enableRedraw:true},i),r))};r.prototype.stop=function(){this.screen.stop()};r.prototype.resize=function(r){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:r;var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;this.documentElement.resize(r,e,t)};return r}();export{AElement,AnimateColorElement,AnimateElement,AnimateTransformElement,BoundingBox,CB1,CB2,CB3,CB4,Canvg,CircleElement,ClipPathElement,DefsElement,DescElement,Document,Element,EllipseElement,FeColorMatrixElement,FeCompositeElement,FeDropShadowElement,FeGaussianBlurElement,FeMorphologyElement,FilterElement,Font,FontElement,FontFaceElement,GElement,GlyphElement,GradientElement,ImageElement,LineElement,LinearGradientElement,MarkerElement,MaskElement,Matrix,MissingGlyphElement,Mouse,PSEUDO_ZERO,Parser,PathElement,PathParser,PatternElement,Point,PolygonElement,PolylineElement,Property,QB1,QB2,QB3,RadialGradientElement,RectElement,RenderedElement,Rotate,SVGElement,SVGFontLoader,Scale,Screen,Skew,SkewX,SkewY,StopElement,StyleElement,SymbolElement,TRefElement,TSpanElement,TextElement,TextPathElement,TitleElement,Transform,Translate,UnknownElement,UseElement,ViewPort,compressSpaces,Canvg as default,getSelectorSpecificity,normalizeAttributeName,normalizeColor,parseExternalUrl,index as presets,toNumbers,trimLeft,trimRight,vectorMagnitude,vectorsAngle,vectorsRatio};
//# sourceMappingURL=index.es-1d1921a6.js.map