@antv/g 5.1.8-alpha.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/Canvas.d.ts.map +1 -1
  2. package/dist/canvas-module.d.ts.map +1 -1
  3. package/dist/css/StyleValueRegistry.d.ts.map +1 -1
  4. package/dist/css/cssom/CSSGradientValue.d.ts +10 -23
  5. package/dist/css/cssom/CSSGradientValue.d.ts.map +1 -1
  6. package/dist/css/parser/color.d.ts +12 -3
  7. package/dist/css/parser/color.d.ts.map +1 -1
  8. package/dist/css/parser/dimension.d.ts.map +1 -1
  9. package/dist/css/parser/gradient.d.ts +4 -0
  10. package/dist/css/parser/gradient.d.ts.map +1 -0
  11. package/dist/css/properties/CSSPropertyColor.d.ts +5 -4
  12. package/dist/css/properties/CSSPropertyColor.d.ts.map +1 -1
  13. package/dist/dom/EventTarget.d.ts.map +1 -1
  14. package/dist/dom/KeyframeList.d.ts.map +1 -1
  15. package/dist/index.d.ts +2 -3
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.esm.js +5097 -4628
  18. package/dist/index.js +5104 -4642
  19. package/dist/index.umd.js +6679 -5542
  20. package/dist/index.umd.min.js +2 -2
  21. package/dist/plugins/CullingPlugin.d.ts.map +1 -1
  22. package/dist/plugins/FrustumCullingStrategy.d.ts +0 -4
  23. package/dist/plugins/FrustumCullingStrategy.d.ts.map +1 -1
  24. package/dist/plugins/PrepareRendererPlugin.d.ts.map +1 -1
  25. package/dist/services/RenderingContext.d.ts +1 -0
  26. package/dist/services/RenderingContext.d.ts.map +1 -1
  27. package/dist/services/RenderingService.d.ts +3 -1
  28. package/dist/services/RenderingService.d.ts.map +1 -1
  29. package/dist/services/aabb/RectUpdater.d.ts +1 -1
  30. package/dist/services/aabb/RectUpdater.d.ts.map +1 -1
  31. package/dist/types.d.ts +5 -5
  32. package/dist/types.d.ts.map +1 -1
  33. package/dist/utils/gradient.d.ts +106 -0
  34. package/dist/utils/gradient.d.ts.map +1 -0
  35. package/dist/utils/index.d.ts +1 -0
  36. package/dist/utils/index.d.ts.map +1 -1
  37. package/dist/utils/path.d.ts +1 -1
  38. package/dist/utils/path.d.ts.map +1 -1
  39. package/package.json +8 -5
@@ -1,3 +1,3 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var r,i,o,a=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.NON_CUSTOM_TAG_KEYS=e.POST_CONSTRUCT=e.DESIGN_PARAM_TYPES=e.PARAM_TYPES=e.TAGGED_PROP=e.TAGGED=e.MULTI_INJECT_TAG=e.INJECT_TAG=e.OPTIONAL_TAG=e.UNMANAGED_TAG=e.NAME_TAG=e.NAMED_TAG=void 0,e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct",e.NON_CUSTOM_TAG_KEYS=[e.INJECT_TAG,e.MULTI_INJECT_TAG,e.NAME_TAG,e.UNMANAGED_TAG,e.NAMED_TAG,e.OPTIONAL_TAG]})),s=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0;e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"};e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}})),u=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}})),c=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var n=function(){function t(t,e){this.id=u.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=s.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===s.BindingScopeEnum.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},t}();e.Binding=n})),l=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.STACK_OVERFLOW=e.CIRCULAR_DEPENDENCY_IN_FACTORY=e.POST_CONSTRUCT_ERROR=e.MULTIPLE_POST_CONSTRUCT_METHODS=e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=e.ARGUMENTS_LENGTH_MISMATCH=e.INVALID_DECORATOR_OPERATION=e.INVALID_TO_SELF_VALUE=e.INVALID_FUNCTION_BINDING=e.INVALID_MIDDLEWARE_RETURN=e.NO_MORE_SNAPSHOTS_AVAILABLE=e.INVALID_BINDING_TYPE=e.NOT_IMPLEMENTED=e.CIRCULAR_DEPENDENCY=e.UNDEFINED_INJECT_ANNOTATION=e.MISSING_INJECT_ANNOTATION=e.MISSING_INJECTABLE_ANNOTATION=e.NOT_REGISTERED=e.CANNOT_UNBIND=e.AMBIGUOUS_MATCH=e.KEY_NOT_FOUND=e.NULL_ARGUMENT=e.DUPLICATED_METADATA=e.DUPLICATED_INJECTABLE_DECORATOR=void 0,e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"@postConstruct error in class "+t[0]+": "+t[1]};e.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"It looks like there is a circular dependency in one of the '"+t[0]+"' bindings. Please investigate bindings withservice identifier '"+t[1]+"'."},e.STACK_OVERFLOW="Maximum call stack size exceeded"})),h=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var n=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(a.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(a.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(a.TAGGED_PROP,t)||[]},t}();e.MetadataReader=n})),p=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0;e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}})),f=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0,e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===l.STACK_OVERFLOW}})),d=n((function(t,e){function n(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function r(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||r(t.parentRequest,e))}function i(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}Object.defineProperty(e,"__esModule",{value:!0}),e.circularDependencyToException=e.listMetadataForTarget=e.listRegisteredBindingsForServiceIdentifier=e.getServiceIdentifierAsString=e.getFunctionName=void 0,e.getServiceIdentifierAsString=n,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var r="",o=n(t,e);return 0!==o.length&&(r="\nRegistered bindings:",o.forEach((function(t){var e="Object";null!==t.implementationType&&(e=i(t.implementationType)),r=r+"\n "+e,t.constraint.metaData&&(r=r+" - "+t.constraint.metaData)}))),r},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(r(e,e.serviceIdentifier)){var i=function(t){return function t(e,r){void 0===r&&(r=[]);var i=n(e.serviceIdentifier);return r.push(i),null!==e.parentRequest?t(e.parentRequest,r):r}(t).reverse().join(" --\x3e ")}(e);throw new Error(l.CIRCULAR_DEPENDENCY+" "+i)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",r=e.getNamedTag(),i=e.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t},e.getFunctionName=i})),y=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var n=function(){function t(t){this.id=u.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=n})),v=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var n=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===a.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=n})),g=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0,e.Plan=function(t,e){this.parentContext=t,this.rootRequest=e}})),m=n((function(t,e){function n(t,e,n,r,i){var o={},a="number"==typeof i,s=void 0!==i&&a?i.toString():n;if(a&&void 0!==n)throw new Error(l.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(o=Reflect.getMetadata(t,e));var u=o[s];if(Array.isArray(u))for(var c=0,h=u;h.length>c;c++){var p=h[c];if(p.key===r.key)throw new Error(l.DUPLICATED_METADATA+" "+p.key.toString())}else u=[];u.push(r),o[s]=u,Reflect.defineMetadata(t,o,e)}function r(t,e){Reflect.decorate(t,e)}function i(t,e){return function(n,r){e(n,r,t)}}Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0,e.tagParameter=function(t,e,r,i){n(a.TAGGED,t,e,i,r)},e.tagProperty=function(t,e,r){n(a.TAGGED_PROP,t.constructor,e,r)},e.decorate=function(t,e,n){"number"==typeof n?r([i(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):r([t],e)}})),T=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var n=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=n,e.inject=function(t){return function(e,n,r){if(void 0===t)throw new Error(l.UNDEFINED_INJECT_ANNOTATION(e.name));var i=new v.Metadata(a.INJECT_TAG,t);"number"==typeof r?m.tagParameter(e,n,r,i):m.tagProperty(e,n,i)}}})),b=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var n=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=n})),E=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var n=function(){function t(t,e,n,r){this.id=u.id(),this.type=t,this.serviceIdentifier=n,this.name=new b.QueryableString(e||""),this.metadata=new Array;var i=null;"string"==typeof r?i=new v.Metadata(a.NAMED_TAG,r):r instanceof v.Metadata&&(i=r),null!==i&&this.metadata.push(i)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;n.length>e;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(a.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(a.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(a.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return a.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(a.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===a.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return a.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(a.NAMED_TAG)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var r=0,i=e.metadata;i.length>r;r++){var o=i[r];if(o.key===t&&o.value===n)return!0}return!1}},t}();e.Target=n})),S=n((function(t,n){var r=e&&e.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;r>n;n++,i++)t[i]=e[n];return t};function i(t,e,n,i){var a=t.getConstructorMetadata(n),s=a.compilerGeneratedMetadata;if(void 0===s)throw new Error(l.MISSING_INJECTABLE_ANNOTATION+" "+e+".");var c=a.userGeneratedMetadata,h=Object.keys(c),p=function(t,e,n,r,i){for(var a=[],s=0;i>s;s++){var u=o(s,t,e,n,r);null!==u&&a.push(u)}return a}(i,e,s,c,0===n.length&&h.length>0||h.length>n.length?h.length:n.length),f=u(t,n);return r(r([],p),f)}function o(t,e,n,r,i){var o=i[t.toString()]||[],a=c(o),u=!0!==a.unmanaged,h=r[t],p=a.inject||a.multiInject;if((h=p||h)instanceof T.LazyServiceIdentifer&&(h=h.unwrap()),u){if(!e&&(h===Object||h===Function||void 0===h))throw new Error(l.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".");var f=new E.Target(s.TargetTypeEnum.ConstructorArgument,a.targetName,h);return f.metadata=o,f}return null}function u(t,e){for(var n=t.getPropertiesMetadata(e),i=[],o=0,a=Object.keys(n);a.length>o;o++){var l=a[o],h=n[l],p=c(n[l]),f=new E.Target(s.TargetTypeEnum.ClassProperty,p.targetName||l,p.inject||p.multiInject);f.metadata=h,i.push(f)}var d=Object.getPrototypeOf(e.prototype).constructor;if(d!==Object){var y=u(t,d);i=r(r([],i),y)}return i}function c(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[a.INJECT_TAG],multiInject:e[a.MULTI_INJECT_TAG],targetName:e[a.NAME_TAG],unmanaged:e[a.UNMANAGED_TAG]}}Object.defineProperty(n,"__esModule",{value:!0}),n.getFunctionName=n.getBaseClassDependencyCount=n.getDependencies=void 0,Object.defineProperty(n,"getFunctionName",{enumerable:!0,get:function(){return d.getFunctionName}}),n.getDependencies=function(t,e){return i(t,d.getFunctionName(e),e,!1)},n.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var o=i(e,d.getFunctionName(r),r,!0),s=o.map((function(t){return t.metadata.filter((function(t){return t.key===a.UNMANAGED_TAG}))})),u=[].concat.apply([],s).length,c=o.length-u;return c>0?c:t(e,r)}return 0}})),w=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var n=function(){function t(t,e,n,r,i){this.id=u.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=i,this.childRequests=[],this.bindings=Array.isArray(r)?r:[r],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();e.Request=n})),x=n((function(t,e){function n(t){return t._bindingDictionary}function r(t,e,n,r,i,o){var s=new v.Metadata(t?a.MULTI_INJECT_TAG:a.INJECT_TAG,n),u=new E.Target(e,r,n,s);if(void 0!==i){var c=new v.Metadata(i,o);u.metadata.push(c)}return u}function i(t,e,n,r,i){var o=u(n.container,i.serviceIdentifier),a=[];return o.length===p.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof i.serviceIdentifier&&t.getConstructorMetadata(i.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(i.serviceIdentifier).toSelf(),o=u(n.container,i.serviceIdentifier)),a=e?o:o.filter((function(t){var e=new w.Request(t.serviceIdentifier,n,r,t,i);return t.constraint(e)})),function(t,e,n,r){switch(e.length){case p.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var i=d.getServiceIdentifierAsString(t),o=l.NOT_REGISTERED;throw o+=d.listMetadataForTarget(i,n),o+=d.listRegisteredBindingsForServiceIdentifier(r,i,u),new Error(o);case p.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;default:if(n.isArray())return e;i=d.getServiceIdentifierAsString(t),o=l.AMBIGUOUS_MATCH+" "+i;throw o+=d.listRegisteredBindingsForServiceIdentifier(r,i,u),new Error(o)}}(i.serviceIdentifier,a,i,n.container),a}function o(t,e,n,r,a,u){var c,h;if(null===a){c=i(t,e,r,null,u),h=new w.Request(n,r,null,c,u);var p=new g.Plan(r,h);r.addPlan(p)}else c=i(t,e,r,a,u),h=a.addChildRequest(u.serviceIdentifier,c,u);c.forEach((function(e){var n=null;if(u.isArray())n=h.addChildRequest(e.serviceIdentifier,e,u);else{if(e.cache)return;n=h}if(e.type===s.BindingTypeEnum.Instance&&null!==e.implementationType){var i=S.getDependencies(t,e.implementationType);if(!r.container.options.skipBaseClassChecks)if(S.getBaseClassDependencyCount(t,e.implementationType)>i.length){var a=l.ARGUMENTS_LENGTH_MISMATCH(S.getFunctionName(e.implementationType));throw new Error(a)}i.forEach((function(e){o(t,!1,e.serviceIdentifier,r,n,e)}))}}))}function u(t,e){var r=[],i=n(t);return i.hasKey(e)?r=i.get(e):null!==t.parent&&(r=u(t.parent,e)),r}Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0,e.getBindingDictionary=n,e.plan=function(t,e,n,i,a,s,u,c){void 0===c&&(c=!1);var l=new y.Context(e),h=r(n,i,a,"",s,u);try{return o(t,c,a,l,null,h),l}catch(t){throw f.isStackOverflowExeption(t)&&l.plan&&d.circularDependencyToException(l.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new E.Target(s.TargetTypeEnum.Variable,"",e,new v.Metadata(n,r)),o=new y.Context(t);return new w.Request(e,o,null,[],i)}})),P=n((function(t,n){var r=e&&e.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;r>n;n++,i++)t[i]=e[n];return t};Object.defineProperty(n,"__esModule",{value:!0}),n.resolveInstance=void 0,n.resolveInstance=function(t,e,n){var i,o=null;if(e.length>0){var u=e.filter((function(t){return null!==t.target&&t.target.type===s.TargetTypeEnum.ConstructorArgument})).map(n);o=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===s.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value(),t[r]=i[n]})),t}(o=new((i=t).bind.apply(i,r([void 0],u))),e,n)}else o=new t;return function(t,e){if(Reflect.hasMetadata(a.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(a.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(l.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,o),o}})),k=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var n=function(t,e,n){try{return n()}catch(n){throw f.isStackOverflowExeption(n)?new Error(l.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},r=function(t){return function(e){e.parentContext.setCurrentRequest(e);var i=e.bindings,o=e.childRequests,a=e.target&&e.target.isArray(),u=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(a&&u)return o.map((function(e){return r(t)(e)}));var c=null;if(!e.target.isOptional()||0!==i.length){var h=i[0],p=h.scope===s.BindingScopeEnum.Singleton,f=h.scope===s.BindingScopeEnum.Request;if(p&&h.activated)return h.cache;if(f&&null!==t&&t.has(h.id))return t.get(h.id);if(h.type===s.BindingTypeEnum.ConstantValue)c=h.cache,h.activated=!0;else if(h.type===s.BindingTypeEnum.Function)c=h.cache,h.activated=!0;else if(h.type===s.BindingTypeEnum.Constructor)c=h.implementationType;else if(h.type===s.BindingTypeEnum.DynamicValue&&null!==h.dynamicValue)c=n("toDynamicValue",h.serviceIdentifier,(function(){return h.dynamicValue(e.parentContext)}));else if(h.type===s.BindingTypeEnum.Factory&&null!==h.factory)c=n("toFactory",h.serviceIdentifier,(function(){return h.factory(e.parentContext)}));else if(h.type===s.BindingTypeEnum.Provider&&null!==h.provider)c=n("toProvider",h.serviceIdentifier,(function(){return h.provider(e.parentContext)}));else{if(h.type!==s.BindingTypeEnum.Instance||null===h.implementationType){var y=d.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(l.INVALID_BINDING_TYPE+" "+y)}c=P.resolveInstance(h.implementationType,o,r(t))}return"function"==typeof h.onActivation&&(c=h.onActivation(e.parentContext,c)),p&&(h.cache=c,h.activated=!0),f&&null!==t&&!t.has(h.id)&&t.set(h.id,c),c}}};e.resolve=function(t){return r(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}})),C=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var n=function(t,e){var r=t.parentRequest;return null!==r&&(!!e(r)||n(r,e))};e.traverseAncerstors=n;var r=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new v.Metadata(t,e),n}};e.taggedConstraint=r;var i=r(a.NAMED_TAG);e.namedConstraint=i;e.typeConstraint=function(t){return function(e){return null!==e&&("string"==typeof t?e.bindings[0].serviceIdentifier===t:t===e.bindings[0].implementationType)}}})),N=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new _.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=C.namedConstraint(t),new _.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new _.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=C.taggedConstraint(t)(e),new _.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return C.typeConstraint(t)(e.parentRequest)},new _.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return C.namedConstraint(t)(e.parentRequest)},new _.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return C.taggedConstraint(t)(e)(n.parentRequest)},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return C.traverseAncerstors(e,C.typeConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!C.traverseAncerstors(e,C.typeConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return C.traverseAncerstors(e,C.namedConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!C.traverseAncerstors(e,C.namedConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return C.traverseAncerstors(n,C.taggedConstraint(t)(e))},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!C.traverseAncerstors(n,C.taggedConstraint(t)(e))},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return C.traverseAncerstors(e,t)},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!C.traverseAncerstors(e,t)},new _.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=n})),_=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new N.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=n})),M=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var n=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new N.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new _.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=n})),A=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=s.BindingScopeEnum.Request,new M.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=s.BindingScopeEnum.Singleton,new M.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=s.BindingScopeEnum.Transient,new M.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=n})),O=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var n=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new N.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new _.BindingOnSyntax(this._binding),this._bindingInSyntax=new A.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=n})),I=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=s.BindingTypeEnum.Instance,this._binding.implementationType=t,new O.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+l.INVALID_TO_SELF_VALUE);return this.to(this._binding.serviceIdentifier)},t.prototype.toConstantValue=function(t){return this._binding.type=s.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=s.BindingScopeEnum.Singleton,new M.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=s.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new O.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=s.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=s.BindingScopeEnum.Singleton,new M.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=s.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=s.BindingScopeEnum.Singleton,new M.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(l.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=s.BindingTypeEnum.Function,this._binding.scope=s.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=s.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=s.BindingScopeEnum.Singleton,new M.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=s.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=s.BindingScopeEnum.Singleton,new M.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=n})),R=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var n=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=n})),L=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var n=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(l.NULL_ARGUMENT);if(null==e)throw new Error(l.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(l.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(l.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(l.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(l.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,r){var i=n.filter((function(e){return!t(e)}));i.length>0?e._map.set(r,i):e._map.delete(r)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(l.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=n})),D=n((function(t,n){var r=e&&e.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=e&&e.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){a.label=o[1];break}if(6===o[0]&&i[1]>a.label){a.label=i[1],i=o;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},o=e&&e.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;r>n;n++,i++)t[i]=e[n];return t};Object.defineProperty(n,"__esModule",{value:!0}),n.Container=void 0;var p=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+l.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=s.BindingScopeEnum.Transient;else if(e.defaultScope!==s.BindingScopeEnum.Singleton&&e.defaultScope!==s.BindingScopeEnum.Transient&&e.defaultScope!==s.BindingScopeEnum.Request)throw new Error(""+l.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+l.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+l.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=u.id(),this._bindingDictionary=new L.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new h.MetadataReader}return t.merge=function(e,n){for(var r=[],i=2;arguments.length>i;i++)r[i-2]=arguments[i];var a=new t,s=o([e,n],r).map((function(t){return x.getBindingDictionary(t)})),u=x.getBindingDictionary(a);function c(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return s.forEach((function(t){c(t,u)})),a},t.prototype.load=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=t;i.length>r;r++){var o=i[r],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return r(this,void 0,void 0,(function(){var e,n,r,o,a;return i(this,(function(i){switch(i.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,r=t,i.label=1;case 1:return r.length>n?(a=e((o=r[n]).id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];var r=function(t){return function(e){return e.moduleId===t}};e.forEach((function(e){var n=r(e.id);t._bindingDictionary.removeByCondition(n)}))},t.prototype.bind=function(t){var e=new c.Binding(t,this.options.defaultScope||s.BindingScopeEnum.Transient);return this._bindingDictionary.add(t,e),new I.BindingToSyntax(e)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(l.CANNOT_UNBIND+" "+d.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new L.Lookup},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,a.NAMED_TAG,e)},t.prototype.isBoundTagged=function(t,e,n){var r=!1;if(this._bindingDictionary.hasKey(t)){var i=this._bindingDictionary.get(t),o=x.createMockRequest(this,t,e,n);r=i.some((function(t){return t.constraint(o)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(t,e,n)),r},t.prototype.snapshot=function(){this._snapshots.push(R.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(l.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=t.bindings,this._middleware=t.middleware},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];this._appliedMiddleware=this._appliedMiddleware.concat(t);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){return this._get(!1,!1,s.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,a.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,s.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,s.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,a.NAMED_TAG,e)},t.prototype.resolve=function(t){var e=this.createChild();return e.bind(t).toSelf(),this._appliedMiddleware.forEach((function(t){e.applyMiddleware(t)})),e.get(t)},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(r){var i=t.rebind.bind(t)(r);return e(i,n),i}};return function(r){return{bindFunction:(i=r,function(n){var r=t.bind.bind(t)(n);return e(r,i),r}),isboundFunction:function(e){return t.isBound.bind(t)(e)},rebindFunction:n(r),unbindFunction:function(e){t.unbind.bind(t)(e)}};var i}},t.prototype._get=function(t,e,n,r,i,o){var a=null,s={avoidConstraints:t,contextInterceptor:function(t){return t},isMultiInject:e,key:i,serviceIdentifier:r,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(s)))throw new Error(l.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(s);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=x.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),k.resolve(n)}},t}();n.Container=p})),U=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0,e.ContainerModule=function(t){this.id=u.id(),this.registry=t},e.AsyncContainerModule=function(t){this.id=u.id(),this.registry=t}})),F=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0,e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(a.PARAM_TYPES,t))throw new Error(l.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(a.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(a.PARAM_TYPES,e,t),t}}})),B=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0,e.tagged=function(t,e){return function(n,r,i){var o=new v.Metadata(t,e);"number"==typeof i?m.tagParameter(n,r,i,o):m.tagProperty(n,r,o)}}})),V=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0,e.named=function(t){return function(e,n,r){var i=new v.Metadata(a.NAMED_TAG,t);"number"==typeof r?m.tagParameter(e,n,r,i):m.tagProperty(e,n,i)}}})),G=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0,e.optional=function(){return function(t,e,n){var r=new v.Metadata(a.OPTIONAL_TAG,!0);"number"==typeof n?m.tagParameter(t,e,n,r):m.tagProperty(t,e,r)}}})),j=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0,e.unmanaged=function(){return function(t,e,n){var r=new v.Metadata(a.UNMANAGED_TAG,!0);m.tagParameter(t,e,n,r)}}})),H=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0,e.multiInject=function(t){return function(e,n,r){var i=new v.Metadata(a.MULTI_INJECT_TAG,t);"number"==typeof r?m.tagParameter(e,n,r,i):m.tagProperty(e,n,i)}}})),z=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0,e.targetName=function(t){return function(e,n,r){var i=new v.Metadata(a.NAME_TAG,t);m.tagParameter(e,n,r,i)}}})),W=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0,e.postConstruct=function(){return function(t,e,n){var r=new v.Metadata(a.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(a.POST_CONSTRUCT,t.constructor))throw new Error(l.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(a.POST_CONSTRUCT,r,t.constructor)}}})),Y=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0;e.multiBindToService=function(t){return function(e){return function(){for(var n=[],r=0;arguments.length>r;r++)n[r]=arguments[r];return n.forEach((function(n){return t.bind(n).toService(e)}))}}}})),q=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=e.getServiceIdentifierAsString=e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=e.decorate=e.id=e.MetadataReader=e.postConstruct=e.targetName=e.multiInject=e.unmanaged=e.optional=e.LazyServiceIdentifer=e.inject=e.named=e.tagged=e.injectable=e.ContainerModule=e.AsyncContainerModule=e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=e.Container=e.METADATA_KEY=void 0,e.METADATA_KEY=a,Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return D.Container}}),Object.defineProperty(e,"BindingScopeEnum",{enumerable:!0,get:function(){return s.BindingScopeEnum}}),Object.defineProperty(e,"BindingTypeEnum",{enumerable:!0,get:function(){return s.BindingTypeEnum}}),Object.defineProperty(e,"TargetTypeEnum",{enumerable:!0,get:function(){return s.TargetTypeEnum}}),Object.defineProperty(e,"AsyncContainerModule",{enumerable:!0,get:function(){return U.AsyncContainerModule}}),Object.defineProperty(e,"ContainerModule",{enumerable:!0,get:function(){return U.ContainerModule}}),Object.defineProperty(e,"injectable",{enumerable:!0,get:function(){return F.injectable}}),Object.defineProperty(e,"tagged",{enumerable:!0,get:function(){return B.tagged}}),Object.defineProperty(e,"named",{enumerable:!0,get:function(){return V.named}}),Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return T.inject}}),Object.defineProperty(e,"LazyServiceIdentifer",{enumerable:!0,get:function(){return T.LazyServiceIdentifer}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return G.optional}}),Object.defineProperty(e,"unmanaged",{enumerable:!0,get:function(){return j.unmanaged}}),Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return H.multiInject}}),Object.defineProperty(e,"targetName",{enumerable:!0,get:function(){return z.targetName}}),Object.defineProperty(e,"postConstruct",{enumerable:!0,get:function(){return W.postConstruct}}),Object.defineProperty(e,"MetadataReader",{enumerable:!0,get:function(){return h.MetadataReader}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return u.id}}),Object.defineProperty(e,"decorate",{enumerable:!0,get:function(){return m.decorate}}),Object.defineProperty(e,"traverseAncerstors",{enumerable:!0,get:function(){return C.traverseAncerstors}}),Object.defineProperty(e,"taggedConstraint",{enumerable:!0,get:function(){return C.taggedConstraint}}),Object.defineProperty(e,"namedConstraint",{enumerable:!0,get:function(){return C.namedConstraint}}),Object.defineProperty(e,"typeConstraint",{enumerable:!0,get:function(){return C.typeConstraint}}),Object.defineProperty(e,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return d.getServiceIdentifierAsString}}),Object.defineProperty(e,"multiBindToService",{enumerable:!0,get:function(){return Y.multiBindToService}})}));function X(t){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X(t)}function K(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Z(t,e,n){return e&&K(t.prototype,e),n&&K(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function J(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Q(t){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(t)}function $(t,e){return e.lifecycle===i.Lifecycle.singleton?function(t){return t.inSingletonScope()}(t):function(t){return t.inTransientScope()}(t)}function tt(t,e){t.whenTargetNamed(rt(e))}function et(t,e){return e.bind(it(t))}function nt(t,e){if(e.isBound(it(t)))try{return e.rebind(it(t))}catch(n){return e.bind(it(t))}return e.bind(it(t))}function rt(t){return o.isDefinedToken(t)?t.symbol:t}function it(t){return o.isDefinedToken(t)?t.symbol:t}!function(t){!function(n){var r="object"==typeof e?e:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(t);function o(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===r.Reflect?r.Reflect=t:i=o(r.Reflect,i),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return rt(Object.create(null))}:a?function(){return rt({__proto__:null})}:function(){return rt({})},has:s?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:s?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),l="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,f=new(l||"function"!=typeof WeakMap?nt():WeakMap);function d(t,e,n,r){if(L(n)){if(!z(t))throw new TypeError;if(!Y(e))throw new TypeError;return x(t,e)}if(!z(t))throw new TypeError;if(!F(e))throw new TypeError;if(!F(r)&&!L(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),P(t,e,n=H(n),r)}function y(t,e){function n(n,r){if(!F(n))throw new TypeError;if(!L(r)&&!q(r))throw new TypeError;A(t,e,n,r)}return n}function v(t,e,n,r){if(!F(n))throw new TypeError;return L(r)||(r=H(r)),A(t,e,n,r)}function g(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),C(t,e,n)}function m(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),N(t,e,n)}function T(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),_(t,e,n)}function b(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),M(t,e,n)}function E(t,e){if(!F(t))throw new TypeError;return L(e)||(e=H(e)),O(t,e)}function S(t,e){if(!F(t))throw new TypeError;return L(e)||(e=H(e)),I(t,e)}function w(t,e,n){if(!F(e))throw new TypeError;L(n)||(n=H(n));var r=k(e,n,!1);if(L(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=f.get(e);return i.delete(n),i.size>0||f.delete(e),!0}function x(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!L(r)&&!D(r)){if(!Y(r))throw new TypeError;e=r}}return e}function P(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!L(o)&&!D(o)){if(!F(o))throw new TypeError;r=o}}return r}function k(t,e,n){var r=f.get(t);if(L(r)){if(!n)return;r=new h,f.set(t,r)}var i=r.get(e);if(L(i)){if(!n)return;i=new h,r.set(e,i)}return i}function C(t,e,n){if(N(t,e,n))return!0;var r=$(e);return!D(r)&&C(t,r,n)}function N(t,e,n){var r=k(e,n,!1);return!L(r)&&G(r.has(t))}function _(t,e,n){if(N(t,e,n))return M(t,e,n);var r=$(e);return D(r)?void 0:_(t,r,n)}function M(t,e,n){var r=k(e,n,!1);if(!L(r))return r.get(t)}function A(t,e,n,r){k(n,r,!0).set(t,e)}function O(t,e){var n=I(t,e),r=$(t);if(null===r)return n;var i=O(r,e);if(0>=i.length)return n;if(0>=n.length)return i;for(var o=new p,a=[],s=0,u=n;u.length>s;s++){o.has(h=u[s])||(o.add(h),a.push(h))}for(var c=0,l=i;l.length>c;c++){var h;o.has(h=l[c])||(o.add(h),a.push(h))}return a}function I(t,e){var n=[],r=k(t,e,!1);if(L(r))return n;for(var i=K(r.keys()),o=0;;){var a=J(i);if(!a)return n.length=o,n;var s=Z(a);try{n[o]=s}catch(t){try{Q(i)}finally{throw t}}o++}}function R(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function L(t){return void 0===t}function D(t){return null===t}function U(t){return"symbol"==typeof t}function F(t){return"object"==typeof t?null!==t:"function"==typeof t}function B(t,e){switch(R(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",i=X(t,r);if(void 0!==i){var o=i.call(t,n);if(F(o))throw new TypeError;return o}return V(t,"default"===n?"number":n)}function V(t,e){if("string"===e){var n=t.toString;if(W(n))if(!F(i=n.call(t)))return i;if(W(r=t.valueOf))if(!F(i=r.call(t)))return i}else{var r;if(W(r=t.valueOf))if(!F(i=r.call(t)))return i;var i,o=t.toString;if(W(o))if(!F(i=o.call(t)))return i}throw new TypeError}function G(t){return!!t}function j(t){return""+t}function H(t){var e=B(t,3);return U(e)?e:j(e)}function z(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function W(t){return"function"==typeof t}function Y(t){return"function"==typeof t}function q(t){switch(R(t)){case 3:case 4:return!0;default:return!1}}function X(t,e){var n=t[e];if(null!=n){if(!W(n))throw new TypeError;return n}}function K(t){var e=X(t,i);if(!W(e))throw new TypeError;var n=e.call(t);if(!F(n))throw new TypeError;return n}function Z(t){return t.value}function J(t){var e=t.next();return!e.done&&e}function Q(t){var e=t.return;e&&e.call(t)}function $(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function tt(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&this._keys.length>t){var n=this._selector(this._keys[t],this._values[t]);return this._keys.length>t+1?this._index++:(this._index=-1,this._keys=e,this._values=e),{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw 0>this._index||(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return 0>this._index||(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return 0>e?void 0:this._values[e]},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;r>i;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,o)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),0>this._cacheIndex&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}function et(){return function(){function t(){this._map=new h}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}()}function nt(){var t=16,n=u.create(),r=i();return function(){function t(){this._key=i()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?u.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=i()},t}();function i(){var t;do{t="@@WeakMap@@"+c()}while(u.has(n,t));return n[t]=!0,t}function o(t,n){if(!e.call(t,r)){if(!n)return;Object.defineProperty(t,r,{value:u.create()})}return t[r]}function a(t,e){for(var n=0;e>n;++n)t[n]=255*Math.random()|0;return t}function s(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):a(new Uint8Array(t),t):a(new Array(t),t)}function c(){var e=s(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",r=0;t>r;++r){var i=e[r];4!==r&&6!==r&&8!==r||(n+="-"),16>i&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function rt(t){return t.__=void 0,delete t.__,t}t("decorate",d),t("metadata",y),t("defineMetadata",v),t("hasMetadata",g),t("hasOwnMetadata",m),t("getMetadata",T),t("getOwnMetadata",b),t("getMetadataKeys",E),t("getOwnMetadataKeys",S),t("deleteMetadata",w)}(i)}()}(r||(r={})),function(t){t.defineToken=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{multiple:!0};return new t.DefinedToken(e,n)};var e,n=Z((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};J(this,t),this.prototype={},this.name=void 0,this.multiple=void 0,this.symbol=void 0;var r=n.multiple,i=void 0!==r&&r;this.name=e,this.symbol=Symbol(this.name),this.multiple=i}));t.DefinedToken=n,t.isModule=function(t){return!!t&&"object"===X(t)&&"id"in t},function(t){t.singleton="singleton",t.transient="transient"}(e=t.Lifecycle||(t.Lifecycle={})),t.ClassOptionSymbol=Symbol("SyringeClassOptionSymbol"),t.DefaultOption={lifecycle:e.transient}}(i||(i={})),function(t){t.toArray=function(t){return Array.isArray(t)?t:void 0===t?[]:[t]},t.isClass=function(t){return!(!t||"function"!=typeof t||!("prototype"in t))},t.isDefinedToken=function(t){return!!(t&&"object"===X(t)&&"symbol"in t&&"multiple"in t)},t.isInjectOption=function(t){return!(!t||"object"!==X(t)||!("token"in t))},t.isNamedToken=function(t){return!!(t&&"object"===X(t)&&"token"in t&&"named"in t)},t.isMultipleEnabled=function(e){return t.isDefinedToken(e)&&e.multiple}}(o||(o={}));var ot=new q.Container;function at(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function st(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?at(Object(n),!0).forEach((function(e){ut(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):at(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ut(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ct(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=q.injectable();return function(n){Reflect.defineMetadata(i.ClassOptionSymbol,st(st({},t),{},{target:n}),n),e(n)}}function lt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ct(st(st({},t),{},{lifecycle:i.Lifecycle.singleton}))}function ht(t){return q.inject(it(t))}function pt(t){return q.named(rt(t))}var ft=Symbol("SyringeOptionSymbol");function dt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yt(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dt(Object(n),!0).forEach((function(e){vt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function vt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gt(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var mt=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.token=void 0,this.rawToken=void 0,this.named=void 0,this.generalToken=void 0,this.option=void 0,this.register=void 0,this.mutiple=void 0,this.register=e,this.token=n,this.option=r,this.rawToken=o.isNamedToken(n)?n.token:n,this.named=o.isNamedToken(n)?n.named:void 0,this.mutiple=!!this.named||o.isMultipleEnabled(this.rawToken),this.generalToken=this.rawToken}var e,n,r;return e=t,n=[{key:"resolve",value:function(){var t=this,e=this.register;(function(t){return t&&"object"===Q(t)&&"bind"in t&&"unbind"in t&&"rebind"in t&&"isBound"in t})(e)&&(this.mutiple?this.resolveMutilple(e):(this.resolveMono(e),!this.named&&this.option.contrib.length>0&&this.option.contrib.forEach((function(n){o.isMultipleEnabled(n)?et(n,e).toService(t.generalToken):nt(n,e).toService(t.generalToken)}))))}},{key:"resolveMono",value:function(t){if("useValue"in this.option)return nt(this.generalToken,t).toConstantValue(this.option.useValue);if(this.option.useDynamic.length>0){var e=this.option.useDynamic[this.option.useDynamic.length-1];return $(nt(this.generalToken,t).toDynamicValue((function(t){var n=Dt.getContainer(t.container);return e({container:n})})),this.option)}if(this.option.useFactory.length>0){var n=this.option.useFactory[this.option.useFactory.length-1];return nt(this.generalToken,t).toFactory((function(t){var e=Dt.getContainer(t.container);return n({container:e})}))}if(this.option.useClass.length>0){var r=this.option.useClass[this.option.useClass.length-1];return $(nt(this.generalToken,t).to(r),this.option)}}},{key:"resolveMutilple",value:function(t){var e=this,n=this.option.useClass.map((function(n){return $(et(e.generalToken,t).to(n),e.option)})),r=this.option.useDynamic.map((function(n){return $(et(e.generalToken,t).toDynamicValue((function(t){var e=Dt.getContainer(t.container);return n({container:e})})),e.option)})),i=this.option.useFactory.map((function(n){return et(e.generalToken,t).toFactory((function(t){var e=Dt.getContainer(t.container);return n({container:e})}))})),o="useValue"in this.option?et(this.generalToken,t).toConstantValue(this.option.useValue):void 0;this.named&&(n.forEach((function(t){return e.named&&tt(t,e.named)})),r.forEach((function(t){return e.named&&tt(t,e.named)})),i.forEach((function(t){return e.named&&tt(t,e.named)})),o&&tt(o,this.named))}}],r=[{key:"resolveTarget",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{try{var a=Reflect.getMetadata(ft,n);a&&t.resolveOption(e,a)}catch(t){}if(o.isClass(n))if(r.useClass){var s=o.toArray(r.useClass);s.unshift(n),r.useClass=s}else r.useClass=[n];var u;try{u=Reflect.getMetadata(i.ClassOptionSymbol,n)}catch(t){}if((u=yt(yt({},u||{}),r)).token){var c=o.toArray(u.token);c.unshift(n),u.token=c}else u.token=[n];t.resolveOption(e,u)}catch(t){}}},{key:"resolveOption",value:function(e,n){var r=function(t){var e=o.toArray(t.token),n=o.toArray(t.useClass),r=o.toArray(t.useDynamic),a=o.toArray(t.useFactory),s=o.toArray(t.contrib),u={token:e,useClass:n,lifecycle:s.length>0?i.Lifecycle.singleton:t.lifecycle||i.Lifecycle.transient,contrib:s,useDynamic:r,useFactory:a};return"useValue"in t&&(u.useValue=t.useValue),u}(yt(yt({},t.globalConfig),n));(0!==r.useClass.length||0!==r.useDynamic.length||0!==r.useFactory.length||"useValue"in r)&&r.token.forEach((function(n){new t(e,n,yt({},r)).resolve()}))}}],n&&gt(e.prototype,n),r&&gt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();mt.globalConfig=i.DefaultOption;var Tt=i.defineToken("ContributionProvider");function bt(t){return function(t){if(Array.isArray(t))return Et(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Et(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Et(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);e>n;n++)r[n]=t[n];return r}function St(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wt(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?St(Object(n),!0).forEach((function(e){xt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function xt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pt(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var kt=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.option={recursive:!1,cache:!0},this.services=void 0,this.serviceIdentifier=void 0,this.container=void 0,this.container=n,this.serviceIdentifier=e,r&&(this.option=wt(wt({},this.option),r))}var e,n,r;return e=t,n=[{key:"setServices",value:function(t){for(var e=[],n=this.container;n;){if(n.isBound(this.serviceIdentifier)){var r=n.getAll(this.serviceIdentifier);e.push.apply(e,bt(r))}n=t?n.parent:void 0}return e}},{key:"getContributions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=wt(wt({},this.option),t),n=e.cache,r=e.recursive;return n&&void 0!==this.services||(this.services=this.setServices(!!r)),this.services}}],n&&Pt(e.prototype,n),r&&Pt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Ct(t,e){return{token:{token:Tt,named:t},useDynamic:function(n){return new kt(t,n.container,e)},lifecycle:i.Lifecycle.singleton}}function Nt(t,e,n){t({token:{token:Tt,named:e},useDynamic:function(t){return new kt(e,t.container,n)},lifecycle:i.Lifecycle.singleton})}function _t(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Mt=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=void 0,this.inversifyModule=void 0,this.baseRegistry=void 0,this.optionCollection=void 0,this.inversifyRegister=function(t,e,r,i){var a={bind:t,unbind:e,isBound:r,rebind:i},s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o.isInjectOption(t)?mt.resolveOption(a,t):mt.resolveTarget(a,t,e)};n.baseRegistry&&n.baseRegistry(s),n.optionCollection&&n.optionCollection.forEach((function(t){return s(t)}))},this.baseRegistry=e,this.inversifyModule=new q.ContainerModule(this.inversifyRegister),this.id=this.inversifyModule.id}var e,n,r;return e=t,n=[{key:"options",get:function(){return this.optionCollection||(this.optionCollection=[]),this.optionCollection}},{key:"register",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return n.forEach((function(e){return t.options.push(e)})),this}},{key:"contribution",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return n.forEach((function(e){return t.options.push(Ct(e))})),this}}],n&&_t(e.prototype,n),r&&_t(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function At(t){return t&&"inversifyModule"in t}function Ot(t){return new Mt(t)}function It(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Rt,Lt=new Map,Dt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.loadedModules=[],this.container=void 0,this.inversify=!0,this.parent=void 0,this.container=e||new q.Container,t.setContainer(this.container,this)}var e,n,r;return e=t,n=[{key:"load",value:function(t,e){var n=this;return e||!this.loadedModules.includes(t.id)?(At(t)&&this.container.load(t.inversifyModule),this.loadedModules.push(t.id),{dispose:function(){n.unload(t)}}):(console.warn("Unsupported module."),{dispose:function(){}})}},{key:"unload",value:function(t){At(t)&&(this.container.unload(t.inversifyModule),this.loadedModules=this.loadedModules.filter((function(e){return e!==t.id})))}},{key:"remove",value:function(t){return this.container.unbind(it(t))}},{key:"get",value:function(t){return this.container.get(it(t))}},{key:"getNamed",value:function(t,e){return this.container.getNamed(it(t),rt(e))}},{key:"getAll",value:function(t){return this.container.getAll(it(t))}},{key:"getAllNamed",value:function(t,e){return this.container.getAllNamed(it(t),rt(e))}},{key:"isBound",value:function(t){return this.container.isBound(it(t))}},{key:"isBoundNamed",value:function(t,e){return this.container.isBoundNamed(it(t),rt(e))}},{key:"createChild",value:function(){var e=new t(this.container.createChild());return e.parent=this,e}},{key:"register",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o.isInjectOption(t)?mt.resolveOption(this.container,t):mt.resolveTarget(this.container,t,e)}}],r=[{key:"setContainer",value:function(t,e){return Lt.set(t.id,e)}},{key:"getContainer",value:function(e){var n=Lt.get(e.id);if(!n){var r=new t(e);return t.setContainer(e,r),r}return n}},{key:"config",value:function(t){mt.globalConfig=t}}],n&&It(e.prototype,n),r&&It(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Ut=new Dt(ot),Ft=Ut.register.bind(Ut),Bt=function(t){return function(e,n,r){pt(t)(e,n,r),ht(Tt)(e,n,r)}};!function(t){t.Provider=Tt,t.register=Nt}(Rt||(Rt={}));var Vt,Gt,jt,Ht,zt=Object.freeze({__proto__:null,postConstruct:q.postConstruct,optional:q.optional,unmanaged:q.unmanaged,decorate:q.decorate,injectable:ct,singleton:lt,transient:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ct(st(st({},t),{},{lifecycle:i.Lifecycle.transient}))},inject:ht,named:pt,Container:Dt,GlobalContainer:Ut,register:Ft,SyringeModule:Mt,isSyringeModule:At,Module:Ot,Provider:Tt,DefaultContributionProvider:kt,contrib:Bt,get Contribution(){return Rt},get Syringe(){return i},get Utils(){return o},OptionSymbol:ft,registerSideOption:function(t,e){Reflect.defineMetadata(ft,t,e)}});function Wt(t,e,n,r,i){Yt(t,e,n||0,r||t.length-1,i||Xt)}function Yt(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=e-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*u*(o-u)/o)*(0>a-o/2?-1:1);Yt(t,e,Math.max(n,Math.floor(e-a*u/o+c)),Math.min(r,Math.floor(e+(o-a)*u/o+c)),i)}var l=t[e],h=n,p=r;for(qt(t,n,e),i(t[r],l)>0&&qt(t,n,r);p>h;){for(qt(t,h,p),h++,p--;0>i(t[h],l);)h++;for(;i(t[p],l)>0;)p--}0===i(t[n],l)?qt(t,n,p):qt(t,++p,r),p>e||(n=p+1),e>p||(r=p-1)}}function qt(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Xt(t,e){return e>t?-1:t>e?1:0}class Kt{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!ae(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;e.children.length>o;o++){const a=e.children[o],s=e.leaf?r(a):a;ae(t,s)&&(e.leaf?n.push(a):oe(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n}collides(t){let e=this.data;if(!ae(t,e))return!1;const n=[];for(;e;){for(let r=0;e.children.length>r;r++){const i=e.children[r],o=e.leaf?this.toBBox(i):i;if(ae(t,o)){if(e.leaf||oe(t,o))return!0;n.push(i)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(let e=0;t.length>e;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(e.height>this.data.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=se([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),i=[],o=[];let a,s,u;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],a=o.pop(),u=!0),n.leaf){const r=Zt(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}u||n.leaf||!oe(n,r)?s?(a++,n=s.children[a],u=!1):n=null:(i.push(n),o.push(a),a=0,s=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const i=n-e+1;let o,a=this._maxEntries;if(a>=i)return o=se(t.slice(e,n+1)),Jt(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,r-1))),o=se([]),o.leaf=!1,o.height=r;const s=Math.ceil(i/a),u=s*Math.ceil(Math.sqrt(a));ue(t,e,n,u,this.compareMinX);for(let i=e;n>=i;i+=u){const e=Math.min(i+u-1,n);ue(t,i,e,s,this.compareMinY);for(let n=i;e>=n;n+=s){const i=Math.min(n+s-1,e);o.children.push(this._build(t,n,i,r-1))}}return Jt(o,this.toBBox),o}_chooseSubtree(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){let n,r=1/0,a=1/0;for(let s=0;e.children.length>s;s++){const u=e.children[s],c=ne(u),l=(i=t,o=u,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-c);a>l?(a=l,r=r>c?c:r,n=u):l===a&&r>c&&(r=c,n=u)}e=n||e.children[0]}var i,o;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),$t(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=se(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,Jt(n,this.toBBox),Jt(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=se([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Jt(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let a=e;n-e>=a;a++){const e=Qt(t,0,a,this.toBBox),s=Qt(t,a,n,this.toBBox),u=ie(e,s),c=ne(e)+ne(s);i>u?(i=u,r=a,o=o>c?c:o):u===i&&o>c&&(o=c,r=a)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:te,i=t.leaf?this.compareMinY:ee,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this.toBBox,o=Qt(t,0,e,i),a=Qt(t,n-e,n,i);let s=re(o)+re(a);for(let r=e;n-e>r;r++){const e=t.children[r];$t(o,t.leaf?i(e):e),s+=re(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];$t(a,t.leaf?i(e):e),s+=re(a)}return s}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)$t(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():Jt(t[n],this.toBBox)}}function Zt(t,e,n){if(!n)return e.indexOf(t);for(let r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function Jt(t,e){Qt(t,0,t.children.length,e,t)}function Qt(t,e,n,r,i){i||(i=se(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;n>o;o++){const e=t.children[o];$t(i,t.leaf?r(e):e)}return i}function $t(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function te(t,e){return t.minX-e.minX}function ee(t,e){return t.minY-e.minY}function ne(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function re(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ie(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function oe(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function ae(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function se(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ue(t,e,n,r,i){const o=[e,n];for(;o.length;){if(r>=(n=o.pop())-(e=o.pop()))continue;const a=e+Math.ceil((n-e)/r/2)*r;Wt(t,a,e,n,i),o.push(e,a,a,n)}}function ce(t,e,n,r){var i,o=arguments.length,a=3>o?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(3>o?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function le(t,e){return function(n,r){e(n,r,t)}}function he(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function pe(){
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var r,i,o=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.NON_CUSTOM_TAG_KEYS=e.POST_CONSTRUCT=e.DESIGN_PARAM_TYPES=e.PARAM_TYPES=e.TAGGED_PROP=e.TAGGED=e.MULTI_INJECT_TAG=e.INJECT_TAG=e.OPTIONAL_TAG=e.UNMANAGED_TAG=e.NAME_TAG=e.NAMED_TAG=void 0,e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct",e.NON_CUSTOM_TAG_KEYS=[e.INJECT_TAG,e.MULTI_INJECT_TAG,e.NAME_TAG,e.UNMANAGED_TAG,e.NAMED_TAG,e.OPTIONAL_TAG]})),a=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0;e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"};e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}})),s=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}})),u=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var n=function(){function t(t,e){this.id=s.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=a.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===a.BindingScopeEnum.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.cache=this.cache,e},t}();e.Binding=n})),c=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.STACK_OVERFLOW=e.CIRCULAR_DEPENDENCY_IN_FACTORY=e.POST_CONSTRUCT_ERROR=e.MULTIPLE_POST_CONSTRUCT_METHODS=e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=e.ARGUMENTS_LENGTH_MISMATCH=e.INVALID_DECORATOR_OPERATION=e.INVALID_TO_SELF_VALUE=e.INVALID_FUNCTION_BINDING=e.INVALID_MIDDLEWARE_RETURN=e.NO_MORE_SNAPSHOTS_AVAILABLE=e.INVALID_BINDING_TYPE=e.NOT_IMPLEMENTED=e.CIRCULAR_DEPENDENCY=e.UNDEFINED_INJECT_ANNOTATION=e.MISSING_INJECT_ANNOTATION=e.MISSING_INJECTABLE_ANNOTATION=e.NOT_REGISTERED=e.CANNOT_UNBIND=e.AMBIGUOUS_MATCH=e.KEY_NOT_FOUND=e.NULL_ARGUMENT=e.DUPLICATED_METADATA=e.DUPLICATED_INJECTABLE_DECORATOR=void 0,e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"@postConstruct error in class "+t[0]+": "+t[1]};e.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"It looks like there is a circular dependency in one of the '"+t[0]+"' bindings. Please investigate bindings withservice identifier '"+t[1]+"'."},e.STACK_OVERFLOW="Maximum call stack size exceeded"})),l=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var n=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(o.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(o.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(o.TAGGED_PROP,t)||[]},t}();e.MetadataReader=n})),h=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0;e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}})),p=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0,e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===c.STACK_OVERFLOW}})),f=n((function(t,e){function n(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function r(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||r(t.parentRequest,e))}function i(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}Object.defineProperty(e,"__esModule",{value:!0}),e.circularDependencyToException=e.listMetadataForTarget=e.listRegisteredBindingsForServiceIdentifier=e.getServiceIdentifierAsString=e.getFunctionName=void 0,e.getServiceIdentifierAsString=n,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var r="",o=n(t,e);return 0!==o.length&&(r="\nRegistered bindings:",o.forEach((function(t){var e="Object";null!==t.implementationType&&(e=i(t.implementationType)),r=r+"\n "+e,t.constraint.metaData&&(r=r+" - "+t.constraint.metaData)}))),r},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(r(e,e.serviceIdentifier)){var i=function(t){return function t(e,r){void 0===r&&(r=[]);var i=n(e.serviceIdentifier);return r.push(i),null!==e.parentRequest?t(e.parentRequest,r):r}(t).reverse().join(" --\x3e ")}(e);throw new Error(c.CIRCULAR_DEPENDENCY+" "+i)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",r=e.getNamedTag(),i=e.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t},e.getFunctionName=i})),d=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var n=function(){function t(t){this.id=s.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=n})),y=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var n=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===o.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=n})),v=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0,e.Plan=function(t,e){this.parentContext=t,this.rootRequest=e}})),g=n((function(t,e){function n(t,e,n,r,i){var o={},a="number"==typeof i,s=void 0!==i&&a?i.toString():n;if(a&&void 0!==n)throw new Error(c.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(o=Reflect.getMetadata(t,e));var u=o[s];if(Array.isArray(u))for(var l=0,h=u;h.length>l;l++){var p=h[l];if(p.key===r.key)throw new Error(c.DUPLICATED_METADATA+" "+p.key.toString())}else u=[];u.push(r),o[s]=u,Reflect.defineMetadata(t,o,e)}function r(t,e){Reflect.decorate(t,e)}function i(t,e){return function(n,r){e(n,r,t)}}Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0,e.tagParameter=function(t,e,r,i){n(o.TAGGED,t,e,i,r)},e.tagProperty=function(t,e,r){n(o.TAGGED_PROP,t.constructor,e,r)},e.decorate=function(t,e,n){"number"==typeof n?r([i(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):r([t],e)}})),m=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var n=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=n,e.inject=function(t){return function(e,n,r){if(void 0===t)throw new Error(c.UNDEFINED_INJECT_ANNOTATION(e.name));var i=new y.Metadata(o.INJECT_TAG,t);"number"==typeof r?g.tagParameter(e,n,r,i):g.tagProperty(e,n,i)}}})),T=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var n=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=n})),b=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var n=function(){function t(t,e,n,r){this.id=s.id(),this.type=t,this.serviceIdentifier=n,this.name=new T.QueryableString(e||""),this.metadata=new Array;var i=null;"string"==typeof r?i=new y.Metadata(o.NAMED_TAG,r):r instanceof y.Metadata&&(i=r),null!==i&&this.metadata.push(i)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;n.length>e;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(o.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(o.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(o.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return o.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(o.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===o.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return o.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(o.NAMED_TAG)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var r=0,i=e.metadata;i.length>r;r++){var o=i[r];if(o.key===t&&o.value===n)return!0}return!1}},t}();e.Target=n})),S=n((function(t,n){var r=e&&e.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;r>n;n++,i++)t[i]=e[n];return t};function i(t,e,n,i){var o=t.getConstructorMetadata(n),a=o.compilerGeneratedMetadata;if(void 0===a)throw new Error(c.MISSING_INJECTABLE_ANNOTATION+" "+e+".");var l=o.userGeneratedMetadata,h=Object.keys(l),p=function(t,e,n,r,i){for(var o=[],a=0;i>a;a++){var u=s(a,t,e,n,r);null!==u&&o.push(u)}return o}(i,e,a,l,0===n.length&&h.length>0||h.length>n.length?h.length:n.length),f=u(t,n);return r(r([],p),f)}function s(t,e,n,r,i){var o=i[t.toString()]||[],s=l(o),u=!0!==s.unmanaged,h=r[t],p=s.inject||s.multiInject;if((h=p||h)instanceof m.LazyServiceIdentifer&&(h=h.unwrap()),u){if(!e&&(h===Object||h===Function||void 0===h))throw new Error(c.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".");var f=new b.Target(a.TargetTypeEnum.ConstructorArgument,s.targetName,h);return f.metadata=o,f}return null}function u(t,e){for(var n=t.getPropertiesMetadata(e),i=[],o=0,s=Object.keys(n);s.length>o;o++){var c=s[o],h=n[c],p=l(n[c]),f=new b.Target(a.TargetTypeEnum.ClassProperty,p.targetName||c,p.inject||p.multiInject);f.metadata=h,i.push(f)}var d=Object.getPrototypeOf(e.prototype).constructor;if(d!==Object){var y=u(t,d);i=r(r([],i),y)}return i}function l(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[o.INJECT_TAG],multiInject:e[o.MULTI_INJECT_TAG],targetName:e[o.NAME_TAG],unmanaged:e[o.UNMANAGED_TAG]}}Object.defineProperty(n,"__esModule",{value:!0}),n.getFunctionName=n.getBaseClassDependencyCount=n.getDependencies=void 0,Object.defineProperty(n,"getFunctionName",{enumerable:!0,get:function(){return f.getFunctionName}}),n.getDependencies=function(t,e){return i(t,f.getFunctionName(e),e,!1)},n.getBaseClassDependencyCount=function t(e,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var a=i(e,f.getFunctionName(r),r,!0),s=a.map((function(t){return t.metadata.filter((function(t){return t.key===o.UNMANAGED_TAG}))})),u=[].concat.apply([],s).length,c=a.length-u;return c>0?c:t(e,r)}return 0}})),E=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var n=function(){function t(t,e,n,r,i){this.id=s.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=i,this.childRequests=[],this.bindings=Array.isArray(r)?r:[r],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();e.Request=n})),w=n((function(t,e){function n(t){return t._bindingDictionary}function r(t,e,n,r,i,a){var s=new y.Metadata(t?o.MULTI_INJECT_TAG:o.INJECT_TAG,n),u=new b.Target(e,r,n,s);if(void 0!==i){var c=new y.Metadata(i,a);u.metadata.push(c)}return u}function i(t,e,n,r,i){var o=u(n.container,i.serviceIdentifier),a=[];return o.length===h.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof i.serviceIdentifier&&t.getConstructorMetadata(i.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(i.serviceIdentifier).toSelf(),o=u(n.container,i.serviceIdentifier)),a=e?o:o.filter((function(t){var e=new E.Request(t.serviceIdentifier,n,r,t,i);return t.constraint(e)})),function(t,e,n,r){switch(e.length){case h.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var i=f.getServiceIdentifierAsString(t),o=c.NOT_REGISTERED;throw o+=f.listMetadataForTarget(i,n),o+=f.listRegisteredBindingsForServiceIdentifier(r,i,u),new Error(o);case h.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;default:if(n.isArray())return e;i=f.getServiceIdentifierAsString(t),o=c.AMBIGUOUS_MATCH+" "+i;throw o+=f.listRegisteredBindingsForServiceIdentifier(r,i,u),new Error(o)}}(i.serviceIdentifier,a,i,n.container),a}function s(t,e,n,r,o,u){var l,h;if(null===o){l=i(t,e,r,null,u),h=new E.Request(n,r,null,l,u);var p=new v.Plan(r,h);r.addPlan(p)}else l=i(t,e,r,o,u),h=o.addChildRequest(u.serviceIdentifier,l,u);l.forEach((function(e){var n=null;if(u.isArray())n=h.addChildRequest(e.serviceIdentifier,e,u);else{if(e.cache)return;n=h}if(e.type===a.BindingTypeEnum.Instance&&null!==e.implementationType){var i=S.getDependencies(t,e.implementationType);if(!r.container.options.skipBaseClassChecks)if(S.getBaseClassDependencyCount(t,e.implementationType)>i.length){var o=c.ARGUMENTS_LENGTH_MISMATCH(S.getFunctionName(e.implementationType));throw new Error(o)}i.forEach((function(e){s(t,!1,e.serviceIdentifier,r,n,e)}))}}))}function u(t,e){var r=[],i=n(t);return i.hasKey(e)?r=i.get(e):null!==t.parent&&(r=u(t.parent,e)),r}Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0,e.getBindingDictionary=n,e.plan=function(t,e,n,i,o,a,u,c){void 0===c&&(c=!1);var l=new d.Context(e),h=r(n,i,o,"",a,u);try{return s(t,c,o,l,null,h),l}catch(t){throw p.isStackOverflowExeption(t)&&l.plan&&f.circularDependencyToException(l.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,r){var i=new b.Target(a.TargetTypeEnum.Variable,"",e,new y.Metadata(n,r)),o=new d.Context(t);return new E.Request(e,o,null,[],i)}})),x=n((function(t,n){var r=e&&e.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;r>n;n++,i++)t[i]=e[n];return t};Object.defineProperty(n,"__esModule",{value:!0}),n.resolveInstance=void 0,n.resolveInstance=function(t,e,n){var i,s=null;if(e.length>0){var u=e.filter((function(t){return null!==t.target&&t.target.type===a.TargetTypeEnum.ConstructorArgument})).map(n);s=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===a.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value(),t[r]=i[n]})),t}(s=new((i=t).bind.apply(i,r([void 0],u))),e,n)}else s=new t;return function(t,e){if(Reflect.hasMetadata(o.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(o.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(c.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,s),s}})),k=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var n=function(t,e,n){try{return n()}catch(n){throw p.isStackOverflowExeption(n)?new Error(c.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},r=function(t){return function(e){e.parentContext.setCurrentRequest(e);var i=e.bindings,o=e.childRequests,s=e.target&&e.target.isArray(),u=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(s&&u)return o.map((function(e){return r(t)(e)}));var l=null;if(!e.target.isOptional()||0!==i.length){var h=i[0],p=h.scope===a.BindingScopeEnum.Singleton,d=h.scope===a.BindingScopeEnum.Request;if(p&&h.activated)return h.cache;if(d&&null!==t&&t.has(h.id))return t.get(h.id);if(h.type===a.BindingTypeEnum.ConstantValue)l=h.cache,h.activated=!0;else if(h.type===a.BindingTypeEnum.Function)l=h.cache,h.activated=!0;else if(h.type===a.BindingTypeEnum.Constructor)l=h.implementationType;else if(h.type===a.BindingTypeEnum.DynamicValue&&null!==h.dynamicValue)l=n("toDynamicValue",h.serviceIdentifier,(function(){return h.dynamicValue(e.parentContext)}));else if(h.type===a.BindingTypeEnum.Factory&&null!==h.factory)l=n("toFactory",h.serviceIdentifier,(function(){return h.factory(e.parentContext)}));else if(h.type===a.BindingTypeEnum.Provider&&null!==h.provider)l=n("toProvider",h.serviceIdentifier,(function(){return h.provider(e.parentContext)}));else{if(h.type!==a.BindingTypeEnum.Instance||null===h.implementationType){var y=f.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(c.INVALID_BINDING_TYPE+" "+y)}l=x.resolveInstance(h.implementationType,o,r(t))}return"function"==typeof h.onActivation&&(l=h.onActivation(e.parentContext,l)),p&&(h.cache=l,h.activated=!0),d&&null!==t&&!t.has(h.id)&&t.set(h.id,l),l}}};e.resolve=function(t){return r(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}})),P=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var n=function(t,e){var r=t.parentRequest;return null!==r&&(!!e(r)||n(r,e))};e.traverseAncerstors=n;var r=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new y.Metadata(t,e),n}};e.taggedConstraint=r;var i=r(o.NAMED_TAG);e.namedConstraint=i;e.typeConstraint=function(t){return function(e){return null!==e&&("string"==typeof t?e.bindings[0].serviceIdentifier===t:t===e.bindings[0].implementationType)}}})),C=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new _.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=P.namedConstraint(t),new _.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new _.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=P.taggedConstraint(t)(e),new _.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return P.typeConstraint(t)(e.parentRequest)},new _.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return P.namedConstraint(t)(e.parentRequest)},new _.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return P.taggedConstraint(t)(e)(n.parentRequest)},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return P.traverseAncerstors(e,P.typeConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!P.traverseAncerstors(e,P.typeConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return P.traverseAncerstors(e,P.namedConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!P.traverseAncerstors(e,P.namedConstraint(t))},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return P.traverseAncerstors(n,P.taggedConstraint(t)(e))},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!P.traverseAncerstors(n,P.taggedConstraint(t)(e))},new _.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return P.traverseAncerstors(e,t)},new _.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!P.traverseAncerstors(e,t)},new _.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=n})),_=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new C.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=n})),N=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var n=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new C.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new _.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=n})),M=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=a.BindingScopeEnum.Request,new N.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=a.BindingScopeEnum.Singleton,new N.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=a.BindingScopeEnum.Transient,new N.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=n})),A=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var n=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new C.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new _.BindingOnSyntax(this._binding),this._bindingInSyntax=new M.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=n})),O=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=a.BindingTypeEnum.Instance,this._binding.implementationType=t,new A.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+c.INVALID_TO_SELF_VALUE);return this.to(this._binding.serviceIdentifier)},t.prototype.toConstantValue=function(t){return this._binding.type=a.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=a.BindingScopeEnum.Singleton,new N.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=a.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new A.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=a.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=a.BindingScopeEnum.Singleton,new N.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=a.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=a.BindingScopeEnum.Singleton,new N.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(c.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=a.BindingTypeEnum.Function,this._binding.scope=a.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=a.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=a.BindingScopeEnum.Singleton,new N.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=a.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=a.BindingScopeEnum.Singleton,new N.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=n})),I=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var n=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=n})),R=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var n=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(c.NULL_ARGUMENT);if(null==e)throw new Error(c.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(c.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(c.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(c.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(c.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,r){var i=n.filter((function(e){return!t(e)}));i.length>0?e._map.set(r,i):e._map.delete(r)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(c.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=n})),L=n((function(t,n){var r=e&&e.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=e&&e.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&i[3]>o[1])){a.label=o[1];break}if(6===o[0]&&i[1]>a.label){a.label=i[1],i=o;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},h=e&&e.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;r>n;n++,i++)t[i]=e[n];return t};Object.defineProperty(n,"__esModule",{value:!0}),n.Container=void 0;var p=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+c.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=a.BindingScopeEnum.Transient;else if(e.defaultScope!==a.BindingScopeEnum.Singleton&&e.defaultScope!==a.BindingScopeEnum.Transient&&e.defaultScope!==a.BindingScopeEnum.Request)throw new Error(""+c.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+c.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+c.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=s.id(),this._bindingDictionary=new R.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new l.MetadataReader}return t.merge=function(e,n){for(var r=[],i=2;arguments.length>i;i++)r[i-2]=arguments[i];var o=new t,a=h([e,n],r).map((function(t){return w.getBindingDictionary(t)})),s=w.getBindingDictionary(o);function u(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return a.forEach((function(t){u(t,s)})),o},t.prototype.load=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=t;i.length>r;r++){var o=i[r],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return r(this,void 0,void 0,(function(){var e,n,r,o,a;return i(this,(function(i){switch(i.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,r=t,i.label=1;case 1:return r.length>n?(a=e((o=r[n]).id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];var r=function(t){return function(e){return e.moduleId===t}};e.forEach((function(e){var n=r(e.id);t._bindingDictionary.removeByCondition(n)}))},t.prototype.bind=function(t){var e=new u.Binding(t,this.options.defaultScope||a.BindingScopeEnum.Transient);return this._bindingDictionary.add(t,e),new O.BindingToSyntax(e)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(c.CANNOT_UNBIND+" "+f.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new R.Lookup},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,o.NAMED_TAG,e)},t.prototype.isBoundTagged=function(t,e,n){var r=!1;if(this._bindingDictionary.hasKey(t)){var i=this._bindingDictionary.get(t),o=w.createMockRequest(this,t,e,n);r=i.some((function(t){return t.constraint(o)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(t,e,n)),r},t.prototype.snapshot=function(){this._snapshots.push(I.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(c.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=t.bindings,this._middleware=t.middleware},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];this._appliedMiddleware=this._appliedMiddleware.concat(t);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){return this._get(!1,!1,a.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,a.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,o.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,a.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,a.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,o.NAMED_TAG,e)},t.prototype.resolve=function(t){var e=this.createChild();return e.bind(t).toSelf(),this._appliedMiddleware.forEach((function(t){e.applyMiddleware(t)})),e.get(t)},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(r){var i=t.rebind.bind(t)(r);return e(i,n),i}};return function(r){return{bindFunction:(i=r,function(n){var r=t.bind.bind(t)(n);return e(r,i),r}),isboundFunction:function(e){return t.isBound.bind(t)(e)},rebindFunction:n(r),unbindFunction:function(e){t.unbind.bind(t)(e)}};var i}},t.prototype._get=function(t,e,n,r,i,o){var a=null,s={avoidConstraints:t,contextInterceptor:function(t){return t},isMultiInject:e,key:i,serviceIdentifier:r,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(s)))throw new Error(c.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(s);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=w.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),k.resolve(n)}},t}();n.Container=p})),D=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0,e.ContainerModule=function(t){this.id=s.id(),this.registry=t},e.AsyncContainerModule=function(t){this.id=s.id(),this.registry=t}})),U=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0,e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(o.PARAM_TYPES,t))throw new Error(c.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(o.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(o.PARAM_TYPES,e,t),t}}})),F=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0,e.tagged=function(t,e){return function(n,r,i){var o=new y.Metadata(t,e);"number"==typeof i?g.tagParameter(n,r,i,o):g.tagProperty(n,r,o)}}})),B=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0,e.named=function(t){return function(e,n,r){var i=new y.Metadata(o.NAMED_TAG,t);"number"==typeof r?g.tagParameter(e,n,r,i):g.tagProperty(e,n,i)}}})),V=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0,e.optional=function(){return function(t,e,n){var r=new y.Metadata(o.OPTIONAL_TAG,!0);"number"==typeof n?g.tagParameter(t,e,n,r):g.tagProperty(t,e,r)}}})),G=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0,e.unmanaged=function(){return function(t,e,n){var r=new y.Metadata(o.UNMANAGED_TAG,!0);g.tagParameter(t,e,n,r)}}})),j=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0,e.multiInject=function(t){return function(e,n,r){var i=new y.Metadata(o.MULTI_INJECT_TAG,t);"number"==typeof r?g.tagParameter(e,n,r,i):g.tagProperty(e,n,i)}}})),H=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0,e.targetName=function(t){return function(e,n,r){var i=new y.Metadata(o.NAME_TAG,t);g.tagParameter(e,n,r,i)}}})),z=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0,e.postConstruct=function(){return function(t,e,n){var r=new y.Metadata(o.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(o.POST_CONSTRUCT,t.constructor))throw new Error(c.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(o.POST_CONSTRUCT,r,t.constructor)}}})),W=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0;e.multiBindToService=function(t){return function(e){return function(){for(var n=[],r=0;arguments.length>r;r++)n[r]=arguments[r];return n.forEach((function(n){return t.bind(n).toService(e)}))}}}})),Y=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=e.getServiceIdentifierAsString=e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=e.decorate=e.id=e.MetadataReader=e.postConstruct=e.targetName=e.multiInject=e.unmanaged=e.optional=e.LazyServiceIdentifer=e.inject=e.named=e.tagged=e.injectable=e.ContainerModule=e.AsyncContainerModule=e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=e.Container=e.METADATA_KEY=void 0,e.METADATA_KEY=o,Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return L.Container}}),Object.defineProperty(e,"BindingScopeEnum",{enumerable:!0,get:function(){return a.BindingScopeEnum}}),Object.defineProperty(e,"BindingTypeEnum",{enumerable:!0,get:function(){return a.BindingTypeEnum}}),Object.defineProperty(e,"TargetTypeEnum",{enumerable:!0,get:function(){return a.TargetTypeEnum}}),Object.defineProperty(e,"AsyncContainerModule",{enumerable:!0,get:function(){return D.AsyncContainerModule}}),Object.defineProperty(e,"ContainerModule",{enumerable:!0,get:function(){return D.ContainerModule}}),Object.defineProperty(e,"injectable",{enumerable:!0,get:function(){return U.injectable}}),Object.defineProperty(e,"tagged",{enumerable:!0,get:function(){return F.tagged}}),Object.defineProperty(e,"named",{enumerable:!0,get:function(){return B.named}}),Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return m.inject}}),Object.defineProperty(e,"LazyServiceIdentifer",{enumerable:!0,get:function(){return m.LazyServiceIdentifer}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return V.optional}}),Object.defineProperty(e,"unmanaged",{enumerable:!0,get:function(){return G.unmanaged}}),Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return j.multiInject}}),Object.defineProperty(e,"targetName",{enumerable:!0,get:function(){return H.targetName}}),Object.defineProperty(e,"postConstruct",{enumerable:!0,get:function(){return z.postConstruct}}),Object.defineProperty(e,"MetadataReader",{enumerable:!0,get:function(){return l.MetadataReader}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return s.id}}),Object.defineProperty(e,"decorate",{enumerable:!0,get:function(){return g.decorate}}),Object.defineProperty(e,"traverseAncerstors",{enumerable:!0,get:function(){return P.traverseAncerstors}}),Object.defineProperty(e,"taggedConstraint",{enumerable:!0,get:function(){return P.taggedConstraint}}),Object.defineProperty(e,"namedConstraint",{enumerable:!0,get:function(){return P.namedConstraint}}),Object.defineProperty(e,"typeConstraint",{enumerable:!0,get:function(){return P.typeConstraint}}),Object.defineProperty(e,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return f.getServiceIdentifierAsString}}),Object.defineProperty(e,"multiBindToService",{enumerable:!0,get:function(){return W.multiBindToService}})}));function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function X(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function K(t,e,n){return e&&X(t.prototype,e),n&&X(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Z(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function J(t){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(t)}function Q(e,n){return n.lifecycle===t.Syringe.Lifecycle.singleton?function(t){return t.inSingletonScope()}(e):function(t){return t.inTransientScope()}(e)}function $(t,e){t.whenTargetNamed(nt(e))}function tt(t,e){return e.bind(rt(t))}function et(t,e){if(e.isBound(rt(t)))try{return e.rebind(rt(t))}catch(n){return e.bind(rt(t))}return e.bind(rt(t))}function nt(e){return t.Utils.isDefinedToken(e)?e.symbol:e}function rt(e){return t.Utils.isDefinedToken(e)?e.symbol:e}!function(t){!function(n){var r="object"==typeof e?e:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(t);function o(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===r.Reflect?r.Reflect=t:i=o(r.Reflect,i),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return rt(Object.create(null))}:a?function(){return rt({__proto__:null})}:function(){return rt({})},has:s?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:s?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},c=Object.getPrototypeOf(Function),l="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,f=new(l||"function"!=typeof WeakMap?nt():WeakMap);function d(t,e,n,r){if(L(n)){if(!z(t))throw new TypeError;if(!Y(e))throw new TypeError;return x(t,e)}if(!z(t))throw new TypeError;if(!F(e))throw new TypeError;if(!F(r)&&!L(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),k(t,e,n=H(n),r)}function y(t,e){function n(n,r){if(!F(n))throw new TypeError;if(!L(r)&&!q(r))throw new TypeError;A(t,e,n,r)}return n}function v(t,e,n,r){if(!F(n))throw new TypeError;return L(r)||(r=H(r)),A(t,e,n,r)}function g(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),C(t,e,n)}function m(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),_(t,e,n)}function T(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),N(t,e,n)}function b(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),M(t,e,n)}function S(t,e){if(!F(t))throw new TypeError;return L(e)||(e=H(e)),O(t,e)}function E(t,e){if(!F(t))throw new TypeError;return L(e)||(e=H(e)),I(t,e)}function w(t,e,n){if(!F(e))throw new TypeError;L(n)||(n=H(n));var r=P(e,n,!1);if(L(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=f.get(e);return i.delete(n),i.size>0||f.delete(e),!0}function x(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!L(r)&&!D(r)){if(!Y(r))throw new TypeError;e=r}}return e}function k(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!L(o)&&!D(o)){if(!F(o))throw new TypeError;r=o}}return r}function P(t,e,n){var r=f.get(t);if(L(r)){if(!n)return;r=new h,f.set(t,r)}var i=r.get(e);if(L(i)){if(!n)return;i=new h,r.set(e,i)}return i}function C(t,e,n){if(_(t,e,n))return!0;var r=$(e);return!D(r)&&C(t,r,n)}function _(t,e,n){var r=P(e,n,!1);return!L(r)&&G(r.has(t))}function N(t,e,n){if(_(t,e,n))return M(t,e,n);var r=$(e);return D(r)?void 0:N(t,r,n)}function M(t,e,n){var r=P(e,n,!1);if(!L(r))return r.get(t)}function A(t,e,n,r){P(n,r,!0).set(t,e)}function O(t,e){var n=I(t,e),r=$(t);if(null===r)return n;var i=O(r,e);if(0>=i.length)return n;if(0>=n.length)return i;for(var o=new p,a=[],s=0,u=n;u.length>s;s++){o.has(h=u[s])||(o.add(h),a.push(h))}for(var c=0,l=i;l.length>c;c++){var h;o.has(h=l[c])||(o.add(h),a.push(h))}return a}function I(t,e){var n=[],r=P(t,e,!1);if(L(r))return n;for(var i=K(r.keys()),o=0;;){var a=J(i);if(!a)return n.length=o,n;var s=Z(a);try{n[o]=s}catch(t){try{Q(i)}finally{throw t}}o++}}function R(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function L(t){return void 0===t}function D(t){return null===t}function U(t){return"symbol"==typeof t}function F(t){return"object"==typeof t?null!==t:"function"==typeof t}function B(t,e){switch(R(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",i=X(t,r);if(void 0!==i){var o=i.call(t,n);if(F(o))throw new TypeError;return o}return V(t,"default"===n?"number":n)}function V(t,e){if("string"===e){var n=t.toString;if(W(n))if(!F(i=n.call(t)))return i;if(W(r=t.valueOf))if(!F(i=r.call(t)))return i}else{var r;if(W(r=t.valueOf))if(!F(i=r.call(t)))return i;var i,o=t.toString;if(W(o))if(!F(i=o.call(t)))return i}throw new TypeError}function G(t){return!!t}function j(t){return""+t}function H(t){var e=B(t,3);return U(e)?e:j(e)}function z(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function W(t){return"function"==typeof t}function Y(t){return"function"==typeof t}function q(t){switch(R(t)){case 3:case 4:return!0;default:return!1}}function X(t,e){var n=t[e];if(null!=n){if(!W(n))throw new TypeError;return n}}function K(t){var e=X(t,i);if(!W(e))throw new TypeError;var n=e.call(t);if(!F(n))throw new TypeError;return n}function Z(t){return t.value}function J(t){var e=t.next();return!e.done&&e}function Q(t){var e=t.return;e&&e.call(t)}function $(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function tt(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&this._keys.length>t){var n=this._selector(this._keys[t],this._values[t]);return this._keys.length>t+1?this._index++:(this._index=-1,this._keys=e,this._values=e),{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw 0>this._index||(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return 0>this._index||(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return 0>e?void 0:this._values[e]},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;r>i;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,o)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),0>this._cacheIndex&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}function et(){return function(){function t(){this._map=new h}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}()}function nt(){var t=16,n=u.create(),r=i();return function(){function t(){this._key=i()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?u.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=i()},t}();function i(){var t;do{t="@@WeakMap@@"+c()}while(u.has(n,t));return n[t]=!0,t}function o(t,n){if(!e.call(t,r)){if(!n)return;Object.defineProperty(t,r,{value:u.create()})}return t[r]}function a(t,e){for(var n=0;e>n;++n)t[n]=255*Math.random()|0;return t}function s(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):a(new Uint8Array(t),t):a(new Array(t),t)}function c(){var e=s(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",r=0;t>r;++r){var i=e[r];4!==r&&6!==r&&8!==r||(n+="-"),16>i&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function rt(t){return t.__=void 0,delete t.__,t}t("decorate",d),t("metadata",y),t("defineMetadata",v),t("hasMetadata",g),t("hasOwnMetadata",m),t("getMetadata",T),t("getOwnMetadata",b),t("getMetadataKeys",S),t("getOwnMetadataKeys",E),t("deleteMetadata",w)}(i)}()}(r||(r={})),function(t){t.defineToken=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{multiple:!0};return new t.DefinedToken(e,n)};var e,n=K((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Z(this,t),this.prototype={},this.name=void 0,this.multiple=void 0,this.symbol=void 0;var r=n.multiple,i=void 0!==r&&r;this.name=e,this.symbol=Symbol(this.name),this.multiple=i}));t.DefinedToken=n,t.isModule=function(t){return!!t&&"object"===q(t)&&"id"in t},function(t){t.singleton="singleton",t.transient="transient"}(e=t.Lifecycle||(t.Lifecycle={})),t.ClassOptionSymbol=Symbol("SyringeClassOptionSymbol"),t.DefaultOption={lifecycle:e.transient}}(t.Syringe||(t.Syringe={})),(i=t.Utils||(t.Utils={})).toArray=function(t){return Array.isArray(t)?t:void 0===t?[]:[t]},i.isClass=function(t){return!(!t||"function"!=typeof t||!("prototype"in t))},i.isDefinedToken=function(t){return!!(t&&"object"===q(t)&&"symbol"in t&&"multiple"in t)},i.isInjectOption=function(t){return!(!t||"object"!==q(t)||!("token"in t))},i.isNamedToken=function(t){return!!(t&&"object"===q(t)&&"token"in t&&"named"in t)},i.isMultipleEnabled=function(t){return i.isDefinedToken(t)&&t.multiple};var it=new Y.Container;function ot(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function at(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(n),!0).forEach((function(e){st(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function st(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ut(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Y.injectable();return function(r){Reflect.defineMetadata(t.Syringe.ClassOptionSymbol,at(at({},e),{},{target:r}),r),n(r)}}function ct(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ut(at(at({},e),{},{lifecycle:t.Syringe.Lifecycle.singleton}))}function lt(t){return Y.inject(rt(t))}function ht(t){return Y.named(nt(t))}var pt=Symbol("SyringeOptionSymbol");function ft(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function dt(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ft(Object(n),!0).forEach((function(e){yt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ft(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function yt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vt(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var gt=function(){function e(n,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.token=void 0,this.rawToken=void 0,this.named=void 0,this.generalToken=void 0,this.option=void 0,this.register=void 0,this.mutiple=void 0,this.register=n,this.token=r,this.option=i,this.rawToken=t.Utils.isNamedToken(r)?r.token:r,this.named=t.Utils.isNamedToken(r)?r.named:void 0,this.mutiple=!!this.named||t.Utils.isMultipleEnabled(this.rawToken),this.generalToken=this.rawToken}var n,r,i;return n=e,r=[{key:"resolve",value:function(){var e=this,n=this.register;(function(t){return t&&"object"===J(t)&&"bind"in t&&"unbind"in t&&"rebind"in t&&"isBound"in t})(n)&&(this.mutiple?this.resolveMutilple(n):(this.resolveMono(n),!this.named&&this.option.contrib.length>0&&this.option.contrib.forEach((function(r){t.Utils.isMultipleEnabled(r)?tt(r,n).toService(e.generalToken):et(r,n).toService(e.generalToken)}))))}},{key:"resolveMono",value:function(t){if("useValue"in this.option)return et(this.generalToken,t).toConstantValue(this.option.useValue);if(this.option.useDynamic.length>0){var e=this.option.useDynamic[this.option.useDynamic.length-1];return Q(et(this.generalToken,t).toDynamicValue((function(t){var n=Bt.getContainer(t.container);return e({container:n})})),this.option)}if(this.option.useFactory.length>0){var n=this.option.useFactory[this.option.useFactory.length-1];return et(this.generalToken,t).toFactory((function(t){var e=Bt.getContainer(t.container);return n({container:e})}))}if(this.option.useClass.length>0){var r=this.option.useClass[this.option.useClass.length-1];return Q(et(this.generalToken,t).to(r),this.option)}}},{key:"resolveMutilple",value:function(t){var e=this,n=this.option.useClass.map((function(n){return Q(tt(e.generalToken,t).to(n),e.option)})),r=this.option.useDynamic.map((function(n){return Q(tt(e.generalToken,t).toDynamicValue((function(t){var e=Bt.getContainer(t.container);return n({container:e})})),e.option)})),i=this.option.useFactory.map((function(n){return tt(e.generalToken,t).toFactory((function(t){var e=Bt.getContainer(t.container);return n({container:e})}))})),o="useValue"in this.option?tt(this.generalToken,t).toConstantValue(this.option.useValue):void 0;this.named&&(n.forEach((function(t){return e.named&&$(t,e.named)})),r.forEach((function(t){return e.named&&$(t,e.named)})),i.forEach((function(t){return e.named&&$(t,e.named)})),o&&$(o,this.named))}}],i=[{key:"resolveTarget",value:function(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{try{var o=Reflect.getMetadata(pt,r);o&&e.resolveOption(n,o)}catch(t){}if(t.Utils.isClass(r))if(i.useClass){var a=t.Utils.toArray(i.useClass);a.unshift(r),i.useClass=a}else i.useClass=[r];var s;try{s=Reflect.getMetadata(t.Syringe.ClassOptionSymbol,r)}catch(t){}if((s=dt(dt({},s||{}),i)).token){var u=t.Utils.toArray(s.token);u.unshift(r),s.token=u}else s.token=[r];e.resolveOption(n,s)}catch(t){}}},{key:"resolveOption",value:function(n,r){var i=function(e){var n=t.Utils.toArray(e.token),r=t.Utils.toArray(e.useClass),i=t.Utils.toArray(e.useDynamic),o=t.Utils.toArray(e.useFactory),a=t.Utils.toArray(e.contrib),s={token:n,useClass:r,lifecycle:a.length>0?t.Syringe.Lifecycle.singleton:e.lifecycle||t.Syringe.Lifecycle.transient,contrib:a,useDynamic:i,useFactory:o};return"useValue"in e&&(s.useValue=e.useValue),s}(dt(dt({},e.globalConfig),r));(0!==i.useClass.length||0!==i.useDynamic.length||0!==i.useFactory.length||"useValue"in i)&&i.token.forEach((function(t){new e(n,t,dt({},i)).resolve()}))}}],r&&vt(n.prototype,r),i&&vt(n,i),Object.defineProperty(n,"prototype",{writable:!1}),e}();gt.globalConfig=t.Syringe.DefaultOption;var mt=t.Syringe.defineToken("ContributionProvider");function Tt(t){return function(t){if(Array.isArray(t))return bt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return bt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);e>n;n++)r[n]=t[n];return r}function St(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Et(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?St(Object(n),!0).forEach((function(e){wt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function wt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xt(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var kt=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.option={recursive:!1,cache:!0},this.services=void 0,this.serviceIdentifier=void 0,this.container=void 0,this.container=n,this.serviceIdentifier=e,r&&(this.option=Et(Et({},this.option),r))}var e,n,r;return e=t,n=[{key:"setServices",value:function(t){for(var e=[],n=this.container;n;){if(n.isBound(this.serviceIdentifier)){var r=n.getAll(this.serviceIdentifier);e.push.apply(e,Tt(r))}n=t?n.parent:void 0}return e}},{key:"getContributions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Et(Et({},this.option),t),n=e.cache,r=e.recursive;return n&&void 0!==this.services||(this.services=this.setServices(!!r)),this.services}}],n&&xt(e.prototype,n),r&&xt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function Pt(e,n){return{token:{token:mt,named:e},useDynamic:function(t){return new kt(e,t.container,n)},lifecycle:t.Syringe.Lifecycle.singleton}}function Ct(e,n,r){e({token:{token:mt,named:n},useDynamic:function(t){return new kt(n,t.container,r)},lifecycle:t.Syringe.Lifecycle.singleton})}function _t(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Nt=function(){function e(n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=void 0,this.inversifyModule=void 0,this.baseRegistry=void 0,this.optionCollection=void 0,this.inversifyRegister=function(e,n,i,o){var a={bind:e,unbind:n,isBound:i,rebind:o},s=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.Utils.isInjectOption(e)?gt.resolveOption(a,e):gt.resolveTarget(a,e,n)};r.baseRegistry&&r.baseRegistry(s),r.optionCollection&&r.optionCollection.forEach((function(t){return s(t)}))},this.baseRegistry=n,this.inversifyModule=new Y.ContainerModule(this.inversifyRegister),this.id=this.inversifyModule.id}var n,r,i;return n=e,r=[{key:"options",get:function(){return this.optionCollection||(this.optionCollection=[]),this.optionCollection}},{key:"register",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return n.forEach((function(e){return t.options.push(e)})),this}},{key:"contribution",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];return n.forEach((function(e){return t.options.push(Pt(e))})),this}}],r&&_t(n.prototype,r),i&&_t(n,i),Object.defineProperty(n,"prototype",{writable:!1}),e}();function Mt(t){return t&&"inversifyModule"in t}function At(t){return new Nt(t)}function Ot(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var It,Rt,Lt,Dt,Ut,Ft=new Map,Bt=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadedModules=[],this.container=void 0,this.inversify=!0,this.parent=void 0,this.container=t||new Y.Container,e.setContainer(this.container,this)}var n,r,i;return n=e,r=[{key:"load",value:function(t,e){var n=this;return e||!this.loadedModules.includes(t.id)?(Mt(t)&&this.container.load(t.inversifyModule),this.loadedModules.push(t.id),{dispose:function(){n.unload(t)}}):(console.warn("Unsupported module."),{dispose:function(){}})}},{key:"unload",value:function(t){Mt(t)&&(this.container.unload(t.inversifyModule),this.loadedModules=this.loadedModules.filter((function(e){return e!==t.id})))}},{key:"remove",value:function(t){return this.container.unbind(rt(t))}},{key:"get",value:function(t){return this.container.get(rt(t))}},{key:"getNamed",value:function(t,e){return this.container.getNamed(rt(t),nt(e))}},{key:"getAll",value:function(t){return this.container.getAll(rt(t))}},{key:"getAllNamed",value:function(t,e){return this.container.getAllNamed(rt(t),nt(e))}},{key:"isBound",value:function(t){return this.container.isBound(rt(t))}},{key:"isBoundNamed",value:function(t,e){return this.container.isBoundNamed(rt(t),nt(e))}},{key:"createChild",value:function(){var t=new e(this.container.createChild());return t.parent=this,t}},{key:"register",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.Utils.isInjectOption(e)?gt.resolveOption(this.container,e):gt.resolveTarget(this.container,e,n)}}],i=[{key:"setContainer",value:function(t,e){return Ft.set(t.id,e)}},{key:"getContainer",value:function(t){var n=Ft.get(t.id);if(!n){var r=new e(t);return e.setContainer(t,r),r}return n}},{key:"config",value:function(t){gt.globalConfig=t}}],r&&Ot(n.prototype,r),i&&Ot(n,i),Object.defineProperty(n,"prototype",{writable:!1}),e}(),Vt=new Bt(it),Gt=Vt.register.bind(Vt),jt=function(t){return function(e,n,r){ht(t)(e,n,r),lt(mt)(e,n,r)}};function Ht(t,e,n,r,i){zt(t,e,n||0,r||t.length-1,i||Yt)}function zt(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=e-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*u*(o-u)/o)*(0>a-o/2?-1:1);zt(t,e,Math.max(n,Math.floor(e-a*u/o+c)),Math.min(r,Math.floor(e+(o-a)*u/o+c)),i)}var l=t[e],h=n,p=r;for(Wt(t,n,e),i(t[r],l)>0&&Wt(t,n,r);p>h;){for(Wt(t,h,p),h++,p--;0>i(t[h],l);)h++;for(;i(t[p],l)>0;)p--}0===i(t[n],l)?Wt(t,n,p):Wt(t,++p,r),p>e||(n=p+1),e>p||(r=p-1)}}function Wt(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Yt(t,e){return e>t?-1:t>e?1:0}(It=t.Contribution||(t.Contribution={})).Provider=mt,It.register=Ct;class qt{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!ie(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;e.children.length>o;o++){const a=e.children[o],s=e.leaf?r(a):a;ie(t,s)&&(e.leaf?n.push(a):re(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n}collides(t){let e=this.data;if(!ie(t,e))return!1;const n=[];for(;e;){for(let r=0;e.children.length>r;r++){const i=e.children[r],o=e.leaf?this.toBBox(i):i;if(ie(t,o)){if(e.leaf||re(t,o))return!0;n.push(i)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(let e=0;t.length>e;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(e.height>this.data.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=oe([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),i=[],o=[];let a,s,u;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],a=o.pop(),u=!0),n.leaf){const r=Xt(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}u||n.leaf||!re(n,r)?s?(a++,n=s.children[a],u=!1):n=null:(i.push(n),o.push(a),a=0,s=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const i=n-e+1;let o,a=this._maxEntries;if(a>=i)return o=oe(t.slice(e,n+1)),Kt(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,r-1))),o=oe([]),o.leaf=!1,o.height=r;const s=Math.ceil(i/a),u=s*Math.ceil(Math.sqrt(a));ae(t,e,n,u,this.compareMinX);for(let i=e;n>=i;i+=u){const e=Math.min(i+u-1,n);ae(t,i,e,s,this.compareMinY);for(let n=i;e>=n;n+=s){const i=Math.min(n+s-1,e);o.children.push(this._build(t,n,i,r-1))}}return Kt(o,this.toBBox),o}_chooseSubtree(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){let n,r=1/0,a=1/0;for(let s=0;e.children.length>s;s++){const u=e.children[s],c=te(u),l=(i=t,o=u,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-c);a>l?(a=l,r=r>c?c:r,n=u):l===a&&r>c&&(r=c,n=u)}e=n||e.children[0]}var i,o;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),Jt(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=oe(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,Kt(n,this.toBBox),Kt(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=oe([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Kt(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let a=e;n-e>=a;a++){const e=Zt(t,0,a,this.toBBox),s=Zt(t,a,n,this.toBBox),u=ne(e,s),c=te(e)+te(s);i>u?(i=u,r=a,o=o>c?c:o):u===i&&o>c&&(o=c,r=a)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:Qt,i=t.leaf?this.compareMinY:$t,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this.toBBox,o=Zt(t,0,e,i),a=Zt(t,n-e,n,i);let s=ee(o)+ee(a);for(let r=e;n-e>r;r++){const e=t.children[r];Jt(o,t.leaf?i(e):e),s+=ee(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];Jt(a,t.leaf?i(e):e),s+=ee(a)}return s}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)Jt(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():Kt(t[n],this.toBBox)}}function Xt(t,e,n){if(!n)return e.indexOf(t);for(let r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function Kt(t,e){Zt(t,0,t.children.length,e,t)}function Zt(t,e,n,r,i){i||(i=oe(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;n>o;o++){const e=t.children[o];Jt(i,t.leaf?r(e):e)}return i}function Jt(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function Qt(t,e){return t.minX-e.minX}function $t(t,e){return t.minY-e.minY}function te(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ee(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ne(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function re(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function ie(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function oe(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ae(t,e,n,r,i){const o=[e,n];for(;o.length;){if(r>=(n=o.pop())-(e=o.pop()))continue;const a=e+Math.ceil((n-e)/r/2)*r;Ht(t,a,e,n,i),o.push(e,a,a,n)}}function se(t,e,n,r){var i,o=arguments.length,a=3>o?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(3>o?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function ue(t,e){return function(n,r){e(n,r,t)}}function ce(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function le(){
2
2
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
3
- pe=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new w(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=b(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,o),i}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function p(){}function f(){}var d={};s(d,i,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(x([])));v&&v!==e&&n.call(v,i)&&(d=v);var g=f.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function x(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return p.prototype=f,s(g,"constructor",f),s(f,"constructor",p),p.displayName=s(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(T.prototype),s(T.prototype,o,(function(){return this})),t.AsyncIterator=T,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new T(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),s(g,a,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=x,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function fe(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function de(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){fe(o,r,i,a,s,"next",t)}function s(t){fe(o,r,i,a,s,"throw",t)}a(void 0)}))}}function ye(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ve(t,e,n){return e&&ye(t.prototype,e),n&&ye(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ge(){return ge=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ge.apply(this,arguments)}function me(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Te(t,e)}function Te(t,e){return Te=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Te(t,e)}function be(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Ee(t,e,n){return Ee=be()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&Te(i,n.prototype),i},Ee.apply(null,arguments)}function Se(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;o.length>r;r++)0>e.indexOf(n=o[r])&&(i[n]=t[n]);return i}function we(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xe(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);e>n;n++)r[n]=t[n];return r}function Pe(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return xe(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xe(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(Vt=t.LayoutTaskType||(t.LayoutTaskType={})).Layout="layout",Vt.IntrinsicSizes="intrinsic-sizes",function(t){t[t.block=0]="block",t[t.normal=1]="normal"}(Gt||(Gt={})),function(t){t[t["block-like"]=0]="block-like",t[t.manual=1]="manual"}(jt||(jt={})),(Ht=t.PropertyName||(t.PropertyName={})).LAYOUT="display",Ht.LEFT="left",Ht.TOP="top",Ht.BOTTOM="bottom",Ht.RIGHT="right",Ht.WIDTH="width",Ht.HEIGHT="height",Ht.MIN_WIDTH="minWidth",Ht.MAX_WIDTH="maxWidth",Ht.MIN_HEIGHT="minHeight",Ht.MAX_HEIGHT="maxHeight",Ht.BOX_SIZING="boxSizing",Ht.PADDING="padding",Ht.PADDING_TOP="paddingTop",Ht.PADDING_BOTTOM="paddingBottom",Ht.PADDING_START="paddingLeft",Ht.PADDING_END="paddingRight",Ht.MARGIN="margin",Ht.MARGIN_TOP="marginTop",Ht.MARGIN_BOTTOM="marginBottom",Ht.MARGIN_START="marginLeft",Ht.MARGIN_END="marginRight",Ht.BORDER="border",Ht.BORDER_TOP="borderTop",Ht.BORDER_BOTTOM="borderBottom",Ht.BORDER_START="borderLeft",Ht.BORDER_END="borderRight",Ht.FLEX_DIRECTION="flexDirection",Ht.FLEX_WRAP="flexWrap",Ht.FLEX_FLOW="flexFlow",Ht.ALIGN_ITEMS="alignItems",Ht.ALIGN_CONTENT="alignContent",Ht.JUSTIFY_CONTENT="justifyContent",Ht.FLEX="flex",Ht.ALIGN_SELF="alignSelf",Ht.FLEX_SHRINK="flexShrink",Ht.FLEX_BASIS="flexBasis",Ht.FLEX_GROW="flexGrow",Ht.OFFSET_WIDTH="offsetWidth",Ht.OFFSET_HEIGHT="offsetHeight",Ht.ORDER="order";var ke=1,Ce=function(){function e(t){void 0===t&&(t=new Map),this.id=void 0,this.style=void 0,this.dirty=void 0,this.parent=void 0,this.children=void 0,this.internalIntrisicSizes=void 0,this.computedLayout=void 0,this.measureFn=void 0,this.id=ke++,this.style=t,this.parent=void 0,this.children=[],this.dirty=!1}var n=e.prototype;return n.setMeasure=function(t){this.measureFn=t},n.setIntrisicSizes=function(t){this.internalIntrisicSizes=t},n.addChild=function(t){var e;null===(e=this.children)||void 0===e||e.push(t)},n.insertChild=function(t,e){this.children.splice(t,0,e)},n.removeChild=function(t){var e,n=null===(e=this.children)||void 0===e?void 0:e.findIndex((function(e){return e.id===t.id}));this.removeChildAtIndex(n)},n.removeChildAtIndex=function(t){this.children.splice(t,1)},n.replaceChildAtIndex=function(t,e){this.children.splice(t,1,e)},n.setStyle=function(t,e){this.style.set(t,e)},n.getStyle=function(){for(var t=this,e=new Map,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return r.forEach((function(n){var r=t.style.get(n);r&&e.set(n,r)})),e},n.getAllStyle=function(){return this.style},n.markDirty=function(){this.dirty=!0},n.idDirty=function(){return this.dirty},n.getSize=function(){var e,n,r,i;return{width:null!==(e=null===(n=this.style.get(t.PropertyName.WIDTH))||void 0===n?void 0:n.value)&&void 0!==e?e:0,height:null!==(r=null===(i=this.style.get(t.PropertyName.HEIGHT))||void 0===i?void 0:i.value)&&void 0!==r?r:0}},n.computeLayout=function(){var t=de(pe().mark((function t(){var e;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getSize(),t.next=3,bl.computeLayout(this,{availableInlineSize:e.width,availableBlockSize:e.height,fixedInlineSize:e.width,fixedBlockSize:e.height,percentageInlineSize:e.width,percentageBlockSize:e.height,data:void 0});case 3:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.setComputedLayout=function(t){this.computedLayout=t},n.getComputedLayout=function(){return this.computedLayout},n.getAllComputedLayout=function(){},n.toString=function(){return"LayoutObject "+this.id},ve(e,[{key:"intrisicSizes",get:function(){return this.internalIntrisicSizes}},{key:"childCount",get:function(){return this.children.length}}]),e}(),Ne=i.defineToken("LayoutContextFactory"),_e=i.defineToken("LayoutContextOptions"),Me=0;t.LayoutContext=function(){function t(t){this.options=void 0,this.contextId=void 0,this.workQueue=[],this.mode=void 0,this.layoutChildrenFactory=void 0,this.fragmentResultFactory=void 0,this.layoutFragmentFactory=void 0,this.options=t,this.contextId=""+Me++,this.mode=t.mode,this.layoutChildrenFactory=t.layoutChildrenFactory,this.fragmentResultFactory=t.fragmentResultFactory,this.layoutFragmentFactory=t.layoutFragmentFactory}var e=t.prototype;return e.appendWorkTask=function(t){this.workQueue.push(t)},e.clearWorkQueue=function(){this.workQueue=[]},t}(),t.LayoutContext=ce([lt(),le(0,ht(_e)),he("design:paramtypes",[Object])],t.LayoutContext);var Ae=i.defineToken("FragmentResultFactory"),Oe=i.defineToken("FragmentResultOptions"),Ie=i.defineToken("contextNode");function Re(t){if(!t)throw new Error}function Le(t,e){if(t!==e)throw new Error}function De(t,e){if(t===e)throw new Error}function Ue(t){return void 0===t}function Fe(t){return null==t}function Be(t){return"number"==typeof t}function Ve(t){return"function"==typeof t}function Ge(t){return"boolean"==typeof t}function je(t){return"[object Object]"===Object.prototype.toString.call(t)}t.FragmentResult=function(t,e,n){this._layoutContext=void 0,this._node=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.node=void 0,this.childFragments=void 0,this.data=void 0,this._layoutContext=t,this._node=e,this.options=n,this.layoutContext=t,this.inlineSize=null==n?void 0:n.inlineSize,this.blockSize=null==n?void 0:n.blockSize,this.childFragments=null==n?void 0:n.childFragments,this.data=n.data,this.node=e},t.FragmentResult=ce([ct(),le(0,ht(t.LayoutContext)),le(1,ht(Ie)),le(2,ht(Oe)),he("design:paramtypes",[t.LayoutContext,Ce,Object])],t.FragmentResult);var He={},ze=0;function We(t,e){if(t){var n="string"==typeof t?t:t.id||ze++;He[n]&&He[n].destroy(),He[n]=e}}var Ye="undefined"!=typeof window&&void 0!==window.document,qe=.1,Xe="function"==typeof Float32Array,Ke=function(t,e){return 1-3*e+3*t},Ze=function(t,e){return 3*e-6*t},Je=function(t){return 3*t},Qe=function(t,e,n){return((Ke(e,n)*t+Ze(e,n))*t+Je(e))*t},$e=function(t,e,n){return 3*Ke(e,n)*t*t+2*Ze(e,n)*t+Je(e)},tn=function(t,e,n,r){if(0>t||t>1||0>n||n>1)throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Xe?new Float32Array(11):new Array(11),o=0;11>o;++o)i[o]=Qe(o*qe,t,n);var a=function(e){for(var r=0,o=1;10!==o&&e>=i[o];++o)r+=qe;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*qe,s=$e(a,t,n);return.001>s?0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=Qe(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&10>++s);return a}(e,r,r+qe,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var o=$e(e,n,r);if(0===o)return e;e-=(Qe(e,n,r)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:Qe(a(t),e,r)}},en=1e-6,nn="undefined"!=typeof Float32Array?Float32Array:Array;function rn(){var t=new nn(9);return nn!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function on(){var t=new nn(16);return nn!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function an(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function sn(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function un(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15],m=n*s-r*a,T=n*u-i*a,b=n*c-o*a,E=r*u-i*s,S=r*c-o*s,w=i*c-o*u,x=l*y-h*d,P=l*v-p*d,k=l*g-f*d,C=h*v-p*y,N=h*g-f*y,_=p*g-f*v,M=m*_-T*N+b*C+E*k-S*P+w*x;return M?(t[0]=(s*_-u*N+c*C)*(M=1/M),t[1]=(i*N-r*_-o*C)*M,t[2]=(y*w-v*S+g*E)*M,t[3]=(p*S-h*w-f*E)*M,t[4]=(u*k-a*_-c*P)*M,t[5]=(n*_-i*k+o*P)*M,t[6]=(v*b-d*w-g*T)*M,t[7]=(l*w-p*b+f*T)*M,t[8]=(a*N-s*k+c*x)*M,t[9]=(r*k-n*N-o*x)*M,t[10]=(d*S-y*b+g*m)*M,t[11]=(h*b-l*S-f*m)*M,t[12]=(s*P-a*C-u*x)*M,t[13]=(n*C-r*P+i*x)*M,t[14]=(y*T-d*E-v*m)*M,t[15]=(l*E-h*T+p*m)*M,t):null}function cn(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],v=e[13],g=e[14],m=e[15],T=n[0],b=n[1],E=n[2],S=n[3];return t[0]=T*r+b*s+E*h+S*y,t[1]=T*i+b*u+E*p+S*v,t[2]=T*o+b*c+E*f+S*g,t[3]=T*a+b*l+E*d+S*m,t[4]=(T=n[4])*r+(b=n[5])*s+(E=n[6])*h+(S=n[7])*y,t[5]=T*i+b*u+E*p+S*v,t[6]=T*o+b*c+E*f+S*g,t[7]=T*a+b*l+E*d+S*m,t[8]=(T=n[8])*r+(b=n[9])*s+(E=n[10])*h+(S=n[11])*y,t[9]=T*i+b*u+E*p+S*v,t[10]=T*o+b*c+E*f+S*g,t[11]=T*a+b*l+E*d+S*m,t[12]=(T=n[12])*r+(b=n[13])*s+(E=n[14])*h+(S=n[15])*y,t[13]=T*i+b*u+E*p+S*v,t[14]=T*o+b*c+E*f+S*g,t[15]=T*a+b*l+E*d+S*m,t}function ln(t,e,n){var r,i,o,a,s,u,c,l,h,p,f,d,y=n[0],v=n[1],g=n[2];return e===t?(t[12]=e[0]*y+e[4]*v+e[8]*g+e[12],t[13]=e[1]*y+e[5]*v+e[9]*g+e[13],t[14]=e[2]*y+e[6]*v+e[10]*g+e[14],t[15]=e[3]*y+e[7]*v+e[11]*g+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*y+s*v+h*g+e[12],t[13]=i*y+u*v+p*g+e[13],t[14]=o*y+c*v+f*g+e[14],t[15]=a*y+l*v+d*g+e[15]),t}function hn(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function pn(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function fn(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,s),t}function dn(t,e){var n=new nn(3);fn(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,u=e[2]*o,c=e[4]*r,l=e[5]*i,h=e[6]*o,p=e[8]*r,f=e[9]*i,d=e[10]*o,y=a+l+d,v=0;return y>0?(v=2*Math.sqrt(y+1),t[3]=.25*v,t[0]=(h-f)/v,t[1]=(p-u)/v,t[2]=(s-c)/v):a>l&&a>d?(v=2*Math.sqrt(1+a-l-d),t[3]=(h-f)/v,t[0]=.25*v,t[1]=(s+c)/v,t[2]=(p+u)/v):l>d?(v=2*Math.sqrt(1+l-a-d),t[3]=(p-u)/v,t[0]=(s+c)/v,t[1]=.25*v,t[2]=(h+f)/v):(v=2*Math.sqrt(1+d-a-l),t[3]=(s-c)/v,t[0]=(p+u)/v,t[1]=(h+f)/v,t[2]=.25*v),t}function yn(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,p=o*c,f=o*l,d=o*h,y=a*l,v=a*h,g=s*h,m=u*c,T=u*l,b=u*h,E=r[0],S=r[1],w=r[2],x=i[0],P=i[1],k=i[2],C=(1-(y+g))*E,N=(f+b)*E,_=(d-T)*E,M=(f-b)*S,A=(1-(p+g))*S,O=(v+m)*S,I=(d+T)*w,R=(v-m)*w,L=(1-(p+y))*w;return t[0]=C,t[1]=N,t[2]=_,t[3]=0,t[4]=M,t[5]=A,t[6]=O,t[7]=0,t[8]=I,t[9]=R,t[10]=L,t[11]=0,t[12]=n[0]+x-(C*x+M*P+I*k),t[13]=n[1]+P-(N*x+A*P+R*k),t[14]=n[2]+k-(_*x+O*P+L*k),t[15]=1,t}function vn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,p=i*a,f=i*s,d=i*u,y=o*a,v=o*s,g=o*u;return t[0]=1-h-d,t[1]=l+g,t[2]=p-v,t[3]=0,t[4]=l-g,t[5]=1-c-d,t[6]=f+y,t[7]=0,t[8]=p+v,t[9]=f-y,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var gn=function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t};function mn(){var t=new nn(3);return nn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Tn(t){var e=new nn(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function bn(t){return Math.hypot(t[0],t[1],t[2])}function En(t,e,n){var r=new nn(3);return r[0]=t,r[1]=e,r[2]=n,r}function Sn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function wn(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function xn(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Pn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function kn(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function Cn(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Nn(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function _n(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function Mn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function An(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function On(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function In(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function Rn(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=en*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=en*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=en*Math.max(1,Math.abs(i),Math.abs(s))}var Ln,Dn=Pn,Un=kn,Fn=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},Bn=bn;Ln=mn();function Vn(){var t=new nn(4);return nn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Gn(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}!function(){var t=Vn()}();function jn(){var t=new nn(4);return nn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Hn(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function zn(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function Wn(t,e,n,r){var i,o,a,s,u,c=e[0],l=e[1],h=e[2],p=e[3],f=n[0],d=n[1],y=n[2],v=n[3];return 0>(o=c*f+l*d+h*y+p*v)&&(o=-o,f=-f,d=-d,y=-y,v=-v),1-o>en?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),t[0]=s*c+u*f,t[1]=s*l+u*d,t[2]=s*h+u*y,t[3]=s*p+u*v,t}function Yn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function qn(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}var Xn,Kn,Zn,Jn,Qn,$n,tr=function(t,e,n,r){var i=new nn(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},er=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},nr=zn,rr=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};Xn=mn(),Kn=En(1,0,0),Zn=En(0,1,0),Jn=jn(),Qn=jn(),$n=rn();!function(){var t,e=(t=new nn(2),nn!=Float32Array&&(t[0]=0,t[1]=0),t)}();function ir(t,e,n){return n?Math.min(t,e)===t?e:Math.max(t,n)===t?n:t:Math.max(t,e)===e?t:e}function or(t){return void 0===t?0:t>360||-360>t?t%360:t}function ar(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Be(t)?En(t,e,n):Array.isArray(t)&&3===t.length?Tn(t):En(t[0],t[1]||e,t[2]||n)}function sr(t){return t*(180/Math.PI)}function ur(t){return 360*t}function cr(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=fn(mn(),e),a=o[0],s=o[1],u=o[2],c=Math.asin(-e[2]/a);return i>c?c>-i?(n=Math.atan2(e[6]/s,e[10]/u),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function lr(t,e,n,r,i){var o,a,s,u,c,l,h,p,f,d,y=Math.cos(t),v=Math.sin(t);return o=r*y,a=i*v,s=0,u=-r*v,c=i*y,l=0,h=e,p=n,f=1,(d=new nn(9))[0]=o,d[1]=a,d[2]=s,d[3]=u,d[4]=c,d[5]=l,d[6]=h,d[7]=p,d[8]=f,d}function hr(t,e,n,r,i,o,a){var s=2*o/(r-i),u=(n+e)/(n-e),c=(r+i)/(r-i),l=-(a+o)/(a-o),h=-2*a*o/(a-o);return t[0]=2*o/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=l,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}function pr(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);0>e*i-n*r&&(i>e?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=sr(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var fr=function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))).charAt(0)?t.substr(1):t},dr=function(t){return Math.pow(t,2)},yr=function(t){return Math.pow(t,3)},vr=function(t){return Math.pow(t,4)},gr=function(t){return Math.pow(t,5)},mr=function(t){return Math.pow(t,6)},Tr=function(t){return 1-Math.cos(t*Math.PI/2)},br=function(t){return 1-Math.sqrt(1-t*t)},Er=function(t){return t*t*(3*t-2)},Sr=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},wr=function(t,e){void 0===e&&(e=[]);var n=e[0],r=e[1],i=void 0===r?.5:r,o=ir(Number(void 0===n?1:n),1,10),a=ir(Number(i),.1,2);return 0===t||1===t?t:-o*Math.pow(2,10*(t-1))*Math.sin((t-1-a/(2*Math.PI)*Math.asin(1/o))*(2*Math.PI)/a)},xr=function(t,e,n){void 0===e&&(e=[]);var r=e[0],i=void 0===r?1:r,o=e[1],a=void 0===o?100:o,s=e[2],u=void 0===s?10:s,c=e[3],l=void 0===c?0:c;i=ir(i,.1,1e3),a=ir(a,.1,1e3),u=ir(u,.1,1e3),l=ir(l,.1,1e3);var h=Math.sqrt(a/i),p=u/(2*Math.sqrt(a*i)),f=1>p?h*Math.sqrt(1-p*p):0,d=1>p?(p*h-l)/f:-l+h,y=n?n*t/1e3:t;return y=1>p?Math.exp(-y*p*h)*(1*Math.cos(f*y)+d*Math.sin(f*y)):(1+d*y)*Math.exp(-y*h),0===t||1===t?t:1-y},Pr=function(t,e){void 0===e&&(e=[]);var n=e[0],r=void 0===n?10:n;return("start"==e[1]?Math.ceil:Math.floor)(ir(t,0,1)*r)/r},kr=function(t,e){void 0===e&&(e=[]);return tn(e[0],e[1],e[2],e[3])(t)},Cr=tn(.42,0,1,1),Nr=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},_r=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},Mr=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},Ar={steps:Pr,"step-start":function(t){return Pr(t,[1,"start"])},"step-end":function(t){return Pr(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":kr,ease:function(t){return kr(t,[.25,.1,.25,1])},in:Cr,out:Nr(Cr),"in-out":_r(Cr),"out-in":Mr(Cr),"in-quad":dr,"out-quad":Nr(dr),"in-out-quad":_r(dr),"out-in-quad":Mr(dr),"in-cubic":yr,"out-cubic":Nr(yr),"in-out-cubic":_r(yr),"out-in-cubic":Mr(yr),"in-quart":vr,"out-quart":Nr(vr),"in-out-quart":_r(vr),"out-in-quart":Mr(vr),"in-quint":gr,"out-quint":Nr(gr),"in-out-quint":_r(gr),"out-in-quint":Mr(gr),"in-expo":mr,"out-expo":Nr(mr),"in-out-expo":_r(mr),"out-in-expo":Mr(mr),"in-sine":Tr,"out-sine":Nr(Tr),"in-out-sine":_r(Tr),"out-in-sine":Mr(Tr),"in-circ":br,"out-circ":Nr(br),"in-out-circ":_r(br),"out-in-circ":Mr(br),"in-back":Er,"out-back":Nr(Er),"in-out-back":_r(Er),"out-in-back":Mr(Er),"in-bounce":Sr,"out-bounce":Nr(Sr),"in-out-bounce":_r(Sr),"out-in-bounce":Mr(Sr),"in-elastic":wr,"out-elastic":Nr(wr),"in-out-elastic":_r(wr),"out-in-elastic":Mr(wr),spring:xr,"spring-in":xr,"spring-out":Nr(xr),"spring-in-out":_r(xr),"spring-out-in":Mr(xr)},Or=function(t){return Ar[function(t){return fr(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||Ar.linear},Ir=function(t){if(t.isRejected||t.isFulfilled)return t;var e,n=!0,r=!1,i=!1,o=t.then((function(t){return i=!0,n=!1,e=t,t}),(function(t){throw r=!0,n=!1,t}));return o.isFulfilled=function(){return i},o.isPending=function(){return n},o.isRejected=function(){return r},o.getFullFilledValue=function(){return e},o},Rr=function(){var t=this;this.resolve=void 0,this.reject=void 0,this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},Lr={keys:Object.keys,values:Object.values,entries:Object.entries};function Dr(t,e){if(Ye)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function Ur(t){var e=Dr(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}function Fr(t){var e=Dr(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}var Br,Vr={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};(Br=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",Br.COLOR="<color>",Br.PAINT="<paint>",Br.NUMBER="<number>",Br.ANGLE="<angle>",Br.OPACITY_VALUE="<opacity-value>",Br.SHADOW_BLUR="<shadow-blur>",Br.LENGTH="<length>",Br.PERCENTAGE="<percentage>",Br.LENGTH_PERCENTAGE="<length> | <percentage>",Br.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",Br.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",Br.LIST_OF_POINTS="<list-of-points>",Br.PATH="<path>",Br.FILTER="<filter>",Br.Z_INDEX="<z-index>",Br.OFFSET_PATH="<offset-path>",Br.OFFSET_DISTANCE="<offset-distance>",Br.CLIP_PATH="<clip-path>",Br.TRANSFORM="<transform>",Br.TRANSFORM_ORIGIN="<transform-origin>",Br.TEXT="<text>",Br.TEXT_TRANSFORM="<text-transform>";var Gr=i.defineToken("StyleValueRegistry"),jr=function(t){return t};function Hr(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var zr="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Wr=new RegExp("cubic-bezier\\("+zr+","+zr+","+zr+","+zr+"\\)"),Yr=/steps\(\s*(\d+)\s*\)/,qr=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Xr(t){var e=Wr.exec(t);if(e)return tn.apply(void 0,e.slice(1).map(Number));var n=Yr.exec(t);if(n)return Hr(Number(n[1]),0);var r=qr.exec(t);return r?Hr(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):Or(t)}function Kr(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function Zr(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e<Math.min(n.delay+t+n.endDelay,r)?3:2}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),u=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),c=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=c,n.easingFunction(c)}var Jr={};function Qr(t){return void 0===t&&(t=""),Jr[t]||(Jr[t]=t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))),Jr[t]}function $r(t){return!Fe(t)&&"string"==typeof t}function ti(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(ei(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Xr(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;i.length-1>o;o++){var a=o,s=o+1,u=i[a].computedOffset,c=i[s].computedOffset,l=u,h=c;0===o&&(l=-1/0,0===c&&(s=a)),o===i.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:l,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:ri(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var r=n.endOffset-n.startOffset,i=0===r?0:n.easingFunction((e-n.startOffset)/r);t.style[n.property]=n.interpolation(i)}));else for(var n in r)ei(n)&&(t.style[n]=null)}}function ei(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var ni=function(t,e,n){return function(r){return n(ii(t,e,r))}};function ri(t,e,n,r){var i=e,o=n,a=Ut.get(Gr),s=a.getMetadata(t);if(s&&s.syntax&&s.interpolable){var u=a.getPropertySyntax(s.syntax);if(u){u.parser&&(i=u.parser(e,r),o=u.parser(n,r));var c=u.mixer(i,o,r);if(c){var l=ni.apply(void 0,c);return function(t){return 0===t?e:1===t?n:l(t)}}}}return ni(!1,!0,(function(t){return t?n:e}))}function ii(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>n?t:e;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){for(var r=[],i=0;t.length>i;i++)r.push(ii(t[i],e[i],n));return r}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var oi={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign",values:{middle:"center"}},src:{alias:"img"}};function ai(t,e){var n,r=Qr(t),i=oi[r];return[r=(null==i?void 0:i.alias)||r,(null==i||null===(n=i.values)||void 0===n?void 0:n[e])||e]}function si(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function ui(t,e){return.001>Math.abs(t-e)}function ci(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}var li={box:function(t,e,n,r){return ci([t,n],[e,r])},length:function(t,e,n,r){return si(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,o){var a=(n-t)*(i-t)+(r-e)*(o-e);return 0>a?si(t,e,i,o):a>(n-t)*(n-t)+(r-e)*(r-e)?si(n,r,i,o):this.pointToLine(t,e,n,r,i,o)},pointToLine:function(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,o-e],s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function hi(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function pi(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function fi(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(ui(s,0))ui(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;ui(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}function di(t,e,n,r,i,o,a,s,u){var c=hi(t,n,i,a,u),l=hi(e,r,o,s,u),h=li.pointAt(t,e,n,r,u),p=li.pointAt(n,r,i,o,u),f=li.pointAt(i,o,a,s,u),d=li.pointAt(h.x,h.y,p.x,p.y,u),y=li.pointAt(p.x,p.y,f.x,f.y,u);return[[t,e,h.x,h.y,d.x,d.y,c,l],[c,l,y.x,y.y,f.x,f.y,a,s]]}function yi(t,e,n,r,i,o,a,s,u){if(0===u)return function(t,e){for(var n=0,r=t.length,i=0;r>i;i++)n+=si(t[i],e[i],t[(i+1)%r],e[(i+1)%r]);return n/2}([t,n,i,a],[e,r,o,s]);var c=di(t,e,n,r,i,o,a,s,.5),l=[].concat(c[0],[u-1]),h=[].concat(c[1],[u-1]);return yi.apply(void 0,l)+yi.apply(void 0,h)}var vi={extrema:fi,box:function(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=fi(t,n,i,a),h=fi(e,r,o,s),p=0;l.length>p;p++)u.push(hi(t,n,i,a,l[p]));for(var f=0;h.length>f;f++)c.push(hi(e,r,o,s,h[f]));return ci(u,c)},length:function(t,e,n,r,i,o,a,s){return yi(t,e,n,r,i,o,a,s,3)},nearestPoint:function(t,e,n,r,i,o,a,s,u,c,l){return function(t,e,n,r,i,o){var a=-1,s=1/0,u=[n,r],c=20;o&&o>200&&(c=o/10);for(var l=1/c,h=l/10,p=0;c>=p;p++){var f=p*l,d=[i.apply(void 0,t.concat([f])),i.apply(void 0,e.concat([f]))],y=si(u[0],u[1],d[0],d[1]);s>y&&(a=f,s=y)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var v=t.length;return{x:t[v-1],y:e[v-1]}}s=1/0;for(var g=0;32>g&&h>=1e-4;g++){var m=a-h,T=a+h,b=[i.apply(void 0,t.concat([m])),i.apply(void 0,e.concat([m]))],E=si(u[0],u[1],b[0],b[1]);if(m>=0&&s>E)a=m,s=E;else{var S=[i.apply(void 0,t.concat([T])),i.apply(void 0,e.concat([T]))],w=si(u[0],u[1],S[0],S[1]);1>=T&&s>w?(a=T,s=w):h*=.5}}return{x:i.apply(void 0,t.concat([a])),y:i.apply(void 0,e.concat([a]))}}([t,n,i,a],[e,r,o,s],u,c,hi,l)},pointDistance:function(t,e,n,r,i,o,a,s,u,c,l){var h=this.nearestPoint(t,e,n,r,i,o,a,s,u,c,l);return si(h.x,h.y,u,c)},interpolationAt:hi,pointAt:function(t,e,n,r,i,o,a,s,u){return{x:hi(t,n,i,a,u),y:hi(e,r,o,s,u)}},divide:function(t,e,n,r,i,o,a,s,u){return di(t,e,n,r,i,o,a,s,u)},tangentAngle:function(t,e,n,r,i,o,a,s,u){var c=pi(t,n,i,a,u),l=pi(e,r,o,s,u);return(Math.atan2(l,c)+2*Math.PI)%(2*Math.PI)}};var gi,mi=function(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=si(r[0],r[1],i[0],i[1])}return e}(t)};(gi=t.Shape||(t.Shape={})).GROUP="g",gi.CIRCLE="circle",gi.ELLIPSE="ellipse",gi.IMAGE="image",gi.RECT="rect",gi.LINE="line",gi.POLYLINE="polyline",gi.POLYGON="polygon",gi.TEXT="text",gi.PATH="path",gi.HTML="html",gi.MESH="mesh";var Ti=i.defineToken("CanvasConfig");function bi(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function Ei(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?vi.length.apply(vi,r):0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=bi(n,r,e),s=bi(r,i,e),u=bi(i,o,e),c=bi(a,s,e),l=bi(s,u,e),h=bi(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function Si(t,e,n){var r=Ei(t),i=Ei(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),p=[c,l],f=[h-o,h-a],d=0,y=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return f[e]-=(d=n&&f[e]&&t.l>=p[e])?1:0,d?t.ss:[t.s]})).flat()}));return y[0].length===y[1].length?y:Si(y[0],y[1],h)}function wi(t){return Pi(t)>=0}function xi(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}function Pi(t){var e=0,n=0,r=0,i=0,o=0;return t.map((function(t){switch(t[0]){case"M":case"Z":return e=r="M"===t[0]?t[1]:r,n=i="M"===t[0]?t[2]:i,0;default:o=xi.apply(0,[e,n].concat(t.slice(1)));var a=t.slice(-2);return e=a[0],n=a[1],o}})).reduce((function(t,e){return t+e}),0)}function ki(t){var e=t.slice(1).map((function(e,n,r){return n?r[n-1].slice(-2).concat(e.slice(1)):t[0].slice(1).concat(e.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map((function(t){return["C"].concat(t.slice(2))})))}function Ci(t){return t.map((function(t){return Array.isArray(t)?Ci(t):Number.isNaN(+t)?t:+t}))}function Ni(t,e){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a=i+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(r,o){i+=function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),r[a]=i,i=0})),o[r.indexOf(Math.min.apply(null,r))]}function _i(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,u,r-a,u,r],["C",u,r+a,n+o,l,n,l],["C",n-o,l,s,r+a,s,r],["Z"]]}var Mi=function(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)},Ai=function(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)},Oi=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},Ii=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=t,this.name=e,this.taps=[],this.interceptors=[],this._call=Mi,this.call=Mi,this._callAsync=Ai,this.callAsync=Ai,this._promise=Oi,this.promise=Oi,this._x=void 0}var e=t.prototype;return e.compile=function(t){throw new Error("Abstract: should be overridden")},e._createCall=function(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})},e._tap=function(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw new Error("Missing name for tap");e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)},e.tap=function(t,e){this._tap("sync",t,e)},e.tapAsync=function(t,e){this._tap("async",t,e)},e.tapPromise=function(t,e){this._tap("promise",t,e)},e._runRegisterInterceptors=function(t){for(var e,n=Pe(this.interceptors);!(e=n()).done;){var r=e.value;if(r.register){var i=r.register(t);void 0!==i&&(t=i)}}return t},e.withOptions=function(t){var e=this,n=function(e){return Object.assign({},t,"string"==typeof e?{name:e}:e)};return{name:this.name,tap:function(t,r){return e.tap(n(t),r)},tapAsync:function(t,r){return e.tapAsync(n(t),r)},tapPromise:function(t,r){return e.tapPromise(n(t),r)},isUsed:function(){return e.isUsed()},withOptions:function(t){return e.withOptions(n(t))}}},e.isUsed=function(){return this.taps.length>0||this.interceptors.length>0},e._resetCompilation=function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise},e._insert=function(t){var e;this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var n=0;"number"==typeof t.stage&&(n=t.stage);for(var r=this.taps.length;r>0;){r--;var i=this.taps[r];this.taps[r+1]=i;var o=i.stage||0;if(e){if(e.has(i.name)){e.delete(i.name);continue}if(e.size>0)continue}if(n>=o){r++;break}}this.taps[r]=t},t}(),Ri=function(){function t(t){this.config=t,this.options=void 0,this._args=void 0}var e=t.prototype;return e.create=function(t){var e;switch(this.init(t),this.options.type){case"sync":e=new Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"throw "+t+";\n"},onResult:function(t){return"return "+t+";\n"},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":e=new Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"_callback("+t+");\n"},onResult:function(t){return"_callback(null, "+t+");\n"},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,r=this.contentWithInterceptors({onError:function(t){return n=!0,"_error("+t+");\n"},onResult:function(t){return"_resolve("+t+");\n"},onDone:function(){return"_resolve();\n"}}),i="";i+='"use strict";\n',i+=this.header(),i+="return new Promise((function(_resolve, _reject) {\n",n&&(i+="var _sync = true;\n",i+="function _error(_err) {\n",i+="if(_sync)\n",i+="_resolve(Promise.resolve().then((function() { throw _err; })));\n",i+="else\n",i+="_reject(_err);\n",i+="};\n"),i+=r,n&&(i+="_sync = false;\n"),i+="}));\n",e=new Function(this.args(),i)}return this.deinit(),e},e.setup=function(t,e){t._x=e.taps.map((function(t){return t.fn}))},e.init=function(t){this.options=t,this._args=t.args.slice()},e.deinit=function(){this.options=void 0,this._args=void 0},e.contentWithInterceptors=function(t){var e=this;if(this.options.interceptors.length>0){for(var n=t.onError,r=t.onResult,i=t.onDone,o="",a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.call&&(o+=this.getInterceptor(a)+".call("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.content(Object.assign(t,{onError:n&&function(t){for(var r="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].error&&(r+=e.getInterceptor(i)+".error("+t+");\n")}return r+=n(t)},onResult:r&&function(t){for(var n="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].result&&(n+=e.getInterceptor(i)+".result("+t+");\n")}return n+=r(t)},onDone:i&&function(){for(var t="",n=0;e.options.interceptors.length>n;n++){e.options.interceptors[n].done&&(t+=e.getInterceptor(n)+".done();\n")}return t+=i()}}))}return this.content(t)},e.header=function(){var t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",this.options.interceptors.length>0&&(t+="var _taps = this.taps;\n",t+="var _interceptors = this.interceptors;\n"),t},e.needContext=function(){for(var t,e=Pe(this.options.taps);!(t=e()).done;){if(t.value.context)return!0}return!1},e.callTap=function(t,e){for(var n=e.onError,r=e.onResult,i=e.onDone,o=e.rethrowIfPossible,a="",s=!1,u=0;this.options.interceptors.length>u;u++){var c=this.options.interceptors[u];c.tap&&(s||(a+="var _tap"+t+" = "+this.getTap(t)+";\n",s=!0),a+=this.getInterceptor(u)+".tap("+(c.context?"_context, ":"")+"_tap"+t+");\n")}a+="var _fn"+t+" = "+this.getTapFn(t)+";\n";var l=this.options.taps[t];switch(l.type){case"sync":o||(a+="var _hasError"+t+" = false;\n",a+="try {\n"),a+=r?"var _result"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n":"_fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",o||(a+="} catch(_err) {\n",a+="_hasError"+t+" = true;\n",a+=n("_err"),a+="}\n",a+="if(!_hasError"+t+") {\n"),r&&(a+=r("_result"+t)),i&&(a+=i()),o||(a+="}\n");break;case"async":var h="";h+=r?"(function(_err"+t+", _result"+t+") {\n":"(function(_err"+t+") {\n",h+="if(_err"+t+") {\n",h+=n("_err"+t),h+="} else {\n",r&&(h+=r("_result"+t)),i&&(h+=i()),h+="}\n",a+="_fn"+t+"("+this.args({before:l.context?"_context":void 0,after:h+="})"})+");\n";break;case"promise":a+="var _hasResult"+t+" = false;\n",a+="var _promise"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",a+="if (!_promise"+t+" || !_promise"+t+".then)\n",a+=" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise"+t+" + ')');\n",a+="_promise"+t+".then((function(_result"+t+") {\n",a+="_hasResult"+t+" = true;\n",r&&(a+=r("_result"+t)),i&&(a+=i()),a+="}), function(_err"+t+") {\n",a+="if(_hasResult"+t+") throw _err"+t+";\n",a+=n("_err"+t),a+="});\n"}return a},e.callTapsSeries=function(t){var e=this,n=t.onError,r=t.onResult,i=t.resultReturns,o=t.onDone,a=t.doneReturns,s=t.rethrowIfPossible;if(0===this.options.taps.length)return o();for(var u=this.options.taps.findIndex((function(t){return"sync"!==t.type})),c=i||a,l="",h=o,p=0,f=function(t){var i=t;h!==o&&("sync"!==e.options.taps[i].type||p++>20)&&(p=0,l+="function _next"+i+"() {\n",l+=h(),l+="}\n",h=function(){return(c?"return ":"")+"_next"+i+"();\n"});var a=h,f=function(t){return t?"":o()},d=e.callTap(i,{onError:function(t){return n(i,t,a,f)},onResult:r&&function(t){return r(i,t,a,f)},onDone:!r&&a,rethrowIfPossible:s&&(0>u||u>i)});h=function(){return d}},d=this.options.taps.length-1;d>=0;d--)f(d);return l+=h()},e.callTapsLooping=function(t){var e=t.onError,n=t.onDone,r=t.rethrowIfPossible;if(0===this.options.taps.length)return n();var i=this.options.taps.every((function(t){return"sync"===t.type})),o="";i||(o+="var _looper = (function() {\n",o+="var _loopAsync = false;\n"),o+="var _loop;\n",o+="do {\n",o+="_loop = false;\n";for(var a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.loop&&(o+=this.getInterceptor(a)+".loop("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.callTapsSeries({onError:e,onResult:function(t,e,n,r){var o="";return o+="if("+e+" !== undefined) {\n",o+="_loop = true;\n",i||(o+="if(_loopAsync) _looper();\n"),o+=r(!0),o+="} else {\n",o+=n(),o+="}\n"},onDone:n&&function(){var t="";return t+="if(!_loop) {\n",t+=n(),t+="}\n"},rethrowIfPossible:r&&i}),o+="} while(_loop);\n",i||(o+="_loopAsync = true;\n",o+="});\n",o+="_looper();\n"),o},e.callTapsParallel=function(t){var e=this,n=t.onError,r=t.onResult,i=t.onDone,o=t.rethrowIfPossible,a=t.onTap,s=void 0===a?function(t,e){return e()}:a;if(1>=this.options.taps.length)return this.callTapsSeries({onError:n,onResult:r,onDone:i,rethrowIfPossible:o});var u="";u+="do {\n",u+="var _counter = "+this.options.taps.length+";\n",i&&(u+="var _done = (function() {\n",u+=i(),u+="});\n");for(var c=function(t){var a=function(){return i?"if(--_counter === 0) _done();\n":"--_counter;"},c=function(t){return t||!i?"_counter = 0;\n":"_counter = 0;\n_done();\n"};u+="if(_counter <= 0) break;\n",u+=s(t,(function(){return e.callTap(t,{onError:function(e){var r="";return r+="if(_counter > 0) {\n",r+=n(t,e,a,c),r+="}\n"},onResult:r&&function(e){var n="";return n+="if(_counter > 0) {\n",n+=r(t,e,a,c),n+="}\n"},onDone:!r&&function(){return a()},rethrowIfPossible:o})}),a,c)},l=0;this.options.taps.length>l;l++)c(l);return u+="} while(false);\n"},e.args=function(t){var e=void 0===t?{}:t,n=e.before,r=e.after,i=this._args;return n&&(i=[n].concat(i)),r&&(i=i.concat(r)),0===i.length?"":i.join(", ")},e.getTapFn=function(t){return"_x["+t+"]"},e.getTap=function(t){return"_taps["+t+"]"},e.getInterceptor=function(t){return"_interceptors["+t+"]"},t}(),Li=function(t){function e(){return t.apply(this,arguments)||this}return me(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsParallel({onError:function(t,n,r,i){return e(n)+i(!0)},onDone:t.onDone})},e}(Ri),Di=new Li,Ui=function(t){return Di.setup(this,t),Di.create(t)},Fi=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=Ui,r._call=void 0,r.call=void 0,r}return me(e,t),e}(Ii),Bi=function(t){function e(){return t.apply(this,arguments)||this}return me(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e,r,i){return n(e)+i(!0)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])}})},e}(Ri),Vi=new Bi,Gi=function(t){return Vi.setup(this,t),Vi.create(t)},ji=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=Gi,r._call=void 0,r.call=void 0,r}return me(e,t),e}(Ii),Hi=function(t){function e(){return t.apply(this,arguments)||this}return me(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsSeries({onError:function(t,n){return e(n)},onDone:t.onDone,rethrowIfPossible:t.rethrowIfPossible})},e}(Ri),zi=new Hi,Wi=function(){throw new Error("tapAsync is not supported on a SyncHook")},Yi=function(){throw new Error("tapPromise is not supported on a SyncHook")},qi=function(t){return zi.setup(this,t),zi.create(t)},Xi=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=Wi,r.tapPromise=Yi,r.compile=qi,r}return me(e,t),e}(Ii),Ki=function(t){function e(){return t.apply(this,arguments)||this}return me(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e){return n(e)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])},doneReturns:t.resultReturns,rethrowIfPossible:t.rethrowIfPossible})},e}(Ri),Zi=new Ki,Ji=function(){throw new Error("tapAsync is not supported on a SyncWaterfallHook")},Qi=function(){throw new Error("tapPromise is not supported on a SyncWaterfallHook")},$i=function(t){return Zi.setup(this,t),Zi.create(t)},to=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=Ji,r.tapPromise=Qi,r.compile=$i,r}return me(e,t),e}(Xi),eo=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function no(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=Be(e)?e+"px":e.toString(),s=$r(n)?n.split(","):[n.value],u=s.length-1;u>=0;u--){var c=s[u].trim();!/([\"\'])[^\'\"]+\1/.test(c)&&0>eo.indexOf(c)&&(c='"'+c+'"'),s[u]=c}return r+" "+i+" "+o+" "+a+" "+s.join(",")}var ro=i.defineToken("LayoutChildrenFactory"),io=i.defineToken("LayoutChildrenOptions");t.LayoutChildren=function(){function e(t,e){this._layoutContext=void 0,this.options=void 0,this.node=void 0,this.styleMap=void 0,this.layoutContext=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.node=e.node,this.styleMap=e.node.getAllStyle()}var n=e.prototype;return n.intrinsicSizes=function(){var e=new Rr;return this.layoutContext.appendWorkTask({layoutChild:this,taskType:t.LayoutTaskType.IntrinsicSizes,deferred:e}),e.promise},n.layoutNextFragment=function(e){if(this.layoutContext.mode===t.LayoutTaskType.IntrinsicSizes)throw new Error("Not Supported: cant call layoutNextFragment in intrinsicSizes");var n=new Rr;return this.layoutContext.appendWorkTask({layoutConstraints:e,layoutChild:this,taskType:t.LayoutTaskType.Layout,deferred:n}),n.promise},e}(),t.LayoutChildren=ce([ct(),le(0,ht(t.LayoutContext)),le(1,ht(io)),he("design:paramtypes",[t.LayoutContext,Object])],t.LayoutChildren);var oo=function(){};oo.inputProperties=void 0,oo.childrenInputProperties=void 0,oo.layoutOptions=void 0;var ao,so,uo=i.defineToken("LayoutEdgesFactory"),co=i.defineToken("LayoutEdgesOptions"),lo=[0,0,0,0];t.LayoutEdges=function(e){var n,r,i,o,a,s,u,c,l,h,p,f,d,y,v,g;this.options=void 0,this.inlineStart=void 0,this.inlineEnd=void 0,this.blockStart=void 0,this.blockEnd=void 0,this.inline=void 0,this.block=void 0,this.options=e;var m=e.node.getAllStyle(),T=null!==(n=null===(r=m.get(t.PropertyName.PADDING_TOP))||void 0===r?void 0:r.value)&&void 0!==n?n:0,b=null!==(i=null===(o=m.get(t.PropertyName.PADDING_END))||void 0===o?void 0:o.value)&&void 0!==i?i:0,E=null!==(a=null===(s=m.get(t.PropertyName.PADDING_BOTTOM))||void 0===s?void 0:s.value)&&void 0!==a?a:0,S=null!==(u=null===(c=m.get(t.PropertyName.PADDING_START))||void 0===c?void 0:c.value)&&void 0!==u?u:0,w=null!==(l=null===(h=m.get(t.PropertyName.PADDING_TOP))||void 0===h?void 0:h.value)&&void 0!==l?l:0,x=null!==(p=null===(f=m.get(t.PropertyName.PADDING_END))||void 0===f?void 0:f.value)&&void 0!==p?p:0,P=null!==(d=null===(y=m.get(t.PropertyName.PADDING_BOTTOM))||void 0===y?void 0:y.value)&&void 0!==d?d:0,k=null!==(v=null===(g=m.get(t.PropertyName.PADDING_START))||void 0===g?void 0:g.value)&&void 0!==v?v:0;this.blockStart=T+lo[0]+w,this.inlineStart=b+lo[1]+x,this.blockEnd=E+lo[2]+P,this.inlineEnd=S+lo[3]+k,this.block=this.blockStart+this.blockEnd,this.inline=this.inlineStart+this.inlineEnd},t.LayoutEdges=ce([ct(),le(0,ht(co)),he("design:paramtypes",[Object])],t.LayoutEdges),t.LayoutRegistry=((ao=function(){function t(){this.registry=new Map}var e=t.prototype;return e.hasLayout=function(t){return this.registry.has(t)},e.getLayout=function(t){if(void 0===t&&(t="absolute"),!this.hasLayout(t))throw new Error("invalid layout property: "+t);return this.registry.get(t)},e.updateLayout=function(t,e){this.registry.set(t,e)},e.registerLayout=function(t,e){if(""===t)throw new TypeError("layout name cant't be empty");if(so.reservedLayout.includes(t))throw new Error("layout name '"+t+"' is a system reserved layout name, please use another name");if(this.hasLayout(t))throw new Error("layout '"+t+"' already exist.");this.registry.set(t,e)},e.deleteLayout=function(t){this.registry.delete(t)},ve(t,[{key:"size",get:function(){return this.registry.size}}]),t}()).reservedLayout=[],so=ao),t.LayoutRegistry=so=ce([lt()],t.LayoutRegistry);var ho=function(t){return void 0===t&&(t=0),new Promise((function(e){setTimeout((function(){e()}),t)}))};t.LayoutEngine=function(){function e(t,e,n){this._layoutRegistry=void 0,this._layoutContextFactory=void 0,this._layoutEdgesFactory=void 0,this.layoutRegistry=void 0,this.layoutContextFactory=void 0,this.layoutEdgesFactory=void 0,this._layoutRegistry=t,this._layoutContextFactory=e,this._layoutEdgesFactory=n,this.layoutRegistry=t,this.layoutContextFactory=e,this.layoutEdgesFactory=n}var n=e.prototype;return n.computeLayout=function(){var t=de(pe().mark((function t(e,n){return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.determineIntrinsicSizes(e,e.children);case 2:return t.next=4,this.calculateLayout(e,e.children,n);case 4:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.determineAllIntrinsicSizes=function(){var t=de(pe().mark((function t(e){return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),n.getLayoutDefinitionName=function(e){var n=e.getAllStyle().get(t.PropertyName.LAYOUT);if(!n)throw new Error("layout property not found");return n.value},n.determineIntrinsicSizes=function(){var t=de(pe().mark((function t(e,n){var r;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getLayoutDefinitionName(e),t.next=3,this.invokeIntrinsicSizesCallback(r,e,n);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.invokeIntrinsicSizesCallback=function(){var e=de(pe().mark((function e(n,r,i){var o,a,s,u,c,l,h,p,f,d,y;return pe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this.layoutRegistry.getLayout(n),a=new o,s=this.layoutContextFactory({mode:t.LayoutTaskType.IntrinsicSizes}),c=void 0===(u=o.inputProperties)?[]:u,l=[],i.forEach((function(t){var e=s.layoutChildrenFactory({node:t});l.push(e)})),h=this.layoutEdgesFactory({node:r}),p=r.getStyle.apply(r,c),f=a.intrinsicSizes(l,h,p),(d=this.runWorkQueue(f,s.workQueue)).next(),e.next=13,ho();case 13:y=d.next().value,s.clearWorkQueue(),r.setIntrisicSizes(y);case 16:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),n.calculateLayout=function(){var t=de(pe().mark((function t(e,n,r){var i;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.getLayoutDefinitionName(e),t.next=3,this.invokeLayoutCallback(i,e,n,r);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),n.invokeLayoutCallback=function(){var e=de(pe().mark((function e(n,r,i,o){var a,s,u,c,l,h,p,f,d,y,v,g,m;return pe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.layoutRegistry.getLayout(n),s=new a,u=this.layoutContextFactory({mode:t.LayoutTaskType.Layout}),l=void 0===(c=a.inputProperties)?[]:c,h=[],i.forEach((function(t){var e=u.layoutChildrenFactory({node:t});h.push(e)})),p=this.layoutEdgesFactory({node:r}),f=r.getStyle.apply(r,l),d=s.layout(h,p,o,f),(y=this.runWorkQueue(d,u.workQueue)).next(),e.next=13,ho();case 13:v=y.next().value,u.clearWorkQueue(),g=v instanceof t.FragmentResult?v:u.fragmentResultFactory(v),m=u.layoutFragmentFactory({inlineSize:g.inlineSize,blockSize:g.blockSize,data:g.data}),r.setComputedLayout(m),i.forEach((function(t,e){t.setComputedLayout(g.childFragments[e])}));case 19:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i){return e.apply(this,arguments)}}(),n.runWorkQueue=pe().mark((function e(n,r){var i,o=this;return pe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Ir(n),r.length>0&&i.isPending()&&r.forEach((function(e){e.taskType===t.LayoutTaskType.IntrinsicSizes&&e.deferred.resolve(o.getNodeIntrisicSizes(e.layoutChild.node));if(e.taskType===t.LayoutTaskType.Layout){var n=e.layoutChild,r=e.deferred,i=n.layoutContext,a=o.getNodeFragment(n.node,e.layoutConstraints);r.resolve(i.layoutFragmentFactory(a))}})),void(e.next=4);case 4:if(i.isFulfilled()){e.next=6;break}throw new Error("promise not fullfilled!");case 6:return e.abrupt("return",i.getFullFilledValue());case 7:case"end":return e.stop()}}),e)})),n.getNodeIntrisicSizes=function(e){var n,r,i,o,a,s,u,c,l,h,p,f,d=e.getAllStyle();return{minContentInlineSize:(null===(n=d.get(t.PropertyName.MIN_WIDTH))||void 0===n?void 0:n.value)||(null===(r=e.intrisicSizes)||void 0===r?void 0:r.minContentInlineSize)||(null===(i=d.get(t.PropertyName.WIDTH))||void 0===i?void 0:i.value)||0,maxContentInlineSize:(null===(o=d.get(t.PropertyName.MAX_WIDTH))||void 0===o?void 0:o.value)||(null===(a=e.intrisicSizes)||void 0===a?void 0:a.maxContentInlineSize)||(null===(s=d.get(t.PropertyName.WIDTH))||void 0===s?void 0:s.value)||0,minContentBlockSize:(null===(u=d.get(t.PropertyName.MIN_HEIGHT))||void 0===u?void 0:u.value)||(null===(c=e.intrisicSizes)||void 0===c?void 0:c.minContentBlockSize)||(null===(l=d.get(t.PropertyName.HEIGHT))||void 0===l?void 0:l.value)||0,maxContentBlockSize:(null===(h=d.get(t.PropertyName.MAX_HEIGHT))||void 0===h?void 0:h.value)||(null===(p=e.intrisicSizes)||void 0===p?void 0:p.maxContentBlockSize)||(null===(f=d.get(t.PropertyName.HEIGHT))||void 0===f?void 0:f.value)||0}},n.getNodeFragment=function(e,n){var r,i,o,a,s,u;return{inlineSize:(null===(r=e.getComputedLayout())||void 0===r?void 0:r.inlineSize)||(null===(i=e.getAllStyle().get(t.PropertyName.MIN_WIDTH))||void 0===i?void 0:i.value)||(null===(o=e.getAllStyle().get(t.PropertyName.WIDTH))||void 0===o?void 0:o.value)||0,blockSize:(null===(a=e.getComputedLayout())||void 0===a?void 0:a.blockSize)||(null===(s=e.getAllStyle().get(t.PropertyName.MIN_HEIGHT))||void 0===s?void 0:s.value)||(null===(u=e.getAllStyle().get(t.PropertyName.HEIGHT))||void 0===u?void 0:u.value)||0,data:n.data}},e}(),t.LayoutEngine=ce([lt(),le(0,ht(t.LayoutRegistry)),le(1,ht(Ne)),le(2,ht(uo)),he("design:paramtypes",[t.LayoutRegistry,Function,Function])],t.LayoutEngine);var po=i.defineToken("LayoutFragmentFactory"),fo=i.defineToken("LayoutFragmentOptions");t.LayoutFragment=function(t,e){this._layoutContext=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.inlineOffset=void 0,this.blockOffset=void 0,this.data=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.inlineSize=e.inlineSize,this.blockSize=e.blockSize,this.inlineOffset=0,this.blockOffset=0,this.data=e.data},t.LayoutFragment=ce([ct(),le(0,ht(t.LayoutContext)),le(1,ht(fo)),he("design:paramtypes",[t.LayoutContext,Object])],t.LayoutFragment);var yo,vo,go,mo,To,bo=n((function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,o=new Array(i);i>r;r++)o[r]=e[r].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,a),!0}for(c=1,u=new Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;f>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,i);break;default:if(!u)for(p=1,u=new Array(h-1);h>p;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}));(yo=t.UnitType||(t.UnitType={}))[yo.kUnknown=0]="kUnknown",yo[yo.kNumber=1]="kNumber",yo[yo.kPercentage=2]="kPercentage",yo[yo.kEms=3]="kEms",yo[yo.kExs=4]="kExs",yo[yo.kPixels=5]="kPixels",yo[yo.kCentimeters=6]="kCentimeters",yo[yo.kMillimeters=7]="kMillimeters",yo[yo.kInches=8]="kInches",yo[yo.kPoints=9]="kPoints",yo[yo.kPicas=10]="kPicas",yo[yo.kQuarterMillimeters=11]="kQuarterMillimeters",yo[yo.kViewportWidth=12]="kViewportWidth",yo[yo.kViewportHeight=13]="kViewportHeight",yo[yo.kViewportInlineSize=14]="kViewportInlineSize",yo[yo.kViewportBlockSize=15]="kViewportBlockSize",yo[yo.kViewportMin=16]="kViewportMin",yo[yo.kViewportMax=17]="kViewportMax",yo[yo.kSmallViewportWidth=18]="kSmallViewportWidth",yo[yo.kSmallViewportHeight=19]="kSmallViewportHeight",yo[yo.kSmallViewportInlineSize=20]="kSmallViewportInlineSize",yo[yo.kSmallViewportBlockSize=21]="kSmallViewportBlockSize",yo[yo.kSmallViewportMin=22]="kSmallViewportMin",yo[yo.kSmallViewportMax=23]="kSmallViewportMax",yo[yo.kLargeViewportWidth=24]="kLargeViewportWidth",yo[yo.kLargeViewportHeight=25]="kLargeViewportHeight",yo[yo.kLargeViewportInlineSize=26]="kLargeViewportInlineSize",yo[yo.kLargeViewportBlockSize=27]="kLargeViewportBlockSize",yo[yo.kLargeViewportMin=28]="kLargeViewportMin",yo[yo.kLargeViewportMax=29]="kLargeViewportMax",yo[yo.kDynamicViewportWidth=30]="kDynamicViewportWidth",yo[yo.kDynamicViewportHeight=31]="kDynamicViewportHeight",yo[yo.kDynamicViewportInlineSize=32]="kDynamicViewportInlineSize",yo[yo.kDynamicViewportBlockSize=33]="kDynamicViewportBlockSize",yo[yo.kDynamicViewportMin=34]="kDynamicViewportMin",yo[yo.kDynamicViewportMax=35]="kDynamicViewportMax",yo[yo.kContainerWidth=36]="kContainerWidth",yo[yo.kContainerHeight=37]="kContainerHeight",yo[yo.kContainerInlineSize=38]="kContainerInlineSize",yo[yo.kContainerBlockSize=39]="kContainerBlockSize",yo[yo.kContainerMin=40]="kContainerMin",yo[yo.kContainerMax=41]="kContainerMax",yo[yo.kRems=42]="kRems",yo[yo.kChs=43]="kChs",yo[yo.kUserUnits=44]="kUserUnits",yo[yo.kDegrees=45]="kDegrees",yo[yo.kRadians=46]="kRadians",yo[yo.kGradians=47]="kGradians",yo[yo.kTurns=48]="kTurns",yo[yo.kMilliseconds=49]="kMilliseconds",yo[yo.kSeconds=50]="kSeconds",yo[yo.kHertz=51]="kHertz",yo[yo.kKilohertz=52]="kKilohertz",yo[yo.kDotsPerPixel=53]="kDotsPerPixel",yo[yo.kDotsPerInch=54]="kDotsPerInch",yo[yo.kDotsPerCentimeter=55]="kDotsPerCentimeter",yo[yo.kFraction=56]="kFraction",yo[yo.kInteger=57]="kInteger",yo[yo.kQuirkyEms=58]="kQuirkyEms",(vo=t.UnitCategory||(t.UnitCategory={}))[vo.kUNumber=0]="kUNumber",vo[vo.kUPercent=1]="kUPercent",vo[vo.kULength=2]="kULength",vo[vo.kUAngle=3]="kUAngle",vo[vo.kUTime=4]="kUTime",vo[vo.kUFrequency=5]="kUFrequency",vo[vo.kUResolution=6]="kUResolution",vo[vo.kUOther=7]="kUOther",(go=t.ValueRange||(t.ValueRange={}))[go.kAll=0]="kAll",go[go.kNonNegative=1]="kNonNegative",go[go.kInteger=2]="kInteger",go[go.kNonNegativeInteger=3]="kNonNegativeInteger",go[go.kPositiveInteger=4]="kPositiveInteger",(mo=t.Nested||(t.Nested={}))[mo.kYes=0]="kYes",mo[mo.kNo=1]="kNo",(To=t.ParenLess||(t.ParenLess={}))[To.kYes=0]="kYes",To[To.kNo=1]="kNo";var Eo,So=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];(Eo=t.CSSStyleValueType||(t.CSSStyleValueType={}))[Eo.kUnknownType=0]="kUnknownType",Eo[Eo.kUnparsedType=1]="kUnparsedType",Eo[Eo.kKeywordType=2]="kKeywordType",Eo[Eo.kUnitType=3]="kUnitType",Eo[Eo.kSumType=4]="kSumType",Eo[Eo.kProductType=5]="kProductType",Eo[Eo.kNegateType=6]="kNegateType",Eo[Eo.kInvertType=7]="kInvertType",Eo[Eo.kMinType=8]="kMinType",Eo[Eo.kMaxType=9]="kMaxType",Eo[Eo.kClampType=10]="kClampType",Eo[Eo.kTransformType=11]="kTransformType",Eo[Eo.kPositionType=12]="kPositionType",Eo[Eo.kURLImageType=13]="kURLImageType",Eo[Eo.kColorType=14]="kColorType",Eo[Eo.kUnsupportedColorType=15]="kUnsupportedColorType";var wo,xo,Po=function(){function e(){}e.parse=function(t,e){return[][0]},e.parseAll=function(t,e){return[]},e.unitFromName=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:this.stringToUnitType(e):t.UnitType.kUnknown},e.unitTypeToUnitCategory=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return t.UnitCategory.kUNumber;case t.UnitType.kPercentage:return t.UnitCategory.kUPercent;case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:return t.UnitCategory.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return t.UnitCategory.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return t.UnitCategory.kUAngle;case t.UnitType.kHertz:case t.UnitType.kKilohertz:return t.UnitCategory.kUFrequency;case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:return t.UnitCategory.kUResolution;default:return t.UnitCategory.kUOther}},e.unitTypeToString=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:case t.UnitType.kUserUnits:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:case t.UnitType.kQuirkyEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},e.stringToUnitType=function(t){return So.find((function(e){return e.name===t})).unit_type},e.canonicalUnitTypeForCategory=function(e){switch(e){case t.UnitCategory.kUNumber:return t.UnitType.kNumber;case t.UnitCategory.kULength:return t.UnitType.kPixels;case t.UnitCategory.kUPercent:return t.UnitType.kUnknown;case t.UnitCategory.kUTime:return t.UnitType.kSeconds;case t.UnitCategory.kUAngle:return t.UnitType.kDegrees;case t.UnitCategory.kUFrequency:return t.UnitType.kHertz;case t.UnitCategory.kUResolution:return t.UnitType.kDotsPerPixel;default:return t.UnitType.kUnknown}},e.conversionToCanonicalUnitsScaleFactor=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kUserUnits:case t.UnitType.kDegrees:case t.UnitType.kSeconds:case t.UnitType.kHertz:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kCentimeters:case t.UnitType.kDotsPerCentimeter:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kDotsPerInch:case t.UnitType.kPoints:case t.UnitType.kPicas:break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360;break;case t.UnitType.kKilohertz:n=1e3}return n},e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isViewportPercentageLength=function(e){return e>=t.UnitType.kViewportWidth&&t.UnitType.kDynamicViewportMax>=e},e.isContainerPercentageLength=function(e){return e>=t.UnitType.kContainerWidth&&t.UnitType.kContainerMax>=e},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kUserUnits>=e||e==t.UnitType.kQuirkyEms},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kExs||e===t.UnitType.kRems||e===t.UnitType.kChs||this.isViewportPercentageLength(e)||this.isContainerPercentageLength(e)},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds},e.isFrequency=function(e){return e==t.UnitType.kHertz||e==t.UnitType.kKilohertz},e.isResolution=function(e){return e>=t.UnitType.kDotsPerPixel&&t.UnitType.kDotsPerCentimeter>=e},e.isFlex=function(e){return e===t.UnitType.kFraction};var n=e.prototype;return n.toString=function(){return this.buildCSSText(t.Nested.kNo,t.ParenLess.kNo,"")},n.isNumericValue=function(){return this.getType()>=t.CSSStyleValueType.kUnitType&&this.getType()<=t.CSSStyleValueType.kClampType},e}(),ko=function(e){function n(t){var n;return(n=e.call(this)||this).colorSpace=void 0,n.colorSpace=t,n}me(n,e);var r=n.prototype;return r.getType=function(){return t.CSSStyleValueType.kColorType},r.to=function(t){return this},n}(Po),Co=function(e){function n(t){var n;return(n=e.call(this)||this).value=void 0,n.value=t,n}me(n,e);var r=n.prototype;return r.clone=function(){return new n(this.value)},r.getType=function(){return t.CSSStyleValueType.kKeywordType},r.buildCSSText=function(t,e,n){return n+this.value},n}(Po);function No(e){switch(De(e,t.UnitType.kNumber),e){case t.UnitType.kEms:case t.UnitType.kExs:case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:case t.UnitType.kViewportWidth:case t.UnitType.kViewportHeight:case t.UnitType.kViewportInlineSize:case t.UnitType.kViewportBlockSize:case t.UnitType.kViewportMin:case t.UnitType.kViewportMax:case t.UnitType.kSmallViewportWidth:case t.UnitType.kSmallViewportHeight:case t.UnitType.kSmallViewportInlineSize:case t.UnitType.kSmallViewportBlockSize:case t.UnitType.kSmallViewportMin:case t.UnitType.kSmallViewportMax:case t.UnitType.kLargeViewportWidth:case t.UnitType.kLargeViewportHeight:case t.UnitType.kLargeViewportInlineSize:case t.UnitType.kLargeViewportBlockSize:case t.UnitType.kLargeViewportMin:case t.UnitType.kLargeViewportMax:case t.UnitType.kDynamicViewportWidth:case t.UnitType.kDynamicViewportHeight:case t.UnitType.kDynamicViewportInlineSize:case t.UnitType.kDynamicViewportBlockSize:case t.UnitType.kDynamicViewportMin:case t.UnitType.kDynamicViewportMax:case t.UnitType.kContainerWidth:case t.UnitType.kContainerHeight:case t.UnitType.kContainerInlineSize:case t.UnitType.kContainerBlockSize:case t.UnitType.kContainerMin:case t.UnitType.kContainerMax:case t.UnitType.kRems:case t.UnitType.kChs:return t.BaseType.kLength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return t.BaseType.kTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return t.BaseType.kAngle;case t.UnitType.kHertz:case t.UnitType.kKilohertz:return t.BaseType.kFrequency;case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:return t.BaseType.kResolution;case t.UnitType.kFraction:return t.BaseType.kFlex;case t.UnitType.kPercentage:return t.BaseType.kPercent;default:return t.BaseType.kLength}}function _o(e){switch(e){case t.BaseType.kLength:return"length";case t.BaseType.kAngle:return"angle";case t.BaseType.kTime:return"time";case t.BaseType.kFrequency:return"frequency";case t.BaseType.kResolution:return"resolution";case t.BaseType.kFlex:return"flex";case t.BaseType.kPercent:return"percent"}return""}(wo=t.CSSMathOperator||(t.CSSMathOperator={})).kAdd="+",wo.kSubtract="-",wo.kMultiply="*",wo.kDivide="/",wo.kMin="min",wo.kMax="max",wo.kClamp="clamp",wo.kInvalid="",(xo=t.BaseType||(t.BaseType={}))[xo.kLength=0]="kLength",xo[xo.kAngle=1]="kAngle",xo[xo.kTime=2]="kTime",xo[xo.kFrequency=3]="kFrequency",xo[xo.kResolution=4]="kResolution",xo[xo.kFlex=5]="kFlex",xo[xo.kPercent=6]="kPercent",xo[xo.kNumBaseTypes=7]="kNumBaseTypes";var Mo=function(){function e(e,n){void 0===e&&(e=t.UnitType.kNumber),void 0===n&&(n=1),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=t.BaseType.kPercent,this.hasPercentHint=!1,this.exponents=new Array(t.BaseType.kNumBaseTypes).fill(0),e!==t.UnitType.kNumber&&this.setExponent(No(e),n)}var n=e.prototype;return n.applyPercentHint=function(e){De(e,t.BaseType.kPercent),this.setExponent(e,this.exponent(e)+this.exponent(t.BaseType.kPercent)),this.setExponent(t.BaseType.kPercent,0),this.percentHint=e,this.hasPercentHint=!0},n.hasNonZeroEntries=function(){return this.numNonZeroEntries>0},n.isOnlyNonZeroEntry=function(t,e){return De(e,0),1===this.numNonZeroEntries&&this.exponent(t)===e},n.exponent=function(t){return this.exponents[t]},n.setExponent=function(t,e){var n=this.exponents[t];0==n&&0!==e?this.numNonZeroEntries++:0!==n&&0==e&&this.numNonZeroEntries--,this.exponents[t]=e},e.negateExponents=function(t){return t.exponents.forEach((function(t){return-1*t})),t},n.matchesBaseType=function(e){return De(e,t.BaseType.kPercent),this.isOnlyNonZeroEntry(e,1)&&!this.hasPercentHint},n.matchesPercentage=function(){return this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},n.matchesBaseTypePercentage=function(e){return De(e,t.BaseType.kPercent),this.isOnlyNonZeroEntry(e,1)||this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},n.matchesNumber=function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint},n.matchesNumberPercentage=function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},e.add=function(e,n,r){if(e.hasPercentHint&&n.hasPercentHint&&e.percentHint!=n.percentHint)return e;e.hasPercentHint?n.applyPercentHint(e.percentHint):n.hasPercentHint&&e.applyPercentHint(n.percentHint),Le(e.percentHint,n.percentHint);for(var i=0;t.BaseType.kNumBaseTypes>i;++i){var o=i;if(e.exponents[i]!==n.exponents[i]&&(o!==t.BaseType.kPercent&&(e.applyPercentHint(o),n.applyPercentHint(o)),e.exponents[i]!==n.exponents[i]))return e}return e},e.multiply=function(e,n,r){if(e.hasPercentHint&&n.hasPercentHint&&e.percentHint!=n.percentHint)return e;e.hasPercentHint?n.applyPercentHint(e.percentHint):n.hasPercentHint&&e.applyPercentHint(n.percentHint);for(var i=0;t.BaseType.kNumBaseTypes>i;++i){var o=i;e.setExponent(o,e.exponent(o)+n.exponent(o))}return e},e}(),Ao=function(e){function n(t){var n;return(n=e.call(this)||this).type_=void 0,n.type_=t,n}me(n,e),n.fromNumberish=function(e){return"number"==typeof e?new Uo(e,t.UnitType.kNumber):e},n.fromPercentish=function(e){return"number"==typeof e?new Uo(100*e,t.UnitType.kPercentage):e};var r=n.prototype;return r.getType=function(){return t.CSSStyleValueType.kUnknownType},r.equals=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);return i.every((function(e){return t.equals(e)}))},r.add=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);Io(t.CSSStyleValueType.kSumType,i,this);var o=Lo(i,t.CSSMathOperator.kAdd);return o||Yo.create(i)},r.sub=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);i=i.map((function(t){return t.negate()})),Io(t.CSSStyleValueType.kSumType,i,this);var o=Lo(i,t.CSSMathOperator.kAdd);return o||Yo.create(i)},r.mul=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);Io(t.CSSStyleValueType.kProductType,i,this);var o=Do(i);return o||qo.create(i)},r.div=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);i=i.map((function(t){return t.invert()})),Io(t.CSSStyleValueType.kProductType,i,this);var o=Do(i);return o||qo.create(i)},r.min=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);Io(t.CSSStyleValueType.kMinType,i,this);var o=Lo(i,t.CSSMathOperator.kMin);return o||zo.create(i)},r.max=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);Io(t.CSSStyleValueType.kMaxType,i,this);var o=Lo(i,t.CSSMathOperator.kMax);return o||Wo.create(i)},r.to=function(t){var e=this.sumValue();if(0===e.length||1!==e.length)return null;var n,r=Ro(e[0]);return r?(n="string"==typeof t?Uo.unitFromName(t):t,r.convertTo(n)):null},r.toSum=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];for(var i=0,o=e;o.length>i;i++){var a=o[i];if(!n.isValidUnit(n.unitFromName(a)))return null}var s=this.sumValue();if(!s.length)return null;for(var u,c=[],l=Pe(s);!(u=l()).done;){var h=u.value,p=Ro(h);if(!p)return null;c.push(p)}if(0===e.length){c.sort((function(t,e){return t.unit-e.unit}));var f=Yo.create(c);return Re(!!f),f}for(var d=[],y=function(){var t=n.unitFromName(g[v]);Re(n.isValidUnit(t));var e=c.reduce((function(e,n,r){if(n){var i=n.convertTo(t);i&&(e+=i.value,c[r]=null)}return e}),0);d.push(new Uo(e,t))},v=0,g=e;g.length>v;v++)y();if(c.some((function(t){return!!t})))throw new Error("There were leftover terms that were not converted");return Yo.create(d)},r.type=function(){var e={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},n=this.type_.exponent(t.BaseType.kLength);return n&&(e.length=n),(n=this.type_.exponent(t.BaseType.kAngle))&&(e.angle=n),(n=this.type_.exponent(t.BaseType.kTime))&&(e.time=n),(n=this.type_.exponent(t.BaseType.kFrequency))&&(e.frequency=n),(n=this.type_.exponent(t.BaseType.kResolution))&&(e.resolution=n),(n=this.type_.exponent(t.BaseType.kFlex))&&(e.flex=n),(n=this.type_.exponent(t.BaseType.kPercent))&&(e.percent=n),this.type_.hasPercentHint&&(e.percentHint=_o(this.type_.percentHint)),e},n.isValidUnit=function(e){return e!==t.UnitType.kUserUnits&&!!(e===t.UnitType.kNumber||e==t.UnitType.kPercentage||this.isLength(e)||this.isAngle(e)||this.isTime(e)||this.isFrequency(e)||this.isResolution(e)||this.isFlex(e))},r.negate=function(){return Vo.create(this)},r.invert=function(){return Bo.create(this)},n}(Po);function Oo(t){return t.map(Ao.fromNumberish)}function Io(t,e,n){Re(!!n),n.getType()===t?e.unshift.apply(e,n.numericValues()):e.unshift(n)}function Ro(t){return 0===Object.keys(t.units).length?new Uo(t.value):1===Object.keys(t.units).length&&1===t.units[Object.keys(t.units)[0]]?new Uo(t.value,Number(Object.keys(t.units)[0])):null}function Lo(e,n){Re(!!e.length);var r=e[0]instanceof Uo?e[0]:null;if(!r)return null;for(var i=r.value,o=1;e.length>o;o++){var a=e[o]instanceof Uo?e[o]:null;if(!a||a.unit!==r.unit)return null;n===t.CSSMathOperator.kAdd?i+=a.value:n===t.CSSMathOperator.kMax?i=Math.max(i,a.value):n===t.CSSMathOperator.kMin&&(i=Math.min(i,a.value))}return new Uo(i,r.unit)}function Do(e){Re(!!e.length);for(var n=t.UnitType.kNumber,r=1,i=0;e.length>i;i++){var o=e[i]instanceof Uo?e[i]:null;if(!o)return null;if(o.unit!==t.UnitType.kNumber){if(n!==t.UnitType.kNumber)return null;n=o.unit}r*=o.value}return new Uo(r,n)}var Uo=function(e){function n(r,i){var o,a;return void 0===i&&(i=t.UnitType.kNumber),a="string"==typeof i?n.unitFromName(i):i,Re(n.isValidUnit(a)),(o=e.call(this,new Mo(a))||this).unit=void 0,o.value=void 0,o.unit=a,o.value=r,o}me(n,e),n.toCanonicalUnit=function(t){return this.canonicalUnitTypeForCategory(this.unitTypeToUnitCategory(t))},n.toCanonicalUnitIfPossible=function(e){var n=this.toCanonicalUnit(e);return n===t.UnitType.kUnknown?e:n},n.formatInfinityOrNaN=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(Re(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},n.formatNumber=function(t,e){return void 0===e&&(e=""),t+e};var r=n.prototype;return r.clone=function(){return new n(this.value,this.unit)},r.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var r=n.toCanonicalUnit(this.unit);if(r!==n.toCanonicalUnit(e)||r===t.UnitType.kUnknown)return null;var i=Po.conversionToCanonicalUnitsScaleFactor(this.unit)/Po.conversionToCanonicalUnitsScaleFactor(e);return new n(this.value*i,e)},r.equals=function(t){return this.value===t.value&&this.unit===t.unit},r.getType=function(){return t.CSSStyleValueType.kUnitType},r.sumValue=function(){var e=[],r={};return this.unit!==t.UnitType.kNumber&&(r[n.toCanonicalUnitIfPossible(this.unit)]=1),e.push({value:this.value*Po.conversionToCanonicalUnitsScaleFactor(this.unit),units:r}),e},r.negate=function(){return new n(-this.value,this.unit)},r.invert=function(){return this.unit===t.UnitType.kNumber?0===this.value?null:new n(1/this.value,this.unit):Bo.create(this)},r.buildCSSText=function(e,r,i){var o;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:o=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kQuirkyEms:case t.UnitType.kExs:case t.UnitType.kRems:case t.UnitType.kChs:case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kHertz:case t.UnitType.kKilohertz:case t.UnitType.kTurns:case t.UnitType.kFraction:case t.UnitType.kViewportWidth:case t.UnitType.kViewportHeight:case t.UnitType.kViewportInlineSize:case t.UnitType.kViewportBlockSize:case t.UnitType.kViewportMin:case t.UnitType.kViewportMax:case t.UnitType.kSmallViewportWidth:case t.UnitType.kSmallViewportHeight:case t.UnitType.kSmallViewportInlineSize:case t.UnitType.kSmallViewportBlockSize:case t.UnitType.kSmallViewportMin:case t.UnitType.kSmallViewportMax:case t.UnitType.kLargeViewportWidth:case t.UnitType.kLargeViewportHeight:case t.UnitType.kLargeViewportInlineSize:case t.UnitType.kLargeViewportBlockSize:case t.UnitType.kLargeViewportMin:case t.UnitType.kLargeViewportMax:case t.UnitType.kDynamicViewportWidth:case t.UnitType.kDynamicViewportHeight:case t.UnitType.kDynamicViewportInlineSize:case t.UnitType.kDynamicViewportBlockSize:case t.UnitType.kDynamicViewportMin:case t.UnitType.kDynamicViewportMax:case t.UnitType.kContainerWidth:case t.UnitType.kContainerHeight:case t.UnitType.kContainerInlineSize:case t.UnitType.kContainerBlockSize:case t.UnitType.kContainerMin:case t.UnitType.kContainerMax:var a=this.value,s=n.unitTypeToString(this.unit);if(-999999>a||a>999999){var u=n.unitTypeToString(this.unit);o=!Number.isFinite(a)||Number.isNaN(a)?n.formatInfinityOrNaN(a,u):n.formatNumber(a,u)}else o=""+a+s}return i+=o},n}(Ao),Fo=function(t){function e(){return t.apply(this,arguments)||this}return me(e,t),e.prototype.isUnitValue=function(){return!1},e}(Ao),Bo=function(e){function n(t,n){var r;return(r=e.call(this,n)||this).value=void 0,r.operator="invert",r.value=t,r}me(n,e),n.create=function(t){return new n(t,Mo.negateExponents(t.type_))};var r=n.prototype;return r.clone=function(){return new n(this.value,this.type_)},r.getType=function(){return t.CSSStyleValueType.kInvertType},r.equals=function(e){return e.getType()===t.CSSStyleValueType.kInvertType&&this.value.equals(e.value)},r.sumValue=function(){var t=this.value.sumValue();return 0===t.length||1!==t.length||0===t[0].value?null:(Object.keys(t[0].units).forEach((function(e){t[0].units[e]*=-1})),t[0].value=1/t[0].value,t)},r.buildCSSText=function(e,n,r){return n==t.ParenLess.kNo&&(r+=e===t.Nested.kYes?"(":"calc("),r=this.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+="1 / "),n===t.ParenLess.kNo&&(r+=")"),r},n}(Fo),Vo=function(e){function n(t,n){var r;return(r=e.call(this,n)||this).value=void 0,r.operator="negate",r.value=t,r}me(n,e),n.create=function(t){return new n(t,t.type_)};var r=n.prototype;return r.clone=function(){return new n(this.value,this.type_)},r.getType=function(){return t.CSSStyleValueType.kNegateType},r.equals=function(e){return e.getType()===t.CSSStyleValueType.kNegateType&&this.value.equals(e.value)},r.sumValue=function(){var t=this.value.sumValue();return 0===t.length?null:(t.forEach((function(t){t.value*=-1})),t)},r.buildCSSText=function(e,n,r){return n==t.ParenLess.kNo&&(r+=e===t.Nested.kYes?"(":"calc("),r=this.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+="-"),n===t.ParenLess.kNo&&(r+=")"),r},n}(Fo);function Go(t,e,n){for(var r=t[0].type_,i=1;t.length>i;i++)r=e(r,t[i].type_,false);return r}var jo,Ho=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).values=void 0,r.values=e,r}me(e,t);var n=e.prototype;return n.numericValues=function(){return this.values},n.equals=function(t){return this.getType()===t.getType()&&this.values.every((function(e,n){return e.equals(t.values[n])}))},e}(Fo),zo=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).operator="min",t}me(n,e),n.create=function(t){return new n(t,Go(t,Mo.add))};var r=n.prototype;return r.clone=function(){return new n(this.values,this.type_)},r.getType=function(){return t.CSSStyleValueType.kMinType},r.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=Pe(this.numericValues());!(e=n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}return t},r.buildCSSText=function(e,n,r){r+="min(";for(var i,o=!0,a=Pe(this.numericValues());!(i=a()).done;){o||(r+=", "),o=!1,r=i.value.buildCSSText(t.Nested.kYes,t.ParenLess.kYes,r)}return r+=")"},n}(Ho),Wo=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).operator="max",t}me(n,e),n.create=function(t){return new n(t,Go(t,Mo.add))};var r=n.prototype;return r.clone=function(){return new n(this.values,this.type_)},r.getType=function(){return t.CSSStyleValueType.kMaxType},r.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=Pe(this.numericValues());!(e=n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}return t},r.buildCSSText=function(e,n,r){r+="max(";for(var i,o=!0,a=Pe(this.numericValues());!(i=a()).done;){o||(r+=", "),o=!1,r=i.value.buildCSSText(t.Nested.kYes,t.ParenLess.kYes,r)}return r+=")"},n}(Ho),Yo=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).operator="sum",t}me(n,e),n.create=function(t){return new n(t,Go(t,Mo.add))},n.numericTypeFromUnitMap=function(t){var e=new Mo;return Object.keys(t).forEach((function(n){var r=t[n];e=Mo.multiply(e,new Mo(Number(n),r),false),Re(!0)})),e},n.canCreateNumericTypeFromSumValue=function(t){var e=this;Re(!!t.length);var n=this.numericTypeFromUnitMap(t[0].units);return t.every((function(t){return Mo.add(n,e.numericTypeFromUnitMap(t.units),false),!0}))};var r=n.prototype;return r.clone=function(){return new n(this.values,this.type_)},r.getType=function(){return t.CSSStyleValueType.kSumType},r.sumValue=function(){var t=[];return this.numericValues().forEach((function(e){var n=e.sumValue();if(!n.length)return null;n.forEach((function(e){var n=t.findIndex((function(t){return JSON.stringify(t.units)===JSON.stringify(e.units)}));-1===n?t.push(ge({},e)):t[n].value+=e.value}))})),n.canCreateNumericTypeFromSumValue(t)?t:null},r.buildCSSText=function(e,n,r){n==t.ParenLess.kNo&&(r+=e===t.Nested.kYes?"(":"calc(");var i=this.numericValues();r=i[0].buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r);for(var o=1;i.length>o;o++){var a=i[o];r=a.getType()===t.CSSStyleValueType.kNegateType?a.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+=" - "):a.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+=" + ")}return n===t.ParenLess.kNo&&(r+=")"),r},n}(Ho),qo=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).operator="product",t}me(n,e),n.create=function(t){return new n(t,Go(t,Mo.multiply))},n.multiplyUnitMaps=function(t,e){return Object.keys(e).forEach((function(n){De(e[n].value,0);var r=n in t?t[n].value:0;r+e[n].value===0?delete t[n]:t[n]=r+e[n].value})),t};var r=n.prototype;return r.clone=function(){return new n(this.values,this.type_)},r.getType=function(){return t.CSSStyleValueType.kProductType},r.sumValue=function(){var t=[{value:1,units:{}}];return this.numericValues().forEach((function(e){var r=e.sumValue();if(!r.length)return null;var i=[];t.forEach((function(t){r.forEach((function(e){i.push({value:t.value*e.value,units:n.multiplyUnitMaps(t.units,e.units)})}))})),t=i})),t},r.buildCSSText=function(e,n,r){n==t.ParenLess.kNo&&(r+=e===t.Nested.kYes?"(":"calc(");var i=this.numericValues();r=i[0].buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r);for(var o=1;i.length>o;o++){var a=i[o];r=a.getType()===t.CSSStyleValueType.kInvertType?a.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+=" / "):a.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+=" * ")}return n===t.ParenLess.kNo&&(r+=")"),r},n}(Ho),Xo=new Uo(0,"px"),Ko=new Uo(0,"deg"),Zo=function(t){function e(e,n,r,i,o){var a;return void 0===i&&(i=1),void 0===o&&(o=!1),(a=t.call(this,"rgb")||this).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}me(e,t);var n=e.prototype;return n.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},n.buildCSSText=function(t,e,n){return n+"rgba("+this.r+","+this.g+","+this.b+","+this.alpha+")"},e}(ko);(jo=t.GradientPatternType||(t.GradientPatternType={}))[jo.Constant=0]="Constant",jo[jo.LinearGradient=1]="LinearGradient",jo[jo.RadialGradient=2]="RadialGradient",jo[jo.Pattern=3]="Pattern";var Jo=function(e){function n(t,n){var r;return(r=e.call(this)||this).type=void 0,r.value=void 0,r.type=t,r.value=n,r}me(n,e);var r=n.prototype;return r.clone=function(){return new n(this.type,this.value)},r.buildCSSText=function(e,n,r){var i="";return this.type===t.GradientPatternType.LinearGradient?i="linear-gradient("+this.value.steps.map((function(t){return t.join(",")})).join(",")+")":this.type===t.GradientPatternType.RadialGradient?i="radial-gradient("+this.value.steps.map((function(t){return t.join(",")})).join(",")+")":this.type===t.GradientPatternType.Pattern&&(i="url("+this.value.src+")"),r+i},r.getType=function(){return t.CSSStyleValueType.kColorType},n}(Po);function Qo(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function $o(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ta(){}var ea=.7,na=1/ea,ra="\\s*([+-]?\\d+)\\s*",ia="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",oa="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",aa=/^#([0-9a-f]{3,8})$/,sa=new RegExp("^rgb\\("+[ra,ra,ra]+"\\)$"),ua=new RegExp("^rgb\\("+[oa,oa,oa]+"\\)$"),ca=new RegExp("^rgba\\("+[ra,ra,ra,ia]+"\\)$"),la=new RegExp("^rgba\\("+[oa,oa,oa,ia]+"\\)$"),ha=new RegExp("^hsl\\("+[ia,oa,oa]+"\\)$"),pa=new RegExp("^hsla\\("+[ia,oa,oa,ia]+"\\)$"),fa={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function da(){return this.rgb().formatHex()}function ya(){return this.rgb().formatRgb()}function va(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=aa.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ga(e):3===n?new ba(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ma(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ma(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=sa.exec(t))?new ba(e[1],e[2],e[3],1):(e=ua.exec(t))?new ba(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ca.exec(t))?ma(e[1],e[2],e[3],e[4]):(e=la.exec(t))?ma(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ha.exec(t))?xa(e[1],e[2]/100,e[3]/100,1):(e=pa.exec(t))?xa(e[1],e[2]/100,e[3]/100,e[4]):fa.hasOwnProperty(t)?ga(fa[t]):"transparent"===t?new ba(NaN,NaN,NaN,0):null}function ga(t){return new ba(t>>16&255,t>>8&255,255&t,1)}function ma(t,e,n,r){return r>0||(t=e=n=NaN),new ba(t,e,n,r)}function Ta(t){return t instanceof ta||(t=va(t)),t?new ba((t=t.rgb()).r,t.g,t.b,t.opacity):new ba}function ba(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ea(){return"#"+wa(this.r)+wa(this.g)+wa(this.b)}function Sa(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function wa(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function xa(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new ka(t,e,n,r)}function Pa(t){if(t instanceof ka)return new ka(t.h,t.s,t.l,t.opacity);if(t instanceof ta||(t=va(t)),!t)return new ka;if(t instanceof ka)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new ka(a,s,u,t.opacity)}function ka(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ca(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}Qo(ta,va,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:da,formatHex:da,formatHsl:function(){return Pa(this).formatHsl()},formatRgb:ya,toString:ya}),Qo(ba,(function(t,e,n,r){return 1===arguments.length?Ta(t):new ba(t,e,n,null==r?1:r)}),$o(ta,{brighter:function(t){return t=null==t?na:Math.pow(na,t),new ba(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?ea:Math.pow(ea,t),new ba(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:Ea,formatHex:Ea,formatRgb:Sa,toString:Sa})),Qo(ka,(function(t,e,n,r){return 1===arguments.length?Pa(t):new ka(t,e,n,null==r?1:r)}),$o(ta,{brighter:function(t){return t=null==t?na:Math.pow(na,t),new ka(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?ea:Math.pow(ea,t),new ka(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(.5>n?n:1-n)*e,i=2*n-r;return new ba(Ca(240>t?t+120:t-240,i,r),Ca(t,i,r),Ca(120>t?t+240:t-120,i,r),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Na=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,_a=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Ma=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Aa=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function Oa(e){if(Fe(e)&&(e=""),"transparent"===e)return new Zo(0,0,0,0);"currentColor"===e&&(e="black");var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=function(t){var e=Na.exec(t);if(e){var n,r,i,o=parseFloat(e[1])%360*(Math.PI/180),a=(null===(n=e[2].match(Aa))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[],s=1,u=1,c=0,l=0;o>=0&&o<.5*Math.PI?(r={x:c,y:l},i={x:s,y:u}):.5*Math.PI<=o&&o<Math.PI?(r={x:s,y:l},i={x:c,y:u}):Math.PI<=o&&o<1.5*Math.PI?(r={x:s,y:u},i={x:c,y:l}):(r={x:c,y:u},i={x:s,y:l});var h=Math.tan(o),p=h*h;return{x0:r.x,y0:r.y,x1:(i.x-r.x+h*(i.y-r.y))/(p+1)+r.x,y1:h*(i.x-r.x+h*(i.y-r.y))/(p+1)+r.y,steps:a,hash:t}}return null}(e);if(r)return new Jo(t.GradientPatternType.LinearGradient,r)}else if("r"===n){var i=function(t){var e=_a.exec(t);if(e){var n,r=parseFloat(e[1]),i=parseFloat(e[2]),o=parseFloat(e[3]),a=(null===(n=e[4].match(Aa))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];if(0===o){var s=e[4].match(Aa);return s[s.length-1].split(":")[1]}return{x0:r,y0:i,r0:0,x1:.5,y1:.5,r1:o,steps:a,hash:t}}return null}(e);if(i){if(!$r(i))return new Jo(t.GradientPatternType.RadialGradient,i);e=i}}else if("p"===n){var o=function(t){var e=Ma.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{src:r,repetition:n,hash:t}}return null}(e);if(o)return new Jo(t.GradientPatternType.Pattern,o)}var a=va(e),s=[0,0,0,0];return null!==a&&(s[0]=a.r||0,s[1]=a.g||0,s[2]=a.b||0,s[3]=a.opacity),Ee(Zo,s)}function Ia(t,e){if(t instanceof Zo&&e instanceof Zo)return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(ir(e[n],0,255));return e[3]=ir(e[3],0,1),"rgba("+e.join(",")+")"}]}var Ra,La=function(){function t(t,e){this.center=void 0,this.halfExtents=void 0,this.min=mn(),this.max=mn(),this.update(t,e)}t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]};var e=t.prototype;return e.update=function(t,e){this.center=Sn(mn(),t||mn()),this.halfExtents=Sn(mn(),e||En(0,0,0)),this.min=Dn(this.min,this.center,this.halfExtents),this.max=xn(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){xn(this.center,e,t),Cn(this.center,this.center,.5),Dn(this.halfExtents,e,t),Cn(this.halfExtents,this.halfExtents,.5),Sn(this.min,t),Sn(this.max,e)},e.getMin=function(){return this.min},e.getMax=function(){return this.max},e.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=r-s,h=r+s,p=i-u,f=i+u,d=o-c,y=o+c,v=e.center,g=v[0],m=v[1],T=v[2],b=e.halfExtents,E=b[0],S=b[1],w=b[2],x=g-E,P=g+E,k=m-S,C=m+S,N=T-w,_=T+w;l>x&&(l=x),P>h&&(h=P),p>k&&(p=k),C>f&&(f=C),d>N&&(d=N),_>y&&(y=_),n[0]=.5*(l+h),n[1]=.5*(p+f),n[2]=.5*(d+y),a[0]=.5*(h-l),a[1]=.5*(f-p),a[2]=.5*(y-d),this.min[0]=l,this.min[1]=p,this.min[2]=d,this.max[0]=h,this.max[1]=f,this.max[2]=y}},e.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],c=e[1],l=e[5],h=e[9],p=e[2],f=e[6],d=e[10],y=Math.abs(a),v=Math.abs(s),g=Math.abs(u),m=Math.abs(c),T=Math.abs(l),b=Math.abs(h),E=Math.abs(p),S=Math.abs(f),w=Math.abs(d);wn(n,e[12]+a*i[0]+s*i[1]+u*i[2],e[13]+c*i[0]+l*i[1]+h*i[2],e[14]+p*i[0]+f*i[1]+d*i[2]),wn(r,y*o[0]+v*o[1]+g*o[2],m*o[0]+T*o[1]+b*o[2],E*o[0]+S*o[1]+w*o[2]),this.min=Dn(this.min,n,r),this.max=xn(this.max,n,r)},e.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])},e.intersection=function(e){if(!this.intersects(e))return null;var n,r,i,o=new t,a=(n=mn(),r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}(mn(),this.getMax(),e.getMax());return o.setMinMax(a,s),o},e.containsPoint=function(t){var e=this.getMin(),n=this.getMax();return!(e[0]>t[0]||t[0]>n[0]||e[1]>t[1]||t[1]>n[1]||e[2]>t[2]||t[2]>n[2])},e.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?Sn(mn(),this.min):272===t.pnVertexFlag?En(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?En(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?En(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?En(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?En(this.max[0],this.min[1],this.max[2]):En(this.max[0],this.max[1],1===t.pnVertexFlag?this.min[2]:this.max[2])},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?Sn(mn(),this.max):272===t.pnVertexFlag?En(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?En(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?En(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?En(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?En(this.min[0],this.max[1],this.min[2]):En(this.min[0],this.min[1],1===t.pnVertexFlag?this.max[2]:this.min[2])},t}(),Da=mn(),Ua=function(){function t(t,e){this.center=void 0,this.radius=void 0,this.center=t||mn(),this.radius=e||.5}var e=t.prototype;return e.containsPoint=function(t){return Dn(Da,t,this.center),bn(Da)<this.radius*this.radius},e.intersects=function(t){Dn(Da,t.center,this.center);var e=t.radius+this.radius;return bn(Da)<=e*e},t}(),Fa=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||En(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},e.distanceToPoint=function(t){return Mn(t,this.normal)-this.distance},e.normalize=function(){var t=1/Bn(this.normal);Cn(this.normal,this.normal,t),this.distance*=t},e.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&1>=i;return o&&n&&On(n,t,e,i),o},t}();(Ra=t.Mask||(t.Mask={}))[Ra.OUTSIDE=4294967295]="OUTSIDE",Ra[Ra.INSIDE=0]="INSIDE",Ra[Ra.INDETERMINATE=2147483647]="INDETERMINATE";var Ba=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new Fa)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],p=t[11],f=t[12],d=t[13],y=t[14],v=t[15];wn(this.planes[0].normal,i-e,u-o,p-c),this.planes[0].distance=v-f,wn(this.planes[1].normal,i+e,u+o,p+c),this.planes[1].distance=v+f,wn(this.planes[2].normal,i+n,u+a,p+l),this.planes[2].distance=v+d,wn(this.planes[3].normal,i-n,u-a,p-l),this.planes[3].distance=v-d,wn(this.planes[4].normal,i-r,u-s,p-h),this.planes[4].distance=v-y,wn(this.planes[5].normal,i+r,u+s,p+h),this.planes[5].distance=v+y,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),Va=mn(),Ga=mn(),ja=mn(),Ha=mn(),za=mn(),Wa=function(){function t(t,e){this.origin=void 0,this.direction=void 0,this.origin=t||mn(),this.direction=e||En(0,0,-1)}var e=t.prototype;return e.intersectsAABB=function(t,e){return e?this.intersectAABBWithIntersection(t,e):this.intersectsAABBWithoutIntersection(t)},e.intersectsSphere=function(t,e){var n=Dn(Va,this.origin,t.center);_n(Ga,Sn(Ga,this.direction));var r=Mn(n,Ga),i=Mn(n,n)-t.radius*t.radius;if(i>0&&r>0)return null;var o=r*r-i;if(0>o)return!1;var a=Math.abs(-r-Math.sqrt(o));return e&&(Sn(e,this.direction),Nn(e,this.origin,e,a)),!0},e.intersectsPlane=function(t,e){var n=(t.distance-Mn(t.normal,this.origin))/Mn(t.normal,this.direction),r=n>=0;return r&&e&&Nn(e,this.origin,this.direction,n),r},e.intersectsAABBWithoutIntersection=function(t){var e=Va,n=Ga,r=ja,i=Ha,o=za,a=this.direction;return Dn(e,this.origin,t.center),wn(i,Math.abs(e[0]),Math.abs(e[1]),Math.abs(e[2])),Un(r,e,a),!(i[0]>t.halfExtents[0]&&r[0]>=0||i[1]>t.halfExtents[1]&&r[1]>=0||i[2]>t.halfExtents[2]&&r[2]>=0)&&(wn(o,Math.abs(a[0]),Math.abs(a[1]),Math.abs(a[2])),An(n,a,e),wn(n,Math.abs(n[0]),Math.abs(n[1]),Math.abs(n[2])),!(n[0]>t.halfExtents[1]*o[2]+t.halfExtents[2]*o[1]||n[1]>t.halfExtents[0]*o[2]+t.halfExtents[2]*o[0]||n[2]>t.halfExtents[0]*o[1]+t.halfExtents[1]*o[0]))},e.intersectAABBWithIntersection=function(t,e){var n=Sn(mn(),t.getMin());Dn(n,n,this.origin);var r=Sn(mn(),t.getMax());Dn(r,r,this.origin);var i=this.direction;0===i[0]?(n[0]=0>n[0]?-Number.MAX_VALUE:Number.MAX_VALUE,r[0]=0>r[0]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[0]/=i[0],r[0]/=i[0]),0===i[1]?(n[1]=0>n[1]?-Number.MAX_VALUE:Number.MAX_VALUE,r[1]=0>r[1]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[1]/=i[1],r[1]/=i[1]),0===i[2]?(n[2]=0>n[2]?-Number.MAX_VALUE:Number.MAX_VALUE,r[2]=0>r[2]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[2]/=i[2],r[2]/=i[2]);var o=wn(ja,Math.min(n[0],r[0]),Math.min(n[1],r[1]),Math.min(n[2],r[2])),a=wn(Ha,Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.max(n[2],r[2])),s=Math.min(Math.min(a[0],a[1]),a[2]),u=Math.max(Math.max(o[0],o[1]),o[2]),c=s>=u&&u>=0;return c&&(Sn(e,this.direction),Nn(e,this.origin,e,u)),c},t}(),Ya=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),qa=function(){function t(t,e,n,r){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}();function Xa(t,e){if(Fe(e))return new Uo(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return new Uo(Number(e),"px");if("deg".search(t)>=0)return new Uo(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return new Uo(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}function Ka(t){return Xa(new RegExp("px","g"),t)}function Za(t){return Xa(new RegExp("px|%|em|rem","g"),t)}function Ja(t){return Xa(new RegExp("deg|rad|grad|turn","g"),t)}function Qa(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0;return(Uo.isLength(t.unit)||Uo.isLength(e.unit))&&(a=ns(t,i,n),s=ns(e,i,n),o="px"),(Uo.isAngle(t.unit)||Uo.isAngle(e.unit))&&(a=$a(t),s=$a(e),o="deg"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function $a(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=sr(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=ur(Number(e.value))),n}function ts(t){return $r(t)?t.split(" ").map((function(t){return Za(t)})):t.map((function(t){return Za(t.toString())}))}function es(t,e,n){if(t.length===e.length){var r=t[0].unit;return[t.map((function(t){return t.value})),e.map((function(t){return t.value})),function(t){return t.map((function(t){return new Uo(t,r)})).join(" ")}]}}function ns(e,n,r){if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var i=r.getGeometryBounds(),o=0;return La.isEmpty(i)||(o=2*i.halfExtents[n]),Number(e.value)/100*o}return 0}function rs(t){return t.toString()}function is(t){return"number"==typeof t?new Uo(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?new Uo(Number(t)):new Uo(0)}function os(t,e){return[t.value,e.value,rs]}function as(t,e){return function(n,r){return[n.value,r.value,function(n){return rs(ir(n,t,e))}]}}var ss=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,us=/[^\s,]+/gi;var cs=new RegExp("([a-z])[\\s,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\\s]*,?[\\s]*)+)","ig"),ls=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[\\s]*,?[\\s]*","ig");var hs=/[a-z]/;function ps(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function fs(t){var e=function(t){if("string"==typeof t){if(t){var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return t.replace(cs,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(ls,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=e[a]&&(n.push([r].concat(o.splice(0,e[a]))),e[a]););return""})),n}return null}if(Array.isArray(t))return t}(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,r=0;e.length>r;r++){if(hs.test(p=e[r][0])||["V","H","T","S"].indexOf(p)>=0){n=!0;break}}if(!n)return e;var i=[],o=0,a=0,s=0,u=0,c=0,l=e[0];"M"!==l[0]&&"m"!==l[0]||(s=o=+l[1],u=a=+l[2],c++,i[0]=["M",o,a]);r=c;for(var h=e.length;h>r;r++){var p,f=e[r],d=i[r-1],y=[],v=(p=f[0]).toUpperCase();if(p!==v)switch(y[0]=v,v){case"A":y[1]=f[1],y[2]=f[2],y[3]=f[3],y[4]=f[4],y[5]=f[5],y[6]=+f[6]+o,y[7]=+f[7]+a;break;case"V":y[1]=+f[1]+a;break;case"H":y[1]=+f[1]+o;break;case"M":u=+f[2]+a,y[1]=s=+f[1]+o,y[2]=u;break;default:for(var g=1,m=f.length;m>g;g++)y[g]=+f[g]+(g%2?o:a)}else y=e[r];switch(v){case"Z":o=+s,a=+u;break;case"H":y=["L",o=y[1],a];break;case"V":y=["L",o,a=y[1]];break;case"T":o=y[1],a=y[2];var T=ps([d[1],d[2]],[d[3],d[4]]);y=["Q",T[0],T[1],o,a];break;case"S":o=y[y.length-2],a=y[y.length-1];var b=d.length,E=ps([d[b-4],d[b-3]],[d[b-2],d[b-1]]);y=["C",E[0],E[1],y[1],y[2],o,a];break;case"M":s=y[y.length-2],u=y[y.length-1];break;default:o=y[y.length-2],a=y[y.length-1]}i.push(y)}return i}var ds=2*Math.PI,ys=function(t,e,n,r,i,o,a){var s=t.x,u=t.y;return{x:r*(s*=e)-i*(u*=n)+o,y:i*s+r*u+a}},vs=function(t,e){var n=1.5707963267948966===e?.551915024494:-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),r=Math.cos(t),i=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[{x:r-i*n,y:i+r*n},{x:o+a*n,y:a-o*n},{x:o,y:a}]},gs=function(t,e,n,r){var i=t*n+e*r;return i>1&&(i=1),-1>i&&(i=-1),(0>t*r-e*n?-1:1)*Math.acos(i)},ms=function(t){var e=t.px,n=t.py,r=t.cx,i=t.cy,o=t.rx,a=t.ry,s=t.xAxisRotation,u=void 0===s?0:s,c=t.largeArcFlag,l=void 0===c?0:c,h=t.sweepFlag,p=void 0===h?0:h,f=[];if(0===o||0===a)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:i}];var d=Math.sin(u*ds/360),y=Math.cos(u*ds/360),v=y*(e-r)/2+d*(n-i)/2,g=-d*(e-r)/2+y*(n-i)/2;if(0===v&&0===g)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:i}];o=Math.abs(o),a=Math.abs(a);var m=Math.pow(v,2)/Math.pow(o,2)+Math.pow(g,2)/Math.pow(a,2);m>1&&(o*=Math.sqrt(m),a*=Math.sqrt(m));var T=function(t,e,n,r,i,o,a,s,u,c,l,h){var p=Math.pow(i,2),f=Math.pow(o,2),d=Math.pow(l,2),y=Math.pow(h,2),v=p*f-p*y-f*d;0>v&&(v=0),v/=p*y+f*d;var g=(v=Math.sqrt(v)*(a===s?-1:1))*i/o*h,m=v*-o/i*l,T=c*g-u*m+(t+n)/2,b=u*g+c*m+(e+r)/2,E=(l-g)/i,S=(h-m)/o,w=(-l-g)/i,x=(-h-m)/o,P=gs(1,0,E,S),k=gs(E,S,w,x);return 0===s&&k>0&&(k-=ds),1===s&&0>k&&(k+=ds),[T,b,P,k]}(e,n,r,i,o,a,l,p,d,y,v,g),b=T[0],E=T[1],S=T[2],w=T[3],x=Math.abs(w)/(ds/4);1e-7>Math.abs(1-x)&&(x=1);var P=Math.max(Math.ceil(x),1);w/=P;for(var k=0;P>k;k++)f.push(vs(S,w)),S+=w;return f.map((function(t){var e=ys(t[0],o,a,y,d,b,E),n=e.x,r=e.y,i=ys(t[1],o,a,y,d,b,E),s=i.x,u=i.y,c=ys(t[2],o,a,y,d,b,E);return{x1:n,y1:r,x2:s,y2:u,x:c.x,y:c.y}}))};function Ts(t,e,n,r,i,o,a,s,u){return ms({px:t,py:e,cx:s,cy:u,rx:n,ry:r,xAxisRotation:i,largeArcFlag:o,sweepFlag:a}).reduce((function(t,e){return t.push(e.x1,e.y1,e.x2,e.y2,e.x,e.y),t}),[])}function bs(t,e,n,r,i,o){var a=1/3,s=2/3;return[a*t+s*n,a*e+s*r,a*i+s*n,a*o+s*r,i,o]}function Es(t,e,n,r){return[t,e,n,r,n,r]}function Ss(t,e){0>"TQ".indexOf(t[0])&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],i=n[1];switch(t[0]){case"M":return e.x=r,e.y=i,t;case"A":return["C"].concat(Ts.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=i,["C"].concat(bs.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(Es(e.x1,e.y1,t[1],t[2]));case"H":return["C"].concat(Es(e.x1,e.y1,t[1],e.y1));case"V":return["C"].concat(Es(e.x1,e.y1,e.x1,t[1]));case"Z":return["C"].concat(Es(e.x1,e.y1,e.x,e.y))}return t}function ws(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var xs=Math.PI/180;function Ps(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ks(t,e){return Ps(t)*Ps(e)?(t[0]*e[0]+t[1]*e[1])/(Ps(t)*Ps(e)):1}function Cs(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(ks(t,e))}function Ns(t,e){return t[0]===e[0]&&t[1]===e[1]}function _s(t,e){var n,r=e[1],i=e[2],o=(n=2*Math.PI,(xs*e[3]%n+n)%n),a=e[4],s=e[5],u=t[0],c=t[1],l=e[6],h=e[7],p=Math.cos(o)*(u-l)/2+Math.sin(o)*(c-h)/2,f=-1*Math.sin(o)*(u-l)/2+Math.cos(o)*(c-h)/2,d=p*p/(r*r)+f*f/(i*i);d>1&&(r*=Math.sqrt(d),i*=Math.sqrt(d));var y=r*r*(f*f)+i*i*(p*p),v=y?Math.sqrt((r*r*(i*i)-y)/y):1;a===s&&(v*=-1),isNaN(v)&&(v=0);var g=i?v*r*f/i:0,m=r?v*-i*p/r:0,T=(u+l)/2+Math.cos(o)*g-Math.sin(o)*m,b=(c+h)/2+Math.sin(o)*g+Math.cos(o)*m,E=[(p-g)/r,(f-m)/i],S=[(-1*p-g)/r,(-1*f-m)/i],w=Cs([1,0],E),x=Cs(E,S);return ks(E,S)>-1||(x=Math.PI),1>ks(E,S)||(x=0),0===s&&x>0&&(x-=2*Math.PI),1===s&&0>x&&(x+=2*Math.PI),{cx:T,cy:b,rx:Ns(t,[l,h])?0:r,ry:Ns(t,[l,h])?0:i,startAngle:w,endAngle:w+x,xRotation:o,arcFlag:a,sweepFlag:s}}function Ms(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function As(t){t=function(t){var e=t||[];return Array.isArray(e)?e:"string"==typeof e?((e=e.match(ss)).forEach((function(t,n){if((t=t.match(us))[0].length>1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}t.forEach((function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0}(t);for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];r=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=_s(n,u);l.arcParams=h}if("Z"===c)n=i,r=t[o+1];else{var p=u.length;n=[u[p-2],u[p-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&Ns(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var f=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]];else if("Q"===c){l.startTangent=[f[0]-(d=[u[1],u[2]])[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]}else if("T"===c){var d=Ms((v=e[s-1]).currentPoint,f);"Q"===v.command?(l.command="Q",l.startTangent=[f[0]-d[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]):(l.command="TL",l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]])}else if("C"===c){var y=[u[3],u[4]];l.startTangent=[f[0]-(g=[u[1],u[2]])[0],f[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[g[0]-y[0],g[1]-y[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[y[0]-g[0],y[1]-g[1]])}else if("S"===c){var v,g=Ms((v=e[s-1]).currentPoint,f);y=[u[1],u[2]];"C"===v.command?(l.command="C",l.startTangent=[f[0]-g[0],f[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]]):(l.command="SQ",l.startTangent=[f[0]-y[0],f[1]-y[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===c){var m=.001,T=l.arcParams||{},b=T.cx,E=void 0===b?0:b,S=T.cy,w=void 0===S?0:S,x=T.rx,P=void 0===x?0:x,k=T.ry,C=void 0===k?0:k,N=T.sweepFlag,_=T.startAngle,M=void 0===_?0:_,A=T.endAngle,O=void 0===A?0:A;0===(void 0===N?0:N)&&(m*=-1);var I=P*Math.cos(M-m)+E,R=C*Math.sin(M-m)+w;l.startTangent=[I-i[0],R-i[1]];var L=P*Math.cos(M+O+m)+E,D=C*Math.sin(M+O-m)+w;l.endTangent=[f[0]-L,f[1]-D]}e.push(l)}return e}function Os(t,e){var n=fs(t),r=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(n),i=n.slice(),o=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}r.length>0&&n.push(r);return{polygons:e,polylines:n}}(i),a=o.polygons,s=o.polylines,u=function(t,e){void 0===e&&(e=!1);for(var n,r,i=fs(t),o={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",u=i.length,c=[],l=0;u>l;l+=1)i[l]&&(s=i[l][0]),a[l]=s,i[l]=Ss(i[l],o),ws(i,a,l),u=i.length,"Z"===s&&c.push(l),o.x1=+(n=i[l])[(r=n.length)-2],o.y1=+n[r-1],o.x2=+n[r-4]||o.x1,o.y2=+n[r-3]||o.y1;return e?[i,c]:i}(i,!0),c=u[0],l=u[1],h=As(i),p=function(t){var e,n,r,i,o=0,a=0,s=[];if(!t)return{curveSegments:[],totalLength:o};if(t.forEach((function(e,n){i=e.length,(r=t[n+1])&&(o+=vi.length(e[i-2],e[i-1],r[1],r[2],r[3],r[4],r[5],r[6])||0)})),0===o)return{curveSegments:[],totalLength:o};return t.forEach((function(u,c){i=u.length,(r=t[c+1])&&((e=[])[0]=a/o,n=vi.length(u[i-2],u[i-1],r[1],r[2],r[3],r[4],r[5],r[6]),e[1]=(a+=n||0)/o,s.push(e))})),{curveSegments:s,totalLength:o}}(c),f=p.totalLength,d=p.curveSegments,y=function(t){var e=0,n=0,r=[],i=[];t.forEach((function(t){var o=t.slice(-2),a=o[0],s=o[1];if("M"===t[0])e=a,n=s,r.push(a),i.push(s);else if("C"===t[0]){var u=vi.box.apply(vi,[e,n].concat(t.slice(1)));r=r.concat(u.x,u.x+u.width),i=i.concat(u.y,u.y+u.height),e=a,n=s}}));var o=Math.min.apply(0,r),a=Math.min.apply(0,i),s=Math.max.apply(0,r),u=Math.max.apply(0,i);return new qa(o,a,s-o,u-a)}(c);return e&&(e.parsedStyle.defX=y.x,e.parsedStyle.defY=y.y),{absolutePath:n,hasArc:r,segments:h,polygons:a,polylines:s,curve:c,totalLength:f,curveSegments:d,zCommandIndexes:l,rect:y}}function Is(t,e,n){var r=t.curve,i=e.curve,o=[r,i];r.length!==i.length&&(o=Si(r,i));var a=wi(o[0])!==wi(o[1])?ki(o[0]):Ci(o[0]);return[a,Ni(o[1],a),function(t){return t}]}function Rs(t,e){var n;n=$r(t)?t.split(" ").map((function(t){var e=t.split(","),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,o=[],a=0,s=mi(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=li.length(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))}));var u=Math.min.apply(Math,n.map((function(t){return t[0]}))),c=Math.min.apply(Math,n.map((function(t){return t[1]})));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=c),{points:n,totalLength:s,segments:o}}var Ls=function(t){return Xa(/deg|rad|grad|turn|px|%/g,t)},Ds=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Us(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Ds.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Ls(t)||Oa(t)}))}),n.lastIndex===t.length)return r}return[]}var Fs={number:function(t){return new Uo(t)},percent:function(t){return new Uo(t,"%")},px:function(t){return new Uo(t,"px")},em:function(t){return new Uo(t,"em")},rem:function(t){return new Uo(t,"rem")},deg:function(t){return new Uo(t,"deg")},grad:function(t){return new Uo(t,"grad")},rad:function(t){return new Uo(t,"rad")},turn:function(t){return new Uo(t,"turn")},s:function(t){return new Uo(t,"s")},ms:function(t){return new Uo(t,"ms")},registerProperty:function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;Ut.get(Gr).registerMetadata({name:e,inherited:n,interpolable:r,defaultValue:i,syntax:o})},registerLayout:function(e,n){Ut.get(t.LayoutRegistry).registerLayout(e,n)}},Bs=null;function Vs(t){return function(e){var n=0;return t.map((function(t){return t===Bs?e[n++]:t}))}}function Gs(t){return t}var js={rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],scale:["Nn",Vs([Bs,Bs,Fs.number(1)]),Gs],scalex:["N",Vs([Bs,Fs.number(1),Fs.number(1)]),Vs([Bs,Fs.number(1)])],scaley:["N",Vs([Fs.number(1),Bs,Fs.number(1)]),Vs([Fs.number(1),Bs])],scalez:["N",Vs([Fs.number(1),Fs.number(1),Bs])],scale3d:["NNN",Gs],translate:["Tt",Vs([Bs,Bs,Xo]),Gs],translatex:["T",Vs([Bs,Xo,Xo]),Vs([Bs,Xo])],translatey:["T",Vs([Xo,Bs,Xo]),Vs([Xo,Bs])],translatez:["L",Vs([Xo,Xo,Bs])],translate3d:["TTL",Gs]};function Hs(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=js[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],p=u[l],f=void 0;if(void 0===(f=h?{A:function(t){return"0"===t.trim()?Ko:Ja(t)},N:is,T:Za,L:Ka}[p.toUpperCase()](h):{a:Ko,n:c[0],t:Xo}[p]))return[];c.push(f)}if(r.push({t:o,d:c}),n.lastIndex===t.length)return r}return[]}function zs(t){return t.replace(/[xy]/,"")}function Ws(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Ys(e,n,r){var i=!1;if(!e.length||!n.length){e.length||(i=!0,e=n,n=[]);for(var o=function(t){var r=e[t],i=r.t,o=r.d,a="scale"===i.substr(0,5)?1:0;n.push({t:i,d:o.map((function(t){return"number"==typeof t?new Uo(a):new Uo(a,t.unit)}))})},a=0;e.length>a;a++)o(a)}var s,u,c=[],l=[],h=[];if(e.length!==n.length);else for(var p=0;e.length>p;p++){var f=e[p].t,d=n[p].t,y=e[p].d,v=n[p].d,g=js[f],m=js[d],T=void 0;if(u=d,("perspective"!==(s=f)||"perspective"!==u)&&("matrix"!==s&&"matrix3d"!==s||"matrix"!==u&&"matrix3d"!==u)){if(f===d)T=f;else if(g[2]&&m[2]&&zs(f)===zs(d))T=zs(f),y=g[2](y),v=m[2](v);else{if(!g[1]||!m[1]||Ws(f)!==Ws(d))break;T=Ws(f),y=g[1](y),v=m[1](v)}for(var b=[],E=[],S=[],w=0;y.length>w;w++){var x=(y[w].unit===t.UnitType.kNumber?os:Qa)(y[w],v[w],r,!1,w);b[w]=x[0],E[w]=x[1],S.push(x[2])}c.push(b),l.push(E),h.push([T,S])}}if(i){var P=c;c=l,l=P}return[c,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return h[e][1][n](t)})).join(",");return"matrix"===h[e][0]&&16===n.split(",").length&&(h[e][0]="matrix3d"),h[e][0]+"("+n+")"})).join(" ")}]}function qs(t){if($r(t)){var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Za(Xs(e[0])),Za(Xs(e[1]))]}return[new Uo(t[0]||0,"px"),new Uo(t[1]||0,"px")]}function Xs(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Ks,Zs=i.defineToken("CSSPropertySyntaxFactory"),Js=i.defineToken("CSSProperty");t.CSSPropertyAngle=function(){function t(){this.parser=Ja,this.mixer=Qa}return t.prototype.calculator=function(t,e,n,r){return new Uo($a(n),"deg")},t}(),t.CSSPropertyAngle=ce([lt({token:{token:Js,named:t.PropertySyntax.ANGLE}})],t.CSSPropertyAngle),(Ks=t.ElementEvent||(t.ElementEvent={})).DESTROY="destroy",Ks.ATTR_MODIFIED="DOMAttrModified",Ks.INSERTED="DOMNodeInserted",Ks.CHILD_INSERTED="child-inserted",Ks.REMOVED="removed",Ks.CHILD_REMOVED="child-removed",Ks.MOUNTED="DOMNodeInsertedIntoDocument",Ks.UNMOUNTED="DOMNodeRemovedFromDocument",Ks.BOUNDS_CHANGED="bounds-changed",Ks.GEOMETRY_BOUNDS_CHANGED="geometry-bounds-changed",Ks.RENDER_ORDER_CHANGED="render-order-changed",Ks.CULLED="culled";var Qs,$s=function(){function t(e){this.type=void 0,this.eventPhase=t.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new Ya,this.page=new Ya,this.canvas=new Ya,this.viewport=new Ya,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}var e=t.prototype;return e.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},e.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.stopPropagation=function(){this.propagationStopped=!0},e.initEvent=function(){},e.initUIEvent=function(){},ve(t,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"propagationPath",get:function(){return this.composedPath()}}]),t}(),tu=function(t){function e(e,n){var r;return(r=t.call(this,null)||this).type=e,r.detail=n,Object.assign(we(r),n),r}return me(e,t),e}($s),eu=function(){function t(){this.emitter=new bo.EventEmitter}var e=t.prototype;return e.on=function(t,e,n){return this.addEventListener(t,e,n),this},e.addEventListener=function(t,e,n){var r=Ge(n)&&n||je(n)&&n.capture,i=je(n)&&n.once,o=Ve(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var u=t.split(":");t=u[1],s=u[0],a=!0}if(t=r?t+"capture":t,e=Ve(e)?e:e.handleEvent,a){var c=e;e=function(){for(var t,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];(null===(t=n[0].target)||void 0===t?void 0:t.name)===s&&c.apply(void 0,n)}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},e.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},e.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.removeEventListener=function(t,e,n){var r,i=Ge(n)&&n||je(n)&&n.capture,o=Ve(e)?void 0:e;return t=i?t+"capture":t,e=Ve(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent,this.emitter.off(t,e,o),this},e.emit=function(t,e){this.dispatchEvent(new tu(t,e))},e.dispatchEvent=function(t){if(!(t instanceof $s))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var e,n,r=this.ownerDocument||this.document;r&&(t.manager=(null===(e=r.defaultView)||void 0===e?void 0:e.getEventService())||null,t.defaultPrevented=!1,t.path=[],t.target=this,null===(n=t.manager)||void 0===n||n.dispatchEvent(t));return!t.defaultPrevented},t}(),nu=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}me(n,e),n.isNode=function(t){return!!t.childNodes};var r=n.prototype;return r.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},r.hasChildNodes=function(){return this.childNodes.length>0},r.isDefaultNamespace=function(t){throw new Error("Method not implemented.")},r.lookupNamespaceURI=function(t){throw new Error("Method not implemented.")},r.lookupPrefix=function(t){throw new Error("Method not implemented.")},r.normalize=function(){throw new Error("Method not implemented.")},r.isEqualNode=function(t){return this===t},r.isSameNode=function(t){return this.isEqualNode(t)},r.compareDocumentPosition=function(t){if(t===this)return 0;if(!(t instanceof n))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");for(var e=t,r=this,i=[e],o=[r];null!==(a=e.parentNode)&&void 0!==a?a:r.parentNode;){var a;e=e.parentNode?(i.push(e.parentNode),e.parentNode):e,r=r.parentNode?(o.push(r.parentNode),r.parentNode):r}if(e!==r)return n.DOCUMENT_POSITION_DISCONNECTED|n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|n.DOCUMENT_POSITION_PRECEDING;var s=i.length>o.length?i:o,u=s===i?o:i;if(s[s.length-u.length]===u[0])return s===i?n.DOCUMENT_POSITION_CONTAINED_BY|n.DOCUMENT_POSITION_FOLLOWING:n.DOCUMENT_POSITION_CONTAINS|n.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],p=s[c+l];if(p!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(p)?u===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING:s===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING}}return n.DOCUMENT_POSITION_FOLLOWING},r.contain=function(t){return this.contains(t)},r.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},r.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},r.forEach=function(t){t(this)||this.childNodes.forEach((function(e){e.forEach(t)}))},ve(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,r=Pe(this.childNodes);!(n=r()).done;){var i=n.value;e+=i.nodeName===t.Shape.TEXT?i.nodeValue:i.textContent}return e},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t,!0)})),this.nodeName===t.Shape.TEXT&&(this.style.text=""+e)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}}]),n}(eu);nu.DOCUMENT_POSITION_DISCONNECTED=1,nu.DOCUMENT_POSITION_PRECEDING=2,nu.DOCUMENT_POSITION_FOLLOWING=4,nu.DOCUMENT_POSITION_CONTAINS=8,nu.DOCUMENT_POSITION_CONTAINED_BY=16,nu.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,(Qs=t.Strategy||(t.Strategy={}))[Qs.Standard=0]="Standard";var ru=function(){function e(){this.strategy=t.Strategy.Standard,this.visibilityPlaneMask=-1,this.visible=!0,this.enable=!0}return e.prototype.isCulled=function(){return this.enable&&!this.visible},e}();ru.tag="c-cullable";var iu=function(){this.contentBounds=void 0,this.renderBounds=void 0};iu.tag="c-geometry";var ou=function(){this.aabb=void 0};ou.tag="c-rbush-node";var au=i.defineToken("RBushRoot"),su=function(){this.bounds=void 0,this.boundsDirty=!0,this.renderBounds=void 0,this.renderBoundsDirty=!0,this.dirtyRenderBounds=void 0,this.dirty=!1};su.tag="c-renderable";var uu=function(){this.dirty=!1,this.sorted=void 0,this.lastSortedIndex=void 0,this.renderOrder=0};uu.tag="c-sortable";var cu=function(){this.dirtyFlag=!1,this.localDirtyFlag=!1,this.frozen=!1,this.localPosition=En(0,0,0),this.localRotation=tr(0,0,0,1),this.localScale=En(1,1,1),this.localTransform=on(),this.position=En(0,0,0),this.rotation=tr(0,0,0,1),this.scaling=En(1,1,1),this.worldTransform=on(),this.origin=En(0,0,0)};cu.tag="c-transform";var lu=function(t){function e(e,n,r,i,o,a,s,u){var c;return(c=t.call(this,null)||this).relatedNode=void 0,c.prevValue=void 0,c.newValue=void 0,c.attrName=void 0,c.attrChange=void 0,c.prevParsedValue=void 0,c.newParsedValue=void 0,c.relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=o,c.attrChange=a,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return me(e,t),e}($s);lu.ADDITION=2,lu.MODIFICATION=1,lu.REMOVAL=3;var hu=0,pu=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).sceneGraphService=Ut.get(bc),t.entity=hu++,t.renderable=new su,t.cullable=new ru,t.transformable=new cu,t.sortable=new uu,t.geometry=new iu,t.rBushNode=new ou,t.id=void 0,t.name=void 0,t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}me(n,e),n.isElement=function(t){return!!t.getAttribute};var r=n.prototype;return r.cloneNode=function(t){throw new Error("Method not implemented.")},r.appendChild=function(e,n){return this.sceneGraphService.attach(e,this,n),this.dispatchEvent(new tu(t.ElementEvent.CHILD_INSERTED,{child:e})),e.dispatchEvent(new lu(t.ElementEvent.INSERTED,this,"","","",0,"","")),e},r.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},r.replaceChild=function(t,e,n){var r=this.childNodes.indexOf(e);return this.removeChild(e,n),this.appendChild(t,r),e},r.removeChild=function(e,n){return void 0===n&&(n=!0),e.dispatchEvent(new lu(t.ElementEvent.REMOVED,this,"","","",0,"","")),n&&(e.dispatchEvent(new tu(t.ElementEvent.DESTROY)),e.destroyed=!0),this.dispatchEvent(new tu(t.ElementEvent.CHILD_REMOVED,{child:e})),this.sceneGraphService.detach(e),n&&e.emitter.removeAllListeners(),e},r.removeChildren=function(t){var e=this;void 0===t&&(t=!0),this.childNodes.slice().forEach((function(n){e.removeChild(n,t)}))},r.matches=function(t){return this.sceneGraphService.matches(t,this)},r.getElementById=function(t){return this.sceneGraphService.querySelector("#"+t,this)},r.getElementsByName=function(t){return this.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},r.getElementsByClassName=function(t){return this.sceneGraphService.querySelectorAll("."+t,this)},r.getElementsByTagName=function(t){return this.sceneGraphService.querySelectorAll(t,this)},r.querySelector=function(t){return this.sceneGraphService.querySelector(t,this)},r.querySelectorAll=function(t){return this.sceneGraphService.querySelectorAll(t,this)},r.closest=function(t){var e=this;do{if(this.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},r.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},r.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},r.after=function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}},r.before=function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,o)}},r.replaceWith=function(){this.after.apply(this,arguments),this.remove()},r.append=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))},r.prepend=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))},r.replaceChildren=function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)},r.remove=function(t){return void 0===t&&(t=!0),this.parentNode?this.parentNode.removeChild(this,t):this},r.destroy=function(){this.dispatchEvent(new tu(t.ElementEvent.DESTROY)),this.remove(!1),this.emitter.removeAllListeners(),this.destroyed=!0},r.getGeometryBounds=function(){return this.sceneGraphService.getGeometryBounds(this)},r.getRenderBounds=function(){return this.sceneGraphService.getBounds(this,!0)},r.getBounds=function(){return this.sceneGraphService.getBounds(this)},r.getLocalBounds=function(){return this.sceneGraphService.getLocalBounds(this)},r.getBoundingClientRect=function(){return this.sceneGraphService.getBoundingClientRect(this)},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},r.getAttributeNames=function(){return Object.keys(this.attributes)},r.getAttribute=function(t){var e=this.attributes[t];if(void 0===e){var n=ai(t.toString(),"");e=this.attributes[n[0]]}return Fe(e)?null:e},r.hasAttribute=function(t){return this.getAttributeNames().includes(t)},r.hasAttributes=function(){return!!this.getAttributeNames().length},r.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},r.setAttribute=function(t,e,n){this.attributes[t]=e},r.getAttributeNS=function(t,e){throw new Error("Method not implemented.")},r.getAttributeNode=function(t){throw new Error("Method not implemented.")},r.getAttributeNodeNS=function(t,e){throw new Error("Method not implemented.")},r.hasAttributeNS=function(t,e){throw new Error("Method not implemented.")},r.removeAttributeNS=function(t,e){throw new Error("Method not implemented.")},r.removeAttributeNode=function(t){throw new Error("Method not implemented.")},r.setAttributeNS=function(t,e,n){throw new Error("Method not implemented.")},r.setAttributeNode=function(t){throw new Error("Method not implemented.")},r.setAttributeNodeNS=function(t){throw new Error("Method not implemented.")},r.toggleAttribute=function(t,e){throw new Error("Method not implemented.")},ve(n,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}}]),n}(nu),fu=function(t){function e(e,n,r,i){var o;return(o=t.call(this,e)||this).currentTime=void 0,o.timelineTime=void 0,o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return me(e,t),e}($s),du=0,yu=function(){function t(t,e){this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,this.effect=t,t.animation=this,this.timeline=e,this.id=""+du++,this._inEffect=!!this.effect.update(0),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}var e=t.prototype;return e.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},e.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},e.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},e.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this.totalDuration:0,this._startTime=this.totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.cancel=function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},e.updatePlaybackRate=function(t){this.playbackRate=t},e.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},e.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},e.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},e.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},e.rewind=function(){if(this.playbackRate<0){if(this.totalDuration>=1/0)throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this.totalDuration}else this.currentTime=0},e.persist=function(){throw new Error("Method not implemented.")},e.addEventListener=function(t,e,n){throw new Error("Method not implemented.")},e.removeEventListener=function(t,e,n){throw new Error("Method not implemented.")},e.dispatchEvent=function(t){throw new Error("Method not implemented.")},e.commitStyles=function(){throw new Error("Method not implemented.")},e.ensureAlive=function(){var t,e;0>this.playbackRate&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},e.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this.totalDuration:0),this.ensureAlive())},e.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new fu(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new fu(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},ve(t,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this.totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){var t;return Number(null===(t=this.effect)||void 0===t?void 0:t.getComputedTiming().endTime)}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}}]),t}();function vu(t,e){return Number(t.id)-Number(e.id)}var gu=function(){function t(t){var e=this;this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(vu),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()},this.document=t}var e=t.prototype;return e.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},e.isTicking=function(){return this.inTick},e.play=function(t){var e=new yu(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},e.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(vu),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},e.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},e.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},e.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},e.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},e.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},e.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},e.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},e.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},e.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],u=[],c=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?u.push(n):c.push(n)})),(r=this.pendingEffects).push.apply(r,a),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,c]},t}();t.DisplayObjectPool=function(){function e(){this.pool={},this.htmlPool=[]}var n=e.prototype;return n.getByEntity=function(t){return this.pool[t]},n.add=function(e,n){this.pool[e]=n,n.nodeName===t.Shape.HTML&&this.htmlPool.push(n)},n.remove=function(e){var n=this.pool[e];if(delete this.pool[e],n.nodeName===t.Shape.HTML){var r=this.htmlPool.indexOf(n);this.htmlPool.splice(r,1)}},n.getHTMLs=function(){return this.htmlPool},e}(),t.DisplayObjectPool=ce([lt()],t.DisplayObjectPool);var mu,Tu,bu={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:""},Eu=function(e){function n(n){var r,i,o,a;return(a=e.call(this)||this).config=void 0,a.styleValueRegistry=Ut.get(Gr),a.isCustomElement=!1,a.activeAnimations=[],a.config=n,a.config.interactive=null!==(r=a.config.capture)&&void 0!==r?r:a.config.interactive,a.id=a.config.id||"",a.name=a.config.name||"",(a.config.className||a.config.class)&&(a.className=a.config.className||a.config.class),a.nodeName=a.config.type||t.Shape.GROUP,a.config.style=ge({},bu,{zIndex:null!==(i=a.config.zIndex)&&void 0!==i?i:0,interactive:null===(o=a.config.interactive)||void 0===o||o},a.config.style,a.config.attrs),null!=a.config.visible&&(a.config.style.visibility=!1===a.config.visible?"hidden":"visible"),null!=a.config.interactive&&(a.config.style.pointerEvents=!1===a.config.interactive?"none":"auto"),a.style=new Proxy(ge({},a.attributes,{setProperty:function(t,e){a.setAttribute(t,e)},getPropertyValue:function(t){return a.getAttribute(t)},removeProperty:function(t){a.removeAttribute(t)},item:function(){return""}}),{get:function(t,e){return void 0!==t[e]?t[e]:a.getAttribute(e)},set:function(t,e,n){return a.setAttribute(e,n),!0}}),a.initAttributes(a.config.style),Ut.get(t.DisplayObjectPool).add(a.entity,we(a)),a}me(n,e);var r=n.prototype;return r.destroy=function(){e.prototype.destroy.call(this),Ut.get(t.DisplayObjectPool).remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))},r.cloneNode=function(t){var e=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:ge({},this.attributes)});return e.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(n){var r=n.cloneNode(t);e.appendChild(r)})),e},r.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable;this.styleValueRegistry.processProperties(this,t),e.dirty=!0},r.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=ai(t,n),o=i[0],a=i[1];Ue(n)||(r||a!==this.attributes[o])&&(this.internalSetAttribute(o,a),e.prototype.setAttribute.call(this,o,a))},r.internalSetAttribute=function(e,n,r){var i,o=this;void 0===r&&(r={});var a=this.renderable,s=this.attributes[e],u=this.parsedStyle[e];this.styleValueRegistry.processProperties(this,((i={})[e]=n,i),r),this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&this.attributes.clipPathTargets.forEach((function(e){Tc(e),e.dispatchEvent(new lu(t.ElementEvent.ATTR_MODIFIED,e,o,o,"clipPath",lu.MODIFICATION,o,o)),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback("clipPath",o,o)})),a.dirty=!0,this.dispatchEvent(new lu(t.ElementEvent.ATTR_MODIFIED,this,s,n,e,lu.MODIFICATION,u,this.parsedStyle[e])),this.isCustomElement&&this.isConnected&&this.attributeChangedCallback&&this.attributeChangedCallback(e,s,n)},r.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],r=e[1],i=t.getMax();return new qa(n,r,i[0]-n,i[1]-r)},r.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setOrigin(this,ar(t,e,n)),this},r.getOrigin=function(){return this.sceneGraphService.getOrigin(this)},r.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setPosition(this,ar(t,e,n)),this},r.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setLocalPosition(this,ar(t,e,n)),this},r.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translate(this,ar(t,e,n)),this},r.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translateLocal(this,ar(t,e,n)),this},r.getPosition=function(){return this.sceneGraphService.getPosition(this)},r.getLocalPosition=function(){return this.sceneGraphService.getLocalPosition(this)},r.scale=function(t,e,n){return this.scaleLocal(t,e,n)},r.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=ar(t,e=e||t,n=n||t)),this.sceneGraphService.scaleLocal(this,t),this},r.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=ar(t,e=e||t,n=n||t)),this.sceneGraphService.setLocalScale(this,t),this},r.getLocalScale=function(){return this.sceneGraphService.getLocalScale(this)},r.getScale=function(){return this.sceneGraphService.getScale(this)},r.getEulerAngles=function(){var t=cr(mn(),this.sceneGraphService.getWorldTransform(this));return sr(t[2])},r.getLocalEulerAngles=function(){var t=cr(mn(),this.sceneGraphService.getLocalRotation(this));return sr(t[2])},r.setEulerAngles=function(t){return this.sceneGraphService.setEulerAngles(this,0,0,t),this},r.setLocalEulerAngles=function(t){return this.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},r.rotateLocal=function(t,e,n){return Fe(e)&&Fe(n)?this.sceneGraphService.rotateLocal(this,0,0,t):this.sceneGraphService.rotateLocal(this,t,e,n),this},r.rotate=function(t,e,n){return Fe(e)&&Fe(n)?this.sceneGraphService.rotate(this,0,0,t):this.sceneGraphService.rotate(this,t,e,n),this},r.setRotation=function(t,e,n,r){return this.sceneGraphService.setRotation(this,t,e,n,r),this},r.setLocalRotation=function(t,e,n,r){return this.sceneGraphService.setLocalRotation(this,t,e,n,r),this},r.getRotation=function(){return this.sceneGraphService.getRotation(this)},r.getLocalRotation=function(){return this.sceneGraphService.getLocalRotation(this)},r.getLocalTransform=function(){return this.sceneGraphService.getLocalTransform(this)},r.getWorldTransform=function(){return this.sceneGraphService.getWorldTransform(this)},r.setLocalTransform=function(t){return this.sceneGraphService.setLocalTransform(this,t),this},r.resetLocalTransform=function(){this.sceneGraphService.resetLocalTransform(this)},r.getAnimations=function(){return this.activeAnimations},r.animate=function(t,e){var n,r,i=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&(i=null===(r=this.attributes.clipPathTargets[0].ownerDocument)||void 0===r?void 0:r.timeline);return delete this.parsedStyle.transform,i?i.play(new fc(this,t,e)):null},r.show=function(){this.style.visibility="visible"},r.hide=function(){this.style.visibility="hidden"},r.isVisible=function(){var t,e;return"visible"===(null===(t=this.parsedStyle)||void 0===t||null===(e=t.visibility)||void 0===e?void 0:e.value)},r.isInteractive=function(){var t,e;return"none"!==(null===(t=this.parsedStyle)||void 0===t||null===(e=t.pointerEvents)||void 0===e?void 0:e.value)},r.isCulled=function(){return!(!this.cullable||!this.cullable.isCulled())},r.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))+1),this},r.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))-1),this},r.getCount=function(){return this.childElementCount},r.getParent=function(){return this.parentElement},r.getChildren=function(){return this.children},r.getFirst=function(){return this.firstElementChild},r.getLast=function(){return this.lastElementChild},r.getChildByIndex=function(t){return this.children[t]||null},r.add=function(t,e){return this.appendChild(t,e)},r.setClip=function(t){this.style.clipPath=t},r.getClip=function(){return this.style.clipPath||null},r.set=function(t,e){this.config[t]=e},r.get=function(t){return this.config[t]},r.getConfig=function(){return this.config},r.attr=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n[1];return i?je(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},r.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.setZIndex=function(t){return this.style.zIndex=t,this},r.getMatrix=function(t){var e=t||this.getWorldTransform(),n=pn(mn(),e),r=n[0],i=n[1],o=fn(mn(),e),a=o[0],s=o[1],u=dn(jn(),e),c=cr(mn(),u);return lr(c[0]||c[2],r,i,a,s)},r.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},r.setMatrix=function(t){var e=pr(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,o)},r.setLocalMatrix=function(t){var e=pr(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},ve(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(pu),Su=["style"],wu=function(t){function e(e){var n,r=void 0===e?{}:e,i=r.style,o=Se(r,Su);return(n=t.call(this,ge({style:ge({x:"",y:""},i)},o))||this).isCustomElement=!0,n}return me(e,t),e}(Eu),xu=["style"],Pu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Se(r,xu);return e.call(this,ge({type:t.Shape.CIRCLE,style:ge({cx:"",cy:"",r:"",anchor:"0.5 0.5",transformOrigin:"center"},i)},o))||this}return me(n,e),n}(Eu),ku=["style"],Cu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Se(r,ku);return e.call(this,ge({type:t.Shape.ELLIPSE,style:ge({cx:"",cy:"",rx:"",ry:"",anchor:"0.5 0.5",transformOrigin:"center"},i)},o))||this}return me(n,e),n}(Eu),Nu=["style"],_u=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Se(r,Nu);return e.call(this,ge({type:t.Shape.GROUP,style:ge({x:"",y:"",width:"",height:""},i)},o))||this}return me(n,e),n}(Eu),Mu=["style"],Au=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Se(r,Mu);return e.call(this,ge({type:t.Shape.IMAGE,style:ge({x:"",y:"",img:"",width:"",height:""},i)},o))||this}return me(n,e),n}(Eu),Ou=["style"],Iu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Se(r,Ou);return e.call(this,ge({type:t.Shape.LINE,style:ge({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},i)},o))||this}me(n,e);var r=n.prototype;return r.getPoint=function(t){var e=this.parsedStyle,n=li.pointAt(e.x1.value,e.y1.value,e.x2.value,e.y2.value,t);return new Ya(n.x,n.y)},r.getTotalLength=function(){var t=this.parsedStyle;return li.length(t.x1.value,t.y1.value,t.x2.value,t.y2.value)},n}(Eu),Ru=["style"],Lu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Se(r,Ru);return e.call(this,ge({type:t.Shape.PATH,style:ge({path:"",miterLimit:4},i)},o))||this}me(n,e);var r=n.prototype;return r.getTotalLength=function(){return this.parsedStyle.path.totalLength},r.getPoint=function(t){var e=0,n=0,r=this.parsedStyle.path.curve;if(!this.parsedStyle.path.curveSegments.length)return r?new Ya(r[0][1],r[0][2]):null;this.parsedStyle.path.curveSegments.forEach((function(r,i){r[0]>t||t>r[1]||(e=(t-r[0])/(r[1]-r[0]),n=i)}));var i=r[n];if(Fe(i)||Fe(n))return null;var o=i.length,a=r[n+1],s=vi.pointAt(i[o-2],i[o-1],a[1],a[2],a[3],a[4],a[5],a[6],e);return new Ya(s.x,s.y)},r.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},r.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},n}(Eu),Du=["style"],Uu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Se(r,Du);return e.call(this,ge({type:t.Shape.POLYGON,style:ge({points:"",miterLimit:4},i)},o))||this}return me(n,e),n}(Eu),Fu=["style"],Bu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Se(r,Fu);return e.call(this,ge({type:t.Shape.POLYLINE,style:ge({points:"",miterLimit:4},i)},o))||this}me(n,e);var r=n.prototype;return r.getTotalLength=function(){return this.parsedStyle.points.totalLength},r.getPoint=function(t){var e=this.parsedStyle.points,n=e.points,r=0,i=0;e.segments.forEach((function(e,n){e[0]>t||t>e[1]||(r=(t-e[0])/(e[1]-e[0]),i=n)}));var o=li.pointAt(n[i][0],n[i][1],n[i+1][0],n[i+1][1],r);return new Ya(o.x,o.y)},r.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},r.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},n}(Eu),Vu=["style"],Gu=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=Se(r,Vu);return e.call(this,ge({type:t.Shape.RECT,style:ge({x:"",y:"",width:"",height:"",radius:""},i)},o))||this}return me(n,e),n}(Eu),ju=["style"],Hu=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=Se(i,ju);return(r=e.call(this,ge({type:t.Shape.TEXT,style:ge({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:0,lineHeight:0,miterLimit:10,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},o)},a))||this).LENGTHADJUST_SPACING=1,r.LENGTHADJUST_SPACINGANDGLYPHS=2,r.LENGTHADJUST_UNKNOWN=0,r.lengthAdjust=void 0,r.textLength=void 0,r}me(n,e);var r=n.prototype;return r.getCharNumAtPosition=function(t){throw new Error("Method not implemented.")},r.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},r.getEndPositionOfChar=function(t){throw new Error("Method not implemented.")},r.getExtentOfChar=function(t){throw new Error("Method not implemented.")},r.getNumberOfChars=function(){throw new Error("Method not implemented.")},r.getRotationOfChar=function(t){throw new Error("Method not implemented.")},r.getStartPositionOfChar=function(t){throw new Error("Method not implemented.")},r.getSubStringLength=function(t,e){throw new Error("Method not implemented.")},r.selectSubString=function(t,e){throw new Error("Method not implemented.")},r.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},n}(Eu),zu=["style"],Wu=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=Se(i,zu);return(r=e.call(this,ge({type:t.Shape.HTML,style:ge({x:"",y:"",width:"auto",height:"auto",innerHTML:""},o)},a))||this).cullable.enable=!1,r}me(n,e);var r=n.prototype;return r.getDomElement=function(){return this.parsedStyle.$el},r.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(t=this.ownerDocument)||void 0===t||null===(e=t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var i=n.left-r.left,o=n.top-r.top,a=new La;return a.setMinMax(En(i,o,0),En(i+n.width,o+n.height,0)),a}return null},r.getLocalBounds=function(){if(this.parentNode){var t=un(on(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!La.isEmpty(e)){var n=new La;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(Eu),Yu=function(t){function e(){var e;(e=t.call(this)||this).defaultView=null,e.documentElement=void 0,e.timeline=void 0,e.ownerDocument=null,e.nodeName="document",e.timeline=new gu(we(e));var n={};return Oc.forEach((function(t){var e=t.defaultValue;t.inherited&&e&&(n[t.name]=e)})),e.documentElement=new _u({id:"g-root",style:n}),e.documentElement.ownerDocument=we(e),e.documentElement.parentNode=we(e),e.childNodes=[e.documentElement],e}me(e,t);var n=e.prototype;return n.createElement=function(t,e){var n=this.defaultView.customElements.get(t);return n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Hu:_u),new n(e)},n.createElementNS=function(t,e,n){return this.createElement(e,n)},n.cloneNode=function(t){throw new Error("Method not implemented.")},n.destroy=function(){try{this.documentElement.destroy()}catch(t){}this.timeline.destroy()},n.elementFromPoint=function(){var t=de(pe().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,p;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",null);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return t.abrupt("return",(p=t.sent.picked)&&p[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.elementsFromPoint=function(){var t=de(pe().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,p;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return(p=t.sent.picked)[p.length-1]!==this.documentElement&&p.push(this.documentElement),t.abrupt("return",p);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.appendChild=function(t,e){throw new Error("Use document.documentElement instead.")},n.insertBefore=function(t,e){throw new Error("Use document.documentElement instead.")},n.removeChild=function(t,e){throw new Error("Use document.documentElement instead.")},n.replaceChild=function(t,e,n){throw new Error("Use document.documentElement instead.")},n.append=function(){throw new Error("Use document.documentElement instead.")},n.prepend=function(){throw new Error("Use document.documentElement instead.")},n.getElementById=function(t){return this.documentElement.getElementById(t)},n.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},n.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},n.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},n.querySelector=function(t){return this.documentElement.querySelector(t)},n.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},n.find=function(t){return this.documentElement.find(t)},n.findAll=function(t){return this.documentElement.findAll(t)},ve(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}}]),e}(nu),qu=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).altKey=void 0,e.button=void 0,e.buttons=void 0,e.ctrlKey=void 0,e.metaKey=void 0,e.relatedTarget=void 0,e.shiftKey=void 0,e.client=new Ya,e.movement=new Ya,e.offset=new Ya,e.global=new Ya,e.screen=new Ya,e}me(e,t);var n=e.prototype;return n.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},n.initMouseEvent=function(){throw new Error("Method not implemented.")},ve(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}}]),e}($s),Xu=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).pointerId=void 0,e.width=0,e.height=0,e.isPrimary=!1,e.pointerType=void 0,e.pressure=void 0,e.tangentialPressure=void 0,e.tiltX=void 0,e.tiltY=void 0,e.twist=void 0,e}me(e,t);var n=e.prototype;return n.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},n.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e}(qu),Ku=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).deltaMode=void 0,e.deltaX=void 0,e.deltaY=void 0,e.deltaZ=void 0,e.DOM_DELTA_LINE=0,e.DOM_DELTA_PAGE=1,e.DOM_DELTA_PIXEL=2,e}return me(e,t),e}(qu),Zu=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=jr,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return ve(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Xr(t),this._easing=t}}]),t}(),Ju=function(){function t(t,e){this.type=void 0,this.target=void 0,this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=t,this.target=e}return t.copy=function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n},t}(),Qu=0,$u=new WeakMap,tc=function(){function e(t,e,n){this.observer=void 0,this.target=void 0,this.options=void 0,this.transientObservedNodes=[],this.observer=t,this.target=e,this.options=n}var n=e.prototype;return n.enqueue=function(t){var e=this.observer.records,n=e.length;if(e.length>0){var r=function(t,e){return t===e?t:Tu&&function(t){return t===Tu||t===mu}(t)?Tu:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else oc.push(this.observer),ic||(ic=!0,"undefined"!=typeof globalThis?globalThis.setTimeout(ac):ac());e[n]=t},n.addListeners=function(){this.addListeners_(this.target)},n.addListeners_=function(e){var n=this.options;n.attributes&&e.addEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.addEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.addEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeListeners=function(){this.removeListeners_(this.target)},n.removeListeners_=function(e){var n=this.options;n.attributes&&e.removeEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.removeEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.removeEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeTransientObservers=function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=$u.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}}),this)},n.handleEvent=function(e){var n,r;switch(e.stopImmediatePropagation(),e.type){case t.ElementEvent.ATTR_MODIFIED:var i=e.attrName,o=e.relatedNode.namespaceURI;(n=nc("attributes",r=e.target)).attributeName=i,n.attributeNamespace=o;var a=e.attrChange===lu.ADDITION?null:e.prevValue;rc(r,(function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(i)||-1!==t.attributeFilter.indexOf(o)))return t.attributeOldValue?function(t){return Tu||((Tu=Ju.copy(mu)).oldValue=t,Tu)}(a):n}));break;case t.ElementEvent.REMOVED:case t.ElementEvent.INSERTED:var s,u,c=e.target;e.type===t.ElementEvent.INSERTED?(s=[c],u=[]):(s=[],u=[c]);var l=c.previousSibling,h=c.nextSibling;(n=nc("childList",r=e.relatedNode)).addedNodes=s,n.removedNodes=u,n.previousSibling=l,n.nextSibling=h,rc(r,(function(t){if(t.childList)return n}))}mu=Tu=void 0},e}(),ec=function(){function t(t){this.callback=void 0,this.nodes=[],this.records=[],this.uid=Qu++,this.callback=t}var e=t.prototype;return e.observe=function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,r=$u.get(t);r||$u.set(t,r=[]);for(var i=0;r.length>i;i++)if(r[i].observer===this){(n=r[i]).removeListeners(),n.options=e;break}n||(n=new tc(this,t,e),r.push(n),this.nodes.push(t)),n.addListeners()},e.disconnect=function(){var t=this;this.nodes.forEach((function(e){for(var n=$u.get(e),r=0;n.length>r;r++){var i=n[r];if(i.observer===t){i.removeListeners(),n.splice(r,1);break}}}),this),this.records=[]},e.takeRecords=function(){var t=this.records;return this.records=[],t},t}();function nc(t,e){return mu=new Ju(t,e)}function rc(t,e){for(var n=t;n;n=n.parentNode){var r=$u.get(n);if(r)for(var i=0;r.length>i;i++){var o=r[i],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}var ic=!1,oc=[];function ac(){ic=!1;var t=oc;oc=[],t.sort((function(t,e){return t.uid-e.uid}));var e=!1;t.forEach((function(t){var n=t.takeRecords();!function(t){t.nodes.forEach((function(e){var n=$u.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&ac()}function sc(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;i>o;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}null!=r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(0>i||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error(i+" compositing is not supported");n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;n.length>o;o++){var a=n[o].offset;if(null!=a){if(i>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}else r=!1}return n=n.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;r>a;a++){var s=Number(n[a].computedOffset);if(null!=s&&null!=o){for(var u=1;a-i>u;u++)n[i+u].computedOffset=o+(s-o)*u/(a-i);i=a,o=s}}}(),n}var uc="backwards|forwards|both|none".split("|"),cc="reverse|alternate|alternate-reverse".split("|");function lc(t,e){var n=new Zu;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===uc.indexOf(t[e]))return;if("direction"===e&&-1===cc.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function hc(t,e){var n;return lc(t=pc(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}function pc(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var fc=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=t,this.timing=hc(n,!1),this.timing.effect=this,this.timing.activeDuration=Kr(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=sc(e,this.timing),this.interpolations=ti(this.normalizedKeyframes,this.timing,this.target),this.computedTiming=new Proxy(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}})}var e=t.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(t){return null!==t&&(this.timeFraction=Zr(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(t){this.normalizedKeyframes=sc(t)},e.getComputedTiming=function(){return this.computedTiming},e.getTiming=function(){return this.timing},e.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing=t[n]}))},t}(),dc=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,Pu),this.define(t.Shape.ELLIPSE,Cu),this.define(t.Shape.RECT,Gu),this.define(t.Shape.IMAGE,Au),this.define(t.Shape.LINE,Iu),this.define(t.Shape.GROUP,_u),this.define(t.Shape.PATH,Lu),this.define(t.Shape.POLYGON,Uu),this.define(t.Shape.POLYLINE,Bu),this.define(t.Shape.TEXT,Hu),this.define(t.Shape.HTML,Wu)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}(),yc=i.defineToken("SceneGraphSelectorFactory"),vc=i.defineToken("SceneGraphSelector",{multiple:!1}),gc=/\[\s*(.*)=(.*)\s*\]/;function mc(t,e){var n=Number(t.style.zIndex),r=Number(e.style.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function Tc(e,n){void 0===n&&(n=!1);for(var r=e;r;){var i=r.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0),r=r.parentNode}e.dispatchEvent(new tu(t.ElementEvent.BOUNDS_CHANGED,{affectChildren:n}))}t.DefaultSceneGraphSelector=function(){function t(){}var e=t.prototype;return e.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return e.className===n.getIdOrClassname(t)}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},e.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&r.className===n.getIdOrClassname(t)}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},e.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},e.getIdOrClassname=function(t){return t.substring(1)},e.getAttribute=function(t){var e=t.match(gc),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},e.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return Fe(n)?"":n.toString?n.toString():""},t}(),t.DefaultSceneGraphSelector=ce([lt({token:vc})],t.DefaultSceneGraphSelector);var bc=i.defineToken("SceneGraphService");t.DefaultSceneGraphService=function(){function e(){var t,e,n,r,i,o=this;this.sceneGraphSelectorFactory=void 0,this.rotate=(t=jn(),function(e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=En(n,r,i));var a=e.transformable;if(null!==e.parentNode&&e.parentNode.transformable){var s=jn();qn(s,n[0],n[1],n[2]);var u=o.getRotation(e),c=o.getRotation(e.parentNode);er(t,c),Yn(t,t),zn(s,t,s),zn(a.localRotation,s,u),rr(a.localRotation,a.localRotation),o.dirtifyLocal(e,a)}else o.rotateLocal(e,n)}),this.rotateLocal=(e=jn(),function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=En(n,r,i));var a=t.transformable;qn(e,n[0],n[1],n[2]),nr(a.localRotation,a.localRotation,e),o.dirtifyLocal(t,a)}),this.setEulerAngles=(n=jn(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=En(e,r,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){qn(a.localRotation,e[0],e[1],e[2]);var s=o.getRotation(t.parentNode);er(n,Yn(jn(),s)),nr(a.localRotation,a.localRotation,n),o.dirtifyLocal(t,a)}else o.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=En(e,n,r));var i=t.transformable;Rn(e,mn())||(function(t,e,n){var r=n[0],i=n[1],o=n[2],a=e[0],s=e[1],u=e[2],c=i*u-o*s,l=o*a-r*u,h=r*s-i*a,p=i*h-o*l,f=o*c-r*h,d=r*l-i*c,y=2*n[3];l*=y,h*=y,f*=2,d*=2,t[0]=a+(c*=y)+(p*=2),t[1]=s+l+f,t[2]=u+h+d}(e,e,i.localRotation),xn(i.localPosition,i.localPosition,e),o.dirtifyLocal(t,i))},this.setPosition=(r=on(),function(t,e){var n=t.transformable;e=En(e[0],e[1],e[2]||0),Rn(o.getPosition(t),e)||(n.position=e,null!==t.parentNode&&t.parentNode.transformable?(an(r,t.parentNode.transformable.worldTransform),un(r,r),In(n.localPosition,e,r)):Sn(n.localPosition,e),o.dirtifyLocal(t,n))}),this.translate=(i=mn(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=En(e,n,r)),Rn(e,mn())||(xn(i,o.getPosition(t),e),o.setPosition(t,i))}),this.setRotation=function(){var t=jn();return function(e,n,r,i,a){var s=e.transformable;if("number"==typeof n&&(n=tr(n,r,i,a)),null!==e.parentNode&&e.parentNode.transformable){var u=o.getRotation(e.parentNode);er(t,u),Yn(t,t),zn(s.localRotation,t,n),rr(s.localRotation,s.localRotation),o.dirtifyLocal(e,s)}else o.setLocalRotation(e,n)}}}var n=e.prototype;return n.matches=function(t,e){return this.sceneGraphSelectorFactory().is(t,e)},n.querySelector=function(t,e){return this.sceneGraphSelectorFactory().selectOne(t,e)},n.querySelectorAll=function(t,e){return this.sceneGraphSelectorFactory().selectAll(t,e)},n.attach=function(t,e,n){t.parentNode&&this.detach(t),t.parentNode=e,Fe(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var r=e.sortable;r&&(r.dirty=!0);var i=t.transformable;i&&this.dirtifyWorld(t,i),i.frozen&&this.unfreezeParentToRoot(t)},n.detach=function(t){if(t.parentNode){var e=t.transformable,n=t.parentNode.sortable;n&&(n.dirty=!0);var r=t.parentNode.childNodes.indexOf(t);r>-1&&t.parentNode.childNodes.splice(r,1),e&&this.dirtifyWorld(t,e),t.parentNode=null}},n.getOrigin=function(t){return t.transformable.origin},n.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=En(e,n,r));var i=t.transformable;if(!Rn(e,i.origin)){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},n.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=En(e,n,r));var i=t.transformable;qn(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},n.setLocalPosition=function(t,e){var n=t.transformable;e=En(e[0],e[1],e[2]||0),Rn(n.localPosition,e)||(Sn(n.localPosition,e),this.dirtifyLocal(t,n))},n.scaleLocal=function(t,e){var n=t.transformable;kn(n.localScale,n.localScale,En(e[0],e[1],e[2]||1)),this.dirtifyLocal(t,n)},n.setLocalScale=function(t,e){var n=t.transformable,r=En(e[0],e[1],e[2]||n.localScale[2]);Rn(r,n.localScale)||(Sn(n.localScale,r),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=tr(e,n,r,i));var o=t.transformable;er(o.localRotation,e),this.dirtifyLocal(t,o)},n.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},n.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),Tc(t,!0)},n.getPosition=function(t){var e=t.transformable;return pn(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return dn(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return fn(e.scaling,this.getWorldTransform(t,e))},n.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},n.getLocalPosition=function(t){return t.transformable.localPosition},n.getLocalRotation=function(t){return t.transformable.localRotation},n.getLocalScale=function(t){return t.transformable.localScale},n.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(yn(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.localTransform},n.setLocalTransform=function(t,e){var n=pn(mn(),e),r=dn(jn(),e),i=fn(mn(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},n.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0])},n.getTransformedGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=this.getGeometryBounds(t,e);if(La.isEmpty(n))return null;var r=new La;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r},n.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry,r=e?n.renderBounds:n.contentBounds||null;return r&&new La(r.center,r.halfExtents)||new La},n.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=this.getTransformedGeometryBounds(t,e);t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(i?i.add(r):(i=new La).update(r.center,r.halfExtents))}));var o=t.style.clipPath;if(o){var a,s=this.getTransformedGeometryBounds(o,!0);s&&(a=new La).setFromTransformedAABB(s,this.getWorldTransform(t)),i?a&&(i=a.intersection(i)):i=a}return i&&(e?r.renderBounds=i:r.bounds=i),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,i||new La},n.getLocalBounds=function(t){if(t.parentNode){var e=on();t.parentNode.transformable&&(e=un(on(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!La.isEmpty(n)){var r=new La;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);La.isEmpty(i)||(r=new La).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(e=t.ownerDocument)||void 0===e||null===(n=e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=r.getMin(),s=a[0],u=a[1],c=r.getMax();return new qa(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new qa((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},n.dirtifyWorldInternal=function(e,n){var r=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,e.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||r.dirtifyWorldInternal(t,e)}));var i=e.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0),e.dispatchEvent(new lu(t.ElementEvent.ATTR_MODIFIED,e,null,null,"modelMatrix",lu.MODIFICATION,null,null))}},n.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}},n.sync=function(t,e){if(e.localDirtyFlag&&(yn(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?cn(e.worldTransform,r.worldTransform,e.localTransform):an(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},n.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),ce([ht(yc),he("design:type",Function)],t.DefaultSceneGraphService.prototype,"sceneGraphSelectorFactory",void 0),t.DefaultSceneGraphService=ce([lt({token:bc})],t.DefaultSceneGraphService);var Ec,Sc=i.defineToken("ContextService",{multiple:!1});(Ec=t.RenderReason||(t.RenderReason={}))[Ec.CAMERA_CHANGED=0]="CAMERA_CHANGED",Ec[Ec.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Ec[Ec.NONE=2]="NONE";var wc=i.defineToken("RenderingContext"),xc=i.defineToken("RenderingPluginContribution");t.RenderingService=function(){function e(){this.renderingPluginProvider=void 0,this.renderingContext=void 0,this.sceneGraphService=void 0,this.styleValueRegistry=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Fi,dirtycheck:new to(["object"]),cull:new to(["object"]),beginFrame:new Xi([]),beforeRender:new Xi(["objectToRender"]),render:new Xi(["objectToRender"]),afterRender:new Xi(["objectToRender"]),endFrame:new Xi([]),destroy:new Xi([]),pick:new ji(["result"]),pointerDown:new Xi(["event"]),pointerUp:new Xi(["event"]),pointerMove:new Xi(["event"]),pointerOut:new Xi(["event"]),pointerOver:new Xi(["event"]),pointerWheel:new Xi(["event"]),pointerCancel:new Xi(["event"])}}var n=e.prototype;return n.init=function(){var t=de(pe().mark((function t(){var e=this;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.renderingPluginProvider.getContributions({cache:!1}).forEach((function(t){t.apply(e)})),t.next=3,this.hooks.init.promise();case 3:this.inited=!0;case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getStats=function(){return this.stats},n.render=function(t){var e=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.sceneGraphService.syncHierarchy(this.renderingContext.root),this.renderingContext.renderReasons.size&&this.inited&&(this.renderDisplayObject(this.renderingContext.root,t),(this.renderingContext.renderListCurrentFrame.length||this.renderingContext.renderListLastFrame.length!==this.renderingContext.renderListCurrentFrame.length)&&(this.hooks.beginFrame.call(),this.renderingContext.renderListCurrentFrame.forEach((function(t){e.hooks.beforeRender.call(t),e.hooks.render.call(t),e.hooks.afterRender.call(t)})),this.hooks.endFrame.call()),this.renderingContext.renderListLastFrame=[].concat(this.renderingContext.renderListCurrentFrame),this.renderingContext.renderListCurrentFrame=[],this.renderingContext.renderReasons.clear())},n.renderDisplayObject=function(e,n){var r=this,i=n.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.styleValueRegistry.recalc(e);var s=o?this.hooks.dirtycheck.call(e):e;if(s){var u=a?this.hooks.cull.call(s):s;u&&(this.stats.rendered++,this.renderingContext.renderListCurrentFrame.push(u))}e.renderable.dirty=!1,e.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var c=e.sortable,l=!1;c.dirty&&(c.sorted=e.childNodes.slice().sort(mc),l=!0,c.dirty=!1),(c.sorted||e.childNodes).forEach((function(t){r.renderDisplayObject(t,n)})),l&&e.forEach((function(e){e.dispatchEvent(new tu(t.ElementEvent.RENDER_ORDER_CHANGED,{renderOrder:e.sortable.renderOrder}))}))},n.destroy=function(){this.inited=!1,this.hooks.destroy.call()},n.dirtify=function(){this.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),ce([Bt(xc),he("design:type",Object)],t.RenderingService.prototype,"renderingPluginProvider",void 0),ce([ht(wc),he("design:type",Object)],t.RenderingService.prototype,"renderingContext",void 0),ce([ht(bc),he("design:type",Object)],t.RenderingService.prototype,"sceneGraphService",void 0),ce([ht(Gr),he("design:type",Object)],t.RenderingService.prototype,"styleValueRegistry",void 0),t.RenderingService=ce([lt()],t.RenderingService);t.EventService=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).renderingContext=void 0,e.contextService=void 0,e.canvasConfig=void 0,e.displayObjectPool=void 0,e.rootTarget=void 0,e.cursor="default",e.mappingTable={},e.mappingState={trackingData:{}},e.eventPool=new Map,e.pickHandler=void 0,e.onPointerDown=function(){var t=de(pe().mark((function t(n){var r;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Xu){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createPointerEvent(n);case 4:e.dispatchEvent(r=t.sent,"pointerdown"),"touch"===r.pointerType?e.dispatchEvent(r,"touchstart"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||e.dispatchEvent(r,2===r.button?"rightdown":"mousedown"),e.trackingData(n.pointerId).pressTargetsByButton[n.button]=r.composedPath(),e.freeEvent(r);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerUp=function(){var t=de(pe().mark((function t(n){var r,i,o,a,s,u,c,l;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Xu){t.next=2;break}return t.abrupt("return");case 2:return r=performance.now(),t.next=5,e.createPointerEvent(n);case 5:if(e.dispatchEvent(i=t.sent,"pointerup"),"touch"===i.pointerType?e.dispatchEvent(i,"touchend"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||e.dispatchEvent(i,2===i.button?"rightup":"mouseup"),o=e.trackingData(n.pointerId),a=e.findMountedTarget(o.pressTargetsByButton[n.button]),s=a,a&&!i.composedPath().includes(a)){for(u=a;u&&!i.composedPath().includes(u);)i.currentTarget=u,e.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?e.notifyTarget(i,"touchendoutside"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||e.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),nu.isNode(u)&&(u=u.parentNode);delete o.pressTargetsByButton[n.button],s=u}s&&((c=e.clonePointerEvent(i,"click")).target=s,c.path=[],o.clicksByButton[n.button]||(o.clicksByButton[n.button]={clickCount:0,target:c.target,timeStamp:r}),(l=o.clicksByButton[n.button]).target===c.target&&200>r-l.timeStamp?++l.clickCount:l.clickCount=1,l.target=c.target,l.timeStamp=r,c.detail=l.clickCount,e.dispatchEvent(c,"mouse"===c.pointerType||"touch"===c.pointerType?"click":"pointertap"),e.freeEvent(c)),e.freeEvent(i);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerMove=function(){var t=de(pe().mark((function t(n){var r,i,o,a,s,u,c,l,h,p;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Xu){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createPointerEvent(n);case 4:if(i="mouse"===(r=t.sent).pointerType||"pen"===r.pointerType,o=e.trackingData(n.pointerId),a=e.findMountedTarget(o.overTargets),!o.overTargets||a===r.target){t.next=23;break}return s="mousemove"===n.type?"mouseout":"pointerout",t.next=12,e.createPointerEvent(n,s,a||void 0);case 12:if(e.dispatchEvent(u=t.sent,"pointerout"),i&&e.dispatchEvent(u,"mouseout"),r.composedPath().includes(a)){t.next=22;break}return t.next=18,e.createPointerEvent(n,"pointerleave",a||void 0);case 18:for((c=t.sent).eventPhase=c.AT_TARGET;c.target&&!r.composedPath().includes(c.target);)c.currentTarget=c.target,e.notifyTarget(c),i&&e.notifyTarget(c,"mouseleave"),nu.isNode(c.target)&&(c.target=c.target.parentNode);e.freeEvent(c);case 22:e.freeEvent(u);case 23:if(a===r.target){t.next=38;break}l=e.clonePointerEvent(r,"mousemove"===n.type?"mouseover":"pointerover"),e.dispatchEvent(l,"pointerover"),i&&e.dispatchEvent(l,"mouseover"),h=a&&nu.isNode(a)&&a.parentNode;case 29:if(!h||h===(nu.isNode(e.rootTarget)&&e.rootTarget.parentNode)){t.next=35;break}if(h!==r.target){t.next=32;break}return t.abrupt("break",35);case 32:h=h.parentNode,t.next=29;break;case 35:if(!h||h===(nu.isNode(e.rootTarget)&&e.rootTarget.parentNode)){for((p=e.clonePointerEvent(r,"pointerenter")).eventPhase=p.AT_TARGET;p.target&&p.target!==a&&p.target!==(nu.isNode(e.rootTarget)&&e.rootTarget.parentNode);)p.currentTarget=p.target,e.notifyTarget(p),i&&e.notifyTarget(p,"mouseenter"),nu.isNode(p.target)&&(p.target=p.target.parentNode);e.freeEvent(p)}e.freeEvent(l);case 38:e.dispatchEvent(r,"pointermove"),"touch"===r.pointerType&&e.dispatchEvent(r,"touchmove"),i&&(e.dispatchEvent(r,"mousemove"),e.cursor=e.getCursor(r.target)),o.overTargets=r.composedPath(),e.freeEvent(r);case 43:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerOut=function(){var t=de(pe().mark((function t(n){var r,i,o,a,s;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Xu){t.next=2;break}return t.abrupt("return");case 2:if(!(r=e.trackingData(n.pointerId)).overTargets){t.next=19;break}return i="mouse"===n.pointerType||"pen"===n.pointerType,o=e.findMountedTarget(r.overTargets),t.next=8,e.createPointerEvent(n,"pointerout",o||void 0);case 8:return e.dispatchEvent(a=t.sent),i&&e.dispatchEvent(a,"mouseout"),t.next=13,e.createPointerEvent(n,"pointerleave",o||void 0);case 13:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&s.target!==(nu.isNode(e.rootTarget)&&e.rootTarget.parentNode);)s.currentTarget=s.target,e.notifyTarget(s),i&&e.notifyTarget(s,"mouseleave"),nu.isNode(s.target)&&(s.target=s.target.parentNode);r.overTargets=null,e.freeEvent(a),e.freeEvent(s);case 19:e.cursor=null;case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerOver=function(){var t=de(pe().mark((function t(n){var r,i,o,a;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Xu){t.next=2;break}return t.abrupt("return");case 2:return r=e.trackingData(n.pointerId),t.next=5,e.createPointerEvent(n);case 5:for(o="mouse"===(i=t.sent).pointerType||"pen"===i.pointerType,e.dispatchEvent(i,"pointerover"),o&&e.dispatchEvent(i,"mouseover"),"mouse"===i.pointerType&&(e.cursor=e.getCursor(i.target)),(a=e.clonePointerEvent(i,"pointerenter")).eventPhase=a.AT_TARGET;a.target&&a.target!==(nu.isNode(e.rootTarget)&&e.rootTarget.parentNode);)a.currentTarget=a.target,e.notifyTarget(a),o&&e.notifyTarget(a,"mouseenter"),nu.isNode(a.target)&&(a.target=a.target.parentNode);r.overTargets=i.composedPath(),e.freeEvent(i),e.freeEvent(a);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerUpOutside=function(){var t=de(pe().mark((function t(n){var r,i,o,a;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Xu){t.next=2;break}return t.abrupt("return");case 2:return r=e.trackingData(n.pointerId),i=e.findMountedTarget(r.pressTargetsByButton[n.button]),t.next=6,e.createPointerEvent(n);case 6:if(o=t.sent,i){for(a=i;a;)o.currentTarget=a,e.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType||"mouse"!==o.pointerType&&"pen"!==o.pointerType||e.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),nu.isNode(a)&&(a=a.parentNode);delete r.pressTargetsByButton[n.button]}e.freeEvent(o);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onWheel=function(){var t=de(pe().mark((function t(n){var r;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Ku){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createWheelEvent(n);case 4:e.dispatchEvent(r=t.sent),e.freeEvent(r);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e}me(e,t);var n=e.prototype;return n.init=function(){this.rootTarget=this.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)},n.client2Viewport=function(t){var e=this.contextService.getBoundingClientRect();return new Ya(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},n.viewport2Client=function(t){var e=this.contextService.getBoundingClientRect();return new Ya(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},n.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.canvasConfig,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),c=cn(on(),u,s),l=En(e/o*2-1,2*(1-n/a)-1,0);return In(l,l,c),new Ya(l[0],l[1])},n.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=cn(on(),n,r),o=En(t.x,t.y,0);In(o,o,i);var a=this.canvasConfig;return new Ya((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},n.setPickHandler=function(t){this.pickHandler=t},n.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},n.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},n.dispatchEvent=function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.emit(e||t.type,t)},n.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=i+1;n.length>o;o++)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},n.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)nu.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},n.hitTest=function(){var t=de(pe().mark((function t(e){var n,r,i,o,a;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.viewportY,o=(i=this.canvasConfig).width,a=i.height,!(0>(n=e.viewportX)||0>r||n>o||r>a)){t.next=4;break}return t.abrupt("return",null);case 4:return t.next=6,this.pickHandler(e);case 6:if(t.t1=t.sent,t.t1){t.next=9;break}t.t1=this.rootTarget;case 9:if(t.t0=t.t1,t.t0){t.next=12;break}t.t0=null;case 12:return t.abrupt("return",t.t0);case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.isNativeEventFromCanvas=function(t){var e,n=this.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},n.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e,n=Pe(this.displayObjectPool.getHTMLs());!(e=n()).done;){var r=e.value;if(t.nativeEvent.composedPath().indexOf(r)>-1)return r}return null},n.pickTarget=function(){var t=de(pe().mark((function t(e){return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY}));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.createPointerEvent=function(){var t=de(pe().mark((function t(e,n,r){var i,o;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.allocateEvent(Xu),this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.nativeEvent=e.nativeEvent,i.originalEvent=e,o=this.getExistedHTML(i),null==r){t.next=11;break}t.t0=r,t.next=20;break;case 11:if(t.t1=o,t.t1){t.next=19;break}if(t.t2=this.isNativeEventFromCanvas(i),!t.t2){t.next=18;break}return t.next=17,this.pickTarget(i);case 17:t.t2=t.sent;case 18:t.t1=t.t2;case 19:t.t0=t.t1;case 20:return i.target=t.t0,"string"==typeof n&&(i.type=n),t.abrupt("return",i);case 23:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),n.createWheelEvent=function(){var t=de(pe().mark((function t(e){var n,r;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(Ku),this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,r=this.getExistedHTML(n),t.t0=r,t.t0){t.next=15;break}if(t.t1=this.isNativeEventFromCanvas(n),!t.t1){t.next=14;break}return t.next=13,this.pickTarget(n);case 13:t.t1=t.sent;case 14:t.t0=t.t1;case 15:return n.target=t.t0,t.abrupt("return",n);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},n.clonePointerEvent=function(t,e){var n=this.allocateEvent(Xu);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},n.copyPointerData=function(t,e){t instanceof Xu&&e instanceof Xu&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)},n.copyMouseData=function(t,e){t instanceof qu&&e instanceof qu&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset))},n.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},n.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},n.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},n.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},n.notifyTarget=function(t,e){var n;e=null!==(n=e)&&void 0!==n?n:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},n.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},n.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||nu.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},n.getCursor=function(t){for(var e=t;e;){var n=pu.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=nu.isNode(e)&&e.parentNode}},e}(bo.EventEmitter),ce([ht(wc),he("design:type",Object)],t.EventService.prototype,"renderingContext",void 0),ce([ht(Sc),he("design:type",Object)],t.EventService.prototype,"contextService",void 0),ce([ht(Ti),he("design:type",Object)],t.EventService.prototype,"canvasConfig",void 0),ce([ht(t.DisplayObjectPool),he("design:type",t.DisplayObjectPool)],t.EventService.prototype,"displayObjectPool",void 0),ce([q.postConstruct(),he("design:type",Function),he("design:paramtypes",[]),he("design:returntype",void 0)],t.EventService.prototype,"init",null),t.EventService=ce([lt()],t.EventService),t.OffscreenCanvasCreator=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d");else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d")}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.getOrCreateContext=function(t){return this.context||this.getOrCreateCanvas(t),this.context},t}(),t.OffscreenCanvasCreator=ce([lt()],t.OffscreenCanvasCreator);var Pc={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},kc=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Cc=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),Nc=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source);t.TextService=function(){function t(){var t=this;this.cache={},this.offscreenCanvas=void 0,this.shouldBreakByKinsokuShorui=function(e,n){return!t.isBreakingSpace(n)&&!(!e||!Nc.exec(n)&&!Cc.exec(e))},this.trimByKinsokuShorui=function(t){var e=[].concat(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}var e=t.prototype;return e.measureFont=function(t,e){if(this.cache[t])return this.cache[t];var n={ascent:0,descent:0,fontSize:0},r=this.offscreenCanvas.getOrCreateCanvas(e),i=this.offscreenCanvas.getOrCreateContext(e);i.font=t;var o=Pc.MetricsString+Pc.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(Pc.BaselineSymbol).width),u=Pc.HeightMultiplier*s;s=s*Pc.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var c=i.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,p=0,f=0,d=!1;for(p=0;s>p;++p){for(var y=0;h>y;y+=4)if(255!==c[f+y]){d=!0;break}if(d)break;f+=h}for(n.ascent=s-p,f=l-h,d=!1,p=u;p>s;--p){for(var v=0;h>v;v+=4)if(255!==c[f+v]){d=!0;break}if(d)break;f-=h}return n.descent=p-s,n.fontSize=n.ascent+n.descent,this.cache[t]=n,n},e.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,o=e.lineHeight,a=void 0===o?0:o,s=e.lineWidth,u=e.textBaseline,c=e.textAlign,l=e.letterSpacing,h=void 0===l?0:l,p=e.leading,f=void 0===p?0:p,d=no(e),y=this.measureFont(d,n);0===y.fontSize&&(y.fontSize=r.value,y.ascent=r.value);var v=this.offscreenCanvas.getOrCreateContext(n);v.font=d;for(var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),m=new Array(g.length),T=0,b=0;g.length>b;b++){var E=v.measureText(g[b]).width+(g[b].length-1)*h;m[b]=E,T=Math.max(T,E)}var S=T+s.value,w=a||y.fontSize+s.value,x=Math.max(w,y.fontSize+s.value)+(g.length-1)*(w+f),P=0;return"middle"===u.value?P=-x/2:"bottom"===u.value||"alphabetic"===u.value||"ideographic"===u.value?P=-x:"top"!==u.value&&"hanging"!==u.value||(P=0),{font:d,width:S,height:x,lines:g,lineWidths:m,lineHeight:w+=f,maxLineWidth:T,fontProperties:y,lineMetrics:m.map((function(t,e){var n=0;return"center"===c.value?n-=t/2:"right"!==c.value&&"end"!==c.value||(n-=t),new qa(n-s.value/2,P+e*w,t+s.value,w)}))}},e.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=void 0===a?0:a,u=this.offscreenCanvas.getOrCreateContext(n),c=o+s,l=[],h=0,p=0,f={},d=function(t){return r.getFromCache(t,s,f,u)};return Array.from(t).forEach((function(e,n){var i=t[n-1],o=t[n+1],a=d(e);if(r.isNewline(e))return h++,p=0,void(l[h]="");if(p>0&&p+a>c){if(h++,p=0,l[h]="",r.isBreakingSpace(e))return;r.canBreakInLastChar(e)||(l=r.trimToBreakable(l),p=r.sumTextWidthByCache(l[h]||"",f)),r.shouldBreakByKinsokuShorui(e,o)&&(l=r.trimByKinsokuShorui(l),p+=d(i||""))}p+=a,l[h]=(l[h]||"")+e})),l.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&Pc.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&Pc.Newlines.indexOf(t.charCodeAt(0))>=0},e.trimToBreakable=function(t){var e=[].concat(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,o),e},e.canBreakInLastChar=function(t){return!t||!kc.test(t)},e.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},e.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!kc.test(t[e]))return e;return-1},e.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),ce([ht(t.OffscreenCanvasCreator),he("design:type",t.OffscreenCanvasCreator)],t.TextService.prototype,"offscreenCanvas",void 0),t.TextService=ce([lt()],t.TextService);var _c=i.defineToken("GeometryUpdaterFactory"),Mc=i.defineToken("GeometryAABBUpdater");function Ac(t){var e=t.parsedStyle.fontSize;return e&&!Uo.isRelativeUnit(e.unit)?e.clone():new Uo(0,"px")}t.CircleUpdater=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n.value,height:2*n.value}},t}(),t.CircleUpdater=ce([lt({token:{token:Mc,named:t.Shape.CIRCLE}})],t.CircleUpdater),t.EllipseUpdater=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx.value,height:2*t.ry.value}},t}(),t.EllipseUpdater=ce([lt({token:{token:Mc,named:t.Shape.ELLIPSE}})],t.EllipseUpdater),t.RectUpdater=function(){function e(){}return e.prototype.update=function(e,n){var r=e.img,i=e.width,o=e.height,a=0,s=0;return i instanceof Uo&&i.unit===t.UnitType.kPixels&&(a=i.value),o instanceof Uo&&o.unit===t.UnitType.kPixels&&(s=o.value),r&&!$r(r)&&(a||(a=r.width),s||(s=r.height)),i instanceof Uo&&(i.value=a),o instanceof Uo&&(o.value=s),{width:a,height:s}},e}(),t.RectUpdater=ce([lt({token:[{token:Mc,named:t.Shape.RECT},{token:Mc,named:t.Shape.IMAGE},{token:Mc,named:t.Shape.GROUP}]})],t.RectUpdater),t.TextUpdater=function(){function t(){this.textService=void 0}var e=t.prototype;return e.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&t.lineWidth},e.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,c=t.dy,l=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(r=n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var h=this.textService.measureText(i,t,l);t.metrics=h;var p=h.lineHeight,f=h.fontProperties,d=En(h.width/2,h.height/2,0),y=[0,1],v=0;"center"===o.value?(v=a.value/2,y=[.5,1]):"right"!==o.value&&"end"!==o.value||(v=a.value,y=[1,1]);var g=0;return"middle"===s.value?g=d[1]:"top"===s.value||"hanging"===s.value?g=2*d[1]:"alphabetic"===s.value?g=p-f.ascent:"bottom"!==s.value&&"ideographic"!==s.value||(g=0),u&&(v+=u.value),c&&(g+=c.value),t.anchor=[new Uo(y[0]),new Uo(y[1]),new Uo(0)],{width:2*d[0],height:2*d[1],offsetX:v,offsetY:g}},t}(),ce([ht(t.TextService),he("design:type",t.TextService)],t.TextUpdater.prototype,"textService",void 0),t.TextUpdater=ce([lt({token:{token:Mc,named:t.Shape.TEXT}})],t.TextUpdater),t.LineUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e.value,r.value),a=Math.max(e.value,r.value),s=Math.min(n.value,i.value);return{width:a-o,height:Math.max(n.value,i.value)-s}},t}(),t.LineUpdater=ce([lt({token:{token:Mc,named:t.Shape.LINE}})],t.LineUpdater),t.PolylineUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,e.map((function(t){return t[0]}))),r=Math.max.apply(Math,e.map((function(t){return t[0]}))),i=Math.min.apply(Math,e.map((function(t){return t[1]})));return{width:r-n,height:Math.max.apply(Math,e.map((function(t){return t[1]})))-i}},t}(),t.PolylineUpdater=ce([lt({token:[{token:Mc,named:t.Shape.POLYLINE},{token:Mc,named:t.Shape.POLYGON}]})],t.PolylineUpdater),t.PathUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),t.PathUpdater=ce([lt({token:{token:Mc,named:t.Shape.PATH}})],t.PathUpdater),t.CSSPropertyClipPath=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){if(n instanceof Co&&(n=null),e&&e!==n&&e.style.clipPathTargets){var i=e.style.clipPathTargets.indexOf(r);e.style.clipPathTargets.splice(i,1)}return n&&(n.style.clipPathTargets||(n.style.clipPathTargets=[]),n.style.clipPathTargets.push(r)),Tc(r),n},t}(),t.CSSPropertyClipPath=ce([lt({token:{token:Js,named:t.PropertySyntax.CLIP_PATH}})],t.CSSPropertyClipPath),t.CSSPropertyColor=function(){function t(){this.parser=Oa,this.mixer=Ia}return t.prototype.calculator=function(t,e,n,r){return n instanceof Co?new Zo(0,0,0,0,"none"===n.value):n},t}(),t.CSSPropertyColor=ce([lt({token:[{token:Js,named:t.PropertySyntax.PAINT},{token:Js,named:t.PropertySyntax.COLOR}]})],t.CSSPropertyColor),t.CSSPropertyFilter=function(){this.parser=Us},t.CSSPropertyFilter=ce([lt({token:{token:Js,named:t.PropertySyntax.FILTER}})],t.CSSPropertyFilter),t.CSSPropertyLengthOrPercentage=function(){function e(){this.parser=Za,this.mixer=Qa}return e.prototype.calculator=function(e,n,r,i,o){if(!Uo.isRelativeUnit(r.unit))return r.clone();if(r.unit===t.UnitType.kPercentage)return new Uo(0,"px");if(r.unit===t.UnitType.kEms){if(i.parentNode){var a=Ac(i.parentNode);return a.value*=r.value,a}return new Uo(0,"px")}if(r.unit===t.UnitType.kRems){var s;if(null==i||null===(s=i.ownerDocument)||void 0===s?void 0:s.documentElement){var u=Ac(i.ownerDocument.documentElement);return u.value*=r.value,u}return new Uo(0,"px")}},e}(),t.CSSPropertyLengthOrPercentage=ce([lt({token:{token:Js,named:t.PropertySyntax.LENGTH_PERCENTAGE}})],t.CSSPropertyLengthOrPercentage),t.CSSPropertyLengthOrPercentage12=function(){function t(){this.mixer=es}return t.prototype.parser=function(t){var e=ts(Be(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t}(),t.CSSPropertyLengthOrPercentage12=ce([lt({token:{token:Js,named:t.PropertySyntax.LENGTH_PERCENTAGE_12}})],t.CSSPropertyLengthOrPercentage12),t.CSSPropertyLengthOrPercentage14=function(){function t(){this.mixer=es}return t.prototype.parser=function(t){var e=ts(Be(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t}(),t.CSSPropertyLengthOrPercentage14=ce([lt({token:{token:Js,named:t.PropertySyntax.LENGTH_PERCENTAGE_14}})],t.CSSPropertyLengthOrPercentage14),t.CSSPropertyLocalPosition=function(e){function n(){return e.apply(this,arguments)||this}return me(n,e),n.prototype.postProcessor=function(e){var n,r,i;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var o=e.parsedStyle,a=o.cx,s=o.cy;Fe(a)||(n=a.value),Fe(s)||(r=s.value);break;case t.Shape.LINE:var u=e.parsedStyle,c=u.y1,l=u.y2;n=Math.min(u.x1.value,u.x2.value),r=Math.min(c.value,l.value),i=0;break;default:Fe(e.parsedStyle.x)||(n=e.parsedStyle.x.value),Fe(e.parsedStyle.y)||(r=e.parsedStyle.y.value)}e.parsedStyle.defX=n||0,e.parsedStyle.defY=r||0;var h=e.getLocalPosition(),p=h[0],f=h[1],d=h[2];e.setLocalPosition(Fe(n)?p:n,Fe(r)?f:r,Fe(i)?d:i)},n}(t.CSSPropertyLengthOrPercentage),t.CSSPropertyLocalPosition=ce([lt({token:{token:Js,named:t.PropertySyntax.COORDINATE}})],t.CSSPropertyLocalPosition),t.CSSPropertyOffsetDistance=function(){function e(){this.parser=is,this.mixer=as(0,1)}return e.prototype.postProcessor=function(e){if(e.attributes.offsetPath){var n=e.attributes.offsetPath.nodeName;if(n===t.Shape.LINE||n===t.Shape.PATH||n===t.Shape.POLYLINE){var r=e.attributes.offsetPath.getPoint(e.parsedStyle.offsetDistance.value);r&&e.setLocalPosition(r.x,r.y)}}},e}(),t.CSSPropertyOffsetDistance=ce([lt({token:{token:Js,named:t.PropertySyntax.OFFSET_DISTANCE}})],t.CSSPropertyOffsetDistance),t.CSSPropertyOffsetPath=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){if(e&&e!==n&&e.style.offsetPathTargets){var i=e.style.offsetPathTargets.indexOf(r);e.style.offsetPathTargets.splice(i,1)}return n&&(n.style.offsetPathTargets||(n.style.offsetPathTargets=[]),n.style.offsetPathTargets.push(r)),n},t}(),t.CSSPropertyOffsetPath=ce([lt({token:{token:Js,named:t.PropertySyntax.OFFSET_PATH}})],t.CSSPropertyOffsetPath),t.CSSPropertyOpacity=function(){this.parser=is,this.mixer=as(0,1)},t.CSSPropertyOpacity=ce([lt({token:{token:Js,named:t.PropertySyntax.OPACITY_VALUE}})],t.CSSPropertyOpacity),t.CSSPropertyPath=function(){function e(){this.parser=Os,this.mixer=Is}var n=e.prototype;return n.calculator=function(t,e,n){return n instanceof Co&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:[],totalLength:0,curveSegments:[],zCommandIndexes:[],rect:new qa(0,0,0,0)}:n},n.postProcessor=function(e){if(e.nodeName===t.Shape.PATH){var n=e.parsedStyle,r=n.defX,i=n.defY;e.setLocalPosition(void 0===r?0:r,void 0===i?0:i)}},e}(),t.CSSPropertyPath=ce([lt({token:{token:Js,named:t.PropertySyntax.PATH}})],t.CSSPropertyPath),t.CSSPropertyPoints=function(){function e(){this.parser=Rs}return e.prototype.postProcessor=function(e){if(e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE){var n=e.parsedStyle;e.setLocalPosition(n.defX,n.defY)}},e}(),t.CSSPropertyPoints=ce([lt({token:{token:Js,named:t.PropertySyntax.LIST_OF_POINTS}})],t.CSSPropertyPoints),t.CSSPropertyShadowBlur=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).mixer=as(0,1/0),e}return me(e,t),e}(t.CSSPropertyLengthOrPercentage),t.CSSPropertyShadowBlur=ce([lt({token:{token:Js,named:t.PropertySyntax.SHADOW_BLUR}})],t.CSSPropertyShadowBlur),t.CSSPropertyText=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Co?"unset"===n.value?"":n.value:n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),t.CSSPropertyText=ce([lt({token:{token:Js,named:t.PropertySyntax.TEXT}})],t.CSSPropertyText),t.CSSPropertyTextTransform=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n},t}(),t.CSSPropertyTextTransform=ce([lt({token:{token:Js,named:t.PropertySyntax.TEXT_TRANSFORM}})],t.CSSPropertyTextTransform),t.CSSPropertyTransform=function(){function t(){this.parser=Hs,this.mixer=Ys}return t.prototype.postProcessor=function(t){var e=t.parsedStyle,n=e.transform,r=e.defX,i=e.defY;n&&n.length&&(t.resetLocalTransform(),t.setLocalPosition(r,i),n.forEach((function(e){var n=e.t,r=e.d;if("scale"===n){var i=r.map((function(t){return t.value}))||[1,1];t.scaleLocal(i[0],i[1],1)}else if("scalex"===n){var o=r.map((function(t){return t.value}))||[1];t.scaleLocal(o[0],1,1)}else if("scaley"===n){var a=r.map((function(t){return t.value}))||[1];t.scaleLocal(1,a[0],1)}else if("scalez"===n){var s=r.map((function(t){return t.value}))||[1];t.scaleLocal(1,1,s[0])}else if("scale3d"===n){var u=r.map((function(t){return t.value}))||[1,1,1];t.scaleLocal(u[0],u[1],u[2])}else if("translate"===n){var c=r||[Xo,Xo];t.translateLocal(c[0].value,c[1].value,0)}else if("translatex"===n){t.translateLocal((r||[Xo])[0].value,0,0)}else if("translatey"===n){t.translateLocal(0,(r||[Xo])[0].value,0)}else if("translatez"===n){t.translateLocal(0,0,(r||[Xo])[0].value)}else if("translate3d"===n){var l=r||[Xo,Xo,Xo];t.translateLocal(l[0].value,l[1].value,l[2].value)}else if("rotate"===n){t.rotateLocal(0,0,(r||[Ko])[0].value)}else if("rotatex"===n){t.rotateLocal((r||[Ko])[0].value,0,0)}else if("rotatey"===n){t.rotateLocal(0,(r||[Ko])[0].value,0)}else if("rotatez"===n){t.rotateLocal(0,0,(r||[Ko])[0].value)}})))},t}(),t.CSSPropertyTransform=ce([lt({token:{token:Js,named:t.PropertySyntax.TRANSFORM}})],t.CSSPropertyTransform),t.CSSPropertyTransformOrigin=function(){this.parser=qs},t.CSSPropertyTransformOrigin=ce([lt({token:{token:Js,named:t.PropertySyntax.TRANSFORM_ORIGIN}})],t.CSSPropertyTransformOrigin),t.CSSPropertyZIndex=function(){function t(){this.parser=is}return t.prototype.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0)}},t}(),t.CSSPropertyZIndex=ce([lt({token:{token:Js,named:t.PropertySyntax.Z_INDEX}})],t.CSSPropertyZIndex);var Oc=[{name:"display",keywords:["none"]},{name:"opacity",interpolable:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"fillOpacity",interpolable:!0,inherited:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"strokeOpacity",interpolable:!0,inherited:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"fill",interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.PAINT},{name:"stroke",interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.PAINT},{name:"shadowColor",interpolable:!0,syntax:t.PropertySyntax.COLOR},{name:"shadowOffsetX",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"shadowOffsetY",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"shadowBlur",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.SHADOW_BLUR},{name:"lineWidth",interpolable:!0,inherited:!0,defaultValue:"1",layoutDependent:!0,alias:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"increasedLineWidthForHitTesting",inherited:!0,defaultValue:"0",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"lineJoin",inherited:!0,layoutDependent:!0,alias:["strokeLinejoin"],keywords:["miter","bevel","round"],defaultValue:"miter"},{name:"lineCap",inherited:!0,layoutDependent:!0,alias:["strokeLinecap"],keywords:["butt","round","square"],defaultValue:"butt"},{name:"lineDash",interpolable:!0,inherited:!0,keywords:["none"],alias:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{name:"lineDashOffset",interpolable:!0,inherited:!0,defaultValue:"0",alias:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"offsetPath",syntax:t.PropertySyntax.OFFSET_PATH},{name:"offsetDistance",interpolable:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{name:"dx",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"dy",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"zIndex",independent:!0,interpolable:!0,defaultValue:"0",keywords:["auto"],syntax:t.PropertySyntax.Z_INDEX},{name:"visibility",keywords:["visible","hidden"],independent:!0,inherited:!0,defaultValue:"visible"},{name:"pointerEvents",inherited:!0,keywords:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"],defaultValue:"auto"},{name:"filter",independent:!0,layoutDependent:!0,syntax:t.PropertySyntax.FILTER},{name:"clipPath",syntax:t.PropertySyntax.CLIP_PATH},{name:"transform",parsePriority:100,interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.TRANSFORM},{name:"transformOrigin",parsePriority:100,defaultValue:"left top",layoutDependent:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{name:"anchor",parsePriority:99,defaultValue:"0 0",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{name:"cx",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"cy",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"r",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"rx",interpolable:!0,layoutDependent:!0,defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"ry",interpolable:!0,layoutDependent:!0,defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"x",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"y",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"z",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"width",interpolable:!0,layoutDependent:!0,keywords:["auto","fit-content","min-content","max-content"],defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"height",interpolable:!0,layoutDependent:!0,keywords:["auto","fit-content","min-content","max-content"],defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"radius",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{name:"x1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"y1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"z1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"x2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"y2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"z2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"path",interpolable:!0,layoutDependent:!0,defaultValue:"",alias:["d"],syntax:t.PropertySyntax.PATH},{name:"points",layoutDependent:!0,syntax:t.PropertySyntax.LIST_OF_POINTS},{name:"text",layoutDependent:!0,defaultValue:"",syntax:t.PropertySyntax.TEXT,parsePriority:50},{name:"textTransform",layoutDependent:!0,inherited:!0,keywords:["capitalize","uppercase","lowercase","none"],defaultValue:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,parsePriority:51},{name:"font",layoutDependent:!0},{name:"fontSize",interpolable:!0,inherited:!0,defaultValue:"16px",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"fontFamily",layoutDependent:!0,inherited:!0,defaultValue:"sans-serif"},{name:"fontStyle",layoutDependent:!0,inherited:!0,keywords:["normal","italic","oblique"],defaultValue:"normal"},{name:"fontWeight",layoutDependent:!0,inherited:!0,keywords:["normal","bold","bolder","lighter"],defaultValue:"normal"},{name:"fontVariant",layoutDependent:!0,inherited:!0,keywords:["normal","small-caps"],defaultValue:"normal"},{name:"lineHeight",layoutDependent:!0},{name:"letterSpacing",layoutDependent:!0},{name:"wordWrap",layoutDependent:!0},{name:"wordWrapWidth",layoutDependent:!0},{name:"leading",layoutDependent:!0},{name:"textBaseline",layoutDependent:!0,inherited:!0,keywords:["top","hanging","middle","alphabetic","ideographic","bottom"],defaultValue:"alphabetic"},{name:"textAlign",layoutDependent:!0,inherited:!0,keywords:["start","center","end","left","right"],defaultValue:"start"},{name:"whiteSpace",layoutDependent:!0}];t.DefaultStyleValueRegistry=function(){function e(){this.dirty=!1,this.cache={},this.unresolvedProperties={},this.propertySyntaxFactory=void 0,this.cascadeProperties={}}var n=e.prototype;return n.init=function(){var t=this;Oc.forEach((function(e){t.registerMetadata(e)}))},n.registerMetadata=function(t){var e=this;[t.name].concat(t.alias||[]).forEach((function(n){e.cache[n]=t}))},n.unregisterMetadata=function(t){delete this.cache[t]},n.getMetadata=function(t){return this.cache[t]},n.getPropertySyntax=function(t){return this.propertySyntaxFactory(t)},n.processProperties=function(t,e,n){var r=this;void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1});var i=n.skipUpdateAttribute,o=n.skipParse,a=!1;Object.keys(e).forEach((function(n){var o,s=ai(n,e[n]),u=s[0];i||(t.attributes[u]=s[1]),!a&&(null===(o=r.getMetadata(u))||void 0===o?void 0:o.layoutDependent)&&(a=!0)}));var s=Object.keys(e).sort((function(t,e){var n,i;return((null===(n=r.getMetadata(t))||void 0===n?void 0:n.parsePriority)||0)-((null===(i=r.getMetadata(e))||void 0===i?void 0:i.parsePriority)||0)}));o||s.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t)}));var u=!1;s.forEach((function(e){e in t.computedStyle&&(u=r.computeProperty(e,t.computedStyle[e],t))})),u?this.dirty=!0:(a&&this.updateGeometry(t),s.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t)})),s.forEach((function(e){e in t.parsedStyle&&r.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))})))},n.parseProperty=function(t,e,n){var r=this.getMetadata(t),i=e;if((""===e||Fe(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=new Co(e);else if(r){var o=r.keywords,a=r.syntax,s=a&&this.getPropertySyntax(a);if(o&&o.indexOf(e)>-1)i=new Co(e);else if(s){s&&s.parser&&(i=s.parser(e,n))}}return i},n.computeProperty=function(t,e,n){var r=this.getMetadata(t),i="g-root"===n.id,o=e instanceof Po?e.clone():e;if(r){var a=r.syntax,s=r.defaultValue;if(e instanceof Co){var u=e.value;if("unset"===u&&(u=r.inherited&&!i?"inherit":"initial"),"initial"===u)Fe(s)||(e=this.parseProperty(t,s,n));else if("inherit"===u){var c=this.tryToResolveProperty(n,t,{inherited:!0});return c?(n.parsedStyle[t]=c,!1):(this.addUnresolveProperty(n,t),!0)}}var l=a&&this.getPropertySyntax(a);if(l)if(l.calculator)o=l.calculator(t,n.parsedStyle[t],e,n,this);else o=e;else o=e}return n.parsedStyle[t]=o,!1},n.postProcessProperty=function(t,e){var n=this.getMetadata(t);if(n&&n.syntax){var r=n.syntax&&this.getPropertySyntax(n.syntax);r&&r.postProcessor&&r.postProcessor(e)}},n.isPropertyResolved=function(t,e){return!this.unresolvedProperties[t.entity]||0===this.unresolvedProperties[t.entity].length||this.unresolvedProperties[t.entity].includes(e)},n.addUnresolveProperty=function(t,e){this.unresolvedProperties[t.entity]||(this.unresolvedProperties[t.entity]=[]),-1===this.unresolvedProperties[t.entity].indexOf(e)&&this.unresolvedProperties[t.entity].push(e)},n.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&this.isPropertyResolved(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];return(!(r instanceof Co)||"unset"!==r.value&&"initial"!==r.value&&"inherit"!==r.value)&&(!(r instanceof Uo&&Uo.isRelativeUnit(r.unit))&&r)}return!1},n.recalc=function(t){var e=this.unresolvedProperties[t.entity];if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),delete this.unresolvedProperties[t.entity]}},n.updateGeometry=function(e){var n=Ut.get(_c)(e.nodeName);if(n){var r,i=e.geometry;i.contentBounds||(i.contentBounds=new La),i.renderBounds||(i.renderBounds=new La);var o=e.parsedStyle,a=n.update(o,e),s=a.depth,u=a.offsetX,c=void 0===u?0:u,l=a.offsetY,h=void 0===l?0:l,p=a.offsetZ,f=void 0===p?0:p,d=En(a.width/2,a.height/2,(void 0===s?0:s)/2),y=o.lineWidth,v=o.increasedLineWidthForHitTesting,g=o.shadowColor,m=o.filter,T=void 0===m?[]:m,b=o.transformOrigin,E=o.anchor;e.nodeName===t.Shape.TEXT&&delete o.anchor;var S=En((1-2*(E&&E[0].value||0))*d[0]+c,(1-2*(E&&E[1].value||0))*d[1]+h,(1-2*(E&&(null===(r=E[2])||void 0===r?void 0:r.value)||0))*d[2]+f);i.contentBounds.update(S,d);var w=(((null==y?void 0:y.value)||0)+((null==v?void 0:v.value)||0))/2;if(xn(d,d,En(w,w,0)),i.renderBounds.update(S,d),g){var x=i.renderBounds,P=x.min,k=x.max,C=o.shadowBlur,N=o.shadowOffsetX,_=o.shadowOffsetY,M=C&&C.value||0,A=N&&N.value||0,O=_&&_.value||0,I=k[0]+M+A,R=P[1]-M+O,L=k[1]+M+O;P[0]=Math.min(P[0],P[0]-M+A),k[0]=Math.max(k[0],I),P[1]=Math.min(P[1],R),k[1]=Math.max(k[1],L),i.renderBounds.setMinMax(P,k)}T.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,xn(i.renderBounds.halfExtents,i.renderBounds.halfExtents,En(r,r,0)))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=i.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,p=c[1]-s+a,f=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],p),l[1]=Math.max(l[1],f),i.renderBounds.setMinMax(c,l)}})),E=o.anchor;var D=ns(b[0],0,e),U=ns(b[1],1,e);e.setOrigin(D-=(E&&E[0].value||0)*i.contentBounds.halfExtents[0]*2,U-=(E&&E[1].value||0)*i.contentBounds.halfExtents[1]*2),e.dispatchEvent(new tu(t.ElementEvent.GEOMETRY_BOUNDS_CHANGED)),Tc(e)}},n.isPropertyInheritable=function(t){var e=this.getMetadata(t);return!!e&&e.inherited},e}(),ce([ht(Zs),he("design:type",Function)],t.DefaultStyleValueRegistry.prototype,"propertySyntaxFactory",void 0),ce([q.postConstruct(),he("design:type",Function),he("design:paramtypes",[]),he("design:returntype",void 0)],t.DefaultStyleValueRegistry.prototype,"init",null),t.DefaultStyleValueRegistry=ce([lt({token:Gr})],t.DefaultStyleValueRegistry);var Ic,Rc,Lc,Dc=Ot((function(e){q.decorate(ct(),bo.EventEmitter),e(t.DisplayObjectPool),e(t.DefaultSceneGraphSelector),e({token:yc,useFactory:function(t){return function(){return t.container.get(vc)}}}),e(t.DefaultSceneGraphService),e(t.OffscreenCanvasCreator),e(t.TextService),e(t.CircleUpdater),e(t.EllipseUpdater),e(t.RectUpdater),e(t.TextUpdater),e(t.LineUpdater),e(t.PolylineUpdater),e(t.PathUpdater),e({token:_c,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(Mc,n)&&(e[n]=t.container.getNamed(Mc,n)),e[n]}}}),e(t.CSSPropertyAngle),e(t.CSSPropertyClipPath),e(t.CSSPropertyColor),e(t.CSSPropertyFilter),e(t.CSSPropertyLengthOrPercentage),e(t.CSSPropertyLengthOrPercentage12),e(t.CSSPropertyLengthOrPercentage14),e(t.CSSPropertyLocalPosition),e(t.CSSPropertyOffsetDistance),e(t.CSSPropertyOffsetPath),e(t.CSSPropertyOpacity),e(t.CSSPropertyPath),e(t.CSSPropertyPoints),e(t.CSSPropertyShadowBlur),e(t.CSSPropertyText),e(t.CSSPropertyTextTransform),e(t.CSSPropertyTransform),e(t.CSSPropertyTransformOrigin),e(t.CSSPropertyZIndex),e({token:Zs,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(Js,n)&&(e[n]=t.container.getNamed(Js,n)),e[n]}}}),e(t.DefaultStyleValueRegistry),e(t.LayoutRegistry),e(t.LayoutEngine),e(t.LayoutEdges),e({token:uo,useFactory:function(e){return function(n){var r=e.container.createChild();return r.register({token:co,useValue:n}),r.get(t.LayoutEdges)}}}),e({token:Ne,useFactory:function(e){return function(n){var r=e.container.createChild();r.register(t.LayoutContext),r.register(t.LayoutChildren),r.register({token:ro,useFactory:function(e){return function(n){var r=e.container.createChild();return r.register({token:io,useValue:n}),r.get(t.LayoutChildren)}}}),r.register(t.FragmentResult),r.register({token:Ae,useFactory:function(e){return function(n,r){var i=e.container.createChild();return i.register({token:Oe,useValue:n}),i.register({token:Ie,useValue:r}),i.get(t.FragmentResult)}}}),r.register(t.LayoutFragment),r.register({token:po,useFactory:function(e){return function(n){var r=e.container.createChild();return r.register({token:fo,useValue:n}),r.get(t.LayoutFragment)}}});var i=r.get(ro),o=r.get(po),a=r.get(Ae);return r.register({token:_e,useValue:ge({},n,{layoutChildrenFactory:i,layoutFragmentFactory:o,fragmentResultFactory:a})}),r.get(t.LayoutContext)}}})})),Uc=function(){function t(t){this.plugins=[],this.config=void 0,this.config=ge({enableDirtyCheck:!0,enableCulling:!0,enableAutoRendering:!0,enableDirtyRectangleRendering:!0},t)}var e=t.prototype;return e.registerPlugin=function(t){this.plugins.push(t)},e.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.getPlugins=function(){return this.plugins},e.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.getConfig=function(){return this.config},e.setConfig=function(t){Object.assign(this.config,t)},t}(),Fc=i.defineToken("DefaultCamera");(Ic=t.CameraType||(t.CameraType={}))[Ic.ORBITING=0]="ORBITING",Ic[Ic.EXPLORING=1]="EXPLORING",Ic[Ic.TRACKING=2]="TRACKING",(Rc=t.CameraTrackingMode||(t.CameraTrackingMode={}))[Rc.DEFAULT=0]="DEFAULT",Rc[Rc.ROTATIONAL=1]="ROTATIONAL",Rc[Rc.TRANSLATIONAL=2]="TRANSLATIONAL",Rc[Rc.CINEMATIC=3]="CINEMATIC",(Lc=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Lc.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Lc[Lc.PERSPECTIVE=1]="PERSPECTIVE";var Bc={UPDATED:"updated"},Vc=Math.PI/180,Gc=180/Math.PI,jc=2e-4,Hc=function(e){function n(n,r){var i;return void 0===n&&(n=t.CameraType.EXPLORING),void 0===r&&(r=t.CameraTrackingMode.DEFAULT),(i=e.call(this)||this).canvas=void 0,i.matrix=on(),i.right=En(1,0,0),i.up=En(0,1,0),i.forward=En(0,0,1),i.position=En(0,0,1),i.focalPoint=En(0,0,0),i.distanceVector=En(0,0,-1),i.distance=1,i.azimuth=0,i.elevation=0,i.roll=0,i.relAzimuth=0,i.relElevation=0,i.relRoll=0,i.dollyingStep=0,i.maxDistance=1/0,i.minDistance=-1/0,i.zoom=1,i.rotateWorld=!1,i.fov=30,i.near=.1,i.far=1e3,i.aspect=1,i.left=void 0,i.rright=void 0,i.top=void 0,i.bottom=void 0,i.projectionMatrix=on(),i.projectionMatrixInverse=on(),i.jitteredProjectionMatrix=void 0,i.view=void 0,i.enableUpdate=!0,i.type=t.CameraType.EXPLORING,i.trackingMode=t.CameraTrackingMode.DEFAULT,i.projectionMode=t.CameraProjectionMode.PERSPECTIVE,i.frustum=new Ba,i.landmarks=[],i.landmarkAnimationID=void 0,i.orthoMatrix=on(),i.setType(n,r),i}me(n,e);var r=n.prototype;return r.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},r.getProjectionMode=function(){return this.projectionMode},r.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},r.getPerspectiveInverse=function(){return this.projectionMatrixInverse},r.getFrustum=function(){return this.frustum},r.getPosition=function(){return this.position},r.getFocalPoint=function(){return this.focalPoint},r.getDollyingStep=function(){return this.dollyingStep},r.getNear=function(){return this.near},r.getFar=function(){return this.far},r.getZoom=function(){return this.zoom},r.getOrthoMatrix=function(){return this.orthoMatrix},r.getView=function(){return this.view},r.setEnableUpdate=function(t){this.enableUpdate=t},r.setType=function(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this},r.setProjectionMode=function(t){return this.projectionMode=t,this},r.setTrackingMode=function(e){if(this.type!==t.CameraType.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},r.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},r.getViewTransform=function(){return un(on(),this.matrix)},r.getWorldTransform=function(){return this.matrix},r.jitterProjectionMatrix=function(t,e){var n,r,i=(n=on(),r=[t,e,0],n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=r[0],n[13]=r[1],n[14]=r[2],n[15]=1,n);this.jitteredProjectionMatrix=cn(on(),i,this.projectionMatrix)},r.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},r.setMatrix=function(t){return this.matrix=t,this._update(),this},r.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},r.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},r.setNear=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},r.setFar=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},r.setViewOffset=function(e,n,r,i,o,a){return this.aspect=e/n,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},r.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},r.setZoom=function(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},r.setPerspective=function(e,n,r,i){var o;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var a=this.near*Math.tan(.5*Vc*this.fov)/this.zoom,s=2*a,u=this.aspect*s,c=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,a-=this.view.offsetY*s/h,u*=this.view.width/l,s*=this.view.height/h}return hr(this.projectionMatrix,c,c+u,a,a-s,e,this.far),hn(this.projectionMatrix,this.projectionMatrix,En(1,-1,1)),un(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},r.setOrthographic=function(e,n,r,i,o,a){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,p=l-u,f=l+u,d=h+c,y=h-c;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var v=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f=(p+=v*this.view.offsetX)+v*this.view.width,y=(d-=g*this.view.offsetY)-g*this.view.height}return gn(this.projectionMatrix,p,f,y,d,o,a),hn(this.projectionMatrix,this.projectionMatrix,En(1,-1,1)),un(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},r.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=ar(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},r.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var i,o,a,s,u,c,l,h,p,f,d,y,v,g=En(0,1,0);if(this.focalPoint=ar(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var m=Pn(mn(),this.focalPoint,this.position);e=m[0],n=m[1],r=m[2];var T=bn(m),b=Math.asin(n/T)*Gc,E=90+Math.atan2(r,e)*Gc,S=on();i=S,o=S,a=E*Vc,s=Math.sin(a),u=Math.cos(a),c=o[0],l=o[1],h=o[2],p=o[3],f=o[8],d=o[9],y=o[10],v=o[11],o!==i&&(i[4]=o[4],i[5]=o[5],i[6]=o[6],i[7]=o[7],i[12]=o[12],i[13]=o[13],i[14]=o[14],i[15]=o[15]),i[0]=c*u-f*s,i[1]=l*u-d*s,i[2]=h*u-y*s,i[3]=p*u-v*s,i[8]=c*s+f*u,i[9]=l*s+d*u,i[10]=h*s+y*u,i[11]=p*s+v*u,function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],p=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r}(S,S,b*Vc),g=In(mn(),[0,1,0],S)}return un(this.matrix,function(t,e,n,r){var i,o,a,s,u,c,l,h,p,f,d=e[0],y=e[1],v=e[2],g=r[0],m=r[1],T=r[2],b=n[0],E=n[1],S=n[2];return Math.abs(d-b)<en&&Math.abs(y-E)<en&&Math.abs(v-S)<en?sn(t):(l=d-b,h=y-E,p=v-S,i=m*(p*=f=1/Math.hypot(l,h,p))-T*(h*=f),o=T*(l*=f)-g*p,a=g*h-m*l,(f=Math.hypot(i,o,a))?(i*=f=1/f,o*=f,a*=f):(i=0,o=0,a=0),s=h*a-p*o,u=p*i-l*a,c=l*o-h*i,(f=Math.hypot(s,u,c))?(s*=f=1/f,u*=f,c*=f):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=a,t[9]=c,t[10]=p,t[11]=0,t[12]=-(i*d+o*y+a*v),t[13]=-(s*d+u*y+c*v),t[14]=-(l*d+h*y+p*v),t[15]=1,t)}(on(),this.position,this.focalPoint,g)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},r.getDistance=function(){return this.distance},r.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,jc>this.distance&&(this.distance=jc),this.dollyingStep=this.distance/100;var e=mn(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},r.setMaxDistance=function(t){return this.maxDistance=t,this},r.setMinDistance=function(t){return this.minDistance=t,this},r.setAzimuth=function(e){return this.azimuth=or(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.getAzimuth=function(){return this.azimuth},r.setElevation=function(e){return this.elevation=or(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.getElevation=function(){return this.elevation},r.setRoll=function(e){return this.roll=or(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.getRoll=function(){return this.roll},r.rotate=function(e,n,r){if(this.relElevation=or(n),this.relAzimuth=or(e),this.relRoll=or(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var i=Hn(jn(),[1,0,0],(this.rotateWorld?1:-1)*this.relElevation*Vc),o=Hn(jn(),[0,1,0],(this.rotateWorld?1:-1)*this.relAzimuth*Vc),a=Hn(jn(),[0,0,1],this.relRoll*Vc),s=zn(jn(),o,i);s=zn(jn(),s,a);var u=vn(on(),s);ln(this.matrix,this.matrix,[0,0,-this.distance]),cn(this.matrix,this.matrix,u),ln(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this},r.pan=function(t,e){var n=ar(t,e,0),r=Tn(this.position);return xn(r,r,Cn(mn(),this.right,n[0])),xn(r,r,Cn(mn(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},r.dolly=function(e){var n,r=this.forward,i=Tn(this.position);return n=Math.max(Math.min(this.distance+e*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance,i[0]+=n*r[0],i[1]+=n*r[1],i[2]+=n*r[2],this._setPosition(i),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getDistance():this.type===t.CameraType.TRACKING&&xn(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},r.createLandmark=function(t,e){void 0===e&&(e={});var r=e.position,i=void 0===r?this.position:r,o=e.focalPoint,a=void 0===o?this.focalPoint:o,s=e.roll,u=e.zoom,c=new n;c.setType(this.type,void 0),c.setPosition(i[0],i[1]||this.position[1],i[2]||this.position[2]),c.setFocalPoint(a[0],a[1]||this.focalPoint[1],a[2]||this.focalPoint[2]),c.setRoll(s||this.roll),c.setZoom(u||this.zoom);var l,h,p={name:t,matrix:(l=c.matrix,h=new nn(16),h[0]=l[0],h[1]=l[1],h[2]=l[2],h[3]=l[3],h[4]=l[4],h[5]=l[5],h[6]=l[6],h[7]=l[7],h[8]=l[8],h[9]=l[9],h[10]=l[10],h[11]=l[11],h[12]=l[12],h[13]=l[13],h[14]=l[14],h[15]=l[15],h),right:Tn(c.right),up:Tn(c.up),forward:Tn(c.forward),position:Tn(c.position),focalPoint:Tn(c.focalPoint),distanceVector:Tn(c.distanceVector),distance:c.distance,dollyingStep:c.dollyingStep,azimuth:c.azimuth,elevation:c.elevation,roll:c.roll,relAzimuth:c.relAzimuth,relElevation:c.relElevation,relRoll:c.relRoll,zoom:c.zoom};return this.landmarks.push(p),p},r.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=$r(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=Be(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,u=void 0===s?100:s,c=i.easingFunction,l=void 0===c?void 0:c,h=i.onfinish,p=void 0===h?void 0:h;if(0===u)return this.syncFromLandmark(r),void(p&&p());void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID);var f,d=r.position,y=r.focalPoint,v=r.zoom,g=r.roll,m=l||Xr(a),T=function(){n.setFocalPoint(y),n.setPosition(d),n.setRoll(g),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),p&&p()};this.canvas.requestAnimationFrame((function t(e){void 0===f&&(f=e);var r=e-f;if(u<r)T();else{var i,o,a=m(r/u),s=mn(),c=mn();On(s,n.focalPoint,y,a),On(c,n.position,d,a),o=n.roll*(1-a)+g*a,i=n.zoom*(1-a)+v*a,n.setFocalPoint(s),n.setPosition(c),n.setRoll(o),n.setZoom(i),Fn(s,y)+Fn(c,d)>.01?(n.computeMatrix(),n.triggerUpdate(),u>r&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(t))):T()}}))}},r._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},r.computeMatrix=function(){var e=Hn(jn(),[0,0,1],this.roll*Vc);sn(this.matrix);var n=Hn(jn(),[1,0,0],(this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation*Vc),r=Hn(jn(),[0,1,0],(this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth*Vc),i=zn(jn(),r,n);i=zn(jn(),i,e);var o=vn(on(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(ln(this.matrix,this.matrix,this.focalPoint),cn(this.matrix,this.matrix,o),ln(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(ln(this.matrix,this.matrix,this.position),cn(this.matrix,this.matrix,o))},r._setPosition=function(t,e,n){this.position=ar(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},r._getAxes=function(){Sn(this.right,ar(Gn(Vn(),[1,0,0,0],this.matrix))),Sn(this.up,ar(Gn(Vn(),[0,1,0,0],this.matrix))),Sn(this.forward,ar(Gn(Vn(),[0,0,1,0],this.matrix))),_n(this.right,this.right),_n(this.up,this.up),_n(this.forward,this.forward)},r._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=bn(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=Math.asin(n/i)*Gc,this.azimuth=Math.atan2(-e,-r)*Gc):(this.elevation=-Math.asin(n/i)*Gc,this.azimuth=-Math.atan2(-e,-r)*Gc)},r._getPosition=function(){Sn(this.position,ar(Gn(Vn(),[0,0,0,1],this.matrix))),this._getDistance()},r._getFocalPoint=function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=rn(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),xn(this.focalPoint,this.position,this.distanceVector),this._getDistance()},r._getDistance=function(){this.distanceVector=Pn(mn(),this.focalPoint,this.position),this.distance=bn(this.distanceVector),this.dollyingStep=this.distance/100},r._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=Hn(jn(),[0,0,1],-this.roll*Math.PI/180);yn(this.orthoMatrix,n,En((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),En(this.zoom,this.zoom,1),e)}},r.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=cn(on(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.emit(Bc.UPDATED)}},r.syncFromLandmark=function(t){this.matrix=an(this.matrix,t.matrix),this.right=Sn(this.right,t.right),this.up=Sn(this.up,t.up),this.forward=Sn(this.forward,t.forward),this.position=Sn(this.position,t.position),this.focalPoint=Sn(this.focalPoint,t.focalPoint),this.distanceVector=Sn(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},n}(bo.EventEmitter);let zc=1;const Wc="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},Yc=Date.now();let qc={},Xc=Date.now();const Kc=t=>{if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=Date.now(),n=e-Xc,r=n>16?0:16-n,i=zc++;return qc[i]=t,Object.keys(qc).length>1||setTimeout((()=>{Xc=e;const t=qc;qc={},Object.keys(t).forEach((e=>t[e](Wc.performance&&"function"==typeof Wc.performance.now?Wc.performance.now():Date.now()-Yc)))}),r),i},Zc=t=>{delete qc[t]},Jc=t=>"string"!=typeof t?Kc:""===t?Wc.requestAnimationFrame:Wc[t+"RequestAnimationFrame"],Qc=((t,e)=>{let n=0;for(;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}})(["","webkit","moz","ms","o"],(t=>!!Jc(t))),$c=Jc(Qc),tl="string"!=typeof(el=Qc)?Zc:""===el?Wc.cancelAnimationFrame:Wc[el+"CancelAnimationFrame"]||Wc[el+"CancelRequestAnimationFrame"];var el,nl,rl;Wc.requestAnimationFrame=$c,Wc.cancelAnimationFrame=tl,"undefined"!=typeof module&&module.exports&&(module.exports={requestAnimationFrame:$c,cancelAnimationFrame:tl});var il,ol,al=i.defineToken("CullingStrategyContribution"),sl=(nl=function(){function e(){this.strategyProvider=void 0,this.renderingContext=void 0}return e.prototype.apply=function(e){var n=this;this.strategyProvider.getContributions();e.hooks.cull.tap(rl.tag,(function(e){if(e){var r=e.cullable;return r.visible=!0,!r.isCulled()&&e.isVisible()?e:(n.renderingContext.renderListLastFrame.indexOf(e)>-1&&e.dispatchEvent(new tu(t.ElementEvent.CULLED)),null)}return e})),e.hooks.afterRender.tap(rl.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e}(),nl.tag="Culling",rl=nl);ce([Bt(al),he("design:type",Object)],sl.prototype,"strategyProvider",void 0),ce([ht(wc),he("design:type",Object)],sl.prototype,"renderingContext",void 0),sl=rl=ce([lt({contrib:xc})],sl);var ul,cl,ll=(il=function(){function e(){this.renderingContext=void 0}return e.prototype.apply=function(e){var n=this;e.hooks.dirtycheck.tap(ol.tag,(function(e){if(e){var r=e.renderable,i=n.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED);return r.dirty||i?e:null}return e}))},e}(),il.tag="DirtyCheck",ol=il);ce([ht(wc),he("design:type",Object)],ll.prototype,"renderingContext",void 0),ll=ol=ce([lt({contrib:xc})],ll);var hl=(ul=function(){function t(){var t=this;this.canvasConfig=void 0,this.contextService=void 0,this.renderingService=void 0,this.renderingContext=void 0,this.eventService=void 0,this.autoPreventDefault=!0,this.rootPointerEvent=new Xu(null),this.rootWheelEvent=new Ku(null),this.onPointerMove=function(e){var n,r,i=null===(n=t.renderingContext.root)||void 0===n||null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView;if(!i.supportsTouchEvents||"touch"!==e.pointerType){for(var o,a=Pe(t.normalizeToPointerEvent(e,i));!(o=a()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,o.value,i);t.eventService.mapEvent(s)}t.setCursor(t.eventService.cursor)}}}var e=t.prototype;return e.apply=function(t){var e=this,n=this.renderingContext.root.ownerDocument.defaultView;this.eventService.setPickHandler(function(){var t=de(pe().mark((function t(n){return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.renderingService.hooks.pick.promise({position:n,picked:[],topmost:!0});case 2:return t.abrupt("return",t.sent.picked[0]||null);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.hooks.pointerWheel.tap(cl.tag,(function(t){var n=e.normalizeWheelEvent(t);e.eventService.mapEvent(n)})),t.hooks.pointerDown.tap(cl.tag,(function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){var r=e.normalizeToPointerEvent(t,n);if(e.autoPreventDefault&&r[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i,o=Pe(r);!(i=o()).done;){var a=e.bootstrapEvent(e.rootPointerEvent,i.value,n);e.eventService.mapEvent(a)}e.setCursor(e.eventService.cursor)}})),t.hooks.pointerUp.tap(cl.tag,(function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var r,i=e.contextService.getDomElement(),o=i&&t.target&&t.target!==i&&i.contains&&!i.contains(t.target)?"outside":"",a=Pe(e.normalizeToPointerEvent(t,n));!(r=a()).done;){var s=e.bootstrapEvent(e.rootPointerEvent,r.value,n);s.type+=o,e.eventService.mapEvent(s)}e.setCursor(e.eventService.cursor)}})),t.hooks.pointerMove.tap(cl.tag,this.onPointerMove),t.hooks.pointerOver.tap(cl.tag,this.onPointerMove),t.hooks.pointerOut.tap(cl.tag,this.onPointerMove)},e.bootstrapEvent=function(t,e,n){t.pointerType=e.pointerType;var r=t;r.view=n,r.originalEvent=null,r.nativeEvent=e,r.pointerId=e.pointerId,r.width=e.width,r.height=e.height,r.isPrimary=e.isPrimary,r.pressure=e.pressure,r.tangentialPressure=e.tangentialPressure,r.tiltX=e.tiltX,r.tiltY=e.tiltY,r.twist=e.twist,this.transferMouseData(r,e);var i=this.eventService.client2Viewport(new Ya(e.clientX,e.clientY)),o=i.y;r.viewport.x=i.x,r.viewport.y=o;var a=this.eventService.viewport2Canvas(r.viewport),s=a.y;return r.canvas.x=a.x,r.canvas.y=s,r.global.copyFrom(r.canvas),r.offset.copyFrom(r.canvas),r.isTrusted=e.isTrusted,"pointerleave"===r.type&&(r.type="pointerout"),r.type.startsWith("mouse")&&(r.type=r.type.replace("mouse","pointer")),r.type.startsWith("touch")&&(r.type=Vr[r.type]||r.type),r},e.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.eventService.client2Viewport(new Ya(t.clientX,t.clientY)),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},e.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},e.setCursor=function(t){this.contextService.applyCursorStyle(t||this.canvasConfig.cursor||"default")},e.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];Ue(i.button)&&(i.button=t.touches.length?1:0),Ue(i.buttons)&&(i.buttons=t.touches.length?1:0),Ue(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Ue(i.width)&&(i.width=i.radiusX||1),Ue(i.height)&&(i.height=i.radiusY||1),Ue(i.tiltX)&&(i.tiltX=0),Ue(i.tiltY)&&(i.tiltY=0),Ue(i.pointerType)&&(i.pointerType="touch"),Ue(i.pointerId)&&(i.pointerId=i.identifier||0),Ue(i.pressure)&&(i.pressure=i.force||.5),Ue(i.twist)&&(i.twist=0),Ue(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;Ue(o.isPrimary)&&(o.isPrimary=!0),Ue(o.width)&&(o.width=1),Ue(o.height)&&(o.height=1),Ue(o.tiltX)&&(o.tiltX=0),Ue(o.tiltY)&&(o.tiltY=0),Ue(o.pointerType)&&(o.pointerType="mouse"),Ue(o.pointerId)&&(o.pointerId=1),Ue(o.pressure)&&(o.pressure=.5),Ue(o.twist)&&(o.twist=0),Ue(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t}(),ul.tag="Event",cl=ul);ce([ht(Ti),he("design:type",Object)],hl.prototype,"canvasConfig",void 0),ce([ht(Sc),he("design:type",Object)],hl.prototype,"contextService",void 0),ce([ht(t.RenderingService),he("design:type",t.RenderingService)],hl.prototype,"renderingService",void 0),ce([ht(wc),he("design:type",Object)],hl.prototype,"renderingContext",void 0),ce([ht(t.EventService),he("design:type",t.EventService)],hl.prototype,"eventService",void 0),hl=cl=ce([lt({contrib:xc})],hl);var pl,fl,dl=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],yl=function(){function e(){this.camera=void 0,this.rBush=void 0}var n=e.prototype;return n.isVisible=function(t){var e=t.cullable;if(!e.enable)return!0;return e.visible=!0,e.visible},n.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var o=t.Mask.INSIDE,a=dl.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!a||4!==s&&5!==s)){var l=i[s],h=l.normal,p=l.distance;if(0>Mn(h,n.getPositiveFarPoint(i[s]))+p)return t.Mask.OUTSIDE;0>Mn(h,n.getNegativeFarPoint(i[s]))+p&&(o|=c)}}return o},e}();ce([ht(Fc),he("design:type",Hc)],yl.prototype,"camera",void 0),ce([ht(au),he("design:type",Kt)],yl.prototype,"rBush",void 0),yl=ce([lt({contrib:al})],yl);var vl=(pl=function(){function e(){this.renderingContext=void 0,this.styleValueRegistry=void 0,this.rBush=void 0,this.toSync=new Set}var n=e.prototype;return n.pushToSync=function(t){var e=this;t.forEach((function(t){e.toSync.add(t)}))},n.apply=function(e){var n=this,r=function(t){t.target.renderable.dirty=!0,e.dirtify()},i=function(t){t.detail.affectChildren&&t.target.forEach((function(t){n.pushToSync([t])})),n.pushToSync(t.composedPath().slice(0,-2)),e.dirtify()},o=function(t){var r=t.target;n.pushToSync(t.composedPath().slice(0,-2)),n.styleValueRegistry.recalc(r),Tc(r),e.dirtify()},a=function(t){var r=t.target,i=r.rBushNode;i.aabb&&(n.rBush.remove(i.aabb),n.toSync.delete(r)),Tc(t.target),e.dirtify()};e.hooks.init.tapPromise(fl.tag,de(pe().mark((function e(){return pe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.renderingContext.root.addEventListener(t.ElementEvent.MOUNTED,o),n.renderingContext.root.addEventListener(t.ElementEvent.UNMOUNTED,a),n.renderingContext.root.addEventListener(t.ElementEvent.ATTR_MODIFIED,r),n.renderingContext.root.addEventListener(t.ElementEvent.BOUNDS_CHANGED,i);case 4:case"end":return e.stop()}}),e)})))),e.hooks.destroy.tap(fl.tag,(function(){n.renderingContext.root.removeEventListener(t.ElementEvent.MOUNTED,o),n.renderingContext.root.removeEventListener(t.ElementEvent.UNMOUNTED,a),n.renderingContext.root.removeEventListener(t.ElementEvent.ATTR_MODIFIED,r),n.renderingContext.root.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,i)})),e.hooks.endFrame.tap(fl.tag,(function(){n.syncRTree()}))},n.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=i.getMin(),a=o[0],s=o[1],u=i.getMax();r.aabb={id:n.entity,minX:a,minY:s,maxX:u[0],maxY:u[1]}}r.aabb&&e.push(r.aabb)})),this.rBush.load(e),this.toSync.clear()},e}(),pl.tag="Prepare",fl=pl);ce([ht(wc),he("design:type",Object)],vl.prototype,"renderingContext",void 0),ce([ht(Gr),he("design:type",Object)],vl.prototype,"styleValueRegistry",void 0),ce([ht(au),he("design:type",Kt)],vl.prototype,"rBush",void 0),vl=fl=ce([lt({contrib:xc})],vl);var gl,ml=Ot((function(e){Rt.register(e,xc,{cache:!1}),Rt.register(e,al,{cache:!1}),e({token:au,useValue:new Kt}),e(t.RenderingService),e(t.EventService),e(hl),e(vl),e(ll),e(sl),e(yl)}));(gl=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",gl.BEFORE_RENDER="beforerender",gl.AFTER_RENDER="afterrender",gl.BEFORE_DESTROY="beforedestroy",gl.AFTER_DESTROY="afterdestroy",gl.RESIZE="resize";var Tl=function(e){function n(n){var r;(r=e.call(this)||this).container=Ut.createChild(),r.document=void 0,r.customElements=void 0,r.requestAnimationFrame=void 0,r.cancelAnimationFrame=void 0,r.devicePixelRatio=void 0,r.supportsPointerEvents=void 0,r.supportsTouchEvents=void 0,r.isTouchEvent=void 0,r.isMouseEvent=void 0,r.Element=Eu,r.frameId=void 0,r.eventService=void 0,r.renderingService=void 0,r.inited=!1,r.readyPromise=void 0,r.resolveReadyPromise=void 0,r.document=new Yu,r.document.defaultView=we(r),r.customElements=new dc;var i=n.container,o=n.canvas,a=n.offscreenCanvas,s=n.width,u=n.height,c=n.devicePixelRatio,l=n.renderer,h=n.background,p=n.document,f=n.requestAnimationFrame,d=n.cancelAnimationFrame,y=n.createImage,v=n.supportsPointerEvents,g=n.supportsTouchEvents,m=n.isTouchEvent,T=n.isMouseEvent;We(i,we(r));var b=s,E=u,S=c;return o&&(S=1>(S=c||Ye&&window.devicePixelRatio||1)?1:Math.ceil(S),b=s||Ur(o)||o.width/S,E=u||Fr(o)||o.height/S),r.devicePixelRatio=S,r.requestAnimationFrame=null!=f?f:$c.bind(globalThis),r.cancelAnimationFrame=null!=d?d:tl.bind(globalThis),r.supportsTouchEvents=null!=g?g:"ontouchstart"in globalThis,r.supportsPointerEvents=null!=v?v:!!globalThis.PointerEvent,r.isTouchEvent=null!=m?m:function(t){return r.supportsTouchEvents&&t instanceof globalThis.TouchEvent},r.isMouseEvent=null!=T?T:function(t){return!globalThis.MouseEvent||t instanceof globalThis.MouseEvent&&(!r.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:o,width:b,height:E,renderer:l,offscreenCanvas:a,devicePixelRatio:S,cursor:"default",background:h,createImage:y,document:p}),r.initDefaultCamera(b,E),de(pe().mark((function e(){return pe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.initRenderer(l);case 2:r.dispatchEvent(new tu(t.CanvasEvent.READY)),r.readyPromise&&r.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),r}me(n,e);var r=n.prototype;return r.initRenderingContext=function(e){var n=this;this.container.register({token:Ti,useValue:e}),this.container.register({token:wc,useValue:{root:this.document.documentElement,renderListLastFrame:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}),this.document.documentElement.addEventListener(t.ElementEvent.CHILD_INSERTED,(function(t){n.mountChildren(t.detail.child)})),this.document.documentElement.addEventListener(t.ElementEvent.CHILD_REMOVED,(function(t){n.unmountChildren(t.detail.child)}))},r.initDefaultCamera=function(e,n){var r=(new Hc).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3);r.canvas=this;var i=this.container.get(wc);r.on(Bc.UPDATED,(function(){i.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.container.register({token:Fc,useValue:r})},r.getConfig=function(){return this.container.get(Ti)},r.getContainer=function(){return this.container},r.getRoot=function(){return this.document.documentElement},r.getCamera=function(){return this.container.get(Fc)},r.getContextService=function(){return this.container.get(Sc)},r.getEventService=function(){return this.eventService},r.getRenderingService=function(){return this.renderingService},r.getRenderingContext=function(){return this.container.get(wc)},r.getStats=function(){return this.getRenderingService().getStats()},r.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=!1),n||this.dispatchEvent(new tu(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&this.document.destroy(),this.getContextService().destroy(),this.getRenderingService().destroy(),n||this.dispatchEvent(new tu(t.CanvasEvent.AFTER_DESTROY))},r.changeSize=function(t,e){this.resize(t,e)},r.resize=function(e,n){var r=this.container.get(Ti);r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.container.get(Fc),o=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),o===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new tu(t.CanvasEvent.RESIZE,{width:e,height:n}))},r.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},r.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},r.removeChild=function(t,e){return void 0===e&&(e=!0),this.document.documentElement.removeChild(t,e)},r.removeChildren=function(t){void 0===t&&(t=!0),this.document.documentElement.removeChildren(t)},r.render=function(){(this.dispatchEvent(new tu(t.CanvasEvent.BEFORE_RENDER)),this.container.isBound(t.RenderingService))&&this.container.get(t.RenderingService).render(this.getConfig());this.dispatchEvent(new tu(t.CanvasEvent.AFTER_RENDER))},r.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},r.initRenderer=function(){var e=de(pe().mark((function e(n){var r;return pe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.loadCommonContainerModule(),this.loadRendererContainerModule(n),r=this.container.get(Sc),this.renderingService=this.container.get(t.RenderingService),this.eventService=this.container.get(t.EventService),e.next=11,r.init();case 11:return e.next=13,this.renderingService.init();case 13:this.inited=!0,this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot()),n.getConfig().enableAutoRendering&&this.run();case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.loadCommonContainerModule=function(){this.container.unload(ml),this.container.load(ml,!0)},r.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.init(e.container)}))},r.setRenderer=function(){var t=de(pe().mark((function t(e){var n,r,i=this;return pe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.getConfig()).renderer!==e){t.next=3;break}return t.abrupt("return");case 3:return r=n.renderer,n.renderer=e,this.destroy(!1,!0),[].concat(null==r?void 0:r.getPlugins()).reverse().forEach((function(t){t.destroy(i.container)})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),r.setCursor=function(t){this.getContextService().applyCursorStyle(t)},r.unmountChildren=function(e){var n=this;if(this.inited){var r=[];e.forEach((function(t){t.isConnected&&r.push(t)})),r.reverse().forEach((function(e){e instanceof wu&&e.disconnectedCallback&&e.disconnectedCallback(),e.dispatchEvent(new tu(t.ElementEvent.UNMOUNTED)),e!==n.document.documentElement&&(e.ownerDocument=null),e.isConnected=!1}))}},r.mountChildren=function(e){var n=this;this.inited?e.forEach((function(e){e.isConnected||(e.ownerDocument=n.document,e.isConnected=!0,e.dispatchEvent(new tu(t.ElementEvent.MOUNTED)),e instanceof wu&&e.connectedCallback&&e.connectedCallback())})):console.error("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",e)},r.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},r.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},r.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},r.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},r.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},r.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},ve(n,[{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}}]),n}(eu);Ut.load(Dc);var bl=Ut.get(t.LayoutEngine);t.AABB=La,t.AbstractLayoutDefinition=oo,t.AbstractRenderer=Uc,t.Animation=yu,t.AnimationEffectTiming=Zu,t.AnimationEvent=fu,t.AnimationTimeline=gu,t.AsyncParallelHook=Fi,t.AsyncSeriesWaterfallHook=ji,t.BUILT_IN_PROPERTIES=Oc,t.BoundingSphere=Ua,t.CSS=Fs,t.CSSColorValue=ko,t.CSSGradientValue=Jo,t.CSSKeywordValue=Co,t.CSSMathInvert=Bo,t.CSSMathMax=Wo,t.CSSMathMin=zo,t.CSSMathNegate=Vo,t.CSSMathProduct=qo,t.CSSMathSum=Yo,t.CSSMathValue=Fo,t.CSSMathVariadic=Ho,t.CSSNumericValue=Ao,t.CSSNumericValueType=Mo,t.CSSProperty=Js,t.CSSPropertySyntaxFactory=Zs,t.CSSRGB=Zo,t.CSSStyleValue=Po,t.CSSUnitValue=Uo,t.Camera=Hc,t.CameraEvent=Bc,t.Canvas=Tl,t.CanvasConfig=Ti,t.Circle=Pu,t.ContextNode=Ie,t.ContextService=Sc,t.Cullable=ru,t.CustomElement=wu,t.CustomElementRegistry=dc,t.CustomEvent=tu,t.DCHECK=Re,t.DCHECK_EQ=Le,t.DCHECK_NE=De,t.DELEGATION_SPLITTER=":",t.DefaultCamera=Fc,t.Deferred=Rr,t.DisplayObject=Eu,t.Document=Yu,t.EasingFunctions=Ar,t.Element=pu,t.Ellipse=Cu,t.EventTarget=eu,t.FederatedEvent=$s,t.FederatedMouseEvent=qu,t.FederatedPointerEvent=Xu,t.FederatedWheelEvent=Ku,t.FragmentResultFactory=Ae,t.FragmentResultOptions=Oe,t.Frustum=Ba,t.Geometry=iu,t.GeometryAABBUpdater=Mc,t.GeometryUpdaterFactory=_c,t.Group=_u,t.HTML=Wu,t.Image=Au,t.KeyframeEffect=fc,t.LayoutChildrenFactory=ro,t.LayoutChildrenOptions=io,t.LayoutContextFactory=Ne,t.LayoutContextOptions=_e,t.LayoutEdgesFactory=uo,t.LayoutEdgesOptions=co,t.LayoutFragmentFactory=po,t.LayoutFragmentOptions=fo,t.LayoutObject=Ce,t.Line=Iu,t.MOUSE_POINTER_ID=1,t.ManaSyringe=zt,t.MutationEvent=lu,t.MutationObserver=ec,t.MutationRecord=Ju,t.Node=nu,t.ObjectTyped=Lr,t.Odeg=Ko,t.Opx=Xo,t.Path=Lu,t.Plane=Fa,t.Point=Ya,t.Polygon=Uu,t.Polyline=Bu,t.RBush=Kt,t.RBushNode=ou,t.RBushRoot=au,t.Ray=Wa,t.Rect=Gu,t.Rectangle=qa,t.Registration=tc,t.Renderable=su,t.RenderingContext=wc,t.RenderingPluginContribution=xc,t.SceneGraphSelector=vc,t.SceneGraphSelectorFactory=yc,t.SceneGraphService=bc,t.Sortable=uu,t.StyleValueRegistry=Gr,t.SyncHook=Xi,t.SyncWaterfallHook=to,t.TOUCH_TO_POINTER=Vr,t.Text=Hu,t.Transform=cu,t.baseTypeToString=_o,t.camelCase=Qr,t.clamp=ir,t.clampedMergeNumbers=as,t.cleanExistedCanvas=We,t.clonePath=Ci,t.compareAnimations=vu,t.convertAngleUnit=$a,t.convertEffectInput=ti,t.convertPercentUnit=ns,t.convertToDash=fr,t.convertToPath=function(e,n){void 0===n&&(n=!0);var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle;r=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(i.x1.value,i.y1.value,i.x2.value,i.y2.value);break;case t.Shape.CIRCLE:var o=e.parsedStyle,a=o.r;r=_i(a.value,a.value,o.cx.value,o.cy.value);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=_i(s.rx.value,s.ry.value,s.cx.value,s.cy.value);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:r=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var u=e.parsedStyle,c=u.width,l=u.height,h=u.x,p=u.y,f=u.radius,d=f&&f.some((function(t){return 0!==t.value}));r=function(t,e,n,r,i){if(i){var o=i[0],a=i[1],s=i[2],u=i[3];return[["M",n,o+r],o?["A",o,o,0,0,1,o+n,r]:null,["L",t-a+n,r],a?["A",a,a,0,0,1,t+n,a+r]:null,["L",t+n,e-s+r],s?["A",s,s,0,0,1,t-s+n,e+r]:null,["L",u+n,e+r],u?["A",u,u,0,0,1,n,e-u+r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(c.value,l.value,h.value,p.value,d&&f.map((function(t){return t.value})));break;case t.Shape.PATH:var y=e.parsedStyle.path,v=y.zCommandIndexes;r=[].concat(y.curve),v.forEach((function(t,e){r.splice(t+e,1,["Z"])}))}if(r.length)return function(t,e,n){var r;void 0===n&&(n=!0),n&&(r=e.getLocalTransform());var i=e.parsedStyle,o=i.defX,a=void 0===o?0:o,s=i.defY,u=void 0===s?0:s;return t.reduce((function(t,e){var i="";if("M"===e[0]||"L"===e[0]){var o=En(e[1]-a,e[2]-u,0);n&&In(o,o,r),i=""+e[0]+o[0]+","+o[1]}else if("Z"===e[0])i=e[0];else if("C"===e[0]){var s=En(e[1]-a,e[2]-u,0),c=En(e[3]-a,e[4]-u,0),l=En(e[5]-a,e[6]-u,0);n&&(In(s,s,r),In(c,c,r),In(l,l,r)),i=""+e[0]+s[0]+","+s[1]+","+c[0]+","+c[1]+","+l[0]+","+l[1]}else if("A"===e[0]){var h=En(e[6]-a,e[7]-u,0);n&&In(h,h,r),i=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+h[0]+","+h[1]}return t+i}),"")}(r,e,n)},t.createVec3=ar,t.decompose=pr,t.deg2rad=function(t){return t*(Math.PI/180)},t.deg2turn=function(t){return t/360},t.dirtifyToRoot=Tc,t.equalSet=function(t,e){if(t.size!==e.size)return!1;for(var n,r=Pe(t);!(n=r()).done;){if(!e.has(n.value))return!1}return!0},t.equalizeSegments=Si,t.formatAttribute=ai,t.fromRotationTranslationScale=lr,t.getAngle=or,t.getDrawDirection=wi,t.getEasingFunction=Or,t.getEuler=cr,t.getHeight=Fr,t.getPathArea=Pi,t.getRotatedCurve=Ni,t.getRotationInRadians=function(t){return Math.atan2(t[1],t[4])},t.getScaling=function(t,e){var n=e[3],r=e[4];return t[0]=Math.hypot(e[0],e[1]),t[1]=Math.hypot(n,r),t},t.getStyle=Dr,t.getTranslation=function(t,e){return t[0]=e[6],t[1]=e[7],t},t.getWidth=Ur,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBoolean=Ge,t.isBrowser=Ye,t.isComparison=function(e){return e===t.CSSMathOperator.kMin||e===t.CSSMathOperator.kMax||e===t.CSSMathOperator.kClamp},t.isFunction=Ve,t.isNil=Fe,t.isNumber=Be,t.isObject=je,t.isString=$r,t.isUndefined=Ue,t.layoutEngine=bl,t.makePerspective=hr,t.makeQuerablePromise=Ir,t.makeTiming=lc,t.mergeColors=Ia,t.mergeDimensionList=es,t.mergeDimensions=Qa,t.mergeNumberLists=function(t,e){if(t.length===e.length)return[t.map((function(t){return t.value})),e.map((function(t){return t.value})),function(t){return t}]},t.mergeNumbers=os,t.mergePaths=Is,t.mergeTransforms=Ys,t.normalizeKeyframes=sc,t.normalizeTimingInput=hc,t.numberToString=rs,t.numericTimingToObject=pc,t.parseAngle=Ja,t.parseColor=Oa,t.parseDimension=Xa,t.parseDimensionArray=ts,t.parseFilter=Us,t.parseLength=Ka,t.parseLengthOrPercentage=Za,t.parseNumber=is,t.parseNumberList=function(t){return $r(t)?t.split(" ").map(is):t.map(is)},t.parseParam=Ls,t.parsePath=Os,t.parsePoints=Rs,t.parseTransform=Hs,t.parseTransformOrigin=qs,t.parserPercentage=function(t){return Xa(new RegExp("%","g"),t)},t.rad2deg=sr,t.reverseCurve=ki,t.setDOMSize=function(t,e,n){Ye&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.sortByZIndex=mc,t.toFontString=no,t.turn2deg=ur,t.typeCheck=Go,t.unitTypeToBaseType=No,Object.defineProperty(t,"__esModule",{value:!0})}));
3
+ le=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new w(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return k()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=b(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,o),i}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function p(){}function f(){}var d={};s(d,i,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(x([])));v&&v!==e&&n.call(v,i)&&(d=v);var g=f.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function x(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return p.prototype=f,s(g,"constructor",f),s(f,"constructor",p),p.displayName=s(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(T.prototype),s(T.prototype,o,(function(){return this})),t.AsyncIterator=T,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new T(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),s(g,a,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=x,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function he(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function pe(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){he(o,r,i,a,s,"next",t)}function s(t){he(o,r,i,a,s,"throw",t)}a(void 0)}))}}function fe(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function de(t,e,n){return e&&fe(t.prototype,e),n&&fe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ye(){return ye=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ye.apply(this,arguments)}function ve(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,ge(t,e)}function ge(t,e){return ge=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ge(t,e)}function me(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Te(t,e,n){return Te=me()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&ge(i,n.prototype),i},Te.apply(null,arguments)}function be(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;o.length>r;r++)0>e.indexOf(n=o[r])&&(i[n]=t[n]);return i}function Se(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ee(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);e>n;n++)r[n]=t[n];return r}function we(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ee(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ee(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(Rt=t.LayoutTaskType||(t.LayoutTaskType={})).Layout="layout",Rt.IntrinsicSizes="intrinsic-sizes",function(t){t[t.block=0]="block",t[t.normal=1]="normal"}(Lt||(Lt={})),function(t){t[t["block-like"]=0]="block-like",t[t.manual=1]="manual"}(Dt||(Dt={})),(Ut=t.PropertyName||(t.PropertyName={})).LAYOUT="display",Ut.LEFT="left",Ut.TOP="top",Ut.BOTTOM="bottom",Ut.RIGHT="right",Ut.WIDTH="width",Ut.HEIGHT="height",Ut.MIN_WIDTH="minWidth",Ut.MAX_WIDTH="maxWidth",Ut.MIN_HEIGHT="minHeight",Ut.MAX_HEIGHT="maxHeight",Ut.BOX_SIZING="boxSizing",Ut.PADDING="padding",Ut.PADDING_TOP="paddingTop",Ut.PADDING_BOTTOM="paddingBottom",Ut.PADDING_START="paddingLeft",Ut.PADDING_END="paddingRight",Ut.MARGIN="margin",Ut.MARGIN_TOP="marginTop",Ut.MARGIN_BOTTOM="marginBottom",Ut.MARGIN_START="marginLeft",Ut.MARGIN_END="marginRight",Ut.BORDER="border",Ut.BORDER_TOP="borderTop",Ut.BORDER_BOTTOM="borderBottom",Ut.BORDER_START="borderLeft",Ut.BORDER_END="borderRight",Ut.FLEX_DIRECTION="flexDirection",Ut.FLEX_WRAP="flexWrap",Ut.FLEX_FLOW="flexFlow",Ut.ALIGN_ITEMS="alignItems",Ut.ALIGN_CONTENT="alignContent",Ut.JUSTIFY_CONTENT="justifyContent",Ut.FLEX="flex",Ut.ALIGN_SELF="alignSelf",Ut.FLEX_SHRINK="flexShrink",Ut.FLEX_BASIS="flexBasis",Ut.FLEX_GROW="flexGrow",Ut.OFFSET_WIDTH="offsetWidth",Ut.OFFSET_HEIGHT="offsetHeight",Ut.ORDER="order";var xe=1,ke=function(){function e(t){void 0===t&&(t=new Map),this.id=void 0,this.style=void 0,this.dirty=void 0,this.parent=void 0,this.children=void 0,this.internalIntrisicSizes=void 0,this.computedLayout=void 0,this.measureFn=void 0,this.id=xe++,this.style=t,this.parent=void 0,this.children=[],this.dirty=!1}var n=e.prototype;return n.setMeasure=function(t){this.measureFn=t},n.setIntrisicSizes=function(t){this.internalIntrisicSizes=t},n.addChild=function(t){var e;null===(e=this.children)||void 0===e||e.push(t)},n.insertChild=function(t,e){this.children.splice(t,0,e)},n.removeChild=function(t){var e,n=null===(e=this.children)||void 0===e?void 0:e.findIndex((function(e){return e.id===t.id}));this.removeChildAtIndex(n)},n.removeChildAtIndex=function(t){this.children.splice(t,1)},n.replaceChildAtIndex=function(t,e){this.children.splice(t,1,e)},n.setStyle=function(t,e){this.style.set(t,e)},n.getStyle=function(){for(var t=this,e=new Map,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return r.forEach((function(n){var r=t.style.get(n);r&&e.set(n,r)})),e},n.getAllStyle=function(){return this.style},n.markDirty=function(){this.dirty=!0},n.idDirty=function(){return this.dirty},n.getSize=function(){var e,n,r,i;return{width:null!==(e=null===(n=this.style.get(t.PropertyName.WIDTH))||void 0===n?void 0:n.value)&&void 0!==e?e:0,height:null!==(r=null===(i=this.style.get(t.PropertyName.HEIGHT))||void 0===i?void 0:i.value)&&void 0!==r?r:0}},n.computeLayout=function(){var t=pe(le().mark((function t(){var e;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getSize(),t.next=3,th.computeLayout(this,{availableInlineSize:e.width,availableBlockSize:e.height,fixedInlineSize:e.width,fixedBlockSize:e.height,percentageInlineSize:e.width,percentageBlockSize:e.height,data:void 0});case 3:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.setComputedLayout=function(t){this.computedLayout=t},n.getComputedLayout=function(){return this.computedLayout},n.getAllComputedLayout=function(){},n.toString=function(){return"LayoutObject "+this.id},de(e,[{key:"intrisicSizes",get:function(){return this.internalIntrisicSizes}},{key:"childCount",get:function(){return this.children.length}}]),e}(),Pe=t.Syringe.defineToken("LayoutContextFactory"),Ce=t.Syringe.defineToken("LayoutContextOptions"),_e=0;t.LayoutContext=function(){function t(t){this.options=void 0,this.contextId=void 0,this.workQueue=[],this.mode=void 0,this.layoutChildrenFactory=void 0,this.fragmentResultFactory=void 0,this.layoutFragmentFactory=void 0,this.options=t,this.contextId=""+_e++,this.mode=t.mode,this.layoutChildrenFactory=t.layoutChildrenFactory,this.fragmentResultFactory=t.fragmentResultFactory,this.layoutFragmentFactory=t.layoutFragmentFactory}var e=t.prototype;return e.appendWorkTask=function(t){this.workQueue.push(t)},e.clearWorkQueue=function(){this.workQueue=[]},t}(),t.LayoutContext=se([ct(),ue(0,lt(Ce)),ce("design:paramtypes",[Object])],t.LayoutContext);var Ne=t.Syringe.defineToken("FragmentResultFactory"),Me=t.Syringe.defineToken("FragmentResultOptions"),Ae=t.Syringe.defineToken("contextNode");function Oe(t){if(!t)throw new Error}function Ie(t,e){if(t!==e)throw new Error}function Re(t,e){if(t===e)throw new Error}function Le(t){return void 0===t}function De(t){return null==t}function Ue(t){return"number"==typeof t}function Fe(t){return"function"==typeof t}function Be(t){return"boolean"==typeof t}function Ve(t){return"[object Object]"===Object.prototype.toString.call(t)}t.FragmentResult=function(t,e,n){this._layoutContext=void 0,this._node=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.node=void 0,this.childFragments=void 0,this.data=void 0,this._layoutContext=t,this._node=e,this.options=n,this.layoutContext=t,this.inlineSize=null==n?void 0:n.inlineSize,this.blockSize=null==n?void 0:n.blockSize,this.childFragments=null==n?void 0:n.childFragments,this.data=n.data,this.node=e},t.FragmentResult=se([ut(),ue(0,lt(t.LayoutContext)),ue(1,lt(Ae)),ue(2,lt(Me)),ce("design:paramtypes",[t.LayoutContext,ke,Object])],t.FragmentResult);var Ge={},je=0;function He(t,e){if(t){var n="string"==typeof t?t:t.id||je++;Ge[n]&&Ge[n].destroy(),Ge[n]=e}}var ze="undefined"!=typeof window&&void 0!==window.document,We=.1,Ye="function"==typeof Float32Array,qe=function(t,e){return 1-3*e+3*t},Xe=function(t,e){return 3*e-6*t},Ke=function(t){return 3*t},Ze=function(t,e,n){return((qe(e,n)*t+Xe(e,n))*t+Ke(e))*t},Je=function(t,e,n){return 3*qe(e,n)*t*t+2*Xe(e,n)*t+Ke(e)},Qe=function(t,e,n,r){if(0>t||t>1||0>n||n>1)throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Ye?new Float32Array(11):new Array(11),o=0;11>o;++o)i[o]=Ze(o*We,t,n);var a=function(e){for(var r=0,o=1;10!==o&&e>=i[o];++o)r+=We;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*We,s=Je(a,t,n);return.001>s?0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=Ze(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&10>++s);return a}(e,r,r+We,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var o=Je(e,n,r);if(0===o)return e;e-=(Ze(e,n,r)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:Ze(a(t),e,r)}},$e=1e-6,tn="undefined"!=typeof Float32Array?Float32Array:Array;function en(){var t=new tn(9);return tn!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function nn(){var t=new tn(16);return tn!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function rn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function on(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function an(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15],m=n*s-r*a,T=n*u-i*a,b=n*c-o*a,S=r*u-i*s,E=r*c-o*s,w=i*c-o*u,x=l*y-h*d,k=l*v-p*d,P=l*g-f*d,C=h*v-p*y,_=h*g-f*y,N=p*g-f*v,M=m*N-T*_+b*C+S*P-E*k+w*x;return M?(t[0]=(s*N-u*_+c*C)*(M=1/M),t[1]=(i*_-r*N-o*C)*M,t[2]=(y*w-v*E+g*S)*M,t[3]=(p*E-h*w-f*S)*M,t[4]=(u*P-a*N-c*k)*M,t[5]=(n*N-i*P+o*k)*M,t[6]=(v*b-d*w-g*T)*M,t[7]=(l*w-p*b+f*T)*M,t[8]=(a*_-s*P+c*x)*M,t[9]=(r*P-n*_-o*x)*M,t[10]=(d*E-y*b+g*m)*M,t[11]=(h*b-l*E-f*m)*M,t[12]=(s*k-a*C-u*x)*M,t[13]=(n*C-r*k+i*x)*M,t[14]=(y*T-d*S-v*m)*M,t[15]=(l*S-h*T+p*m)*M,t):null}function sn(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],v=e[13],g=e[14],m=e[15],T=n[0],b=n[1],S=n[2],E=n[3];return t[0]=T*r+b*s+S*h+E*y,t[1]=T*i+b*u+S*p+E*v,t[2]=T*o+b*c+S*f+E*g,t[3]=T*a+b*l+S*d+E*m,t[4]=(T=n[4])*r+(b=n[5])*s+(S=n[6])*h+(E=n[7])*y,t[5]=T*i+b*u+S*p+E*v,t[6]=T*o+b*c+S*f+E*g,t[7]=T*a+b*l+S*d+E*m,t[8]=(T=n[8])*r+(b=n[9])*s+(S=n[10])*h+(E=n[11])*y,t[9]=T*i+b*u+S*p+E*v,t[10]=T*o+b*c+S*f+E*g,t[11]=T*a+b*l+S*d+E*m,t[12]=(T=n[12])*r+(b=n[13])*s+(S=n[14])*h+(E=n[15])*y,t[13]=T*i+b*u+S*p+E*v,t[14]=T*o+b*c+S*f+E*g,t[15]=T*a+b*l+S*d+E*m,t}function un(t,e,n){var r,i,o,a,s,u,c,l,h,p,f,d,y=n[0],v=n[1],g=n[2];return e===t?(t[12]=e[0]*y+e[4]*v+e[8]*g+e[12],t[13]=e[1]*y+e[5]*v+e[9]*g+e[13],t[14]=e[2]*y+e[6]*v+e[10]*g+e[14],t[15]=e[3]*y+e[7]*v+e[11]*g+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*y+s*v+h*g+e[12],t[13]=i*y+u*v+p*g+e[13],t[14]=o*y+c*v+f*g+e[14],t[15]=a*y+l*v+d*g+e[15]),t}function cn(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ln(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function hn(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,s),t}function pn(t,e){var n=new tn(3);hn(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,u=e[2]*o,c=e[4]*r,l=e[5]*i,h=e[6]*o,p=e[8]*r,f=e[9]*i,d=e[10]*o,y=a+l+d,v=0;return y>0?(v=2*Math.sqrt(y+1),t[3]=.25*v,t[0]=(h-f)/v,t[1]=(p-u)/v,t[2]=(s-c)/v):a>l&&a>d?(v=2*Math.sqrt(1+a-l-d),t[3]=(h-f)/v,t[0]=.25*v,t[1]=(s+c)/v,t[2]=(p+u)/v):l>d?(v=2*Math.sqrt(1+l-a-d),t[3]=(p-u)/v,t[0]=(s+c)/v,t[1]=.25*v,t[2]=(h+f)/v):(v=2*Math.sqrt(1+d-a-l),t[3]=(s-c)/v,t[0]=(p+u)/v,t[1]=(h+f)/v,t[2]=.25*v),t}function fn(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,p=o*c,f=o*l,d=o*h,y=a*l,v=a*h,g=s*h,m=u*c,T=u*l,b=u*h,S=r[0],E=r[1],w=r[2],x=i[0],k=i[1],P=i[2],C=(1-(y+g))*S,_=(f+b)*S,N=(d-T)*S,M=(f-b)*E,A=(1-(p+g))*E,O=(v+m)*E,I=(d+T)*w,R=(v-m)*w,L=(1-(p+y))*w;return t[0]=C,t[1]=_,t[2]=N,t[3]=0,t[4]=M,t[5]=A,t[6]=O,t[7]=0,t[8]=I,t[9]=R,t[10]=L,t[11]=0,t[12]=n[0]+x-(C*x+M*k+I*P),t[13]=n[1]+k-(_*x+A*k+R*P),t[14]=n[2]+P-(N*x+O*k+L*P),t[15]=1,t}function dn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,p=i*a,f=i*s,d=i*u,y=o*a,v=o*s,g=o*u;return t[0]=1-h-d,t[1]=l+g,t[2]=p-v,t[3]=0,t[4]=l-g,t[5]=1-c-d,t[6]=f+y,t[7]=0,t[8]=p+v,t[9]=f-y,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var yn=function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t};function vn(){var t=new tn(3);return tn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function gn(t){var e=new tn(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function mn(t){return Math.hypot(t[0],t[1],t[2])}function Tn(t,e,n){var r=new tn(3);return r[0]=t,r[1]=e,r[2]=n,r}function bn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Sn(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function En(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function wn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function xn(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function kn(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Pn(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function Cn(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function _n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Nn(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function Mn(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function An(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function On(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=$e*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=$e*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=$e*Math.max(1,Math.abs(i),Math.abs(s))}var In,Rn=wn,Ln=xn,Dn=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},Un=mn;In=vn();function Fn(){var t=new tn(4);return tn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Bn(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}!function(){var t=Fn()}();function Vn(){var t=new tn(4);return tn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Gn(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function jn(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function Hn(t,e,n,r){var i,o,a,s,u,c=e[0],l=e[1],h=e[2],p=e[3],f=n[0],d=n[1],y=n[2],v=n[3];return 0>(o=c*f+l*d+h*y+p*v)&&(o=-o,f=-f,d=-d,y=-y,v=-v),1-o>$e?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),t[0]=s*c+u*f,t[1]=s*l+u*d,t[2]=s*h+u*y,t[3]=s*p+u*v,t}function zn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function Wn(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}var Yn,qn,Xn,Kn,Zn,Jn,Qn=function(t,e,n,r){var i=new tn(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},$n=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},tr=jn,er=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};Yn=vn(),qn=Tn(1,0,0),Xn=Tn(0,1,0),Kn=Vn(),Zn=Vn(),Jn=en();!function(){var t,e=(t=new tn(2),tn!=Float32Array&&(t[0]=0,t[1]=0),t)}();function nr(t,e,n){return n?Math.min(t,e)===t?e:Math.max(t,n)===t?n:t:Math.max(t,e)===e?t:e}function rr(t){return void 0===t?0:t>360||-360>t?t%360:t}function ir(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ue(t)?Tn(t,e,n):Array.isArray(t)&&3===t.length?gn(t):Tn(t[0],t[1]||e,t[2]||n)}function or(t){return t*(180/Math.PI)}function ar(t){return 360*t}function sr(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=hn(vn(),e),a=o[0],s=o[1],u=o[2],c=Math.asin(-e[2]/a);return i>c?c>-i?(n=Math.atan2(e[6]/s,e[10]/u),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function ur(t,e,n,r,i){var o,a,s,u,c,l,h,p,f,d,y=Math.cos(t),v=Math.sin(t);return o=r*y,a=i*v,s=0,u=-r*v,c=i*y,l=0,h=e,p=n,f=1,(d=new tn(9))[0]=o,d[1]=a,d[2]=s,d[3]=u,d[4]=c,d[5]=l,d[6]=h,d[7]=p,d[8]=f,d}function cr(t,e,n,r,i,o,a){var s=2*o/(r-i),u=(n+e)/(n-e),c=(r+i)/(r-i),l=-(a+o)/(a-o),h=-2*a*o/(a-o);return t[0]=2*o/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=l,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}function lr(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);0>e*i-n*r&&(i>e?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=or(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var hr=function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))).charAt(0)?t.substr(1):t},pr=function(t){return Math.pow(t,2)},fr=function(t){return Math.pow(t,3)},dr=function(t){return Math.pow(t,4)},yr=function(t){return Math.pow(t,5)},vr=function(t){return Math.pow(t,6)},gr=function(t){return 1-Math.cos(t*Math.PI/2)},mr=function(t){return 1-Math.sqrt(1-t*t)},Tr=function(t){return t*t*(3*t-2)},br=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},Sr=function(t,e){void 0===e&&(e=[]);var n=e[0],r=e[1],i=void 0===r?.5:r,o=nr(Number(void 0===n?1:n),1,10),a=nr(Number(i),.1,2);return 0===t||1===t?t:-o*Math.pow(2,10*(t-1))*Math.sin((t-1-a/(2*Math.PI)*Math.asin(1/o))*(2*Math.PI)/a)},Er=function(t,e,n){void 0===e&&(e=[]);var r=e[0],i=void 0===r?1:r,o=e[1],a=void 0===o?100:o,s=e[2],u=void 0===s?10:s,c=e[3],l=void 0===c?0:c;i=nr(i,.1,1e3),a=nr(a,.1,1e3),u=nr(u,.1,1e3),l=nr(l,.1,1e3);var h=Math.sqrt(a/i),p=u/(2*Math.sqrt(a*i)),f=1>p?h*Math.sqrt(1-p*p):0,d=1>p?(p*h-l)/f:-l+h,y=n?n*t/1e3:t;return y=1>p?Math.exp(-y*p*h)*(1*Math.cos(f*y)+d*Math.sin(f*y)):(1+d*y)*Math.exp(-y*h),0===t||1===t?t:1-y},wr=function(t,e){void 0===e&&(e=[]);var n=e[0],r=void 0===n?10:n;return("start"==e[1]?Math.ceil:Math.floor)(nr(t,0,1)*r)/r},xr=function(t,e){void 0===e&&(e=[]);return Qe(e[0],e[1],e[2],e[3])(t)},kr=Qe(.42,0,1,1),Pr=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},Cr=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},_r=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},Nr={steps:wr,"step-start":function(t){return wr(t,[1,"start"])},"step-end":function(t){return wr(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":xr,ease:function(t){return xr(t,[.25,.1,.25,1])},in:kr,out:Pr(kr),"in-out":Cr(kr),"out-in":_r(kr),"in-quad":pr,"out-quad":Pr(pr),"in-out-quad":Cr(pr),"out-in-quad":_r(pr),"in-cubic":fr,"out-cubic":Pr(fr),"in-out-cubic":Cr(fr),"out-in-cubic":_r(fr),"in-quart":dr,"out-quart":Pr(dr),"in-out-quart":Cr(dr),"out-in-quart":_r(dr),"in-quint":yr,"out-quint":Pr(yr),"in-out-quint":Cr(yr),"out-in-quint":_r(yr),"in-expo":vr,"out-expo":Pr(vr),"in-out-expo":Cr(vr),"out-in-expo":_r(vr),"in-sine":gr,"out-sine":Pr(gr),"in-out-sine":Cr(gr),"out-in-sine":_r(gr),"in-circ":mr,"out-circ":Pr(mr),"in-out-circ":Cr(mr),"out-in-circ":_r(mr),"in-back":Tr,"out-back":Pr(Tr),"in-out-back":Cr(Tr),"out-in-back":_r(Tr),"in-bounce":br,"out-bounce":Pr(br),"in-out-bounce":Cr(br),"out-in-bounce":_r(br),"in-elastic":Sr,"out-elastic":Pr(Sr),"in-out-elastic":Cr(Sr),"out-in-elastic":_r(Sr),spring:Er,"spring-in":Er,"spring-out":Pr(Er),"spring-in-out":Cr(Er),"spring-out-in":_r(Er)},Mr=function(t){return Nr[function(t){return hr(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||Nr.linear},Ar=function(t){if(t.isRejected||t.isFulfilled)return t;var e,n=!0,r=!1,i=!1,o=t.then((function(t){return i=!0,n=!1,e=t,t}),(function(t){throw r=!0,n=!1,t}));return o.isFulfilled=function(){return i},o.isPending=function(){return n},o.isRejected=function(){return r},o.getFullFilledValue=function(){return e},o},Or=function(){var t=this;this.resolve=void 0,this.reject=void 0,this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},Ir={keys:Object.keys,values:Object.values,entries:Object.entries};function Rr(t,e){if(ze)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function Lr(t){var e=Rr(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}function Dr(t){var e=Rr(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}var Ur={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function Fr(t){var e=t.type,n=t.value;return"hex"===e?"#"+n:"literal"===e?n:"rgb"===e?"rgb("+n.join(",")+")":"rgba("+n.join(",")+")"}var Br,Vr=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,p=/^\(/,f=/^\)/,d=/^,/,y=/^\#([0-9a-fA-F]+)/,v=/^([a-zA-Z]+)/,g=/^rgb/i,m=/^rgba/i,T=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,b="";function S(t){throw new Error(b+": "+t)}function E(){var t=O(w);return b.length>0&&S("Invalid input not EOF"),t}function w(){return x("linear-gradient",t,P)||x("repeating-linear-gradient",e,P)||x("radial-gradient",n,C)||x("repeating-radial-gradient",r,C)||x("conic-gradient",i,C)}function x(t,e,n){return k(e,(function(e){var r=n();return r&&(F(d)||S("Missing comma before color stops")),{type:t,orientation:r,colorStops:O(I)}}))}function k(t,e){var n=F(t);if(n){F(p)||S("Missing (");var r=e(n);return F(f)||S("Missing )"),r}}function P(){return U("directional",o,1)||U("angular",h,1)}function C(){var t,e,n=_();return n&&((t=[]).push(n),e=b,F(d)&&((n=_())?t.push(n):b=e)),t}function _(){var t=function(){var t=U("shape",/^(circle)/i,0);t&&(t.style=D()||N());return t}()||function(){var t=U("shape",/^(ellipse)/i,0);t&&(t.style=L()||N());return t}();if(t)t.at=M();else{var e=N();if(e){t=e;var n=M();n&&(t.at=n)}else{var r=A();r&&(t={type:"default-radial",at:r})}}return t}function N(){return U("extent-keyword",a,1)}function M(){if(U("position",/^at/,0)){var t=A();return t||S("Missing positioning value"),t}}function A(){var t={x:L(),y:L()};if(t.x||t.y)return{type:"position",value:t}}function O(t){var e=t(),n=[];if(e)for(n.push(e);F(d);)(e=t())?n.push(e):S("One extra comma");return n}function I(){var t=U("hex",y,1)||k(m,(function(){return{type:"rgba",value:O(R)}}))||k(g,(function(){return{type:"rgb",value:O(R)}}))||U("literal",v,0);return t||S("Expected color definition"),t.length=L(),t}function R(){return F(T)[1]}function L(){return U("%",c,1)||U("position-keyword",s,1)||D()}function D(){return U("px",u,1)||U("em",l,1)}function U(t,e,n){var r=F(e);if(r)return{type:t,value:r[n]}}function F(t){var e=/^[\n\r\t\s]+/.exec(b);e&&B(e[0].length);var n=t.exec(b);return n&&B(n[0].length),n}function B(t){b=b.substring(t)}return function(t){return b=t,E()}}();(Br=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",Br.COLOR="<color>",Br.PAINT="<paint>",Br.NUMBER="<number>",Br.ANGLE="<angle>",Br.OPACITY_VALUE="<opacity-value>",Br.SHADOW_BLUR="<shadow-blur>",Br.LENGTH="<length>",Br.PERCENTAGE="<percentage>",Br.LENGTH_PERCENTAGE="<length> | <percentage>",Br.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",Br.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",Br.LIST_OF_POINTS="<list-of-points>",Br.PATH="<path>",Br.FILTER="<filter>",Br.Z_INDEX="<z-index>",Br.OFFSET_PATH="<offset-path>",Br.OFFSET_DISTANCE="<offset-distance>",Br.CLIP_PATH="<clip-path>",Br.TRANSFORM="<transform>",Br.TRANSFORM_ORIGIN="<transform-origin>",Br.TEXT="<text>",Br.TEXT_TRANSFORM="<text-transform>";var Gr=t.Syringe.defineToken("StyleValueRegistry"),jr=function(t){return t};function Hr(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var zr="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Wr=new RegExp("cubic-bezier\\("+zr+","+zr+","+zr+","+zr+"\\)"),Yr=/steps\(\s*(\d+)\s*\)/,qr=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Xr(t){var e=Wr.exec(t);if(e)return Qe.apply(void 0,e.slice(1).map(Number));var n=Yr.exec(t);if(n)return Hr(Number(n[1]),0);var r=qr.exec(t);return r?Hr(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):Mr(t)}function Kr(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function Zr(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e<Math.min(n.delay+t+n.endDelay,r)?3:2}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),u=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),c=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=c,n.easingFunction(c)}var Jr={};function Qr(t){return void 0===t&&(t=""),Jr[t]||(Jr[t]=t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))),Jr[t]}function $r(t){return!De(t)&&"string"==typeof t}function ti(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(ei(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Xr(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;i.length-1>o;o++){var a=o,s=o+1,u=i[a].computedOffset,c=i[s].computedOffset,l=u,h=c;0===o&&(l=-1/0,0===c&&(s=a)),o===i.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:l,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:ri(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var r=n.endOffset-n.startOffset,i=0===r?0:n.easingFunction((e-n.startOffset)/r);t.style[n.property]=n.interpolation(i)}));else for(var n in r)ei(n)&&(t.style[n]=null)}}function ei(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var ni=function(t,e,n){return function(r){return n(ii(t,e,r))}};function ri(t,e,n,r){var i=e,o=n,a=Vt.get(Gr),s=a.getMetadata(t);if(s&&s.syntax&&s.interpolable){var u=a.getPropertySyntax(s.syntax);if(u){u.parser&&(i=u.parser(e,r),o=u.parser(n,r));var c=u.mixer(i,o,r);if(c){var l=ni.apply(void 0,c);return function(t){return 0===t?e:1===t?n:l(t)}}}}return ni(!1,!0,(function(t){return t?n:e}))}function ii(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>n?t:e;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){for(var r=[],i=0;t.length>i;i++)r.push(ii(t[i],e[i],n));return r}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var oi={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign",values:{middle:"center"}},src:{alias:"img"}};function ai(t,e){var n,r=Qr(t),i=oi[r];return[r=(null==i?void 0:i.alias)||r,(null==i||null===(n=i.values)||void 0===n?void 0:n[e])||e]}function si(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function ui(t,e){return.001>Math.abs(t-e)}function ci(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}var li={box:function(t,e,n,r){return ci([t,n],[e,r])},length:function(t,e,n,r){return si(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,o){var a=(n-t)*(i-t)+(r-e)*(o-e);return 0>a?si(t,e,i,o):a>(n-t)*(n-t)+(r-e)*(r-e)?si(n,r,i,o):this.pointToLine(t,e,n,r,i,o)},pointToLine:function(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,o-e],s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function hi(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function pi(t,e,n,r,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(n-e)+i*i*(r-n))}function fi(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(ui(s,0))ui(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;ui(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}function di(t,e,n,r,i,o,a,s,u){var c=hi(t,n,i,a,u),l=hi(e,r,o,s,u),h=li.pointAt(t,e,n,r,u),p=li.pointAt(n,r,i,o,u),f=li.pointAt(i,o,a,s,u),d=li.pointAt(h.x,h.y,p.x,p.y,u),y=li.pointAt(p.x,p.y,f.x,f.y,u);return[[t,e,h.x,h.y,d.x,d.y,c,l],[c,l,y.x,y.y,f.x,f.y,a,s]]}function yi(t,e,n,r,i,o,a,s,u){if(0===u)return function(t,e){for(var n=0,r=t.length,i=0;r>i;i++)n+=si(t[i],e[i],t[(i+1)%r],e[(i+1)%r]);return n/2}([t,n,i,a],[e,r,o,s]);var c=di(t,e,n,r,i,o,a,s,.5),l=[].concat(c[0],[u-1]),h=[].concat(c[1],[u-1]);return yi.apply(void 0,l)+yi.apply(void 0,h)}var vi={extrema:fi,box:function(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=fi(t,n,i,a),h=fi(e,r,o,s),p=0;l.length>p;p++)u.push(hi(t,n,i,a,l[p]));for(var f=0;h.length>f;f++)c.push(hi(e,r,o,s,h[f]));return ci(u,c)},length:function(t,e,n,r,i,o,a,s){return yi(t,e,n,r,i,o,a,s,3)},nearestPoint:function(t,e,n,r,i,o,a,s,u,c,l){return function(t,e,n,r,i,o){var a=-1,s=1/0,u=[n,r],c=20;o&&o>200&&(c=o/10);for(var l=1/c,h=l/10,p=0;c>=p;p++){var f=p*l,d=[i.apply(void 0,t.concat([f])),i.apply(void 0,e.concat([f]))],y=si(u[0],u[1],d[0],d[1]);s>y&&(a=f,s=y)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var v=t.length;return{x:t[v-1],y:e[v-1]}}s=1/0;for(var g=0;32>g&&h>=1e-4;g++){var m=a-h,T=a+h,b=[i.apply(void 0,t.concat([m])),i.apply(void 0,e.concat([m]))],S=si(u[0],u[1],b[0],b[1]);if(m>=0&&s>S)a=m,s=S;else{var E=[i.apply(void 0,t.concat([T])),i.apply(void 0,e.concat([T]))],w=si(u[0],u[1],E[0],E[1]);1>=T&&s>w?(a=T,s=w):h*=.5}}return{x:i.apply(void 0,t.concat([a])),y:i.apply(void 0,e.concat([a]))}}([t,n,i,a],[e,r,o,s],u,c,hi,l)},pointDistance:function(t,e,n,r,i,o,a,s,u,c,l){var h=this.nearestPoint(t,e,n,r,i,o,a,s,u,c,l);return si(h.x,h.y,u,c)},interpolationAt:hi,pointAt:function(t,e,n,r,i,o,a,s,u){return{x:hi(t,n,i,a,u),y:hi(e,r,o,s,u)}},divide:function(t,e,n,r,i,o,a,s,u){return di(t,e,n,r,i,o,a,s,u)},tangentAngle:function(t,e,n,r,i,o,a,s,u){var c=pi(t,n,i,a,u),l=pi(e,r,o,s,u);return(Math.atan2(l,c)+2*Math.PI)%(2*Math.PI)}};var gi,mi=function(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=si(r[0],r[1],i[0],i[1])}return e}(t)};(gi=t.Shape||(t.Shape={})).GROUP="g",gi.CIRCLE="circle",gi.ELLIPSE="ellipse",gi.IMAGE="image",gi.RECT="rect",gi.LINE="line",gi.POLYLINE="polyline",gi.POLYGON="polygon",gi.TEXT="text",gi.PATH="path",gi.HTML="html",gi.MESH="mesh";var Ti=t.Syringe.defineToken("CanvasConfig");function bi(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function Si(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?vi.length.apply(vi,r):0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=bi(n,r,e),s=bi(r,i,e),u=bi(i,o,e),c=bi(a,s,e),l=bi(s,u,e),h=bi(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function Ei(t,e,n){var r=Si(t),i=Si(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),p=[c,l],f=[h-o,h-a],d=0,y=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return f[e]-=(d=n&&f[e]&&t.l>=p[e])?1:0,d?t.ss:[t.s]})).flat()}));return y[0].length===y[1].length?y:Ei(y[0],y[1],h)}function wi(t){return ki(t)>=0}function xi(t,e,n,r,i,o,a,s){return 3*((s-e)*(n+i)-(a-t)*(r+o)+r*(t-i)-n*(e-o)+s*(i+t/3)-a*(o+e/3))/20}function ki(t){var e=0,n=0,r=0,i=0,o=0;return t.map((function(t){switch(t[0]){case"M":case"Z":return e=r="M"===t[0]?t[1]:r,n=i="M"===t[0]?t[2]:i,0;default:o=xi.apply(0,[e,n].concat(t.slice(1)));var a=t.slice(-2);return e=a[0],n=a[1],o}})).reduce((function(t,e){return t+e}),0)}function Pi(t){var e=t.slice(1).map((function(e,n,r){return n?r[n-1].slice(-2).concat(e.slice(1)):t[0].slice(1).concat(e.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map((function(t){return["C"].concat(t.slice(2))})))}function Ci(t){return t.map((function(t){return Array.isArray(t)?Ci(t):Number.isNaN(+t)?t:+t}))}function _i(t,e){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a=i+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(r,o){i+=function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),r[a]=i,i=0})),o[r.indexOf(Math.min.apply(null,r))]}function Ni(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,u,r-a,u,r],["C",u,r+a,n+o,l,n,l],["C",n-o,l,s,r+a,s,r],["Z"]]}var Mi=function(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)},Ai=function(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)},Oi=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},Ii=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=t,this.name=e,this.taps=[],this.interceptors=[],this._call=Mi,this.call=Mi,this._callAsync=Ai,this.callAsync=Ai,this._promise=Oi,this.promise=Oi,this._x=void 0}var e=t.prototype;return e.compile=function(t){throw new Error("Abstract: should be overridden")},e._createCall=function(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})},e._tap=function(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw new Error("Missing name for tap");e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)},e.tap=function(t,e){this._tap("sync",t,e)},e.tapAsync=function(t,e){this._tap("async",t,e)},e.tapPromise=function(t,e){this._tap("promise",t,e)},e._runRegisterInterceptors=function(t){for(var e,n=we(this.interceptors);!(e=n()).done;){var r=e.value;if(r.register){var i=r.register(t);void 0!==i&&(t=i)}}return t},e.withOptions=function(t){var e=this,n=function(e){return Object.assign({},t,"string"==typeof e?{name:e}:e)};return{name:this.name,tap:function(t,r){return e.tap(n(t),r)},tapAsync:function(t,r){return e.tapAsync(n(t),r)},tapPromise:function(t,r){return e.tapPromise(n(t),r)},isUsed:function(){return e.isUsed()},withOptions:function(t){return e.withOptions(n(t))}}},e.isUsed=function(){return this.taps.length>0||this.interceptors.length>0},e._resetCompilation=function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise},e._insert=function(t){var e;this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var n=0;"number"==typeof t.stage&&(n=t.stage);for(var r=this.taps.length;r>0;){r--;var i=this.taps[r];this.taps[r+1]=i;var o=i.stage||0;if(e){if(e.has(i.name)){e.delete(i.name);continue}if(e.size>0)continue}if(n>=o){r++;break}}this.taps[r]=t},t}(),Ri=function(){function t(t){this.config=t,this.options=void 0,this._args=void 0}var e=t.prototype;return e.create=function(t){var e;switch(this.init(t),this.options.type){case"sync":e=new Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"throw "+t+";\n"},onResult:function(t){return"return "+t+";\n"},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":e=new Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"_callback("+t+");\n"},onResult:function(t){return"_callback(null, "+t+");\n"},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,r=this.contentWithInterceptors({onError:function(t){return n=!0,"_error("+t+");\n"},onResult:function(t){return"_resolve("+t+");\n"},onDone:function(){return"_resolve();\n"}}),i="";i+='"use strict";\n',i+=this.header(),i+="return new Promise((function(_resolve, _reject) {\n",n&&(i+="var _sync = true;\n",i+="function _error(_err) {\n",i+="if(_sync)\n",i+="_resolve(Promise.resolve().then((function() { throw _err; })));\n",i+="else\n",i+="_reject(_err);\n",i+="};\n"),i+=r,n&&(i+="_sync = false;\n"),i+="}));\n",e=new Function(this.args(),i)}return this.deinit(),e},e.setup=function(t,e){t._x=e.taps.map((function(t){return t.fn}))},e.init=function(t){this.options=t,this._args=t.args.slice()},e.deinit=function(){this.options=void 0,this._args=void 0},e.contentWithInterceptors=function(t){var e=this;if(this.options.interceptors.length>0){for(var n=t.onError,r=t.onResult,i=t.onDone,o="",a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.call&&(o+=this.getInterceptor(a)+".call("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.content(Object.assign(t,{onError:n&&function(t){for(var r="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].error&&(r+=e.getInterceptor(i)+".error("+t+");\n")}return r+=n(t)},onResult:r&&function(t){for(var n="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].result&&(n+=e.getInterceptor(i)+".result("+t+");\n")}return n+=r(t)},onDone:i&&function(){for(var t="",n=0;e.options.interceptors.length>n;n++){e.options.interceptors[n].done&&(t+=e.getInterceptor(n)+".done();\n")}return t+=i()}}))}return this.content(t)},e.header=function(){var t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",this.options.interceptors.length>0&&(t+="var _taps = this.taps;\n",t+="var _interceptors = this.interceptors;\n"),t},e.needContext=function(){for(var t,e=we(this.options.taps);!(t=e()).done;){if(t.value.context)return!0}return!1},e.callTap=function(t,e){for(var n=e.onError,r=e.onResult,i=e.onDone,o=e.rethrowIfPossible,a="",s=!1,u=0;this.options.interceptors.length>u;u++){var c=this.options.interceptors[u];c.tap&&(s||(a+="var _tap"+t+" = "+this.getTap(t)+";\n",s=!0),a+=this.getInterceptor(u)+".tap("+(c.context?"_context, ":"")+"_tap"+t+");\n")}a+="var _fn"+t+" = "+this.getTapFn(t)+";\n";var l=this.options.taps[t];switch(l.type){case"sync":o||(a+="var _hasError"+t+" = false;\n",a+="try {\n"),a+=r?"var _result"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n":"_fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",o||(a+="} catch(_err) {\n",a+="_hasError"+t+" = true;\n",a+=n("_err"),a+="}\n",a+="if(!_hasError"+t+") {\n"),r&&(a+=r("_result"+t)),i&&(a+=i()),o||(a+="}\n");break;case"async":var h="";h+=r?"(function(_err"+t+", _result"+t+") {\n":"(function(_err"+t+") {\n",h+="if(_err"+t+") {\n",h+=n("_err"+t),h+="} else {\n",r&&(h+=r("_result"+t)),i&&(h+=i()),h+="}\n",a+="_fn"+t+"("+this.args({before:l.context?"_context":void 0,after:h+="})"})+");\n";break;case"promise":a+="var _hasResult"+t+" = false;\n",a+="var _promise"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",a+="if (!_promise"+t+" || !_promise"+t+".then)\n",a+=" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise"+t+" + ')');\n",a+="_promise"+t+".then((function(_result"+t+") {\n",a+="_hasResult"+t+" = true;\n",r&&(a+=r("_result"+t)),i&&(a+=i()),a+="}), function(_err"+t+") {\n",a+="if(_hasResult"+t+") throw _err"+t+";\n",a+=n("_err"+t),a+="});\n"}return a},e.callTapsSeries=function(t){var e=this,n=t.onError,r=t.onResult,i=t.resultReturns,o=t.onDone,a=t.doneReturns,s=t.rethrowIfPossible;if(0===this.options.taps.length)return o();for(var u=this.options.taps.findIndex((function(t){return"sync"!==t.type})),c=i||a,l="",h=o,p=0,f=function(t){var i=t;h!==o&&("sync"!==e.options.taps[i].type||p++>20)&&(p=0,l+="function _next"+i+"() {\n",l+=h(),l+="}\n",h=function(){return(c?"return ":"")+"_next"+i+"();\n"});var a=h,f=function(t){return t?"":o()},d=e.callTap(i,{onError:function(t){return n(i,t,a,f)},onResult:r&&function(t){return r(i,t,a,f)},onDone:!r&&a,rethrowIfPossible:s&&(0>u||u>i)});h=function(){return d}},d=this.options.taps.length-1;d>=0;d--)f(d);return l+=h()},e.callTapsLooping=function(t){var e=t.onError,n=t.onDone,r=t.rethrowIfPossible;if(0===this.options.taps.length)return n();var i=this.options.taps.every((function(t){return"sync"===t.type})),o="";i||(o+="var _looper = (function() {\n",o+="var _loopAsync = false;\n"),o+="var _loop;\n",o+="do {\n",o+="_loop = false;\n";for(var a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.loop&&(o+=this.getInterceptor(a)+".loop("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.callTapsSeries({onError:e,onResult:function(t,e,n,r){var o="";return o+="if("+e+" !== undefined) {\n",o+="_loop = true;\n",i||(o+="if(_loopAsync) _looper();\n"),o+=r(!0),o+="} else {\n",o+=n(),o+="}\n"},onDone:n&&function(){var t="";return t+="if(!_loop) {\n",t+=n(),t+="}\n"},rethrowIfPossible:r&&i}),o+="} while(_loop);\n",i||(o+="_loopAsync = true;\n",o+="});\n",o+="_looper();\n"),o},e.callTapsParallel=function(t){var e=this,n=t.onError,r=t.onResult,i=t.onDone,o=t.rethrowIfPossible,a=t.onTap,s=void 0===a?function(t,e){return e()}:a;if(1>=this.options.taps.length)return this.callTapsSeries({onError:n,onResult:r,onDone:i,rethrowIfPossible:o});var u="";u+="do {\n",u+="var _counter = "+this.options.taps.length+";\n",i&&(u+="var _done = (function() {\n",u+=i(),u+="});\n");for(var c=function(t){var a=function(){return i?"if(--_counter === 0) _done();\n":"--_counter;"},c=function(t){return t||!i?"_counter = 0;\n":"_counter = 0;\n_done();\n"};u+="if(_counter <= 0) break;\n",u+=s(t,(function(){return e.callTap(t,{onError:function(e){var r="";return r+="if(_counter > 0) {\n",r+=n(t,e,a,c),r+="}\n"},onResult:r&&function(e){var n="";return n+="if(_counter > 0) {\n",n+=r(t,e,a,c),n+="}\n"},onDone:!r&&function(){return a()},rethrowIfPossible:o})}),a,c)},l=0;this.options.taps.length>l;l++)c(l);return u+="} while(false);\n"},e.args=function(t){var e=void 0===t?{}:t,n=e.before,r=e.after,i=this._args;return n&&(i=[n].concat(i)),r&&(i=i.concat(r)),0===i.length?"":i.join(", ")},e.getTapFn=function(t){return"_x["+t+"]"},e.getTap=function(t){return"_taps["+t+"]"},e.getInterceptor=function(t){return"_interceptors["+t+"]"},t}(),Li=function(t){function e(){return t.apply(this,arguments)||this}return ve(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsParallel({onError:function(t,n,r,i){return e(n)+i(!0)},onDone:t.onDone})},e}(Ri),Di=new Li,Ui=function(t){return Di.setup(this,t),Di.create(t)},Fi=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=Ui,r._call=void 0,r.call=void 0,r}return ve(e,t),e}(Ii),Bi=function(t){function e(){return t.apply(this,arguments)||this}return ve(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e,r,i){return n(e)+i(!0)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])}})},e}(Ri),Vi=new Bi,Gi=function(t){return Vi.setup(this,t),Vi.create(t)},ji=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=Gi,r._call=void 0,r.call=void 0,r}return ve(e,t),e}(Ii),Hi=function(t){function e(){return t.apply(this,arguments)||this}return ve(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsSeries({onError:function(t,n){return e(n)},onDone:t.onDone,rethrowIfPossible:t.rethrowIfPossible})},e}(Ri),zi=new Hi,Wi=function(){throw new Error("tapAsync is not supported on a SyncHook")},Yi=function(){throw new Error("tapPromise is not supported on a SyncHook")},qi=function(t){return zi.setup(this,t),zi.create(t)},Xi=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=Wi,r.tapPromise=Yi,r.compile=qi,r}return ve(e,t),e}(Ii),Ki=function(t){function e(){return t.apply(this,arguments)||this}return ve(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e){return n(e)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])},doneReturns:t.resultReturns,rethrowIfPossible:t.rethrowIfPossible})},e}(Ri),Zi=new Ki,Ji=function(){throw new Error("tapAsync is not supported on a SyncWaterfallHook")},Qi=function(){throw new Error("tapPromise is not supported on a SyncWaterfallHook")},$i=function(t){return Zi.setup(this,t),Zi.create(t)},to=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=Ji,r.tapPromise=Qi,r.compile=$i,r}return ve(e,t),e}(Xi),eo=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function no(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=Ue(e)?e+"px":e.toString(),s=$r(n)?n.split(","):[n.value],u=s.length-1;u>=0;u--){var c=s[u].trim();!/([\"\'])[^\'\"]+\1/.test(c)&&0>eo.indexOf(c)&&(c='"'+c+'"'),s[u]=c}return r+" "+i+" "+o+" "+a+" "+s.join(",")}var ro=t.Syringe.defineToken("LayoutChildrenFactory"),io=t.Syringe.defineToken("LayoutChildrenOptions");t.LayoutChildren=function(){function e(t,e){this._layoutContext=void 0,this.options=void 0,this.node=void 0,this.styleMap=void 0,this.layoutContext=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.node=e.node,this.styleMap=e.node.getAllStyle()}var n=e.prototype;return n.intrinsicSizes=function(){var e=new Or;return this.layoutContext.appendWorkTask({layoutChild:this,taskType:t.LayoutTaskType.IntrinsicSizes,deferred:e}),e.promise},n.layoutNextFragment=function(e){if(this.layoutContext.mode===t.LayoutTaskType.IntrinsicSizes)throw new Error("Not Supported: cant call layoutNextFragment in intrinsicSizes");var n=new Or;return this.layoutContext.appendWorkTask({layoutConstraints:e,layoutChild:this,taskType:t.LayoutTaskType.Layout,deferred:n}),n.promise},e}(),t.LayoutChildren=se([ut(),ue(0,lt(t.LayoutContext)),ue(1,lt(io)),ce("design:paramtypes",[t.LayoutContext,Object])],t.LayoutChildren);var oo=function(){};oo.inputProperties=void 0,oo.childrenInputProperties=void 0,oo.layoutOptions=void 0;var ao,so,uo=t.Syringe.defineToken("LayoutEdgesFactory"),co=t.Syringe.defineToken("LayoutEdgesOptions"),lo=[0,0,0,0];t.LayoutEdges=function(e){var n,r,i,o,a,s,u,c,l,h,p,f,d,y,v,g;this.options=void 0,this.inlineStart=void 0,this.inlineEnd=void 0,this.blockStart=void 0,this.blockEnd=void 0,this.inline=void 0,this.block=void 0,this.options=e;var m=e.node.getAllStyle(),T=null!==(n=null===(r=m.get(t.PropertyName.PADDING_TOP))||void 0===r?void 0:r.value)&&void 0!==n?n:0,b=null!==(i=null===(o=m.get(t.PropertyName.PADDING_END))||void 0===o?void 0:o.value)&&void 0!==i?i:0,S=null!==(a=null===(s=m.get(t.PropertyName.PADDING_BOTTOM))||void 0===s?void 0:s.value)&&void 0!==a?a:0,E=null!==(u=null===(c=m.get(t.PropertyName.PADDING_START))||void 0===c?void 0:c.value)&&void 0!==u?u:0,w=null!==(l=null===(h=m.get(t.PropertyName.PADDING_TOP))||void 0===h?void 0:h.value)&&void 0!==l?l:0,x=null!==(p=null===(f=m.get(t.PropertyName.PADDING_END))||void 0===f?void 0:f.value)&&void 0!==p?p:0,k=null!==(d=null===(y=m.get(t.PropertyName.PADDING_BOTTOM))||void 0===y?void 0:y.value)&&void 0!==d?d:0,P=null!==(v=null===(g=m.get(t.PropertyName.PADDING_START))||void 0===g?void 0:g.value)&&void 0!==v?v:0;this.blockStart=T+lo[0]+w,this.inlineStart=b+lo[1]+x,this.blockEnd=S+lo[2]+k,this.inlineEnd=E+lo[3]+P,this.block=this.blockStart+this.blockEnd,this.inline=this.inlineStart+this.inlineEnd},t.LayoutEdges=se([ut(),ue(0,lt(co)),ce("design:paramtypes",[Object])],t.LayoutEdges),t.LayoutRegistry=((ao=function(){function t(){this.registry=new Map}var e=t.prototype;return e.hasLayout=function(t){return this.registry.has(t)},e.getLayout=function(t){if(void 0===t&&(t="absolute"),!this.hasLayout(t))throw new Error("invalid layout property: "+t);return this.registry.get(t)},e.updateLayout=function(t,e){this.registry.set(t,e)},e.registerLayout=function(t,e){if(""===t)throw new TypeError("layout name cant't be empty");if(so.reservedLayout.includes(t))throw new Error("layout name '"+t+"' is a system reserved layout name, please use another name");if(this.hasLayout(t))throw new Error("layout '"+t+"' already exist.");this.registry.set(t,e)},e.deleteLayout=function(t){this.registry.delete(t)},de(t,[{key:"size",get:function(){return this.registry.size}}]),t}()).reservedLayout=[],so=ao),t.LayoutRegistry=so=se([ct()],t.LayoutRegistry);var ho=function(t){return void 0===t&&(t=0),new Promise((function(e){setTimeout((function(){e()}),t)}))};t.LayoutEngine=function(){function e(t,e,n){this._layoutRegistry=void 0,this._layoutContextFactory=void 0,this._layoutEdgesFactory=void 0,this.layoutRegistry=void 0,this.layoutContextFactory=void 0,this.layoutEdgesFactory=void 0,this._layoutRegistry=t,this._layoutContextFactory=e,this._layoutEdgesFactory=n,this.layoutRegistry=t,this.layoutContextFactory=e,this.layoutEdgesFactory=n}var n=e.prototype;return n.computeLayout=function(){var t=pe(le().mark((function t(e,n){return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.determineIntrinsicSizes(e,e.children);case 2:return t.next=4,this.calculateLayout(e,e.children,n);case 4:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.determineAllIntrinsicSizes=function(){var t=pe(le().mark((function t(e){return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),n.getLayoutDefinitionName=function(e){var n=e.getAllStyle().get(t.PropertyName.LAYOUT);if(!n)throw new Error("layout property not found");return n.value},n.determineIntrinsicSizes=function(){var t=pe(le().mark((function t(e,n){var r;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getLayoutDefinitionName(e),t.next=3,this.invokeIntrinsicSizesCallback(r,e,n);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.invokeIntrinsicSizesCallback=function(){var e=pe(le().mark((function e(n,r,i){var o,a,s,u,c,l,h,p,f,d,y;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this.layoutRegistry.getLayout(n),a=new o,s=this.layoutContextFactory({mode:t.LayoutTaskType.IntrinsicSizes}),c=void 0===(u=o.inputProperties)?[]:u,l=[],i.forEach((function(t){var e=s.layoutChildrenFactory({node:t});l.push(e)})),h=this.layoutEdgesFactory({node:r}),p=r.getStyle.apply(r,c),f=a.intrinsicSizes(l,h,p),(d=this.runWorkQueue(f,s.workQueue)).next(),e.next=13,ho();case 13:y=d.next().value,s.clearWorkQueue(),r.setIntrisicSizes(y);case 16:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),n.calculateLayout=function(){var t=pe(le().mark((function t(e,n,r){var i;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.getLayoutDefinitionName(e),t.next=3,this.invokeLayoutCallback(i,e,n,r);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),n.invokeLayoutCallback=function(){var e=pe(le().mark((function e(n,r,i,o){var a,s,u,c,l,h,p,f,d,y,v,g,m;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.layoutRegistry.getLayout(n),s=new a,u=this.layoutContextFactory({mode:t.LayoutTaskType.Layout}),l=void 0===(c=a.inputProperties)?[]:c,h=[],i.forEach((function(t){var e=u.layoutChildrenFactory({node:t});h.push(e)})),p=this.layoutEdgesFactory({node:r}),f=r.getStyle.apply(r,l),d=s.layout(h,p,o,f),(y=this.runWorkQueue(d,u.workQueue)).next(),e.next=13,ho();case 13:v=y.next().value,u.clearWorkQueue(),g=v instanceof t.FragmentResult?v:u.fragmentResultFactory(v),m=u.layoutFragmentFactory({inlineSize:g.inlineSize,blockSize:g.blockSize,data:g.data}),r.setComputedLayout(m),i.forEach((function(t,e){t.setComputedLayout(g.childFragments[e])}));case 19:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i){return e.apply(this,arguments)}}(),n.runWorkQueue=le().mark((function e(n,r){var i,o=this;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Ar(n),r.length>0&&i.isPending()&&r.forEach((function(e){e.taskType===t.LayoutTaskType.IntrinsicSizes&&e.deferred.resolve(o.getNodeIntrisicSizes(e.layoutChild.node));if(e.taskType===t.LayoutTaskType.Layout){var n=e.layoutChild,r=e.deferred,i=n.layoutContext,a=o.getNodeFragment(n.node,e.layoutConstraints);r.resolve(i.layoutFragmentFactory(a))}})),void(e.next=4);case 4:if(i.isFulfilled()){e.next=6;break}throw new Error("promise not fullfilled!");case 6:return e.abrupt("return",i.getFullFilledValue());case 7:case"end":return e.stop()}}),e)})),n.getNodeIntrisicSizes=function(e){var n,r,i,o,a,s,u,c,l,h,p,f,d=e.getAllStyle();return{minContentInlineSize:(null===(n=d.get(t.PropertyName.MIN_WIDTH))||void 0===n?void 0:n.value)||(null===(r=e.intrisicSizes)||void 0===r?void 0:r.minContentInlineSize)||(null===(i=d.get(t.PropertyName.WIDTH))||void 0===i?void 0:i.value)||0,maxContentInlineSize:(null===(o=d.get(t.PropertyName.MAX_WIDTH))||void 0===o?void 0:o.value)||(null===(a=e.intrisicSizes)||void 0===a?void 0:a.maxContentInlineSize)||(null===(s=d.get(t.PropertyName.WIDTH))||void 0===s?void 0:s.value)||0,minContentBlockSize:(null===(u=d.get(t.PropertyName.MIN_HEIGHT))||void 0===u?void 0:u.value)||(null===(c=e.intrisicSizes)||void 0===c?void 0:c.minContentBlockSize)||(null===(l=d.get(t.PropertyName.HEIGHT))||void 0===l?void 0:l.value)||0,maxContentBlockSize:(null===(h=d.get(t.PropertyName.MAX_HEIGHT))||void 0===h?void 0:h.value)||(null===(p=e.intrisicSizes)||void 0===p?void 0:p.maxContentBlockSize)||(null===(f=d.get(t.PropertyName.HEIGHT))||void 0===f?void 0:f.value)||0}},n.getNodeFragment=function(e,n){var r,i,o,a,s,u;return{inlineSize:(null===(r=e.getComputedLayout())||void 0===r?void 0:r.inlineSize)||(null===(i=e.getAllStyle().get(t.PropertyName.MIN_WIDTH))||void 0===i?void 0:i.value)||(null===(o=e.getAllStyle().get(t.PropertyName.WIDTH))||void 0===o?void 0:o.value)||0,blockSize:(null===(a=e.getComputedLayout())||void 0===a?void 0:a.blockSize)||(null===(s=e.getAllStyle().get(t.PropertyName.MIN_HEIGHT))||void 0===s?void 0:s.value)||(null===(u=e.getAllStyle().get(t.PropertyName.HEIGHT))||void 0===u?void 0:u.value)||0,data:n.data}},e}(),t.LayoutEngine=se([ct(),ue(0,lt(t.LayoutRegistry)),ue(1,lt(Pe)),ue(2,lt(uo)),ce("design:paramtypes",[t.LayoutRegistry,Function,Function])],t.LayoutEngine);var po=t.Syringe.defineToken("LayoutFragmentFactory"),fo=t.Syringe.defineToken("LayoutFragmentOptions");t.LayoutFragment=function(t,e){this._layoutContext=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.inlineOffset=void 0,this.blockOffset=void 0,this.data=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.inlineSize=e.inlineSize,this.blockSize=e.blockSize,this.inlineOffset=0,this.blockOffset=0,this.data=e.data},t.LayoutFragment=se([ut(),ue(0,lt(t.LayoutContext)),ue(1,lt(fo)),ce("design:paramtypes",[t.LayoutContext,Object])],t.LayoutFragment);var yo,vo,go,mo,To,bo=n((function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,o=new Array(i);i>r;r++)o[r]=e[r].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,a),!0}for(c=1,u=new Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;f>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,i);break;default:if(!u)for(p=1,u=new Array(h-1);h>p;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}));(yo=t.UnitType||(t.UnitType={}))[yo.kUnknown=0]="kUnknown",yo[yo.kNumber=1]="kNumber",yo[yo.kPercentage=2]="kPercentage",yo[yo.kEms=3]="kEms",yo[yo.kExs=4]="kExs",yo[yo.kPixels=5]="kPixels",yo[yo.kCentimeters=6]="kCentimeters",yo[yo.kMillimeters=7]="kMillimeters",yo[yo.kInches=8]="kInches",yo[yo.kPoints=9]="kPoints",yo[yo.kPicas=10]="kPicas",yo[yo.kQuarterMillimeters=11]="kQuarterMillimeters",yo[yo.kViewportWidth=12]="kViewportWidth",yo[yo.kViewportHeight=13]="kViewportHeight",yo[yo.kViewportInlineSize=14]="kViewportInlineSize",yo[yo.kViewportBlockSize=15]="kViewportBlockSize",yo[yo.kViewportMin=16]="kViewportMin",yo[yo.kViewportMax=17]="kViewportMax",yo[yo.kSmallViewportWidth=18]="kSmallViewportWidth",yo[yo.kSmallViewportHeight=19]="kSmallViewportHeight",yo[yo.kSmallViewportInlineSize=20]="kSmallViewportInlineSize",yo[yo.kSmallViewportBlockSize=21]="kSmallViewportBlockSize",yo[yo.kSmallViewportMin=22]="kSmallViewportMin",yo[yo.kSmallViewportMax=23]="kSmallViewportMax",yo[yo.kLargeViewportWidth=24]="kLargeViewportWidth",yo[yo.kLargeViewportHeight=25]="kLargeViewportHeight",yo[yo.kLargeViewportInlineSize=26]="kLargeViewportInlineSize",yo[yo.kLargeViewportBlockSize=27]="kLargeViewportBlockSize",yo[yo.kLargeViewportMin=28]="kLargeViewportMin",yo[yo.kLargeViewportMax=29]="kLargeViewportMax",yo[yo.kDynamicViewportWidth=30]="kDynamicViewportWidth",yo[yo.kDynamicViewportHeight=31]="kDynamicViewportHeight",yo[yo.kDynamicViewportInlineSize=32]="kDynamicViewportInlineSize",yo[yo.kDynamicViewportBlockSize=33]="kDynamicViewportBlockSize",yo[yo.kDynamicViewportMin=34]="kDynamicViewportMin",yo[yo.kDynamicViewportMax=35]="kDynamicViewportMax",yo[yo.kContainerWidth=36]="kContainerWidth",yo[yo.kContainerHeight=37]="kContainerHeight",yo[yo.kContainerInlineSize=38]="kContainerInlineSize",yo[yo.kContainerBlockSize=39]="kContainerBlockSize",yo[yo.kContainerMin=40]="kContainerMin",yo[yo.kContainerMax=41]="kContainerMax",yo[yo.kRems=42]="kRems",yo[yo.kChs=43]="kChs",yo[yo.kUserUnits=44]="kUserUnits",yo[yo.kDegrees=45]="kDegrees",yo[yo.kRadians=46]="kRadians",yo[yo.kGradians=47]="kGradians",yo[yo.kTurns=48]="kTurns",yo[yo.kMilliseconds=49]="kMilliseconds",yo[yo.kSeconds=50]="kSeconds",yo[yo.kHertz=51]="kHertz",yo[yo.kKilohertz=52]="kKilohertz",yo[yo.kDotsPerPixel=53]="kDotsPerPixel",yo[yo.kDotsPerInch=54]="kDotsPerInch",yo[yo.kDotsPerCentimeter=55]="kDotsPerCentimeter",yo[yo.kFraction=56]="kFraction",yo[yo.kInteger=57]="kInteger",yo[yo.kQuirkyEms=58]="kQuirkyEms",(vo=t.UnitCategory||(t.UnitCategory={}))[vo.kUNumber=0]="kUNumber",vo[vo.kUPercent=1]="kUPercent",vo[vo.kULength=2]="kULength",vo[vo.kUAngle=3]="kUAngle",vo[vo.kUTime=4]="kUTime",vo[vo.kUFrequency=5]="kUFrequency",vo[vo.kUResolution=6]="kUResolution",vo[vo.kUOther=7]="kUOther",(go=t.ValueRange||(t.ValueRange={}))[go.kAll=0]="kAll",go[go.kNonNegative=1]="kNonNegative",go[go.kInteger=2]="kInteger",go[go.kNonNegativeInteger=3]="kNonNegativeInteger",go[go.kPositiveInteger=4]="kPositiveInteger",(mo=t.Nested||(t.Nested={}))[mo.kYes=0]="kYes",mo[mo.kNo=1]="kNo",(To=t.ParenLess||(t.ParenLess={}))[To.kYes=0]="kYes",To[To.kNo=1]="kNo";var So,Eo=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];(So=t.CSSStyleValueType||(t.CSSStyleValueType={}))[So.kUnknownType=0]="kUnknownType",So[So.kUnparsedType=1]="kUnparsedType",So[So.kKeywordType=2]="kKeywordType",So[So.kUnitType=3]="kUnitType",So[So.kSumType=4]="kSumType",So[So.kProductType=5]="kProductType",So[So.kNegateType=6]="kNegateType",So[So.kInvertType=7]="kInvertType",So[So.kMinType=8]="kMinType",So[So.kMaxType=9]="kMaxType",So[So.kClampType=10]="kClampType",So[So.kTransformType=11]="kTransformType",So[So.kPositionType=12]="kPositionType",So[So.kURLImageType=13]="kURLImageType",So[So.kColorType=14]="kColorType",So[So.kUnsupportedColorType=15]="kUnsupportedColorType";var wo,xo,ko=function(){function e(){}e.parse=function(t,e){return[][0]},e.parseAll=function(t,e){return[]},e.unitFromName=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:this.stringToUnitType(e):t.UnitType.kUnknown},e.unitTypeToUnitCategory=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return t.UnitCategory.kUNumber;case t.UnitType.kPercentage:return t.UnitCategory.kUPercent;case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:return t.UnitCategory.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return t.UnitCategory.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return t.UnitCategory.kUAngle;case t.UnitType.kHertz:case t.UnitType.kKilohertz:return t.UnitCategory.kUFrequency;case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:return t.UnitCategory.kUResolution;default:return t.UnitCategory.kUOther}},e.unitTypeToString=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:case t.UnitType.kUserUnits:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:case t.UnitType.kQuirkyEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},e.stringToUnitType=function(t){return Eo.find((function(e){return e.name===t})).unit_type},e.canonicalUnitTypeForCategory=function(e){switch(e){case t.UnitCategory.kUNumber:return t.UnitType.kNumber;case t.UnitCategory.kULength:return t.UnitType.kPixels;case t.UnitCategory.kUPercent:return t.UnitType.kUnknown;case t.UnitCategory.kUTime:return t.UnitType.kSeconds;case t.UnitCategory.kUAngle:return t.UnitType.kDegrees;case t.UnitCategory.kUFrequency:return t.UnitType.kHertz;case t.UnitCategory.kUResolution:return t.UnitType.kDotsPerPixel;default:return t.UnitType.kUnknown}},e.conversionToCanonicalUnitsScaleFactor=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kUserUnits:case t.UnitType.kDegrees:case t.UnitType.kSeconds:case t.UnitType.kHertz:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kCentimeters:case t.UnitType.kDotsPerCentimeter:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kDotsPerInch:case t.UnitType.kPoints:case t.UnitType.kPicas:break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360;break;case t.UnitType.kKilohertz:n=1e3}return n},e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isViewportPercentageLength=function(e){return e>=t.UnitType.kViewportWidth&&t.UnitType.kDynamicViewportMax>=e},e.isContainerPercentageLength=function(e){return e>=t.UnitType.kContainerWidth&&t.UnitType.kContainerMax>=e},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kUserUnits>=e||e==t.UnitType.kQuirkyEms},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kExs||e===t.UnitType.kRems||e===t.UnitType.kChs||this.isViewportPercentageLength(e)||this.isContainerPercentageLength(e)},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds},e.isFrequency=function(e){return e==t.UnitType.kHertz||e==t.UnitType.kKilohertz},e.isResolution=function(e){return e>=t.UnitType.kDotsPerPixel&&t.UnitType.kDotsPerCentimeter>=e},e.isFlex=function(e){return e===t.UnitType.kFraction};var n=e.prototype;return n.toString=function(){return this.buildCSSText(t.Nested.kNo,t.ParenLess.kNo,"")},n.isNumericValue=function(){return this.getType()>=t.CSSStyleValueType.kUnitType&&this.getType()<=t.CSSStyleValueType.kClampType},e}(),Po=function(e){function n(t){var n;return(n=e.call(this)||this).colorSpace=void 0,n.colorSpace=t,n}ve(n,e);var r=n.prototype;return r.getType=function(){return t.CSSStyleValueType.kColorType},r.to=function(t){return this},n}(ko),Co=function(e){function n(t){var n;return(n=e.call(this)||this).value=void 0,n.value=t,n}ve(n,e);var r=n.prototype;return r.clone=function(){return new n(this.value)},r.getType=function(){return t.CSSStyleValueType.kKeywordType},r.buildCSSText=function(t,e,n){return n+this.value},n}(ko);function _o(e){switch(Re(e,t.UnitType.kNumber),e){case t.UnitType.kEms:case t.UnitType.kExs:case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:case t.UnitType.kViewportWidth:case t.UnitType.kViewportHeight:case t.UnitType.kViewportInlineSize:case t.UnitType.kViewportBlockSize:case t.UnitType.kViewportMin:case t.UnitType.kViewportMax:case t.UnitType.kSmallViewportWidth:case t.UnitType.kSmallViewportHeight:case t.UnitType.kSmallViewportInlineSize:case t.UnitType.kSmallViewportBlockSize:case t.UnitType.kSmallViewportMin:case t.UnitType.kSmallViewportMax:case t.UnitType.kLargeViewportWidth:case t.UnitType.kLargeViewportHeight:case t.UnitType.kLargeViewportInlineSize:case t.UnitType.kLargeViewportBlockSize:case t.UnitType.kLargeViewportMin:case t.UnitType.kLargeViewportMax:case t.UnitType.kDynamicViewportWidth:case t.UnitType.kDynamicViewportHeight:case t.UnitType.kDynamicViewportInlineSize:case t.UnitType.kDynamicViewportBlockSize:case t.UnitType.kDynamicViewportMin:case t.UnitType.kDynamicViewportMax:case t.UnitType.kContainerWidth:case t.UnitType.kContainerHeight:case t.UnitType.kContainerInlineSize:case t.UnitType.kContainerBlockSize:case t.UnitType.kContainerMin:case t.UnitType.kContainerMax:case t.UnitType.kRems:case t.UnitType.kChs:return t.BaseType.kLength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return t.BaseType.kTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return t.BaseType.kAngle;case t.UnitType.kHertz:case t.UnitType.kKilohertz:return t.BaseType.kFrequency;case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:return t.BaseType.kResolution;case t.UnitType.kFraction:return t.BaseType.kFlex;case t.UnitType.kPercentage:return t.BaseType.kPercent;default:return t.BaseType.kLength}}function No(e){switch(e){case t.BaseType.kLength:return"length";case t.BaseType.kAngle:return"angle";case t.BaseType.kTime:return"time";case t.BaseType.kFrequency:return"frequency";case t.BaseType.kResolution:return"resolution";case t.BaseType.kFlex:return"flex";case t.BaseType.kPercent:return"percent"}return""}(wo=t.CSSMathOperator||(t.CSSMathOperator={})).kAdd="+",wo.kSubtract="-",wo.kMultiply="*",wo.kDivide="/",wo.kMin="min",wo.kMax="max",wo.kClamp="clamp",wo.kInvalid="",(xo=t.BaseType||(t.BaseType={}))[xo.kLength=0]="kLength",xo[xo.kAngle=1]="kAngle",xo[xo.kTime=2]="kTime",xo[xo.kFrequency=3]="kFrequency",xo[xo.kResolution=4]="kResolution",xo[xo.kFlex=5]="kFlex",xo[xo.kPercent=6]="kPercent",xo[xo.kNumBaseTypes=7]="kNumBaseTypes";var Mo=function(){function e(e,n){void 0===e&&(e=t.UnitType.kNumber),void 0===n&&(n=1),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=t.BaseType.kPercent,this.hasPercentHint=!1,this.exponents=new Array(t.BaseType.kNumBaseTypes).fill(0),e!==t.UnitType.kNumber&&this.setExponent(_o(e),n)}var n=e.prototype;return n.applyPercentHint=function(e){Re(e,t.BaseType.kPercent),this.setExponent(e,this.exponent(e)+this.exponent(t.BaseType.kPercent)),this.setExponent(t.BaseType.kPercent,0),this.percentHint=e,this.hasPercentHint=!0},n.hasNonZeroEntries=function(){return this.numNonZeroEntries>0},n.isOnlyNonZeroEntry=function(t,e){return Re(e,0),1===this.numNonZeroEntries&&this.exponent(t)===e},n.exponent=function(t){return this.exponents[t]},n.setExponent=function(t,e){var n=this.exponents[t];0==n&&0!==e?this.numNonZeroEntries++:0!==n&&0==e&&this.numNonZeroEntries--,this.exponents[t]=e},e.negateExponents=function(t){return t.exponents.forEach((function(t){return-1*t})),t},n.matchesBaseType=function(e){return Re(e,t.BaseType.kPercent),this.isOnlyNonZeroEntry(e,1)&&!this.hasPercentHint},n.matchesPercentage=function(){return this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},n.matchesBaseTypePercentage=function(e){return Re(e,t.BaseType.kPercent),this.isOnlyNonZeroEntry(e,1)||this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},n.matchesNumber=function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint},n.matchesNumberPercentage=function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},e.add=function(e,n,r){if(e.hasPercentHint&&n.hasPercentHint&&e.percentHint!=n.percentHint)return e;e.hasPercentHint?n.applyPercentHint(e.percentHint):n.hasPercentHint&&e.applyPercentHint(n.percentHint),Ie(e.percentHint,n.percentHint);for(var i=0;t.BaseType.kNumBaseTypes>i;++i){var o=i;if(e.exponents[i]!==n.exponents[i]&&(o!==t.BaseType.kPercent&&(e.applyPercentHint(o),n.applyPercentHint(o)),e.exponents[i]!==n.exponents[i]))return e}return e},e.multiply=function(e,n,r){if(e.hasPercentHint&&n.hasPercentHint&&e.percentHint!=n.percentHint)return e;e.hasPercentHint?n.applyPercentHint(e.percentHint):n.hasPercentHint&&e.applyPercentHint(n.percentHint);for(var i=0;t.BaseType.kNumBaseTypes>i;++i){var o=i;e.setExponent(o,e.exponent(o)+n.exponent(o))}return e},e}(),Ao=function(e){function n(t){var n;return(n=e.call(this)||this).type_=void 0,n.type_=t,n}ve(n,e),n.fromNumberish=function(e){return"number"==typeof e?new Uo(e,t.UnitType.kNumber):e},n.fromPercentish=function(e){return"number"==typeof e?new Uo(100*e,t.UnitType.kPercentage):e};var r=n.prototype;return r.getType=function(){return t.CSSStyleValueType.kUnknownType},r.equals=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);return i.every((function(e){return t.equals(e)}))},r.add=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);Io(t.CSSStyleValueType.kSumType,i,this);var o=Lo(i,t.CSSMathOperator.kAdd);return o||Yo.create(i)},r.sub=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);i=i.map((function(t){return t.negate()})),Io(t.CSSStyleValueType.kSumType,i,this);var o=Lo(i,t.CSSMathOperator.kAdd);return o||Yo.create(i)},r.mul=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);Io(t.CSSStyleValueType.kProductType,i,this);var o=Do(i);return o||qo.create(i)},r.div=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);i=i.map((function(t){return t.invert()})),Io(t.CSSStyleValueType.kProductType,i,this);var o=Do(i);return o||qo.create(i)},r.min=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);Io(t.CSSStyleValueType.kMinType,i,this);var o=Lo(i,t.CSSMathOperator.kMin);return o||zo.create(i)},r.max=function(){for(var e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Oo(n);Io(t.CSSStyleValueType.kMaxType,i,this);var o=Lo(i,t.CSSMathOperator.kMax);return o||Wo.create(i)},r.to=function(t){var e=this.sumValue();if(0===e.length||1!==e.length)return null;var n,r=Ro(e[0]);return r?(n="string"==typeof t?Uo.unitFromName(t):t,r.convertTo(n)):null},r.toSum=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];for(var i=0,o=e;o.length>i;i++){var a=o[i];if(!n.isValidUnit(n.unitFromName(a)))return null}var s=this.sumValue();if(!s.length)return null;for(var u,c=[],l=we(s);!(u=l()).done;){var h=u.value,p=Ro(h);if(!p)return null;c.push(p)}if(0===e.length){c.sort((function(t,e){return t.unit-e.unit}));var f=Yo.create(c);return Oe(!!f),f}for(var d=[],y=function(){var t=n.unitFromName(g[v]);Oe(n.isValidUnit(t));var e=c.reduce((function(e,n,r){if(n){var i=n.convertTo(t);i&&(e+=i.value,c[r]=null)}return e}),0);d.push(new Uo(e,t))},v=0,g=e;g.length>v;v++)y();if(c.some((function(t){return!!t})))throw new Error("There were leftover terms that were not converted");return Yo.create(d)},r.type=function(){var e={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},n=this.type_.exponent(t.BaseType.kLength);return n&&(e.length=n),(n=this.type_.exponent(t.BaseType.kAngle))&&(e.angle=n),(n=this.type_.exponent(t.BaseType.kTime))&&(e.time=n),(n=this.type_.exponent(t.BaseType.kFrequency))&&(e.frequency=n),(n=this.type_.exponent(t.BaseType.kResolution))&&(e.resolution=n),(n=this.type_.exponent(t.BaseType.kFlex))&&(e.flex=n),(n=this.type_.exponent(t.BaseType.kPercent))&&(e.percent=n),this.type_.hasPercentHint&&(e.percentHint=No(this.type_.percentHint)),e},n.isValidUnit=function(e){return e!==t.UnitType.kUserUnits&&!!(e===t.UnitType.kNumber||e==t.UnitType.kPercentage||this.isLength(e)||this.isAngle(e)||this.isTime(e)||this.isFrequency(e)||this.isResolution(e)||this.isFlex(e))},r.negate=function(){return Vo.create(this)},r.invert=function(){return Bo.create(this)},n}(ko);function Oo(t){return t.map(Ao.fromNumberish)}function Io(t,e,n){Oe(!!n),n.getType()===t?e.unshift.apply(e,n.numericValues()):e.unshift(n)}function Ro(t){return 0===Object.keys(t.units).length?new Uo(t.value):1===Object.keys(t.units).length&&1===t.units[Object.keys(t.units)[0]]?new Uo(t.value,Number(Object.keys(t.units)[0])):null}function Lo(e,n){Oe(!!e.length);var r=e[0]instanceof Uo?e[0]:null;if(!r)return null;for(var i=r.value,o=1;e.length>o;o++){var a=e[o]instanceof Uo?e[o]:null;if(!a||a.unit!==r.unit)return null;n===t.CSSMathOperator.kAdd?i+=a.value:n===t.CSSMathOperator.kMax?i=Math.max(i,a.value):n===t.CSSMathOperator.kMin&&(i=Math.min(i,a.value))}return new Uo(i,r.unit)}function Do(e){Oe(!!e.length);for(var n=t.UnitType.kNumber,r=1,i=0;e.length>i;i++){var o=e[i]instanceof Uo?e[i]:null;if(!o)return null;if(o.unit!==t.UnitType.kNumber){if(n!==t.UnitType.kNumber)return null;n=o.unit}r*=o.value}return new Uo(r,n)}var Uo=function(e){function n(r,i){var o,a;return void 0===i&&(i=t.UnitType.kNumber),a="string"==typeof i?n.unitFromName(i):i,Oe(n.isValidUnit(a)),(o=e.call(this,new Mo(a))||this).unit=void 0,o.value=void 0,o.unit=a,o.value=r,o}ve(n,e),n.toCanonicalUnit=function(t){return this.canonicalUnitTypeForCategory(this.unitTypeToUnitCategory(t))},n.toCanonicalUnitIfPossible=function(e){var n=this.toCanonicalUnit(e);return n===t.UnitType.kUnknown?e:n},n.formatInfinityOrNaN=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(Oe(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},n.formatNumber=function(t,e){return void 0===e&&(e=""),t+e};var r=n.prototype;return r.clone=function(){return new n(this.value,this.unit)},r.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var r=n.toCanonicalUnit(this.unit);if(r!==n.toCanonicalUnit(e)||r===t.UnitType.kUnknown)return null;var i=ko.conversionToCanonicalUnitsScaleFactor(this.unit)/ko.conversionToCanonicalUnitsScaleFactor(e);return new n(this.value*i,e)},r.equals=function(t){return this.value===t.value&&this.unit===t.unit},r.getType=function(){return t.CSSStyleValueType.kUnitType},r.sumValue=function(){var e=[],r={};return this.unit!==t.UnitType.kNumber&&(r[n.toCanonicalUnitIfPossible(this.unit)]=1),e.push({value:this.value*ko.conversionToCanonicalUnitsScaleFactor(this.unit),units:r}),e},r.negate=function(){return new n(-this.value,this.unit)},r.invert=function(){return this.unit===t.UnitType.kNumber?0===this.value?null:new n(1/this.value,this.unit):Bo.create(this)},r.buildCSSText=function(e,r,i){var o;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:o=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kQuirkyEms:case t.UnitType.kExs:case t.UnitType.kRems:case t.UnitType.kChs:case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kHertz:case t.UnitType.kKilohertz:case t.UnitType.kTurns:case t.UnitType.kFraction:case t.UnitType.kViewportWidth:case t.UnitType.kViewportHeight:case t.UnitType.kViewportInlineSize:case t.UnitType.kViewportBlockSize:case t.UnitType.kViewportMin:case t.UnitType.kViewportMax:case t.UnitType.kSmallViewportWidth:case t.UnitType.kSmallViewportHeight:case t.UnitType.kSmallViewportInlineSize:case t.UnitType.kSmallViewportBlockSize:case t.UnitType.kSmallViewportMin:case t.UnitType.kSmallViewportMax:case t.UnitType.kLargeViewportWidth:case t.UnitType.kLargeViewportHeight:case t.UnitType.kLargeViewportInlineSize:case t.UnitType.kLargeViewportBlockSize:case t.UnitType.kLargeViewportMin:case t.UnitType.kLargeViewportMax:case t.UnitType.kDynamicViewportWidth:case t.UnitType.kDynamicViewportHeight:case t.UnitType.kDynamicViewportInlineSize:case t.UnitType.kDynamicViewportBlockSize:case t.UnitType.kDynamicViewportMin:case t.UnitType.kDynamicViewportMax:case t.UnitType.kContainerWidth:case t.UnitType.kContainerHeight:case t.UnitType.kContainerInlineSize:case t.UnitType.kContainerBlockSize:case t.UnitType.kContainerMin:case t.UnitType.kContainerMax:var a=this.value,s=n.unitTypeToString(this.unit);if(-999999>a||a>999999){var u=n.unitTypeToString(this.unit);o=!Number.isFinite(a)||Number.isNaN(a)?n.formatInfinityOrNaN(a,u):n.formatNumber(a,u)}else o=""+a+s}return i+=o},n}(Ao),Fo=function(t){function e(){return t.apply(this,arguments)||this}return ve(e,t),e.prototype.isUnitValue=function(){return!1},e}(Ao),Bo=function(e){function n(t,n){var r;return(r=e.call(this,n)||this).value=void 0,r.operator="invert",r.value=t,r}ve(n,e),n.create=function(t){return new n(t,Mo.negateExponents(t.type_))};var r=n.prototype;return r.clone=function(){return new n(this.value,this.type_)},r.getType=function(){return t.CSSStyleValueType.kInvertType},r.equals=function(e){return e.getType()===t.CSSStyleValueType.kInvertType&&this.value.equals(e.value)},r.sumValue=function(){var t=this.value.sumValue();return 0===t.length||1!==t.length||0===t[0].value?null:(Object.keys(t[0].units).forEach((function(e){t[0].units[e]*=-1})),t[0].value=1/t[0].value,t)},r.buildCSSText=function(e,n,r){return n==t.ParenLess.kNo&&(r+=e===t.Nested.kYes?"(":"calc("),r=this.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+="1 / "),n===t.ParenLess.kNo&&(r+=")"),r},n}(Fo),Vo=function(e){function n(t,n){var r;return(r=e.call(this,n)||this).value=void 0,r.operator="negate",r.value=t,r}ve(n,e),n.create=function(t){return new n(t,t.type_)};var r=n.prototype;return r.clone=function(){return new n(this.value,this.type_)},r.getType=function(){return t.CSSStyleValueType.kNegateType},r.equals=function(e){return e.getType()===t.CSSStyleValueType.kNegateType&&this.value.equals(e.value)},r.sumValue=function(){var t=this.value.sumValue();return 0===t.length?null:(t.forEach((function(t){t.value*=-1})),t)},r.buildCSSText=function(e,n,r){return n==t.ParenLess.kNo&&(r+=e===t.Nested.kYes?"(":"calc("),r=this.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+="-"),n===t.ParenLess.kNo&&(r+=")"),r},n}(Fo);function Go(t,e,n){for(var r=t[0].type_,i=1;t.length>i;i++)r=e(r,t[i].type_,false);return r}var jo,Ho=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).values=void 0,r.values=e,r}ve(e,t);var n=e.prototype;return n.numericValues=function(){return this.values},n.equals=function(t){return this.getType()===t.getType()&&this.values.every((function(e,n){return e.equals(t.values[n])}))},e}(Fo),zo=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).operator="min",t}ve(n,e),n.create=function(t){return new n(t,Go(t,Mo.add))};var r=n.prototype;return r.clone=function(){return new n(this.values,this.type_)},r.getType=function(){return t.CSSStyleValueType.kMinType},r.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=we(this.numericValues());!(e=n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}return t},r.buildCSSText=function(e,n,r){r+="min(";for(var i,o=!0,a=we(this.numericValues());!(i=a()).done;){o||(r+=", "),o=!1,r=i.value.buildCSSText(t.Nested.kYes,t.ParenLess.kYes,r)}return r+=")"},n}(Ho),Wo=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).operator="max",t}ve(n,e),n.create=function(t){return new n(t,Go(t,Mo.add))};var r=n.prototype;return r.clone=function(){return new n(this.values,this.type_)},r.getType=function(){return t.CSSStyleValueType.kMaxType},r.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=we(this.numericValues());!(e=n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}return t},r.buildCSSText=function(e,n,r){r+="max(";for(var i,o=!0,a=we(this.numericValues());!(i=a()).done;){o||(r+=", "),o=!1,r=i.value.buildCSSText(t.Nested.kYes,t.ParenLess.kYes,r)}return r+=")"},n}(Ho),Yo=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).operator="sum",t}ve(n,e),n.create=function(t){return new n(t,Go(t,Mo.add))},n.numericTypeFromUnitMap=function(t){var e=new Mo;return Object.keys(t).forEach((function(n){var r=t[n];e=Mo.multiply(e,new Mo(Number(n),r),false),Oe(!0)})),e},n.canCreateNumericTypeFromSumValue=function(t){var e=this;Oe(!!t.length);var n=this.numericTypeFromUnitMap(t[0].units);return t.every((function(t){return Mo.add(n,e.numericTypeFromUnitMap(t.units),false),!0}))};var r=n.prototype;return r.clone=function(){return new n(this.values,this.type_)},r.getType=function(){return t.CSSStyleValueType.kSumType},r.sumValue=function(){var t=[];return this.numericValues().forEach((function(e){var n=e.sumValue();if(!n.length)return null;n.forEach((function(e){var n=t.findIndex((function(t){return JSON.stringify(t.units)===JSON.stringify(e.units)}));-1===n?t.push(ye({},e)):t[n].value+=e.value}))})),n.canCreateNumericTypeFromSumValue(t)?t:null},r.buildCSSText=function(e,n,r){n==t.ParenLess.kNo&&(r+=e===t.Nested.kYes?"(":"calc(");var i=this.numericValues();r=i[0].buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r);for(var o=1;i.length>o;o++){var a=i[o];r=a.getType()===t.CSSStyleValueType.kNegateType?a.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+=" - "):a.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+=" + ")}return n===t.ParenLess.kNo&&(r+=")"),r},n}(Ho),qo=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).operator="product",t}ve(n,e),n.create=function(t){return new n(t,Go(t,Mo.multiply))},n.multiplyUnitMaps=function(t,e){return Object.keys(e).forEach((function(n){Re(e[n].value,0);var r=n in t?t[n].value:0;r+e[n].value===0?delete t[n]:t[n]=r+e[n].value})),t};var r=n.prototype;return r.clone=function(){return new n(this.values,this.type_)},r.getType=function(){return t.CSSStyleValueType.kProductType},r.sumValue=function(){var t=[{value:1,units:{}}];return this.numericValues().forEach((function(e){var r=e.sumValue();if(!r.length)return null;var i=[];t.forEach((function(t){r.forEach((function(e){i.push({value:t.value*e.value,units:n.multiplyUnitMaps(t.units,e.units)})}))})),t=i})),t},r.buildCSSText=function(e,n,r){n==t.ParenLess.kNo&&(r+=e===t.Nested.kYes?"(":"calc(");var i=this.numericValues();r=i[0].buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r);for(var o=1;i.length>o;o++){var a=i[o];r=a.getType()===t.CSSStyleValueType.kInvertType?a.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+=" / "):a.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,r+=" * ")}return n===t.ParenLess.kNo&&(r+=")"),r},n}(Ho),Xo=new Uo(0,"px"),Ko=new Uo(0,"deg"),Zo=function(t){function e(e,n,r,i,o){var a;return void 0===i&&(i=1),void 0===o&&(o=!1),(a=t.call(this,"rgb")||this).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}ve(e,t);var n=e.prototype;return n.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},n.buildCSSText=function(t,e,n){return n+"rgba("+this.r+","+this.g+","+this.b+","+this.alpha+")"},e}(Po);(jo=t.GradientType||(t.GradientType={}))[jo.Constant=0]="Constant",jo[jo.LinearGradient=1]="LinearGradient",jo[jo.RadialGradient=2]="RadialGradient";var Jo=function(e){function n(t,n){var r;return(r=e.call(this)||this).type=void 0,r.value=void 0,r.type=t,r.value=n,r}ve(n,e);var r=n.prototype;return r.clone=function(){return new n(this.type,this.value)},r.buildCSSText=function(t,e,n){return n},r.getType=function(){return t.CSSStyleValueType.kColorType},n}(ko);function Qo(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function $o(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ta(){}var ea=.7,na=1/ea,ra="\\s*([+-]?\\d+)\\s*",ia="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",oa="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",aa=/^#([0-9a-f]{3,8})$/,sa=new RegExp("^rgb\\("+[ra,ra,ra]+"\\)$"),ua=new RegExp("^rgb\\("+[oa,oa,oa]+"\\)$"),ca=new RegExp("^rgba\\("+[ra,ra,ra,ia]+"\\)$"),la=new RegExp("^rgba\\("+[oa,oa,oa,ia]+"\\)$"),ha=new RegExp("^hsl\\("+[ia,oa,oa]+"\\)$"),pa=new RegExp("^hsla\\("+[ia,oa,oa,ia]+"\\)$"),fa={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function da(){return this.rgb().formatHex()}function ya(){return this.rgb().formatRgb()}function va(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=aa.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ga(e):3===n?new ba(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ma(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ma(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=sa.exec(t))?new ba(e[1],e[2],e[3],1):(e=ua.exec(t))?new ba(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ca.exec(t))?ma(e[1],e[2],e[3],e[4]):(e=la.exec(t))?ma(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ha.exec(t))?xa(e[1],e[2]/100,e[3]/100,1):(e=pa.exec(t))?xa(e[1],e[2]/100,e[3]/100,e[4]):fa.hasOwnProperty(t)?ga(fa[t]):"transparent"===t?new ba(NaN,NaN,NaN,0):null}function ga(t){return new ba(t>>16&255,t>>8&255,255&t,1)}function ma(t,e,n,r){return r>0||(t=e=n=NaN),new ba(t,e,n,r)}function Ta(t){return t instanceof ta||(t=va(t)),t?new ba((t=t.rgb()).r,t.g,t.b,t.opacity):new ba}function ba(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Sa(){return"#"+wa(this.r)+wa(this.g)+wa(this.b)}function Ea(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function wa(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function xa(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Pa(t,e,n,r)}function ka(t){if(t instanceof Pa)return new Pa(t.h,t.s,t.l,t.opacity);if(t instanceof ta||(t=va(t)),!t)return new Pa;if(t instanceof Pa)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new Pa(a,s,u,t.opacity)}function Pa(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ca(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}Qo(ta,va,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:da,formatHex:da,formatHsl:function(){return ka(this).formatHsl()},formatRgb:ya,toString:ya}),Qo(ba,(function(t,e,n,r){return 1===arguments.length?Ta(t):new ba(t,e,n,null==r?1:r)}),$o(ta,{brighter:function(t){return t=null==t?na:Math.pow(na,t),new ba(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?ea:Math.pow(ea,t),new ba(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:Sa,formatHex:Sa,formatRgb:Ea,toString:Ea})),Qo(Pa,(function(t,e,n,r){return 1===arguments.length?ka(t):new Pa(t,e,n,null==r?1:r)}),$o(ta,{brighter:function(t){return t=null==t?na:Math.pow(na,t),new Pa(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?ea:Math.pow(ea,t),new Pa(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(.5>n?n:1-n)*e,i=2*n-r;return new ba(Ca(240>t?t+120:t-240,i,r),Ca(t,i,r),Ca(120>t?t+240:t-120,i,r),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var _a="__lodash_hash_undefined__",Na="[object Function]",Ma="[object GeneratorFunction]",Aa=/^\[object .+?Constructor\]$/,Oa="object"==typeof self&&self&&self.Object===Object&&self,Ia="object"==typeof e&&e&&e.Object===Object&&e||Oa||Function("return this")();var Ra,La=Array.prototype,Da=Function.prototype,Ua=Object.prototype,Fa=Ia["__core-js_shared__"],Ba=(Ra=/[^.]+$/.exec(Fa&&Fa.keys&&Fa.keys.IE_PROTO||""))?"Symbol(src)_1."+Ra:"",Va=Da.toString,Ga=Ua.hasOwnProperty,ja=Ua.toString,Ha=RegExp("^"+Va.call(Ga).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),za=La.splice,Wa=$a(Ia,"Map"),Ya=$a(Object,"create");function qa(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Xa(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ka(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Za(t,e){for(var n,r,i=t.length;i--;)if((n=t[i][0])===(r=e)||n!=n&&r!=r)return i;return-1}function Ja(t){if(!es(t)||(e=t,Ba&&Ba in e))return!1;var e,n=function(t){var e=es(t)?ja.call(t):"";return e==Na||e==Ma}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?Ha:Aa;return n.test(function(t){if(null!=t){try{return Va.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function Qa(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function $a(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Ja(n)?n:void 0}function ts(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new(ts.Cache||Ka),n}function es(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}qa.prototype.clear=function(){this.__data__=Ya?Ya(null):{}},qa.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},qa.prototype.get=function(t){var e=this.__data__;if(Ya){var n=e[t];return n===_a?void 0:n}return Ga.call(e,t)?e[t]:void 0},qa.prototype.has=function(t){var e=this.__data__;return Ya?void 0!==e[t]:Ga.call(e,t)},qa.prototype.set=function(t,e){return this.__data__[t]=Ya&&void 0===e?_a:e,this},Xa.prototype.clear=function(){this.__data__=[]},Xa.prototype.delete=function(t){var e=this.__data__,n=Za(e,t);return n>=0&&(n==e.length-1?e.pop():za.call(e,n,1),!0)},Xa.prototype.get=function(t){var e=this.__data__,n=Za(e,t);return 0>n?void 0:e[n][1]},Xa.prototype.has=function(t){return Za(this.__data__,t)>-1},Xa.prototype.set=function(t,e){var n=this.__data__,r=Za(n,t);return 0>r?n.push([t,e]):n[r][1]=e,this},Ka.prototype.clear=function(){this.__data__={hash:new qa,map:new(Wa||Xa),string:new qa}},Ka.prototype.delete=function(t){return Qa(this,t).delete(t)},Ka.prototype.get=function(t){return Qa(this,t).get(t)},Ka.prototype.has=function(t){return Qa(this,t).has(t)},Ka.prototype.set=function(t,e){return Qa(this,t).set(t,e),this},ts.Cache=Ka;var ns=ts,rs=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,is=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,os=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,as=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var ss={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},us=ns((function(t){return"angular"===t.type?Number(t.value):ss[t.value]||0})),cs=ns((function(t){var e=.5,n=.5;if("position"===(null==t?void 0:t.type)){var r=t.value,i=r.x,o=r.y;"position-keyword"===(null==i?void 0:i.type)&&("left"===i.value?e=0:"center"===i.value?e=.5:"right"===i.value?e=1:"top"===i.value?n=0:"bottom"===i.value&&(n=1)),"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?n=.5:"right"===o.value?e=1:"top"===o.value?n=0:"bottom"===o.value&&(n=1)),"%"===(null==i?void 0:i.type)&&(e=Number(i.value)/100),"%"===(null==o?void 0:o.type)&&(n=Number(i.value)/100)}return{cx:e,cy:n}})),ls=ns((function(e){if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return Vr(e).map((function(n){var r=n.type,i=n.orientation,o=n.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,o=Number(t[0].length.value),a=1;r>a;a++){var s,u=null===(s=t[a].length)||void 0===s?void 0:s.value;if(!De(u)&&!De(o)){for(var c=1;a-i>c;c++)t[i+c].length={type:"%",value:""+(o+(Number(u)-o)*c/(a-i))};i=a,o=Number(u)}}}(o);var a=o.map((function(t){return[Number(t.length.value)/100,Fr(t)]}));if("linear-gradient"===r)return new Jo(t.GradientType.LinearGradient,{angle:i?us(i):0,steps:a,hash:e});if("radial-gradient"===r&&(i||(i=[{type:"shape",value:"circle"}]),"shape"===i[0].type&&"circle"===i[0].value)){var s=cs(i[0].at);return new Jo(t.GradientType.RadialGradient,{cx:s.cx,cy:s.cy,steps:a,hash:e})}}));var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=rs.exec(e);if(r){var i,o=(null===(i=r[2].match(as))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new Jo(t.GradientType.LinearGradient,{angle:parseFloat(r[1]),steps:o.map((function(t){var e=t[1];return[Number(t[0]),e]})),hash:e})]}}else if("r"===n){var a=function(t){var e=is.exec(t);if(e){var n;return{cx:.5,cy:.5,steps:((null===(n=e[4].match(as))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[]).map((function(t){var e=t[1];return[Number(t[0]),e]})),hash:t}}return null}(e);if(a){if(!$r(a))return[new Jo(t.GradientType.RadialGradient,a)];e=a}}else if("p"===n)return function(t){var e=os.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(e)}));function hs(t){return Ve(t)&&!!t.image}var ps=ns((function(t){if(hs(t))return ye({repetition:"repeat"},t);if(De(t)&&(t=""),"transparent"===t)return new Zo(0,0,0,0);"currentColor"===t&&(t="black");var e=ls(t);if(e)return e;var n=va(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Te(Zo,r)}));function fs(t,e){if(t instanceof Zo&&e instanceof Zo)return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(nr(e[n],0,255));return e[3]=nr(e[3],0,1),"rgba("+e.join(",")+")"}]}var ds,ys=function(){function t(t,e){this.center=void 0,this.halfExtents=void 0,this.min=vn(),this.max=vn(),this.update(t,e)}t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]};var e=t.prototype;return e.update=function(t,e){this.center=bn(vn(),t||vn()),this.halfExtents=bn(vn(),e||Tn(0,0,0)),this.min=Rn(this.min,this.center,this.halfExtents),this.max=En(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){En(this.center,e,t),kn(this.center,this.center,.5),Rn(this.halfExtents,e,t),kn(this.halfExtents,this.halfExtents,.5),bn(this.min,t),bn(this.max,e)},e.getMin=function(){return this.min},e.getMax=function(){return this.max},e.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=r-s,h=r+s,p=i-u,f=i+u,d=o-c,y=o+c,v=e.center,g=v[0],m=v[1],T=v[2],b=e.halfExtents,S=b[0],E=b[1],w=b[2],x=g-S,k=g+S,P=m-E,C=m+E,_=T-w,N=T+w;l>x&&(l=x),k>h&&(h=k),p>P&&(p=P),C>f&&(f=C),d>_&&(d=_),N>y&&(y=N),n[0]=.5*(l+h),n[1]=.5*(p+f),n[2]=.5*(d+y),a[0]=.5*(h-l),a[1]=.5*(f-p),a[2]=.5*(y-d),this.min[0]=l,this.min[1]=p,this.min[2]=d,this.max[0]=h,this.max[1]=f,this.max[2]=y}},e.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],c=e[1],l=e[5],h=e[9],p=e[2],f=e[6],d=e[10],y=Math.abs(a),v=Math.abs(s),g=Math.abs(u),m=Math.abs(c),T=Math.abs(l),b=Math.abs(h),S=Math.abs(p),E=Math.abs(f),w=Math.abs(d);Sn(n,e[12]+a*i[0]+s*i[1]+u*i[2],e[13]+c*i[0]+l*i[1]+h*i[2],e[14]+p*i[0]+f*i[1]+d*i[2]),Sn(r,y*o[0]+v*o[1]+g*o[2],m*o[0]+T*o[1]+b*o[2],S*o[0]+E*o[1]+w*o[2]),this.min=Rn(this.min,n,r),this.max=En(this.max,n,r)},e.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])},e.intersection=function(e){if(!this.intersects(e))return null;var n,r,i,o=new t,a=(n=vn(),r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}(vn(),this.getMax(),e.getMax());return o.setMinMax(a,s),o},e.containsPoint=function(t){var e=this.getMin(),n=this.getMax();return!(e[0]>t[0]||t[0]>n[0]||e[1]>t[1]||t[1]>n[1]||e[2]>t[2]||t[2]>n[2])},e.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?bn(vn(),this.min):272===t.pnVertexFlag?Tn(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?Tn(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?Tn(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?Tn(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?Tn(this.max[0],this.min[1],this.max[2]):Tn(this.max[0],this.max[1],1===t.pnVertexFlag?this.min[2]:this.max[2])},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?bn(vn(),this.max):272===t.pnVertexFlag?Tn(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?Tn(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?Tn(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?Tn(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?Tn(this.min[0],this.max[1],this.min[2]):Tn(this.min[0],this.min[1],1===t.pnVertexFlag?this.max[2]:this.min[2])},t}(),vs=vn(),gs=function(){function t(t,e){this.center=void 0,this.radius=void 0,this.center=t||vn(),this.radius=e||.5}var e=t.prototype;return e.containsPoint=function(t){return Rn(vs,t,this.center),mn(vs)<this.radius*this.radius},e.intersects=function(t){Rn(vs,t.center,this.center);var e=t.radius+this.radius;return mn(vs)<=e*e},t}(),ms=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||Tn(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},e.distanceToPoint=function(t){return _n(t,this.normal)-this.distance},e.normalize=function(){var t=1/Un(this.normal);kn(this.normal,this.normal,t),this.distance*=t},e.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&1>=i;return o&&n&&Mn(n,t,e,i),o},t}();(ds=t.Mask||(t.Mask={}))[ds.OUTSIDE=4294967295]="OUTSIDE",ds[ds.INSIDE=0]="INSIDE",ds[ds.INDETERMINATE=2147483647]="INDETERMINATE";var Ts=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new ms)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],p=t[11],f=t[12],d=t[13],y=t[14],v=t[15];Sn(this.planes[0].normal,i-e,u-o,p-c),this.planes[0].distance=v-f,Sn(this.planes[1].normal,i+e,u+o,p+c),this.planes[1].distance=v+f,Sn(this.planes[2].normal,i+n,u+a,p+l),this.planes[2].distance=v+d,Sn(this.planes[3].normal,i-n,u-a,p-l),this.planes[3].distance=v-d,Sn(this.planes[4].normal,i-r,u-s,p-h),this.planes[4].distance=v-y,Sn(this.planes[5].normal,i+r,u+s,p+h),this.planes[5].distance=v+y,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),bs=vn(),Ss=vn(),Es=vn(),ws=vn(),xs=vn(),ks=function(){function t(t,e){this.origin=void 0,this.direction=void 0,this.origin=t||vn(),this.direction=e||Tn(0,0,-1)}var e=t.prototype;return e.intersectsAABB=function(t,e){return e?this.intersectAABBWithIntersection(t,e):this.intersectsAABBWithoutIntersection(t)},e.intersectsSphere=function(t,e){var n=Rn(bs,this.origin,t.center);Cn(Ss,bn(Ss,this.direction));var r=_n(n,Ss),i=_n(n,n)-t.radius*t.radius;if(i>0&&r>0)return null;var o=r*r-i;if(0>o)return!1;var a=Math.abs(-r-Math.sqrt(o));return e&&(bn(e,this.direction),Pn(e,this.origin,e,a)),!0},e.intersectsPlane=function(t,e){var n=(t.distance-_n(t.normal,this.origin))/_n(t.normal,this.direction),r=n>=0;return r&&e&&Pn(e,this.origin,this.direction,n),r},e.intersectsAABBWithoutIntersection=function(t){var e=bs,n=Ss,r=Es,i=ws,o=xs,a=this.direction;return Rn(e,this.origin,t.center),Sn(i,Math.abs(e[0]),Math.abs(e[1]),Math.abs(e[2])),Ln(r,e,a),!(i[0]>t.halfExtents[0]&&r[0]>=0||i[1]>t.halfExtents[1]&&r[1]>=0||i[2]>t.halfExtents[2]&&r[2]>=0)&&(Sn(o,Math.abs(a[0]),Math.abs(a[1]),Math.abs(a[2])),Nn(n,a,e),Sn(n,Math.abs(n[0]),Math.abs(n[1]),Math.abs(n[2])),!(n[0]>t.halfExtents[1]*o[2]+t.halfExtents[2]*o[1]||n[1]>t.halfExtents[0]*o[2]+t.halfExtents[2]*o[0]||n[2]>t.halfExtents[0]*o[1]+t.halfExtents[1]*o[0]))},e.intersectAABBWithIntersection=function(t,e){var n=bn(vn(),t.getMin());Rn(n,n,this.origin);var r=bn(vn(),t.getMax());Rn(r,r,this.origin);var i=this.direction;0===i[0]?(n[0]=0>n[0]?-Number.MAX_VALUE:Number.MAX_VALUE,r[0]=0>r[0]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[0]/=i[0],r[0]/=i[0]),0===i[1]?(n[1]=0>n[1]?-Number.MAX_VALUE:Number.MAX_VALUE,r[1]=0>r[1]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[1]/=i[1],r[1]/=i[1]),0===i[2]?(n[2]=0>n[2]?-Number.MAX_VALUE:Number.MAX_VALUE,r[2]=0>r[2]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[2]/=i[2],r[2]/=i[2]);var o=Sn(Es,Math.min(n[0],r[0]),Math.min(n[1],r[1]),Math.min(n[2],r[2])),a=Sn(ws,Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.max(n[2],r[2])),s=Math.min(Math.min(a[0],a[1]),a[2]),u=Math.max(Math.max(o[0],o[1]),o[2]),c=s>=u&&u>=0;return c&&(bn(e,this.direction),Pn(e,this.origin,e,u)),c},t}(),Ps=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Cs=function(){function t(t,e,n,r){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}();function _s(t,e){if(De(e))return new Uo(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return new Uo(Number(e),"px");if("deg".search(t)>=0)return new Uo(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return new Uo(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}function Ns(t){return _s(new RegExp("px","g"),t)}function Ms(t){return _s(new RegExp("px|%|em|rem","g"),t)}function As(t){return _s(new RegExp("deg|rad|grad|turn","g"),t)}function Os(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0;return(Uo.isLength(t.unit)||Uo.isLength(e.unit))&&(a=Ds(t,i,n),s=Ds(e,i,n),o="px"),(Uo.isAngle(t.unit)||Uo.isAngle(e.unit))&&(a=Is(t),s=Is(e),o="deg"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Is(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=or(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=ar(Number(e.value))),n}function Rs(t){return $r(t)?t.split(" ").map((function(t){return Ms(t)})):t.map((function(t){return Ms(t.toString())}))}function Ls(t,e,n){if(t.length===e.length){var r=t[0].unit;return[t.map((function(t){return t.value})),e.map((function(t){return t.value})),function(t){return t.map((function(t){return new Uo(t,r)})).join(" ")}]}}function Ds(e,n,r){if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var i=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.getGeometryBounds(),o=0;return ys.isEmpty(i)||(o=2*i.halfExtents[n]),Number(e.value)/100*o}return 0}function Us(t){return t.toString()}function Fs(t){return"number"==typeof t?new Uo(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?new Uo(Number(t)):new Uo(0)}function Bs(t,e){return[t.value,e.value,Us]}function Vs(t,e){return function(n,r){return[n.value,r.value,function(n){return Us(nr(n,t,e))}]}}var Gs=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,js=/[^\s,]+/gi;var Hs=new RegExp("([a-z])[\\s,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\\s]*,?[\\s]*)+)","ig"),zs=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[\\s]*,?[\\s]*","ig");var Ws=/[a-z]/;function Ys(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function qs(t){var e=function(t){if("string"==typeof t){if(t){var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return t.replace(Hs,(function(t,r,i){var o=[],a=r.toLowerCase();if(i.replace(zs,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=e[a]&&(n.push([r].concat(o.splice(0,e[a]))),e[a]););return""})),n}return null}if(Array.isArray(t))return t}(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,r=0;e.length>r;r++){if(Ws.test(p=e[r][0])||["V","H","T","S"].indexOf(p)>=0){n=!0;break}}if(!n)return e;var i=[],o=0,a=0,s=0,u=0,c=0,l=e[0];"M"!==l[0]&&"m"!==l[0]||(s=o=+l[1],u=a=+l[2],c++,i[0]=["M",o,a]);r=c;for(var h=e.length;h>r;r++){var p,f=e[r],d=i[r-1],y=[],v=(p=f[0]).toUpperCase();if(p!==v)switch(y[0]=v,v){case"A":y[1]=f[1],y[2]=f[2],y[3]=f[3],y[4]=f[4],y[5]=f[5],y[6]=+f[6]+o,y[7]=+f[7]+a;break;case"V":y[1]=+f[1]+a;break;case"H":y[1]=+f[1]+o;break;case"M":u=+f[2]+a,y[1]=s=+f[1]+o,y[2]=u;break;default:for(var g=1,m=f.length;m>g;g++)y[g]=+f[g]+(g%2?o:a)}else y=e[r];switch(v){case"Z":o=+s,a=+u;break;case"H":y=["L",o=y[1],a];break;case"V":y=["L",o,a=y[1]];break;case"T":o=y[1],a=y[2];var T=Ys([d[1],d[2]],[d[3],d[4]]);y=["Q",T[0],T[1],o,a];break;case"S":o=y[y.length-2],a=y[y.length-1];var b=d.length,S=Ys([d[b-4],d[b-3]],[d[b-2],d[b-1]]);y=["C",S[0],S[1],y[1],y[2],o,a];break;case"M":s=y[y.length-2],u=y[y.length-1];break;default:o=y[y.length-2],a=y[y.length-1]}i.push(y)}return i}var Xs=2*Math.PI,Ks=function(t,e,n,r,i,o,a){var s=t.x,u=t.y;return{x:r*(s*=e)-i*(u*=n)+o,y:i*s+r*u+a}},Zs=function(t,e){var n=1.5707963267948966===e?.551915024494:-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),r=Math.cos(t),i=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[{x:r-i*n,y:i+r*n},{x:o+a*n,y:a-o*n},{x:o,y:a}]},Js=function(t,e,n,r){var i=t*n+e*r;return i>1&&(i=1),-1>i&&(i=-1),(0>t*r-e*n?-1:1)*Math.acos(i)},Qs=function(t){var e=t.px,n=t.py,r=t.cx,i=t.cy,o=t.rx,a=t.ry,s=t.xAxisRotation,u=void 0===s?0:s,c=t.largeArcFlag,l=void 0===c?0:c,h=t.sweepFlag,p=void 0===h?0:h,f=[];if(0===o||0===a)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:i}];var d=Math.sin(u*Xs/360),y=Math.cos(u*Xs/360),v=y*(e-r)/2+d*(n-i)/2,g=-d*(e-r)/2+y*(n-i)/2;if(0===v&&0===g)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:i}];o=Math.abs(o),a=Math.abs(a);var m=Math.pow(v,2)/Math.pow(o,2)+Math.pow(g,2)/Math.pow(a,2);m>1&&(o*=Math.sqrt(m),a*=Math.sqrt(m));var T=function(t,e,n,r,i,o,a,s,u,c,l,h){var p=Math.pow(i,2),f=Math.pow(o,2),d=Math.pow(l,2),y=Math.pow(h,2),v=p*f-p*y-f*d;0>v&&(v=0),v/=p*y+f*d;var g=(v=Math.sqrt(v)*(a===s?-1:1))*i/o*h,m=v*-o/i*l,T=c*g-u*m+(t+n)/2,b=u*g+c*m+(e+r)/2,S=(l-g)/i,E=(h-m)/o,w=(-l-g)/i,x=(-h-m)/o,k=Js(1,0,S,E),P=Js(S,E,w,x);return 0===s&&P>0&&(P-=Xs),1===s&&0>P&&(P+=Xs),[T,b,k,P]}(e,n,r,i,o,a,l,p,d,y,v,g),b=T[0],S=T[1],E=T[2],w=T[3],x=Math.abs(w)/(Xs/4);1e-7>Math.abs(1-x)&&(x=1);var k=Math.max(Math.ceil(x),1);w/=k;for(var P=0;k>P;P++)f.push(Zs(E,w)),E+=w;return f.map((function(t){var e=Ks(t[0],o,a,y,d,b,S),n=e.x,r=e.y,i=Ks(t[1],o,a,y,d,b,S),s=i.x,u=i.y,c=Ks(t[2],o,a,y,d,b,S);return{x1:n,y1:r,x2:s,y2:u,x:c.x,y:c.y}}))};function $s(t,e,n,r,i,o,a,s,u){return Qs({px:t,py:e,cx:s,cy:u,rx:n,ry:r,xAxisRotation:i,largeArcFlag:o,sweepFlag:a}).reduce((function(t,e){return t.push(e.x1,e.y1,e.x2,e.y2,e.x,e.y),t}),[])}function tu(t,e,n,r,i,o){var a=1/3,s=2/3;return[a*t+s*n,a*e+s*r,a*i+s*n,a*o+s*r,i,o]}function eu(t,e,n,r){return[t,e,n,r,n,r]}function nu(t,e){0>"TQ".indexOf(t[0])&&(e.qx=null,e.qy=null);var n=t.slice(1),r=n[0],i=n[1];switch(t[0]){case"M":return e.x=r,e.y=i,t;case"A":return["C"].concat($s.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=r,e.qy=i,["C"].concat(tu.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(eu(e.x1,e.y1,t[1],t[2]));case"H":return["C"].concat(eu(e.x1,e.y1,t[1],e.y1));case"V":return["C"].concat(eu(e.x1,e.y1,e.x1,t[1]));case"Z":return["C"].concat(eu(e.x1,e.y1,e.x,e.y))}return t}function ru(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var iu=Math.PI/180;function ou(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function au(t,e){return ou(t)*ou(e)?(t[0]*e[0]+t[1]*e[1])/(ou(t)*ou(e)):1}function su(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(au(t,e))}function uu(t,e){return t[0]===e[0]&&t[1]===e[1]}function cu(t,e){var n,r=e[1],i=e[2],o=(n=2*Math.PI,(iu*e[3]%n+n)%n),a=e[4],s=e[5],u=t[0],c=t[1],l=e[6],h=e[7],p=Math.cos(o)*(u-l)/2+Math.sin(o)*(c-h)/2,f=-1*Math.sin(o)*(u-l)/2+Math.cos(o)*(c-h)/2,d=p*p/(r*r)+f*f/(i*i);d>1&&(r*=Math.sqrt(d),i*=Math.sqrt(d));var y=r*r*(f*f)+i*i*(p*p),v=y?Math.sqrt((r*r*(i*i)-y)/y):1;a===s&&(v*=-1),isNaN(v)&&(v=0);var g=i?v*r*f/i:0,m=r?v*-i*p/r:0,T=(u+l)/2+Math.cos(o)*g-Math.sin(o)*m,b=(c+h)/2+Math.sin(o)*g+Math.cos(o)*m,S=[(p-g)/r,(f-m)/i],E=[(-1*p-g)/r,(-1*f-m)/i],w=su([1,0],S),x=su(S,E);return au(S,E)>-1||(x=Math.PI),1>au(S,E)||(x=0),0===s&&x>0&&(x-=2*Math.PI),1===s&&0>x&&(x+=2*Math.PI),{cx:T,cy:b,rx:uu(t,[l,h])?0:r,ry:uu(t,[l,h])?0:i,startAngle:w,endAngle:w+x,xRotation:o,arcFlag:a,sweepFlag:s}}function lu(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function hu(t){t=function(t){var e=t||[];return Array.isArray(e)?e:"string"==typeof e?((e=e.match(Gs)).forEach((function(t,n){if((t=t.match(js))[0].length>1){var r=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=r}t.forEach((function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0}(t);for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];r=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=cu(n,u);l.arcParams=h}if("Z"===c)n=i,r=t[o+1];else{var p=u.length;n=[u[p-2],u[p-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&uu(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var f=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]];else if("Q"===c){l.startTangent=[f[0]-(d=[u[1],u[2]])[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]}else if("T"===c){var d=lu((v=e[s-1]).currentPoint,f);"Q"===v.command?(l.command="Q",l.startTangent=[f[0]-d[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]):(l.command="TL",l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]])}else if("C"===c){var y=[u[3],u[4]];l.startTangent=[f[0]-(g=[u[1],u[2]])[0],f[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[g[0]-y[0],g[1]-y[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[y[0]-g[0],y[1]-g[1]])}else if("S"===c){var v,g=lu((v=e[s-1]).currentPoint,f);y=[u[1],u[2]];"C"===v.command?(l.command="C",l.startTangent=[f[0]-g[0],f[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]]):(l.command="SQ",l.startTangent=[f[0]-y[0],f[1]-y[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===c){var m=.001,T=l.arcParams||{},b=T.cx,S=void 0===b?0:b,E=T.cy,w=void 0===E?0:E,x=T.rx,k=void 0===x?0:x,P=T.ry,C=void 0===P?0:P,_=T.sweepFlag,N=T.startAngle,M=void 0===N?0:N,A=T.endAngle,O=void 0===A?0:A;0===(void 0===_?0:_)&&(m*=-1);var I=k*Math.cos(M-m)+S,R=C*Math.sin(M-m)+w;l.startTangent=[I-i[0],R-i[1]];var L=k*Math.cos(M+O+m)+S,D=C*Math.sin(M+O-m)+w;l.endTangent=[f[0]-L,f[1]-D]}e.push(l)}return e}function pu(t,e){var n=qs(t),r=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(n),i=n.slice(),o=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}r.length>0&&n.push(r);return{polygons:e,polylines:n}}(i),a=o.polygons,s=o.polylines,u=function(t,e){void 0===e&&(e=!1);for(var n,r,i=qs(t),o={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",u=i.length,c=[],l=0;u>l;l+=1)i[l]&&(s=i[l][0]),a[l]=s,i[l]=nu(i[l],o),ru(i,a,l),u=i.length,"Z"===s&&c.push(l),o.x1=+(n=i[l])[(r=n.length)-2],o.y1=+n[r-1],o.x2=+n[r-4]||o.x1,o.y2=+n[r-3]||o.y1;return e?[i,c]:i}(i,!0),c=u[0],l=u[1],h=hu(i),p=function(t){var e,n,r,i,o=0,a=0,s=[];if(!t)return{curveSegments:[],totalLength:o};if(t.forEach((function(e,n){i=e.length,(r=t[n+1])&&(o+=vi.length(e[i-2],e[i-1],r[1],r[2],r[3],r[4],r[5],r[6])||0)})),0===o)return{curveSegments:[],totalLength:o};return t.forEach((function(u,c){i=u.length,(r=t[c+1])&&((e=[])[0]=a/o,n=vi.length(u[i-2],u[i-1],r[1],r[2],r[3],r[4],r[5],r[6]),e[1]=(a+=n||0)/o,s.push(e))})),{curveSegments:s,totalLength:o}}(c),f=p.totalLength,d=p.curveSegments,y=function(t){var e=0,n=0,r=[],i=[];t.forEach((function(t){var o=t.slice(-2),a=o[0],s=o[1];if("M"===t[0])e=a,n=s,r.push(a),i.push(s);else if("C"===t[0]){var u=vi.box.apply(vi,[e,n].concat(t.slice(1)));r=r.concat(u.x,u.x+u.width),i=i.concat(u.y,u.y+u.height),e=a,n=s}}));var o=Math.min.apply(0,r),a=Math.min.apply(0,i),s=Math.max.apply(0,r),u=Math.max.apply(0,i);return new Cs(o,a,s-o,u-a)}(c);return e&&(e.parsedStyle.defX=y.x,e.parsedStyle.defY=y.y),{absolutePath:n,hasArc:r,segments:h,polygons:a,polylines:s,curve:c,totalLength:f,curveSegments:d,zCommandIndexes:l,rect:y}}function fu(t,e,n){var r=t.curve,i=e.curve,o=[r,i];r.length!==i.length&&(o=Ei(r,i));var a=wi(o[0])!==wi(o[1])?Pi(o[0]):Ci(o[0]);return[a,_i(o[1],a),function(t){return t}]}function du(t,e){var n;n=$r(t)?t.split(" ").map((function(t){var e=t.split(","),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,o=[],a=0,s=mi(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=li.length(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))}));var u=Math.min.apply(Math,n.map((function(t){return t[0]}))),c=Math.min.apply(Math,n.map((function(t){return t[1]})));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=c),{points:n,totalLength:s,segments:o}}var yu=function(t){return _s(/deg|rad|grad|turn|px|%/g,t)},vu=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function gu(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,vu.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return yu(t)||ps(t)}))}),n.lastIndex===t.length)return r}return[]}var mu={number:function(t){return new Uo(t)},percent:function(t){return new Uo(t,"%")},px:function(t){return new Uo(t,"px")},em:function(t){return new Uo(t,"em")},rem:function(t){return new Uo(t,"rem")},deg:function(t){return new Uo(t,"deg")},grad:function(t){return new Uo(t,"grad")},rad:function(t){return new Uo(t,"rad")},turn:function(t){return new Uo(t,"turn")},s:function(t){return new Uo(t,"s")},ms:function(t){return new Uo(t,"ms")},registerProperty:function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;Vt.get(Gr).registerMetadata({name:e,inherited:n,interpolable:r,defaultValue:i,syntax:o})},registerLayout:function(e,n){Vt.get(t.LayoutRegistry).registerLayout(e,n)}},Tu=null;function bu(t){return function(e){var n=0;return t.map((function(t){return t===Tu?e[n++]:t}))}}function Su(t){return t}var Eu={rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],scale:["Nn",bu([Tu,Tu,mu.number(1)]),Su],scalex:["N",bu([Tu,mu.number(1),mu.number(1)]),bu([Tu,mu.number(1)])],scaley:["N",bu([mu.number(1),Tu,mu.number(1)]),bu([mu.number(1),Tu])],scalez:["N",bu([mu.number(1),mu.number(1),Tu])],scale3d:["NNN",Su],translate:["Tt",bu([Tu,Tu,Xo]),Su],translatex:["T",bu([Tu,Xo,Xo]),bu([Tu,Xo])],translatey:["T",bu([Xo,Tu,Xo]),bu([Xo,Tu])],translatez:["L",bu([Xo,Xo,Tu])],translate3d:["TTL",Su]};function wu(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=Eu[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],p=u[l],f=void 0;if(void 0===(f=h?{A:function(t){return"0"===t.trim()?Ko:As(t)},N:Fs,T:Ms,L:Ns}[p.toUpperCase()](h):{a:Ko,n:c[0],t:Xo}[p]))return[];c.push(f)}if(r.push({t:o,d:c}),n.lastIndex===t.length)return r}return[]}function xu(t){return t.replace(/[xy]/,"")}function ku(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Pu(e,n,r){var i=!1;if(!e.length||!n.length){e.length||(i=!0,e=n,n=[]);for(var o=function(t){var r=e[t],i=r.t,o=r.d,a="scale"===i.substr(0,5)?1:0;n.push({t:i,d:o.map((function(t){return"number"==typeof t?new Uo(a):new Uo(a,t.unit)}))})},a=0;e.length>a;a++)o(a)}var s,u,c=[],l=[],h=[];if(e.length!==n.length);else for(var p=0;e.length>p;p++){var f=e[p].t,d=n[p].t,y=e[p].d,v=n[p].d,g=Eu[f],m=Eu[d],T=void 0;if(u=d,("perspective"!==(s=f)||"perspective"!==u)&&("matrix"!==s&&"matrix3d"!==s||"matrix"!==u&&"matrix3d"!==u)){if(f===d)T=f;else if(g[2]&&m[2]&&xu(f)===xu(d))T=xu(f),y=g[2](y),v=m[2](v);else{if(!g[1]||!m[1]||ku(f)!==ku(d))break;T=ku(f),y=g[1](y),v=m[1](v)}for(var b=[],S=[],E=[],w=0;y.length>w;w++){var x=(y[w].unit===t.UnitType.kNumber?Bs:Os)(y[w],v[w],r,!1,w);b[w]=x[0],S[w]=x[1],E.push(x[2])}c.push(b),l.push(S),h.push([T,E])}}if(i){var k=c;c=l,l=k}return[c,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return h[e][1][n](t)})).join(",");return"matrix"===h[e][0]&&16===n.split(",").length&&(h[e][0]="matrix3d"),h[e][0]+"("+n+")"})).join(" ")}]}function Cu(t){if($r(t)){var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Ms(_u(e[0])),Ms(_u(e[1]))]}return[new Uo(t[0]||0,"px"),new Uo(t[1]||0,"px")]}function _u(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Nu,Mu=t.Syringe.defineToken("CSSPropertySyntaxFactory"),Au=t.Syringe.defineToken("CSSProperty");t.CSSPropertyAngle=function(){function t(){this.parser=As,this.mixer=Os}return t.prototype.calculator=function(t,e,n,r){return new Uo(Is(n),"deg")},t}(),t.CSSPropertyAngle=se([ct({token:{token:Au,named:t.PropertySyntax.ANGLE}})],t.CSSPropertyAngle),(Nu=t.ElementEvent||(t.ElementEvent={})).DESTROY="destroy",Nu.ATTR_MODIFIED="DOMAttrModified",Nu.INSERTED="DOMNodeInserted",Nu.CHILD_INSERTED="child-inserted",Nu.REMOVED="removed",Nu.CHILD_REMOVED="child-removed",Nu.MOUNTED="DOMNodeInsertedIntoDocument",Nu.UNMOUNTED="DOMNodeRemovedFromDocument",Nu.BOUNDS_CHANGED="bounds-changed",Nu.GEOMETRY_BOUNDS_CHANGED="geometry-bounds-changed",Nu.RENDER_ORDER_CHANGED="render-order-changed",Nu.CULLED="culled";var Ou,Iu=function(){function t(e){this.type=void 0,this.eventPhase=t.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new Ps,this.page=new Ps,this.canvas=new Ps,this.viewport=new Ps,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}var e=t.prototype;return e.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},e.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.stopPropagation=function(){this.propagationStopped=!0},e.initEvent=function(){},e.initUIEvent=function(){},de(t,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"propagationPath",get:function(){return this.composedPath()}}]),t}(),Ru=function(t){function e(e,n){var r;return(r=t.call(this,null)||this).type=e,r.detail=n,Object.assign(Se(r),n),r}return ve(e,t),e}(Iu),Lu=function(){function t(){this.emitter=new bo.EventEmitter}var e=t.prototype;return e.on=function(t,e,n){return this.addEventListener(t,e,n),this},e.addEventListener=function(t,e,n){var r=Be(n)&&n||Ve(n)&&n.capture,i=Ve(n)&&n.once,o=Fe(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var u=t.split(":");t=u[1],s=u[0],a=!0}if(t=r?t+"capture":t,e=Fe(e)?e:e.handleEvent,a){var c=e;e=function(){for(var t,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];(null===(t=n[0].target)||void 0===t?void 0:t.name)===s&&c.apply(void 0,n)}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},e.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},e.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.removeEventListener=function(t,e,n){var r,i=Be(n)&&n||Ve(n)&&n.capture,o=Fe(e)?void 0:e;return t=i?t+"capture":t,e=Fe(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent,this.emitter.off(t,e,o),this},e.emit=function(t,e){this.dispatchEvent(new Ru(t,e))},e.dispatchEvent=function(t){if(!(t instanceof Iu))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var e,n;if(this.document)e=this;else if(this.defaultView)e=this.defaultView;else{var r;e=null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView}e&&(t.manager=e.getEventService()||null,t.defaultPrevented=!1,t.path=[],t.target=this,null===(n=t.manager)||void 0===n||n.dispatchEvent(t));return!t.defaultPrevented},t}(),Du=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}ve(n,e),n.isNode=function(t){return!!t.childNodes};var r=n.prototype;return r.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},r.hasChildNodes=function(){return this.childNodes.length>0},r.isDefaultNamespace=function(t){throw new Error("Method not implemented.")},r.lookupNamespaceURI=function(t){throw new Error("Method not implemented.")},r.lookupPrefix=function(t){throw new Error("Method not implemented.")},r.normalize=function(){throw new Error("Method not implemented.")},r.isEqualNode=function(t){return this===t},r.isSameNode=function(t){return this.isEqualNode(t)},r.compareDocumentPosition=function(t){if(t===this)return 0;if(!(t instanceof n))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");for(var e=t,r=this,i=[e],o=[r];null!==(a=e.parentNode)&&void 0!==a?a:r.parentNode;){var a;e=e.parentNode?(i.push(e.parentNode),e.parentNode):e,r=r.parentNode?(o.push(r.parentNode),r.parentNode):r}if(e!==r)return n.DOCUMENT_POSITION_DISCONNECTED|n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|n.DOCUMENT_POSITION_PRECEDING;var s=i.length>o.length?i:o,u=s===i?o:i;if(s[s.length-u.length]===u[0])return s===i?n.DOCUMENT_POSITION_CONTAINED_BY|n.DOCUMENT_POSITION_FOLLOWING:n.DOCUMENT_POSITION_CONTAINS|n.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],p=s[c+l];if(p!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(p)?u===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING:s===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING}}return n.DOCUMENT_POSITION_FOLLOWING},r.contain=function(t){return this.contains(t)},r.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},r.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},r.forEach=function(t){t(this)||this.childNodes.forEach((function(e){e.forEach(t)}))},de(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,r=we(this.childNodes);!(n=r()).done;){var i=n.value;e+=i.nodeName===t.Shape.TEXT?i.nodeValue:i.textContent}return e},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t,!0)})),this.nodeName===t.Shape.TEXT&&(this.style.text=""+e)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}}]),n}(Lu);Du.DOCUMENT_POSITION_DISCONNECTED=1,Du.DOCUMENT_POSITION_PRECEDING=2,Du.DOCUMENT_POSITION_FOLLOWING=4,Du.DOCUMENT_POSITION_CONTAINS=8,Du.DOCUMENT_POSITION_CONTAINED_BY=16,Du.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,(Ou=t.Strategy||(t.Strategy={}))[Ou.Standard=0]="Standard";var Uu=function(){function e(){this.strategy=t.Strategy.Standard,this.visibilityPlaneMask=-1,this.visible=!0,this.enable=!0}return e.prototype.isCulled=function(){return this.enable&&!this.visible},e}();Uu.tag="c-cullable";var Fu=function(){this.contentBounds=void 0,this.renderBounds=void 0};Fu.tag="c-geometry";var Bu=function(){this.aabb=void 0};Bu.tag="c-rbush-node";var Vu=t.Syringe.defineToken("RBushRoot"),Gu=function(){this.bounds=void 0,this.boundsDirty=!0,this.renderBounds=void 0,this.renderBoundsDirty=!0,this.dirtyRenderBounds=void 0,this.dirty=!1};Gu.tag="c-renderable";var ju=function(){this.dirty=!1,this.sorted=void 0,this.lastSortedIndex=void 0,this.renderOrder=0};ju.tag="c-sortable";var Hu=function(){this.dirtyFlag=!1,this.localDirtyFlag=!1,this.frozen=!1,this.localPosition=Tn(0,0,0),this.localRotation=Qn(0,0,0,1),this.localScale=Tn(1,1,1),this.localTransform=nn(),this.position=Tn(0,0,0),this.rotation=Qn(0,0,0,1),this.scaling=Tn(1,1,1),this.worldTransform=nn(),this.origin=Tn(0,0,0)};Hu.tag="c-transform";var zu=function(t){function e(e,n,r,i,o,a,s,u){var c;return(c=t.call(this,null)||this).relatedNode=void 0,c.prevValue=void 0,c.newValue=void 0,c.attrName=void 0,c.attrChange=void 0,c.prevParsedValue=void 0,c.newParsedValue=void 0,c.relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=o,c.attrChange=a,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return ve(e,t),e}(Iu);zu.ADDITION=2,zu.MODIFICATION=1,zu.REMOVAL=3;var Wu=0,Yu=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).sceneGraphService=Vt.get(tl),t.entity=Wu++,t.renderable=new Gu,t.cullable=new Uu,t.transformable=new Hu,t.sortable=new ju,t.geometry=new Fu,t.rBushNode=new Bu,t.id=void 0,t.name=void 0,t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}ve(n,e),n.isElement=function(t){return!!t.getAttribute};var r=n.prototype;return r.cloneNode=function(t){throw new Error("Method not implemented.")},r.appendChild=function(e,n){return this.sceneGraphService.attach(e,this,n),this.dispatchEvent(new Ru(t.ElementEvent.CHILD_INSERTED,{child:e})),e.dispatchEvent(new zu(t.ElementEvent.INSERTED,this,"","","",0,"","")),e},r.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},r.replaceChild=function(t,e,n){var r=this.childNodes.indexOf(e);return this.removeChild(e,n),this.appendChild(t,r),e},r.removeChild=function(e,n){return void 0===n&&(n=!0),e.dispatchEvent(new zu(t.ElementEvent.REMOVED,this,"","","",0,"","")),n&&(e.dispatchEvent(new Ru(t.ElementEvent.DESTROY)),e.destroyed=!0),this.dispatchEvent(new Ru(t.ElementEvent.CHILD_REMOVED,{child:e})),this.sceneGraphService.detach(e),n&&e.emitter.removeAllListeners(),e},r.removeChildren=function(t){var e=this;void 0===t&&(t=!0),this.childNodes.slice().forEach((function(n){e.removeChild(n,t)}))},r.matches=function(t){return this.sceneGraphService.matches(t,this)},r.getElementById=function(t){return this.sceneGraphService.querySelector("#"+t,this)},r.getElementsByName=function(t){return this.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},r.getElementsByClassName=function(t){return this.sceneGraphService.querySelectorAll("."+t,this)},r.getElementsByTagName=function(t){return this.sceneGraphService.querySelectorAll(t,this)},r.querySelector=function(t){return this.sceneGraphService.querySelector(t,this)},r.querySelectorAll=function(t){return this.sceneGraphService.querySelectorAll(t,this)},r.closest=function(t){var e=this;do{if(this.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},r.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},r.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},r.after=function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}},r.before=function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,o)}},r.replaceWith=function(){this.after.apply(this,arguments),this.remove()},r.append=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))},r.prepend=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))},r.replaceChildren=function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)},r.remove=function(t){return void 0===t&&(t=!0),this.parentNode?this.parentNode.removeChild(this,t):this},r.destroy=function(){this.dispatchEvent(new Ru(t.ElementEvent.DESTROY)),this.remove(!1),this.emitter.removeAllListeners(),this.destroyed=!0},r.getGeometryBounds=function(){return this.sceneGraphService.getGeometryBounds(this)},r.getRenderBounds=function(){return this.sceneGraphService.getBounds(this,!0)},r.getBounds=function(){return this.sceneGraphService.getBounds(this)},r.getLocalBounds=function(){return this.sceneGraphService.getLocalBounds(this)},r.getBoundingClientRect=function(){return this.sceneGraphService.getBoundingClientRect(this)},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},r.getAttributeNames=function(){return Object.keys(this.attributes)},r.getAttribute=function(t){var e=this.attributes[t];if(void 0===e){var n=ai(t.toString(),"");e=this.attributes[n[0]]}return De(e)?null:e},r.hasAttribute=function(t){return this.getAttributeNames().includes(t)},r.hasAttributes=function(){return!!this.getAttributeNames().length},r.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},r.setAttribute=function(t,e,n){this.attributes[t]=e},r.getAttributeNS=function(t,e){throw new Error("Method not implemented.")},r.getAttributeNode=function(t){throw new Error("Method not implemented.")},r.getAttributeNodeNS=function(t,e){throw new Error("Method not implemented.")},r.hasAttributeNS=function(t,e){throw new Error("Method not implemented.")},r.removeAttributeNS=function(t,e){throw new Error("Method not implemented.")},r.removeAttributeNode=function(t){throw new Error("Method not implemented.")},r.setAttributeNS=function(t,e,n){throw new Error("Method not implemented.")},r.setAttributeNode=function(t){throw new Error("Method not implemented.")},r.setAttributeNodeNS=function(t){throw new Error("Method not implemented.")},r.toggleAttribute=function(t,e){throw new Error("Method not implemented.")},de(n,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}}]),n}(Du),qu=function(t){function e(e,n,r,i){var o;return(o=t.call(this,e)||this).currentTime=void 0,o.timelineTime=void 0,o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return ve(e,t),e}(Iu),Xu=0,Ku=function(){function t(t,e){this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,this.effect=t,t.animation=this,this.timeline=e,this.id=""+Xu++,this._inEffect=!!this.effect.update(0),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}var e=t.prototype;return e.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},e.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},e.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},e.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this.totalDuration:0,this._startTime=this.totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.cancel=function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},e.updatePlaybackRate=function(t){this.playbackRate=t},e.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},e.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},e.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},e.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},e.rewind=function(){if(this.playbackRate<0){if(this.totalDuration>=1/0)throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this.totalDuration}else this.currentTime=0},e.persist=function(){throw new Error("Method not implemented.")},e.addEventListener=function(t,e,n){throw new Error("Method not implemented.")},e.removeEventListener=function(t,e,n){throw new Error("Method not implemented.")},e.dispatchEvent=function(t){throw new Error("Method not implemented.")},e.commitStyles=function(){throw new Error("Method not implemented.")},e.ensureAlive=function(){var t,e;0>this.playbackRate&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},e.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this.totalDuration:0),this.ensureAlive())},e.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new qu(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new qu(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},de(t,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this.totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){var t;return Number(null===(t=this.effect)||void 0===t?void 0:t.getComputedTiming().endTime)}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}}]),t}();function Zu(t,e){return Number(t.id)-Number(e.id)}var Ju=function(){function t(t){var e=this;this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(Zu),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()},this.document=t}var e=t.prototype;return e.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},e.isTicking=function(){return this.inTick},e.play=function(t){var e=new Ku(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},e.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Zu),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},e.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},e.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},e.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},e.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},e.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},e.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},e.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},e.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},e.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],u=[],c=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?u.push(n):c.push(n)})),(r=this.pendingEffects).push.apply(r,a),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,c]},t}();t.DisplayObjectPool=function(){function e(){this.pool={},this.htmlPool=[]}var n=e.prototype;return n.getByEntity=function(t){return this.pool[t]},n.add=function(e,n){this.pool[e]=n,n.nodeName===t.Shape.HTML&&this.htmlPool.push(n)},n.remove=function(e){var n=this.pool[e];if(delete this.pool[e],n.nodeName===t.Shape.HTML){var r=this.htmlPool.indexOf(n);this.htmlPool.splice(r,1)}},n.getHTMLs=function(){return this.htmlPool},e}(),t.DisplayObjectPool=se([ct()],t.DisplayObjectPool);var Qu,$u,tc={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:""},ec=function(e){function n(n){var r,i,o,a;return(a=e.call(this)||this).config=void 0,a.styleValueRegistry=Vt.get(Gr),a.isCustomElement=!1,a.activeAnimations=[],a.config=n,a.config.interactive=null!==(r=a.config.capture)&&void 0!==r?r:a.config.interactive,a.id=a.config.id||"",a.name=a.config.name||"",(a.config.className||a.config.class)&&(a.className=a.config.className||a.config.class),a.nodeName=a.config.type||t.Shape.GROUP,a.config.style=ye({},tc,{zIndex:null!==(i=a.config.zIndex)&&void 0!==i?i:0,interactive:null===(o=a.config.interactive)||void 0===o||o},a.config.style,a.config.attrs),null!=a.config.visible&&(a.config.style.visibility=!1===a.config.visible?"hidden":"visible"),null!=a.config.interactive&&(a.config.style.pointerEvents=!1===a.config.interactive?"none":"auto"),a.style=new Proxy(ye({},a.attributes,{setProperty:function(t,e){a.setAttribute(t,e)},getPropertyValue:function(t){return a.getAttribute(t)},removeProperty:function(t){a.removeAttribute(t)},item:function(){return""}}),{get:function(t,e){return void 0!==t[e]?t[e]:a.getAttribute(e)},set:function(t,e,n){return a.setAttribute(e,n),!0}}),a.initAttributes(a.config.style),Vt.get(t.DisplayObjectPool).add(a.entity,Se(a)),a}ve(n,e);var r=n.prototype;return r.destroy=function(){e.prototype.destroy.call(this),Vt.get(t.DisplayObjectPool).remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))},r.cloneNode=function(t){var e=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:ye({},this.attributes)});return e.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(n){var r=n.cloneNode(t);e.appendChild(r)})),e},r.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable;this.styleValueRegistry.processProperties(this,t),e.dirty=!0},r.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=ai(t,n),o=i[0],a=i[1];Le(n)||(r||a!==this.attributes[o])&&(this.internalSetAttribute(o,a),e.prototype.setAttribute.call(this,o,a))},r.internalSetAttribute=function(e,n,r){var i,o=this;void 0===r&&(r={});var a=this.renderable,s=this.attributes[e],u=this.parsedStyle[e];this.styleValueRegistry.processProperties(this,((i={})[e]=n,i),r),this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&this.attributes.clipPathTargets.forEach((function(e){$c(e),e.dispatchEvent(new zu(t.ElementEvent.ATTR_MODIFIED,e,o,o,"clipPath",zu.MODIFICATION,o,o)),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback("clipPath",o,o)})),a.dirty=!0,this.dispatchEvent(new zu(t.ElementEvent.ATTR_MODIFIED,this,s,n,e,zu.MODIFICATION,u,this.parsedStyle[e])),this.isCustomElement&&this.isConnected&&this.attributeChangedCallback&&this.attributeChangedCallback(e,s,n)},r.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],r=e[1],i=t.getMax();return new Cs(n,r,i[0]-n,i[1]-r)},r.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setOrigin(this,ir(t,e,n)),this},r.getOrigin=function(){return this.sceneGraphService.getOrigin(this)},r.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setPosition(this,ir(t,e,n)),this},r.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setLocalPosition(this,ir(t,e,n)),this},r.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translate(this,ir(t,e,n)),this},r.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translateLocal(this,ir(t,e,n)),this},r.getPosition=function(){return this.sceneGraphService.getPosition(this)},r.getLocalPosition=function(){return this.sceneGraphService.getLocalPosition(this)},r.scale=function(t,e,n){return this.scaleLocal(t,e,n)},r.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=ir(t,e=e||t,n=n||t)),this.sceneGraphService.scaleLocal(this,t),this},r.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=ir(t,e=e||t,n=n||t)),this.sceneGraphService.setLocalScale(this,t),this},r.getLocalScale=function(){return this.sceneGraphService.getLocalScale(this)},r.getScale=function(){return this.sceneGraphService.getScale(this)},r.getEulerAngles=function(){var t=sr(vn(),this.sceneGraphService.getWorldTransform(this));return or(t[2])},r.getLocalEulerAngles=function(){var t=sr(vn(),this.sceneGraphService.getLocalRotation(this));return or(t[2])},r.setEulerAngles=function(t){return this.sceneGraphService.setEulerAngles(this,0,0,t),this},r.setLocalEulerAngles=function(t){return this.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},r.rotateLocal=function(t,e,n){return De(e)&&De(n)?this.sceneGraphService.rotateLocal(this,0,0,t):this.sceneGraphService.rotateLocal(this,t,e,n),this},r.rotate=function(t,e,n){return De(e)&&De(n)?this.sceneGraphService.rotate(this,0,0,t):this.sceneGraphService.rotate(this,t,e,n),this},r.setRotation=function(t,e,n,r){return this.sceneGraphService.setRotation(this,t,e,n,r),this},r.setLocalRotation=function(t,e,n,r){return this.sceneGraphService.setLocalRotation(this,t,e,n,r),this},r.getRotation=function(){return this.sceneGraphService.getRotation(this)},r.getLocalRotation=function(){return this.sceneGraphService.getLocalRotation(this)},r.getLocalTransform=function(){return this.sceneGraphService.getLocalTransform(this)},r.getWorldTransform=function(){return this.sceneGraphService.getWorldTransform(this)},r.setLocalTransform=function(t){return this.sceneGraphService.setLocalTransform(this,t),this},r.resetLocalTransform=function(){this.sceneGraphService.resetLocalTransform(this)},r.getAnimations=function(){return this.activeAnimations},r.animate=function(t,e){var n,r,i=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&(i=null===(r=this.attributes.clipPathTargets[0].ownerDocument)||void 0===r?void 0:r.timeline);return delete this.parsedStyle.transform,i?i.play(new qc(this,t,e)):null},r.show=function(){this.style.visibility="visible"},r.hide=function(){this.style.visibility="hidden"},r.isVisible=function(){var t,e;return"visible"===(null===(t=this.parsedStyle)||void 0===t||null===(e=t.visibility)||void 0===e?void 0:e.value)},r.isInteractive=function(){var t,e;return"none"!==(null===(t=this.parsedStyle)||void 0===t||null===(e=t.pointerEvents)||void 0===e?void 0:e.value)},r.isCulled=function(){return!(!this.cullable||!this.cullable.isCulled())},r.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))+1),this},r.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))-1),this},r.getCount=function(){return this.childElementCount},r.getParent=function(){return this.parentElement},r.getChildren=function(){return this.children},r.getFirst=function(){return this.firstElementChild},r.getLast=function(){return this.lastElementChild},r.getChildByIndex=function(t){return this.children[t]||null},r.add=function(t,e){return this.appendChild(t,e)},r.setClip=function(t){this.style.clipPath=t},r.getClip=function(){return this.style.clipPath||null},r.set=function(t,e){this.config[t]=e},r.get=function(t){return this.config[t]},r.getConfig=function(){return this.config},r.attr=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n[1];return i?Ve(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},r.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.setZIndex=function(t){return this.style.zIndex=t,this},r.getMatrix=function(t){var e=t||this.getWorldTransform(),n=ln(vn(),e),r=n[0],i=n[1],o=hn(vn(),e),a=o[0],s=o[1],u=pn(Vn(),e),c=sr(vn(),u);return ur(c[0]||c[2],r,i,a,s)},r.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},r.setMatrix=function(t){var e=lr(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,o)},r.setLocalMatrix=function(t){var e=lr(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},de(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(Yu),nc=["style"],rc=function(t){function e(e){var n,r=void 0===e?{}:e,i=r.style,o=be(r,nc);return(n=t.call(this,ye({style:ye({x:"",y:""},i)},o))||this).isCustomElement=!0,n}return ve(e,t),e}(ec),ic=["style"],oc=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=be(r,ic);return e.call(this,ye({type:t.Shape.CIRCLE,style:ye({cx:"",cy:"",r:"",anchor:"0.5 0.5",transformOrigin:"center"},i)},o))||this}return ve(n,e),n}(ec),ac=["style"],sc=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=be(r,ac);return e.call(this,ye({type:t.Shape.ELLIPSE,style:ye({cx:"",cy:"",rx:"",ry:"",anchor:"0.5 0.5",transformOrigin:"center"},i)},o))||this}return ve(n,e),n}(ec),uc=["style"],cc=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=be(r,uc);return e.call(this,ye({type:t.Shape.GROUP,style:ye({x:"",y:"",width:"",height:""},i)},o))||this}return ve(n,e),n}(ec),lc=["style"],hc=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=be(r,lc);return e.call(this,ye({type:t.Shape.IMAGE,style:ye({x:"",y:"",img:"",width:"",height:""},i)},o))||this}return ve(n,e),n}(ec),pc=["style"],fc=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=be(r,pc);return e.call(this,ye({type:t.Shape.LINE,style:ye({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},i)},o))||this}ve(n,e);var r=n.prototype;return r.getPoint=function(t){var e=this.parsedStyle,n=li.pointAt(e.x1.value,e.y1.value,e.x2.value,e.y2.value,t);return new Ps(n.x,n.y)},r.getTotalLength=function(){var t=this.parsedStyle;return li.length(t.x1.value,t.y1.value,t.x2.value,t.y2.value)},n}(ec),dc=["style"],yc=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=be(r,dc);return e.call(this,ye({type:t.Shape.PATH,style:ye({path:"",miterLimit:4},i)},o))||this}ve(n,e);var r=n.prototype;return r.getTotalLength=function(){return this.parsedStyle.path.totalLength},r.getPoint=function(t){var e=0,n=0,r=this.parsedStyle.path.curve;if(!this.parsedStyle.path.curveSegments.length)return r?new Ps(r[0][1],r[0][2]):null;this.parsedStyle.path.curveSegments.forEach((function(r,i){r[0]>t||t>r[1]||(e=(t-r[0])/(r[1]-r[0]),n=i)}));var i=r[n];if(De(i)||De(n))return null;var o=i.length,a=r[n+1],s=vi.pointAt(i[o-2],i[o-1],a[1],a[2],a[3],a[4],a[5],a[6],e);return new Ps(s.x,s.y)},r.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},r.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},n}(ec),vc=["style"],gc=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=be(r,vc);return e.call(this,ye({type:t.Shape.POLYGON,style:ye({points:"",miterLimit:4},i)},o))||this}return ve(n,e),n}(ec),mc=["style"],Tc=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=be(r,mc);return e.call(this,ye({type:t.Shape.POLYLINE,style:ye({points:"",miterLimit:4},i)},o))||this}ve(n,e);var r=n.prototype;return r.getTotalLength=function(){return this.parsedStyle.points.totalLength},r.getPoint=function(t){var e=this.parsedStyle.points,n=e.points,r=0,i=0;e.segments.forEach((function(e,n){e[0]>t||t>e[1]||(r=(t-e[0])/(e[1]-e[0]),i=n)}));var o=li.pointAt(n[i][0],n[i][1],n[i+1][0],n[i+1][1],r);return new Ps(o.x,o.y)},r.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},r.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},n}(ec),bc=["style"],Sc=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=be(r,bc);return e.call(this,ye({type:t.Shape.RECT,style:ye({x:"",y:"",width:"",height:"",radius:""},i)},o))||this}return ve(n,e),n}(ec),Ec=["style"],wc=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=be(i,Ec);return(r=e.call(this,ye({type:t.Shape.TEXT,style:ye({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:0,lineHeight:0,miterLimit:10,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},o)},a))||this).LENGTHADJUST_SPACING=1,r.LENGTHADJUST_SPACINGANDGLYPHS=2,r.LENGTHADJUST_UNKNOWN=0,r.lengthAdjust=void 0,r.textLength=void 0,r}ve(n,e);var r=n.prototype;return r.getCharNumAtPosition=function(t){throw new Error("Method not implemented.")},r.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},r.getEndPositionOfChar=function(t){throw new Error("Method not implemented.")},r.getExtentOfChar=function(t){throw new Error("Method not implemented.")},r.getNumberOfChars=function(){throw new Error("Method not implemented.")},r.getRotationOfChar=function(t){throw new Error("Method not implemented.")},r.getStartPositionOfChar=function(t){throw new Error("Method not implemented.")},r.getSubStringLength=function(t,e){throw new Error("Method not implemented.")},r.selectSubString=function(t,e){throw new Error("Method not implemented.")},r.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},n}(ec),xc=["style"],kc=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=be(i,xc);return(r=e.call(this,ye({type:t.Shape.HTML,style:ye({x:"",y:"",width:"auto",height:"auto",innerHTML:""},o)},a))||this).cullable.enable=!1,r}ve(n,e);var r=n.prototype;return r.getDomElement=function(){return this.parsedStyle.$el},r.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(t=this.ownerDocument)||void 0===t||null===(e=t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var i=n.left-r.left,o=n.top-r.top,a=new ys;return a.setMinMax(Tn(i,o,0),Tn(i+n.width,o+n.height,0)),a}return null},r.getLocalBounds=function(){if(this.parentNode){var t=an(nn(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!ys.isEmpty(e)){var n=new ys;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(ec),Pc=function(t){function e(){var e;(e=t.call(this)||this).defaultView=null,e.documentElement=void 0,e.timeline=void 0,e.ownerDocument=null,e.nodeName="document",e.timeline=new Ju(Se(e));var n={};return Sl.forEach((function(t){var e=t.defaultValue;t.inherited&&e&&(n[t.name]=e)})),e.documentElement=new cc({id:"g-root",style:n}),e.documentElement.ownerDocument=Se(e),e.documentElement.parentNode=Se(e),e.childNodes=[e.documentElement],e}ve(e,t);var n=e.prototype;return n.createElement=function(t,e){var n=this.defaultView.customElements.get(t);return n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?wc:cc),new n(e)},n.createElementNS=function(t,e,n){return this.createElement(e,n)},n.cloneNode=function(t){throw new Error("Method not implemented.")},n.destroy=function(){try{this.documentElement.destroy()}catch(t){}this.timeline.destroy()},n.elementFromPoint=function(){var t=pe(le().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,p;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",null);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return t.abrupt("return",(p=t.sent.picked)&&p[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.elementsFromPoint=function(){var t=pe(le().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,p;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return(p=t.sent.picked)[p.length-1]!==this.documentElement&&p.push(this.documentElement),t.abrupt("return",p);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.appendChild=function(t,e){throw new Error("Use document.documentElement instead.")},n.insertBefore=function(t,e){throw new Error("Use document.documentElement instead.")},n.removeChild=function(t,e){throw new Error("Use document.documentElement instead.")},n.replaceChild=function(t,e,n){throw new Error("Use document.documentElement instead.")},n.append=function(){throw new Error("Use document.documentElement instead.")},n.prepend=function(){throw new Error("Use document.documentElement instead.")},n.getElementById=function(t){return this.documentElement.getElementById(t)},n.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},n.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},n.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},n.querySelector=function(t){return this.documentElement.querySelector(t)},n.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},n.find=function(t){return this.documentElement.find(t)},n.findAll=function(t){return this.documentElement.findAll(t)},de(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}}]),e}(Du),Cc=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).altKey=void 0,e.button=void 0,e.buttons=void 0,e.ctrlKey=void 0,e.metaKey=void 0,e.relatedTarget=void 0,e.shiftKey=void 0,e.client=new Ps,e.movement=new Ps,e.offset=new Ps,e.global=new Ps,e.screen=new Ps,e}ve(e,t);var n=e.prototype;return n.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},n.initMouseEvent=function(){throw new Error("Method not implemented.")},de(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}}]),e}(Iu),_c=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).pointerId=void 0,e.width=0,e.height=0,e.isPrimary=!1,e.pointerType=void 0,e.pressure=void 0,e.tangentialPressure=void 0,e.tiltX=void 0,e.tiltY=void 0,e.twist=void 0,e}ve(e,t);var n=e.prototype;return n.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},n.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e}(Cc),Nc=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).deltaMode=void 0,e.deltaX=void 0,e.deltaY=void 0,e.deltaZ=void 0,e.DOM_DELTA_LINE=0,e.DOM_DELTA_PAGE=1,e.DOM_DELTA_PIXEL=2,e}return ve(e,t),e}(Cc),Mc=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=jr,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return de(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Xr(t),this._easing=t}}]),t}(),Ac=function(){function t(t,e){this.type=void 0,this.target=void 0,this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=t,this.target=e}return t.copy=function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n},t}(),Oc=0,Ic=new WeakMap,Rc=function(){function e(t,e,n){this.observer=void 0,this.target=void 0,this.options=void 0,this.transientObservedNodes=[],this.observer=t,this.target=e,this.options=n}var n=e.prototype;return n.enqueue=function(t){var e=this.observer.records,n=e.length;if(e.length>0){var r=function(t,e){return t===e?t:$u&&function(t){return t===$u||t===Qu}(t)?$u:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else Bc.push(this.observer),Fc||(Fc=!0,"undefined"!=typeof globalThis?globalThis.setTimeout(Vc):Vc());e[n]=t},n.addListeners=function(){this.addListeners_(this.target)},n.addListeners_=function(e){var n=this.options;n.attributes&&e.addEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.addEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.addEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeListeners=function(){this.removeListeners_(this.target)},n.removeListeners_=function(e){var n=this.options;n.attributes&&e.removeEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.removeEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.removeEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeTransientObservers=function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=Ic.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}}),this)},n.handleEvent=function(e){var n,r;switch(e.stopImmediatePropagation(),e.type){case t.ElementEvent.ATTR_MODIFIED:var i=e.attrName,o=e.relatedNode.namespaceURI;(n=Dc("attributes",r=e.target)).attributeName=i,n.attributeNamespace=o;var a=e.attrChange===zu.ADDITION?null:e.prevValue;Uc(r,(function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(i)||-1!==t.attributeFilter.indexOf(o)))return t.attributeOldValue?function(t){return $u||(($u=Ac.copy(Qu)).oldValue=t,$u)}(a):n}));break;case t.ElementEvent.REMOVED:case t.ElementEvent.INSERTED:var s,u,c=e.target;e.type===t.ElementEvent.INSERTED?(s=[c],u=[]):(s=[],u=[c]);var l=c.previousSibling,h=c.nextSibling;(n=Dc("childList",r=e.relatedNode)).addedNodes=s,n.removedNodes=u,n.previousSibling=l,n.nextSibling=h,Uc(r,(function(t){if(t.childList)return n}))}Qu=$u=void 0},e}(),Lc=function(){function t(t){this.callback=void 0,this.nodes=[],this.records=[],this.uid=Oc++,this.callback=t}var e=t.prototype;return e.observe=function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,r=Ic.get(t);r||Ic.set(t,r=[]);for(var i=0;r.length>i;i++)if(r[i].observer===this){(n=r[i]).removeListeners(),n.options=e;break}n||(n=new Rc(this,t,e),r.push(n),this.nodes.push(t)),n.addListeners()},e.disconnect=function(){var t=this;this.nodes.forEach((function(e){for(var n=Ic.get(e),r=0;n.length>r;r++){var i=n[r];if(i.observer===t){i.removeListeners(),n.splice(r,1);break}}}),this),this.records=[]},e.takeRecords=function(){var t=this.records;return this.records=[],t},t}();function Dc(t,e){return Qu=new Ac(t,e)}function Uc(t,e){for(var n=t;n;n=n.parentNode){var r=Ic.get(n);if(r)for(var i=0;r.length>i;i++){var o=r[i],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}var Fc=!1,Bc=[];function Vc(){Fc=!1;var t=Bc;Bc=[],t.sort((function(t,e){return t.uid-e.uid}));var e=!1;t.forEach((function(t){var n=t.takeRecords();!function(t){t.nodes.forEach((function(e){var n=Ic.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&Vc()}function Gc(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;i>o;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}null!=r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(0>i||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error(i+" compositing is not supported");n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;n.length>o;o++){var a=n[o].offset;if(De(a))r=!1;else{if(i>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;r>a;a++){var s=n[a].computedOffset;if(!De(s)&&!De(o)){for(var u=1;a-i>u;u++)n[i+u].computedOffset=o+(Number(s)-o)*u/(a-i);i=a,o=Number(s)}}}(),n}var jc="backwards|forwards|both|none".split("|"),Hc="reverse|alternate|alternate-reverse".split("|");function zc(t,e){var n=new Mc;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===jc.indexOf(t[e]))return;if("direction"===e&&-1===Hc.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function Wc(t,e){var n;return zc(t=Yc(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}function Yc(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var qc=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=t,this.timing=Wc(n,!1),this.timing.effect=this,this.timing.activeDuration=Kr(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Gc(e,this.timing),this.interpolations=ti(this.normalizedKeyframes,this.timing,this.target),this.computedTiming=new Proxy(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}})}var e=t.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(t){return null!==t&&(this.timeFraction=Zr(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(t){this.normalizedKeyframes=Gc(t)},e.getComputedTiming=function(){return this.computedTiming},e.getTiming=function(){return this.timing},e.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing=t[n]}))},t}(),Xc=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,oc),this.define(t.Shape.ELLIPSE,sc),this.define(t.Shape.RECT,Sc),this.define(t.Shape.IMAGE,hc),this.define(t.Shape.LINE,fc),this.define(t.Shape.GROUP,cc),this.define(t.Shape.PATH,yc),this.define(t.Shape.POLYGON,gc),this.define(t.Shape.POLYLINE,Tc),this.define(t.Shape.TEXT,wc),this.define(t.Shape.HTML,kc)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}(),Kc=t.Syringe.defineToken("SceneGraphSelectorFactory"),Zc=t.Syringe.defineToken("SceneGraphSelector",{multiple:!1}),Jc=/\[\s*(.*)=(.*)\s*\]/;function Qc(t,e){var n=Number(t.style.zIndex),r=Number(e.style.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function $c(e,n){void 0===n&&(n=!1);for(var r=e;r;){var i=r.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0),r=r.parentNode}e.dispatchEvent(new Ru(t.ElementEvent.BOUNDS_CHANGED,{affectChildren:n}))}t.DefaultSceneGraphSelector=function(){function t(){}var e=t.prototype;return e.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return e.className===n.getIdOrClassname(t)}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},e.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&r.className===n.getIdOrClassname(t)}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},e.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},e.getIdOrClassname=function(t){return t.substring(1)},e.getAttribute=function(t){var e=t.match(Jc),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},e.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return De(n)?"":n.toString?n.toString():""},t}(),t.DefaultSceneGraphSelector=se([ct({token:Zc})],t.DefaultSceneGraphSelector);var tl=t.Syringe.defineToken("SceneGraphService");t.DefaultSceneGraphService=function(){function e(){var t,e,n,r,i,o=this;this.sceneGraphSelectorFactory=void 0,this.rotate=(t=Vn(),function(e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=Tn(n,r,i));var a=e.transformable;if(null!==e.parentNode&&e.parentNode.transformable){var s=Vn();Wn(s,n[0],n[1],n[2]);var u=o.getRotation(e),c=o.getRotation(e.parentNode);$n(t,c),zn(t,t),jn(s,t,s),jn(a.localRotation,s,u),er(a.localRotation,a.localRotation),o.dirtifyLocal(e,a)}else o.rotateLocal(e,n)}),this.rotateLocal=(e=Vn(),function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=Tn(n,r,i));var a=t.transformable;Wn(e,n[0],n[1],n[2]),tr(a.localRotation,a.localRotation,e),o.dirtifyLocal(t,a)}),this.setEulerAngles=(n=Vn(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=Tn(e,r,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Wn(a.localRotation,e[0],e[1],e[2]);var s=o.getRotation(t.parentNode);$n(n,zn(Vn(),s)),tr(a.localRotation,a.localRotation,n),o.dirtifyLocal(t,a)}else o.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Tn(e,n,r));var i=t.transformable;On(e,vn())||(function(t,e,n){var r=n[0],i=n[1],o=n[2],a=e[0],s=e[1],u=e[2],c=i*u-o*s,l=o*a-r*u,h=r*s-i*a,p=i*h-o*l,f=o*c-r*h,d=r*l-i*c,y=2*n[3];l*=y,h*=y,f*=2,d*=2,t[0]=a+(c*=y)+(p*=2),t[1]=s+l+f,t[2]=u+h+d}(e,e,i.localRotation),En(i.localPosition,i.localPosition,e),o.dirtifyLocal(t,i))},this.setPosition=(r=nn(),function(t,e){var n=t.transformable;e=Tn(e[0],e[1],e[2]||0),On(o.getPosition(t),e)||(n.position=e,null!==t.parentNode&&t.parentNode.transformable?(rn(r,t.parentNode.transformable.worldTransform),an(r,r),An(n.localPosition,e,r)):bn(n.localPosition,e),o.dirtifyLocal(t,n))}),this.translate=(i=vn(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Tn(e,n,r)),On(e,vn())||(En(i,o.getPosition(t),e),o.setPosition(t,i))}),this.setRotation=function(){var t=Vn();return function(e,n,r,i,a){var s=e.transformable;if("number"==typeof n&&(n=Qn(n,r,i,a)),null!==e.parentNode&&e.parentNode.transformable){var u=o.getRotation(e.parentNode);$n(t,u),zn(t,t),jn(s.localRotation,t,n),er(s.localRotation,s.localRotation),o.dirtifyLocal(e,s)}else o.setLocalRotation(e,n)}}}var n=e.prototype;return n.matches=function(t,e){return this.sceneGraphSelectorFactory().is(t,e)},n.querySelector=function(t,e){return this.sceneGraphSelectorFactory().selectOne(t,e)},n.querySelectorAll=function(t,e){return this.sceneGraphSelectorFactory().selectAll(t,e)},n.attach=function(t,e,n){t.parentNode&&this.detach(t),t.parentNode=e,De(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var r=e.sortable;r&&(r.dirty=!0);var i=t.transformable;i&&this.dirtifyWorld(t,i),i.frozen&&this.unfreezeParentToRoot(t)},n.detach=function(t){if(t.parentNode){var e=t.transformable,n=t.parentNode.sortable;n&&(n.dirty=!0);var r=t.parentNode.childNodes.indexOf(t);r>-1&&t.parentNode.childNodes.splice(r,1),e&&this.dirtifyWorld(t,e),t.parentNode=null}},n.getOrigin=function(t){return t.transformable.origin},n.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Tn(e,n,r));var i=t.transformable;if(!On(e,i.origin)){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},n.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Tn(e,n,r));var i=t.transformable;Wn(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},n.setLocalPosition=function(t,e){var n=t.transformable;e=Tn(e[0],e[1],e[2]||0),On(n.localPosition,e)||(bn(n.localPosition,e),this.dirtifyLocal(t,n))},n.scaleLocal=function(t,e){var n=t.transformable;xn(n.localScale,n.localScale,Tn(e[0],e[1],e[2]||1)),this.dirtifyLocal(t,n)},n.setLocalScale=function(t,e){var n=t.transformable,r=Tn(e[0],e[1],e[2]||n.localScale[2]);On(r,n.localScale)||(bn(n.localScale,r),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=Qn(e,n,r,i));var o=t.transformable;$n(o.localRotation,e),this.dirtifyLocal(t,o)},n.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},n.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),$c(t,!0)},n.getPosition=function(t){var e=t.transformable;return ln(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return pn(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return hn(e.scaling,this.getWorldTransform(t,e))},n.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},n.getLocalPosition=function(t){return t.transformable.localPosition},n.getLocalRotation=function(t){return t.transformable.localRotation},n.getLocalScale=function(t){return t.transformable.localScale},n.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(fn(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.localTransform},n.setLocalTransform=function(t,e){var n=ln(vn(),e),r=pn(Vn(),e),i=hn(vn(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},n.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0])},n.getTransformedGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=this.getGeometryBounds(t,e);if(ys.isEmpty(n))return null;var r=new ys;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r},n.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry,r=e?n.renderBounds:n.contentBounds||null;return r&&new ys(r.center,r.halfExtents)||new ys},n.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=this.getTransformedGeometryBounds(t,e);t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(i?i.add(r):(i=new ys).update(r.center,r.halfExtents))}));var o=t.style.clipPath;if(o){var a,s=this.getTransformedGeometryBounds(o,!0);s&&(a=new ys).setFromTransformedAABB(s,this.getWorldTransform(t)),i?a&&(i=a.intersection(i)):i=a}return i&&(e?r.renderBounds=i:r.bounds=i),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,i||new ys},n.getLocalBounds=function(t){if(t.parentNode){var e=nn();t.parentNode.transformable&&(e=an(nn(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!ys.isEmpty(n)){var r=new ys;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);ys.isEmpty(i)||(r=new ys).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(e=t.ownerDocument)||void 0===e||null===(n=e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=r.getMin(),s=a[0],u=a[1],c=r.getMax();return new Cs(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new Cs((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},n.dirtifyWorldInternal=function(e,n){var r=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,e.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||r.dirtifyWorldInternal(t,e)}));var i=e.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0),e.dispatchEvent(new zu(t.ElementEvent.ATTR_MODIFIED,e,null,null,"modelMatrix",zu.MODIFICATION,null,null))}},n.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}},n.sync=function(t,e){if(e.localDirtyFlag&&(fn(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?sn(e.worldTransform,r.worldTransform,e.localTransform):rn(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},n.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),se([lt(Kc),ce("design:type",Function)],t.DefaultSceneGraphService.prototype,"sceneGraphSelectorFactory",void 0),t.DefaultSceneGraphService=se([ct({token:tl})],t.DefaultSceneGraphService);var el,nl=t.Syringe.defineToken("ContextService",{multiple:!1});(el=t.RenderReason||(t.RenderReason={}))[el.CAMERA_CHANGED=0]="CAMERA_CHANGED",el[el.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",el[el.NONE=2]="NONE";var rl,il,ol,al=t.Syringe.defineToken("RenderingContext"),sl=t.Syringe.defineToken("DefaultCamera");(rl=t.CameraType||(t.CameraType={}))[rl.ORBITING=0]="ORBITING",rl[rl.EXPLORING=1]="EXPLORING",rl[rl.TRACKING=2]="TRACKING",(il=t.CameraTrackingMode||(t.CameraTrackingMode={}))[il.DEFAULT=0]="DEFAULT",il[il.ROTATIONAL=1]="ROTATIONAL",il[il.TRANSLATIONAL=2]="TRANSLATIONAL",il[il.CINEMATIC=3]="CINEMATIC",(ol=t.CameraProjectionMode||(t.CameraProjectionMode={}))[ol.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",ol[ol.PERSPECTIVE=1]="PERSPECTIVE";var ul={UPDATED:"updated"},cl=Math.PI/180,ll=180/Math.PI,hl=2e-4,pl=function(e){function n(n,r){var i;return void 0===n&&(n=t.CameraType.EXPLORING),void 0===r&&(r=t.CameraTrackingMode.DEFAULT),(i=e.call(this)||this).canvas=void 0,i.matrix=nn(),i.right=Tn(1,0,0),i.up=Tn(0,1,0),i.forward=Tn(0,0,1),i.position=Tn(0,0,1),i.focalPoint=Tn(0,0,0),i.distanceVector=Tn(0,0,-1),i.distance=1,i.azimuth=0,i.elevation=0,i.roll=0,i.relAzimuth=0,i.relElevation=0,i.relRoll=0,i.dollyingStep=0,i.maxDistance=1/0,i.minDistance=-1/0,i.zoom=1,i.rotateWorld=!1,i.fov=30,i.near=.1,i.far=1e3,i.aspect=1,i.left=void 0,i.rright=void 0,i.top=void 0,i.bottom=void 0,i.projectionMatrix=nn(),i.projectionMatrixInverse=nn(),i.jitteredProjectionMatrix=void 0,i.view=void 0,i.enableUpdate=!0,i.type=t.CameraType.EXPLORING,i.trackingMode=t.CameraTrackingMode.DEFAULT,i.projectionMode=t.CameraProjectionMode.PERSPECTIVE,i.frustum=new Ts,i.landmarks=[],i.landmarkAnimationID=void 0,i.orthoMatrix=nn(),i.setType(n,r),i}ve(n,e);var r=n.prototype;return r.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},r.getProjectionMode=function(){return this.projectionMode},r.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},r.getPerspectiveInverse=function(){return this.projectionMatrixInverse},r.getFrustum=function(){return this.frustum},r.getPosition=function(){return this.position},r.getFocalPoint=function(){return this.focalPoint},r.getDollyingStep=function(){return this.dollyingStep},r.getNear=function(){return this.near},r.getFar=function(){return this.far},r.getZoom=function(){return this.zoom},r.getOrthoMatrix=function(){return this.orthoMatrix},r.getView=function(){return this.view},r.setEnableUpdate=function(t){this.enableUpdate=t},r.setType=function(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this},r.setProjectionMode=function(t){return this.projectionMode=t,this},r.setTrackingMode=function(e){if(this.type!==t.CameraType.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},r.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},r.getViewTransform=function(){return an(nn(),this.matrix)},r.getWorldTransform=function(){return this.matrix},r.jitterProjectionMatrix=function(t,e){var n,r,i=(n=nn(),r=[t,e,0],n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=r[0],n[13]=r[1],n[14]=r[2],n[15]=1,n);this.jitteredProjectionMatrix=sn(nn(),i,this.projectionMatrix)},r.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},r.setMatrix=function(t){return this.matrix=t,this._update(),this},r.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},r.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},r.setNear=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},r.setFar=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},r.setViewOffset=function(e,n,r,i,o,a){return this.aspect=e/n,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},r.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},r.setZoom=function(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},r.setPerspective=function(e,n,r,i){var o;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var a=this.near*Math.tan(.5*cl*this.fov)/this.zoom,s=2*a,u=this.aspect*s,c=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,a-=this.view.offsetY*s/h,u*=this.view.width/l,s*=this.view.height/h}return cr(this.projectionMatrix,c,c+u,a,a-s,e,this.far),cn(this.projectionMatrix,this.projectionMatrix,Tn(1,-1,1)),an(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},r.setOrthographic=function(e,n,r,i,o,a){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,p=l-u,f=l+u,d=h+c,y=h-c;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var v=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f=(p+=v*this.view.offsetX)+v*this.view.width,y=(d-=g*this.view.offsetY)-g*this.view.height}return yn(this.projectionMatrix,p,f,y,d,o,a),cn(this.projectionMatrix,this.projectionMatrix,Tn(1,-1,1)),an(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},r.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=ir(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},r.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var i,o,a,s,u,c,l,h,p,f,d,y,v,g=Tn(0,1,0);if(this.focalPoint=ir(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var m=wn(vn(),this.focalPoint,this.position);e=m[0],n=m[1],r=m[2];var T=mn(m),b=Math.asin(n/T)*ll,S=90+Math.atan2(r,e)*ll,E=nn();i=E,o=E,a=S*cl,s=Math.sin(a),u=Math.cos(a),c=o[0],l=o[1],h=o[2],p=o[3],f=o[8],d=o[9],y=o[10],v=o[11],o!==i&&(i[4]=o[4],i[5]=o[5],i[6]=o[6],i[7]=o[7],i[12]=o[12],i[13]=o[13],i[14]=o[14],i[15]=o[15]),i[0]=c*u-f*s,i[1]=l*u-d*s,i[2]=h*u-y*s,i[3]=p*u-v*s,i[8]=c*s+f*u,i[9]=l*s+d*u,i[10]=h*s+y*u,i[11]=p*s+v*u,function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],p=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r}(E,E,b*cl),g=An(vn(),[0,1,0],E)}return an(this.matrix,function(t,e,n,r){var i,o,a,s,u,c,l,h,p,f,d=e[0],y=e[1],v=e[2],g=r[0],m=r[1],T=r[2],b=n[0],S=n[1],E=n[2];return Math.abs(d-b)<$e&&Math.abs(y-S)<$e&&Math.abs(v-E)<$e?on(t):(l=d-b,h=y-S,p=v-E,i=m*(p*=f=1/Math.hypot(l,h,p))-T*(h*=f),o=T*(l*=f)-g*p,a=g*h-m*l,(f=Math.hypot(i,o,a))?(i*=f=1/f,o*=f,a*=f):(i=0,o=0,a=0),s=h*a-p*o,u=p*i-l*a,c=l*o-h*i,(f=Math.hypot(s,u,c))?(s*=f=1/f,u*=f,c*=f):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=a,t[9]=c,t[10]=p,t[11]=0,t[12]=-(i*d+o*y+a*v),t[13]=-(s*d+u*y+c*v),t[14]=-(l*d+h*y+p*v),t[15]=1,t)}(nn(),this.position,this.focalPoint,g)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},r.getDistance=function(){return this.distance},r.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,hl>this.distance&&(this.distance=hl),this.dollyingStep=this.distance/100;var e=vn(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},r.setMaxDistance=function(t){return this.maxDistance=t,this},r.setMinDistance=function(t){return this.minDistance=t,this},r.setAzimuth=function(e){return this.azimuth=rr(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.getAzimuth=function(){return this.azimuth},r.setElevation=function(e){return this.elevation=rr(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.getElevation=function(){return this.elevation},r.setRoll=function(e){return this.roll=rr(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},r.getRoll=function(){return this.roll},r.rotate=function(e,n,r){if(this.relElevation=rr(n),this.relAzimuth=rr(e),this.relRoll=rr(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var i=Gn(Vn(),[1,0,0],(this.rotateWorld?1:-1)*this.relElevation*cl),o=Gn(Vn(),[0,1,0],(this.rotateWorld?1:-1)*this.relAzimuth*cl),a=Gn(Vn(),[0,0,1],this.relRoll*cl),s=jn(Vn(),o,i);s=jn(Vn(),s,a);var u=dn(nn(),s);un(this.matrix,this.matrix,[0,0,-this.distance]),sn(this.matrix,this.matrix,u),un(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this},r.pan=function(t,e){var n=ir(t,e,0),r=gn(this.position);return En(r,r,kn(vn(),this.right,n[0])),En(r,r,kn(vn(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},r.dolly=function(e){var n,r=this.forward,i=gn(this.position);return n=Math.max(Math.min(this.distance+e*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance,i[0]+=n*r[0],i[1]+=n*r[1],i[2]+=n*r[2],this._setPosition(i),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getDistance():this.type===t.CameraType.TRACKING&&En(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},r.createLandmark=function(t,e){void 0===e&&(e={});var r=e.position,i=void 0===r?this.position:r,o=e.focalPoint,a=void 0===o?this.focalPoint:o,s=e.roll,u=e.zoom,c=new n;c.setType(this.type,void 0),c.setPosition(i[0],i[1]||this.position[1],i[2]||this.position[2]),c.setFocalPoint(a[0],a[1]||this.focalPoint[1],a[2]||this.focalPoint[2]),c.setRoll(s||this.roll),c.setZoom(u||this.zoom);var l,h,p={name:t,matrix:(l=c.matrix,h=new tn(16),h[0]=l[0],h[1]=l[1],h[2]=l[2],h[3]=l[3],h[4]=l[4],h[5]=l[5],h[6]=l[6],h[7]=l[7],h[8]=l[8],h[9]=l[9],h[10]=l[10],h[11]=l[11],h[12]=l[12],h[13]=l[13],h[14]=l[14],h[15]=l[15],h),right:gn(c.right),up:gn(c.up),forward:gn(c.forward),position:gn(c.position),focalPoint:gn(c.focalPoint),distanceVector:gn(c.distanceVector),distance:c.distance,dollyingStep:c.dollyingStep,azimuth:c.azimuth,elevation:c.elevation,roll:c.roll,relAzimuth:c.relAzimuth,relElevation:c.relElevation,relRoll:c.relRoll,zoom:c.zoom};return this.landmarks.push(p),p},r.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=$r(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=Ue(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,u=void 0===s?100:s,c=i.easingFunction,l=void 0===c?void 0:c,h=i.onfinish,p=void 0===h?void 0:h;if(0===u)return this.syncFromLandmark(r),void(p&&p());void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID);var f,d=r.position,y=r.focalPoint,v=r.zoom,g=r.roll,m=l||Xr(a),T=function(){n.setFocalPoint(y),n.setPosition(d),n.setRoll(g),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),p&&p()};this.canvas.requestAnimationFrame((function t(e){void 0===f&&(f=e);var r=e-f;if(u<r)T();else{var i,o,a=m(r/u),s=vn(),c=vn();Mn(s,n.focalPoint,y,a),Mn(c,n.position,d,a),o=n.roll*(1-a)+g*a,i=n.zoom*(1-a)+v*a,n.setFocalPoint(s),n.setPosition(c),n.setRoll(o),n.setZoom(i),Dn(s,y)+Dn(c,d)>.01?(n.computeMatrix(),n.triggerUpdate(),u>r&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(t))):T()}}))}},r._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},r.computeMatrix=function(){var e=Gn(Vn(),[0,0,1],this.roll*cl);on(this.matrix);var n=Gn(Vn(),[1,0,0],(this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation*cl),r=Gn(Vn(),[0,1,0],(this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth*cl),i=jn(Vn(),r,n);i=jn(Vn(),i,e);var o=dn(nn(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(un(this.matrix,this.matrix,this.focalPoint),sn(this.matrix,this.matrix,o),un(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(un(this.matrix,this.matrix,this.position),sn(this.matrix,this.matrix,o))},r._setPosition=function(t,e,n){this.position=ir(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},r._getAxes=function(){bn(this.right,ir(Bn(Fn(),[1,0,0,0],this.matrix))),bn(this.up,ir(Bn(Fn(),[0,1,0,0],this.matrix))),bn(this.forward,ir(Bn(Fn(),[0,0,1,0],this.matrix))),Cn(this.right,this.right),Cn(this.up,this.up),Cn(this.forward,this.forward)},r._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=mn(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=Math.asin(n/i)*ll,this.azimuth=Math.atan2(-e,-r)*ll):(this.elevation=-Math.asin(n/i)*ll,this.azimuth=-Math.atan2(-e,-r)*ll)},r._getPosition=function(){bn(this.position,ir(Bn(Fn(),[0,0,0,1],this.matrix))),this._getDistance()},r._getFocalPoint=function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=en(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),En(this.focalPoint,this.position,this.distanceVector),this._getDistance()},r._getDistance=function(){this.distanceVector=wn(vn(),this.focalPoint,this.position),this.distance=mn(this.distanceVector),this.dollyingStep=this.distance/100},r._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=Gn(Vn(),[0,0,1],-this.roll*Math.PI/180);fn(this.orthoMatrix,n,Tn((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),Tn(this.zoom,this.zoom,1),e)}},r.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=sn(nn(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.emit(ul.UPDATED)}},r.syncFromLandmark=function(t){this.matrix=rn(this.matrix,t.matrix),this.right=bn(this.right,t.right),this.up=bn(this.up,t.up),this.forward=bn(this.forward,t.forward),this.position=bn(this.position,t.position),this.focalPoint=bn(this.focalPoint,t.focalPoint),this.distanceVector=bn(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},n}(bo.EventEmitter),fl=t.Syringe.defineToken("RenderingPluginContribution");t.RenderingService=function(){function e(){this.renderingPluginProvider=void 0,this.renderingContext=void 0,this.sceneGraphService=void 0,this.styleValueRegistry=void 0,this.camera=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Fi,dirtycheck:new to(["object"]),cull:new to(["object","camera"]),beginFrame:new Xi([]),beforeRender:new Xi(["objectToRender"]),render:new Xi(["objectToRender"]),afterRender:new Xi(["objectToRender"]),endFrame:new Xi([]),destroy:new Xi([]),pick:new ji(["result"]),pointerDown:new Xi(["event"]),pointerUp:new Xi(["event"]),pointerMove:new Xi(["event"]),pointerOut:new Xi(["event"]),pointerOver:new Xi(["event"]),pointerWheel:new Xi(["event"]),pointerCancel:new Xi(["event"])}}var n=e.prototype;return n.init=function(){var t=pe(le().mark((function t(){var e=this;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.renderingPluginProvider.getContributions({cache:!1}).forEach((function(t){t.apply(e)})),t.next=3,this.hooks.init.promise();case 3:this.inited=!0;case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getStats=function(){return this.stats},n.render=function(t){var e=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.sceneGraphService.syncHierarchy(this.renderingContext.root),this.renderingContext.renderReasons.size&&this.inited&&(this.renderDisplayObject(this.renderingContext.root,t),(this.renderingContext.renderListCurrentFrame.length||this.renderingContext.renderListLastFrame.length!==this.renderingContext.renderListCurrentFrame.length)&&(this.hooks.beginFrame.call(),this.renderingContext.renderListCurrentFrame.forEach((function(t){e.hooks.beforeRender.call(t),e.hooks.render.call(t),e.hooks.afterRender.call(t)})),this.hooks.endFrame.call()),this.renderingContext.renderListLastFrame=[].concat(this.renderingContext.renderListCurrentFrame),this.renderingContext.renderListCurrentFrame=[],this.renderingContext.renderReasons.clear())},n.renderDisplayObject=function(e,n){var r=this,i=n.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.styleValueRegistry.recalc(e);var s=o?this.hooks.dirtycheck.call(e):e;if(s){var u=a?this.hooks.cull.call(s,this.camera):s;u&&(this.stats.rendered++,this.renderingContext.renderListCurrentFrame.push(u))}e.renderable.dirty=!1,e.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var c=e.sortable,l=!1;c.dirty&&(c.sorted=e.childNodes.slice().sort(Qc),l=!0,c.dirty=!1),(c.sorted||e.childNodes).forEach((function(t){r.renderDisplayObject(t,n)})),l&&e.forEach((function(e){e.dispatchEvent(new Ru(t.ElementEvent.RENDER_ORDER_CHANGED,{renderOrder:e.sortable.renderOrder}))}))},n.destroy=function(){this.inited=!1,this.hooks.destroy.call()},n.dirtify=function(){this.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),se([jt(fl),ce("design:type",Object)],t.RenderingService.prototype,"renderingPluginProvider",void 0),se([lt(al),ce("design:type",Object)],t.RenderingService.prototype,"renderingContext",void 0),se([lt(tl),ce("design:type",Object)],t.RenderingService.prototype,"sceneGraphService",void 0),se([lt(Gr),ce("design:type",Object)],t.RenderingService.prototype,"styleValueRegistry",void 0),se([lt(sl),ce("design:type",pl)],t.RenderingService.prototype,"camera",void 0),t.RenderingService=se([ct()],t.RenderingService);t.EventService=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).renderingContext=void 0,e.contextService=void 0,e.canvasConfig=void 0,e.displayObjectPool=void 0,e.rootTarget=void 0,e.cursor="default",e.mappingTable={},e.mappingState={trackingData:{}},e.eventPool=new Map,e.pickHandler=void 0,e.onPointerDown=function(){var t=pe(le().mark((function t(n){var r;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof _c){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createPointerEvent(n);case 4:e.dispatchEvent(r=t.sent,"pointerdown"),"touch"===r.pointerType?e.dispatchEvent(r,"touchstart"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||e.dispatchEvent(r,2===r.button?"rightdown":"mousedown"),e.trackingData(n.pointerId).pressTargetsByButton[n.button]=r.composedPath(),e.freeEvent(r);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerUp=function(){var t=pe(le().mark((function t(n){var r,i,o,a,s,u,c,l;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof _c){t.next=2;break}return t.abrupt("return");case 2:return r=performance.now(),t.next=5,e.createPointerEvent(n);case 5:if(e.dispatchEvent(i=t.sent,"pointerup"),"touch"===i.pointerType?e.dispatchEvent(i,"touchend"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||e.dispatchEvent(i,2===i.button?"rightup":"mouseup"),o=e.trackingData(n.pointerId),a=e.findMountedTarget(o.pressTargetsByButton[n.button]),s=a,a&&!i.composedPath().includes(a)){for(u=a;u&&!i.composedPath().includes(u);)i.currentTarget=u,e.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?e.notifyTarget(i,"touchendoutside"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||e.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Du.isNode(u)&&(u=u.parentNode);delete o.pressTargetsByButton[n.button],s=u}s&&((c=e.clonePointerEvent(i,"click")).target=s,c.path=[],o.clicksByButton[n.button]||(o.clicksByButton[n.button]={clickCount:0,target:c.target,timeStamp:r}),(l=o.clicksByButton[n.button]).target===c.target&&200>r-l.timeStamp?++l.clickCount:l.clickCount=1,l.target=c.target,l.timeStamp=r,c.detail=l.clickCount,e.dispatchEvent(c,"mouse"===c.pointerType||"touch"===c.pointerType?"click":"pointertap"),e.freeEvent(c)),e.freeEvent(i);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerMove=function(){var t=pe(le().mark((function t(n){var r,i,o,a,s,u,c,l,h,p;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof _c){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createPointerEvent(n);case 4:if(i="mouse"===(r=t.sent).pointerType||"pen"===r.pointerType,o=e.trackingData(n.pointerId),a=e.findMountedTarget(o.overTargets),!o.overTargets||a===r.target){t.next=23;break}return s="mousemove"===n.type?"mouseout":"pointerout",t.next=12,e.createPointerEvent(n,s,a||void 0);case 12:if(e.dispatchEvent(u=t.sent,"pointerout"),i&&e.dispatchEvent(u,"mouseout"),r.composedPath().includes(a)){t.next=22;break}return t.next=18,e.createPointerEvent(n,"pointerleave",a||void 0);case 18:for((c=t.sent).eventPhase=c.AT_TARGET;c.target&&!r.composedPath().includes(c.target);)c.currentTarget=c.target,e.notifyTarget(c),i&&e.notifyTarget(c,"mouseleave"),Du.isNode(c.target)&&(c.target=c.target.parentNode);e.freeEvent(c);case 22:e.freeEvent(u);case 23:if(a===r.target){t.next=38;break}l=e.clonePointerEvent(r,"mousemove"===n.type?"mouseover":"pointerover"),e.dispatchEvent(l,"pointerover"),i&&e.dispatchEvent(l,"mouseover"),h=a&&Du.isNode(a)&&a.parentNode;case 29:if(!h||h===(Du.isNode(e.rootTarget)&&e.rootTarget.parentNode)){t.next=35;break}if(h!==r.target){t.next=32;break}return t.abrupt("break",35);case 32:h=h.parentNode,t.next=29;break;case 35:if(!h||h===(Du.isNode(e.rootTarget)&&e.rootTarget.parentNode)){for((p=e.clonePointerEvent(r,"pointerenter")).eventPhase=p.AT_TARGET;p.target&&p.target!==a&&p.target!==(Du.isNode(e.rootTarget)&&e.rootTarget.parentNode);)p.currentTarget=p.target,e.notifyTarget(p),i&&e.notifyTarget(p,"mouseenter"),Du.isNode(p.target)&&(p.target=p.target.parentNode);e.freeEvent(p)}e.freeEvent(l);case 38:e.dispatchEvent(r,"pointermove"),"touch"===r.pointerType&&e.dispatchEvent(r,"touchmove"),i&&(e.dispatchEvent(r,"mousemove"),e.cursor=e.getCursor(r.target)),o.overTargets=r.composedPath(),e.freeEvent(r);case 43:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerOut=function(){var t=pe(le().mark((function t(n){var r,i,o,a,s;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof _c){t.next=2;break}return t.abrupt("return");case 2:if(!(r=e.trackingData(n.pointerId)).overTargets){t.next=19;break}return i="mouse"===n.pointerType||"pen"===n.pointerType,o=e.findMountedTarget(r.overTargets),t.next=8,e.createPointerEvent(n,"pointerout",o||void 0);case 8:return e.dispatchEvent(a=t.sent),i&&e.dispatchEvent(a,"mouseout"),t.next=13,e.createPointerEvent(n,"pointerleave",o||void 0);case 13:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&s.target!==(Du.isNode(e.rootTarget)&&e.rootTarget.parentNode);)s.currentTarget=s.target,e.notifyTarget(s),i&&e.notifyTarget(s,"mouseleave"),Du.isNode(s.target)&&(s.target=s.target.parentNode);r.overTargets=null,e.freeEvent(a),e.freeEvent(s);case 19:e.cursor=null;case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerOver=function(){var t=pe(le().mark((function t(n){var r,i,o,a;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof _c){t.next=2;break}return t.abrupt("return");case 2:return r=e.trackingData(n.pointerId),t.next=5,e.createPointerEvent(n);case 5:for(o="mouse"===(i=t.sent).pointerType||"pen"===i.pointerType,e.dispatchEvent(i,"pointerover"),o&&e.dispatchEvent(i,"mouseover"),"mouse"===i.pointerType&&(e.cursor=e.getCursor(i.target)),(a=e.clonePointerEvent(i,"pointerenter")).eventPhase=a.AT_TARGET;a.target&&a.target!==(Du.isNode(e.rootTarget)&&e.rootTarget.parentNode);)a.currentTarget=a.target,e.notifyTarget(a),o&&e.notifyTarget(a,"mouseenter"),Du.isNode(a.target)&&(a.target=a.target.parentNode);r.overTargets=i.composedPath(),e.freeEvent(i),e.freeEvent(a);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerUpOutside=function(){var t=pe(le().mark((function t(n){var r,i,o,a;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof _c){t.next=2;break}return t.abrupt("return");case 2:return r=e.trackingData(n.pointerId),i=e.findMountedTarget(r.pressTargetsByButton[n.button]),t.next=6,e.createPointerEvent(n);case 6:if(o=t.sent,i){for(a=i;a;)o.currentTarget=a,e.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType||"mouse"!==o.pointerType&&"pen"!==o.pointerType||e.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),Du.isNode(a)&&(a=a.parentNode);delete r.pressTargetsByButton[n.button]}e.freeEvent(o);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onWheel=function(){var t=pe(le().mark((function t(n){var r;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Nc){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createWheelEvent(n);case 4:e.dispatchEvent(r=t.sent),e.freeEvent(r);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e}ve(e,t);var n=e.prototype;return n.init=function(){this.rootTarget=this.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)},n.client2Viewport=function(t){var e=this.contextService.getBoundingClientRect();return new Ps(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},n.viewport2Client=function(t){var e=this.contextService.getBoundingClientRect();return new Ps(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},n.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.canvasConfig,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),c=sn(nn(),u,s),l=Tn(e/o*2-1,2*(1-n/a)-1,0);return An(l,l,c),new Ps(l[0],l[1])},n.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=sn(nn(),n,r),o=Tn(t.x,t.y,0);An(o,o,i);var a=this.canvasConfig;return new Ps((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},n.setPickHandler=function(t){this.pickHandler=t},n.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},n.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},n.dispatchEvent=function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.emit(e||t.type,t)},n.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=i+1;n.length>o;o++)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},n.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)Du.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},n.hitTest=function(){var t=pe(le().mark((function t(e){var n,r,i,o,a;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.viewportY,o=(i=this.canvasConfig).width,a=i.height,!(0>(n=e.viewportX)||0>r||n>o||r>a)){t.next=4;break}return t.abrupt("return",null);case 4:return t.next=6,this.pickHandler(e);case 6:if(t.t1=t.sent,t.t1){t.next=9;break}t.t1=this.rootTarget;case 9:if(t.t0=t.t1,t.t0){t.next=12;break}t.t0=null;case 12:return t.abrupt("return",t.t0);case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.isNativeEventFromCanvas=function(t){var e,n=this.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},n.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e,n=we(this.displayObjectPool.getHTMLs());!(e=n()).done;){var r=e.value;if(t.nativeEvent.composedPath().indexOf(r)>-1)return r}return null},n.pickTarget=function(){var t=pe(le().mark((function t(e){return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY}));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.createPointerEvent=function(){var t=pe(le().mark((function t(e,n,r){var i,o;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.allocateEvent(_c),this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.nativeEvent=e.nativeEvent,i.originalEvent=e,o=this.getExistedHTML(i),null==r){t.next=11;break}t.t0=r,t.next=20;break;case 11:if(t.t1=o,t.t1){t.next=19;break}if(t.t2=this.isNativeEventFromCanvas(i),!t.t2){t.next=18;break}return t.next=17,this.pickTarget(i);case 17:t.t2=t.sent;case 18:t.t1=t.t2;case 19:t.t0=t.t1;case 20:return i.target=t.t0,"string"==typeof n&&(i.type=n),t.abrupt("return",i);case 23:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),n.createWheelEvent=function(){var t=pe(le().mark((function t(e){var n,r;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(Nc),this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,r=this.getExistedHTML(n),t.t0=r,t.t0){t.next=15;break}if(t.t1=this.isNativeEventFromCanvas(n),!t.t1){t.next=14;break}return t.next=13,this.pickTarget(n);case 13:t.t1=t.sent;case 14:t.t0=t.t1;case 15:return n.target=t.t0,t.abrupt("return",n);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},n.clonePointerEvent=function(t,e){var n=this.allocateEvent(_c);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},n.copyPointerData=function(t,e){t instanceof _c&&e instanceof _c&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)},n.copyMouseData=function(t,e){t instanceof Cc&&e instanceof Cc&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset))},n.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},n.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},n.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},n.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},n.notifyTarget=function(t,e){var n;e=null!==(n=e)&&void 0!==n?n:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},n.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},n.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Du.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},n.getCursor=function(t){for(var e=t;e;){var n=Yu.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=Du.isNode(e)&&e.parentNode}},e}(bo.EventEmitter),se([lt(al),ce("design:type",Object)],t.EventService.prototype,"renderingContext",void 0),se([lt(nl),ce("design:type",Object)],t.EventService.prototype,"contextService",void 0),se([lt(Ti),ce("design:type",Object)],t.EventService.prototype,"canvasConfig",void 0),se([lt(t.DisplayObjectPool),ce("design:type",t.DisplayObjectPool)],t.EventService.prototype,"displayObjectPool",void 0),se([Y.postConstruct(),ce("design:type",Function),ce("design:paramtypes",[]),ce("design:returntype",void 0)],t.EventService.prototype,"init",null),t.EventService=se([ct()],t.EventService),t.OffscreenCanvasCreator=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d");else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d")}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.getOrCreateContext=function(t){return this.context||this.getOrCreateCanvas(t),this.context},t}(),t.OffscreenCanvasCreator=se([ct()],t.OffscreenCanvasCreator);var dl={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},yl=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,vl=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),gl=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source);t.TextService=function(){function t(){var t=this;this.cache={},this.offscreenCanvas=void 0,this.shouldBreakByKinsokuShorui=function(e,n){return!t.isBreakingSpace(n)&&!(!e||!gl.exec(n)&&!vl.exec(e))},this.trimByKinsokuShorui=function(t){var e=[].concat(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}var e=t.prototype;return e.measureFont=function(t,e){if(this.cache[t])return this.cache[t];var n={ascent:0,descent:0,fontSize:0},r=this.offscreenCanvas.getOrCreateCanvas(e),i=this.offscreenCanvas.getOrCreateContext(e);i.font=t;var o=dl.MetricsString+dl.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(dl.BaselineSymbol).width),u=dl.HeightMultiplier*s;s=s*dl.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var c=i.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,p=0,f=0,d=!1;for(p=0;s>p;++p){for(var y=0;h>y;y+=4)if(255!==c[f+y]){d=!0;break}if(d)break;f+=h}for(n.ascent=s-p,f=l-h,d=!1,p=u;p>s;--p){for(var v=0;h>v;v+=4)if(255!==c[f+v]){d=!0;break}if(d)break;f-=h}return n.descent=p-s,n.fontSize=n.ascent+n.descent,this.cache[t]=n,n},e.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,o=e.lineHeight,a=void 0===o?0:o,s=e.lineWidth,u=e.textBaseline,c=e.textAlign,l=e.letterSpacing,h=void 0===l?0:l,p=e.leading,f=void 0===p?0:p,d=no(e),y=this.measureFont(d,n);0===y.fontSize&&(y.fontSize=r.value,y.ascent=r.value);var v=this.offscreenCanvas.getOrCreateContext(n);v.font=d;for(var g=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),m=new Array(g.length),T=0,b=0;g.length>b;b++){var S=v.measureText(g[b]).width+(g[b].length-1)*h;m[b]=S,T=Math.max(T,S)}var E=T+s.value,w=a||y.fontSize+s.value,x=Math.max(w,y.fontSize+s.value)+(g.length-1)*(w+f),k=0;return"middle"===u.value?k=-x/2:"bottom"===u.value||"alphabetic"===u.value||"ideographic"===u.value?k=-x:"top"!==u.value&&"hanging"!==u.value||(k=0),{font:d,width:E,height:x,lines:g,lineWidths:m,lineHeight:w+=f,maxLineWidth:T,fontProperties:y,lineMetrics:m.map((function(t,e){var n=0;return"center"===c.value?n-=t/2:"right"!==c.value&&"end"!==c.value||(n-=t),new Cs(n-s.value/2,k+e*w,t+s.value,w)}))}},e.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=void 0===a?0:a,u=this.offscreenCanvas.getOrCreateContext(n),c=o+s,l=[],h=0,p=0,f={},d=function(t){return r.getFromCache(t,s,f,u)};return Array.from(t).forEach((function(e,n){var i=t[n-1],o=t[n+1],a=d(e);if(r.isNewline(e))return h++,p=0,void(l[h]="");if(p>0&&p+a>c){if(h++,p=0,l[h]="",r.isBreakingSpace(e))return;r.canBreakInLastChar(e)||(l=r.trimToBreakable(l),p=r.sumTextWidthByCache(l[h]||"",f)),r.shouldBreakByKinsokuShorui(e,o)&&(l=r.trimByKinsokuShorui(l),p+=d(i||""))}p+=a,l[h]=(l[h]||"")+e})),l.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&dl.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&dl.Newlines.indexOf(t.charCodeAt(0))>=0},e.trimToBreakable=function(t){var e=[].concat(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,o),e},e.canBreakInLastChar=function(t){return!t||!yl.test(t)},e.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},e.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!yl.test(t[e]))return e;return-1},e.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),se([lt(t.OffscreenCanvasCreator),ce("design:type",t.OffscreenCanvasCreator)],t.TextService.prototype,"offscreenCanvas",void 0),t.TextService=se([ct()],t.TextService);var ml=t.Syringe.defineToken("GeometryUpdaterFactory"),Tl=t.Syringe.defineToken("GeometryAABBUpdater");function bl(t){var e=t.parsedStyle.fontSize;return e&&!Uo.isRelativeUnit(e.unit)?e.clone():new Uo(0,"px")}t.CircleUpdater=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n.value,height:2*n.value}},t}(),t.CircleUpdater=se([ct({token:{token:Tl,named:t.Shape.CIRCLE}})],t.CircleUpdater),t.EllipseUpdater=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx.value,height:2*t.ry.value}},t}(),t.EllipseUpdater=se([ct({token:{token:Tl,named:t.Shape.ELLIPSE}})],t.EllipseUpdater),t.RectUpdater=function(){function e(){}return e.prototype.update=function(e,n){var r=e.img,i=e.width,o=e.height,a=0,s=0;return i instanceof Uo&&i.unit===t.UnitType.kPixels&&(a=i.value),o instanceof Uo&&o.unit===t.UnitType.kPixels&&(s=o.value),r&&!$r(r)&&(a||(a=r.width),s||(s=r.height)),i instanceof Uo&&(i.value=a),o instanceof Uo&&(o.value=s),{width:a,height:s}},e}(),t.RectUpdater=se([ct({token:[{token:Tl,named:t.Shape.RECT},{token:Tl,named:t.Shape.IMAGE},{token:Tl,named:t.Shape.GROUP}]})],t.RectUpdater),t.TextUpdater=function(){function t(){this.textService=void 0}var e=t.prototype;return e.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&t.lineWidth},e.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,c=t.dy,l=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(r=n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var h=this.textService.measureText(i,t,l);t.metrics=h;var p=h.lineHeight,f=h.fontProperties,d=Tn(h.width/2,h.height/2,0),y=[0,1],v=0;"center"===o.value?(v=a.value/2,y=[.5,1]):"right"!==o.value&&"end"!==o.value||(v=a.value,y=[1,1]);var g=0;return"middle"===s.value?g=d[1]:"top"===s.value||"hanging"===s.value?g=2*d[1]:"alphabetic"===s.value?g=p-f.ascent:"bottom"!==s.value&&"ideographic"!==s.value||(g=0),u&&(v+=u.value),c&&(g+=c.value),t.anchor=[new Uo(y[0]),new Uo(y[1]),new Uo(0)],{width:2*d[0],height:2*d[1],offsetX:v,offsetY:g}},t}(),se([lt(t.TextService),ce("design:type",t.TextService)],t.TextUpdater.prototype,"textService",void 0),t.TextUpdater=se([ct({token:{token:Tl,named:t.Shape.TEXT}})],t.TextUpdater),t.LineUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e.value,r.value),a=Math.max(e.value,r.value),s=Math.min(n.value,i.value);return{width:a-o,height:Math.max(n.value,i.value)-s}},t}(),t.LineUpdater=se([ct({token:{token:Tl,named:t.Shape.LINE}})],t.LineUpdater),t.PolylineUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,e.map((function(t){return t[0]}))),r=Math.max.apply(Math,e.map((function(t){return t[0]}))),i=Math.min.apply(Math,e.map((function(t){return t[1]})));return{width:r-n,height:Math.max.apply(Math,e.map((function(t){return t[1]})))-i}},t}(),t.PolylineUpdater=se([ct({token:[{token:Tl,named:t.Shape.POLYLINE},{token:Tl,named:t.Shape.POLYGON}]})],t.PolylineUpdater),t.PathUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),t.PathUpdater=se([ct({token:{token:Tl,named:t.Shape.PATH}})],t.PathUpdater),t.CSSPropertyClipPath=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){if(n instanceof Co&&(n=null),e&&e!==n&&e.style.clipPathTargets){var i=e.style.clipPathTargets.indexOf(r);e.style.clipPathTargets.splice(i,1)}return n&&(n.style.clipPathTargets||(n.style.clipPathTargets=[]),n.style.clipPathTargets.push(r)),$c(r),n},t}(),t.CSSPropertyClipPath=se([ct({token:{token:Au,named:t.PropertySyntax.CLIP_PATH}})],t.CSSPropertyClipPath),t.CSSPropertyColor=function(){function t(){this.parser=ps,this.mixer=fs}return t.prototype.calculator=function(t,e,n,r){return n instanceof Co?new Zo(0,0,0,0,"none"===n.value):n},t}(),t.CSSPropertyColor=se([ct({token:[{token:Au,named:t.PropertySyntax.PAINT},{token:Au,named:t.PropertySyntax.COLOR}]})],t.CSSPropertyColor),t.CSSPropertyFilter=function(){this.parser=gu},t.CSSPropertyFilter=se([ct({token:{token:Au,named:t.PropertySyntax.FILTER}})],t.CSSPropertyFilter),t.CSSPropertyLengthOrPercentage=function(){function e(){this.parser=Ms,this.mixer=Os}return e.prototype.calculator=function(e,n,r,i,o){if(!Uo.isRelativeUnit(r.unit))return r.clone();if(r.unit===t.UnitType.kPercentage)return new Uo(0,"px");if(r.unit===t.UnitType.kEms){if(i.parentNode){var a=bl(i.parentNode);return a.value*=r.value,a}return new Uo(0,"px")}if(r.unit===t.UnitType.kRems){var s;if(null==i||null===(s=i.ownerDocument)||void 0===s?void 0:s.documentElement){var u=bl(i.ownerDocument.documentElement);return u.value*=r.value,u}return new Uo(0,"px")}},e}(),t.CSSPropertyLengthOrPercentage=se([ct({token:{token:Au,named:t.PropertySyntax.LENGTH_PERCENTAGE}})],t.CSSPropertyLengthOrPercentage),t.CSSPropertyLengthOrPercentage12=function(){function t(){this.mixer=Ls}return t.prototype.parser=function(t){var e=Rs(Ue(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t}(),t.CSSPropertyLengthOrPercentage12=se([ct({token:{token:Au,named:t.PropertySyntax.LENGTH_PERCENTAGE_12}})],t.CSSPropertyLengthOrPercentage12),t.CSSPropertyLengthOrPercentage14=function(){function t(){this.mixer=Ls}return t.prototype.parser=function(t){var e=Rs(Ue(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t}(),t.CSSPropertyLengthOrPercentage14=se([ct({token:{token:Au,named:t.PropertySyntax.LENGTH_PERCENTAGE_14}})],t.CSSPropertyLengthOrPercentage14),t.CSSPropertyLocalPosition=function(e){function n(){return e.apply(this,arguments)||this}return ve(n,e),n.prototype.postProcessor=function(e){var n,r,i;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var o=e.parsedStyle,a=o.cx,s=o.cy;De(a)||(n=a.value),De(s)||(r=s.value);break;case t.Shape.LINE:var u=e.parsedStyle,c=u.y1,l=u.y2;n=Math.min(u.x1.value,u.x2.value),r=Math.min(c.value,l.value),i=0;break;default:De(e.parsedStyle.x)||(n=e.parsedStyle.x.value),De(e.parsedStyle.y)||(r=e.parsedStyle.y.value)}e.parsedStyle.defX=n||0,e.parsedStyle.defY=r||0;var h=e.getLocalPosition(),p=h[0],f=h[1],d=h[2];e.setLocalPosition(De(n)?p:n,De(r)?f:r,De(i)?d:i)},n}(t.CSSPropertyLengthOrPercentage),t.CSSPropertyLocalPosition=se([ct({token:{token:Au,named:t.PropertySyntax.COORDINATE}})],t.CSSPropertyLocalPosition),t.CSSPropertyOffsetDistance=function(){function e(){this.parser=Fs,this.mixer=Vs(0,1)}return e.prototype.postProcessor=function(e){if(e.attributes.offsetPath){var n=e.attributes.offsetPath.nodeName;if(n===t.Shape.LINE||n===t.Shape.PATH||n===t.Shape.POLYLINE){var r=e.attributes.offsetPath.getPoint(e.parsedStyle.offsetDistance.value);r&&e.setLocalPosition(r.x,r.y)}}},e}(),t.CSSPropertyOffsetDistance=se([ct({token:{token:Au,named:t.PropertySyntax.OFFSET_DISTANCE}})],t.CSSPropertyOffsetDistance),t.CSSPropertyOffsetPath=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){if(e&&e!==n&&e.style.offsetPathTargets){var i=e.style.offsetPathTargets.indexOf(r);e.style.offsetPathTargets.splice(i,1)}return n&&(n.style.offsetPathTargets||(n.style.offsetPathTargets=[]),n.style.offsetPathTargets.push(r)),n},t}(),t.CSSPropertyOffsetPath=se([ct({token:{token:Au,named:t.PropertySyntax.OFFSET_PATH}})],t.CSSPropertyOffsetPath),t.CSSPropertyOpacity=function(){this.parser=Fs,this.mixer=Vs(0,1)},t.CSSPropertyOpacity=se([ct({token:{token:Au,named:t.PropertySyntax.OPACITY_VALUE}})],t.CSSPropertyOpacity),t.CSSPropertyPath=function(){function e(){this.parser=pu,this.mixer=fu}var n=e.prototype;return n.calculator=function(t,e,n){return n instanceof Co&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:[],totalLength:0,curveSegments:[],zCommandIndexes:[],rect:new Cs(0,0,0,0)}:n},n.postProcessor=function(e){if(e.nodeName===t.Shape.PATH){var n=e.parsedStyle,r=n.defX,i=n.defY;e.setLocalPosition(void 0===r?0:r,void 0===i?0:i)}},e}(),t.CSSPropertyPath=se([ct({token:{token:Au,named:t.PropertySyntax.PATH}})],t.CSSPropertyPath),t.CSSPropertyPoints=function(){function e(){this.parser=du}return e.prototype.postProcessor=function(e){if(e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE){var n=e.parsedStyle;e.setLocalPosition(n.defX,n.defY)}},e}(),t.CSSPropertyPoints=se([ct({token:{token:Au,named:t.PropertySyntax.LIST_OF_POINTS}})],t.CSSPropertyPoints),t.CSSPropertyShadowBlur=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).mixer=Vs(0,1/0),e}return ve(e,t),e}(t.CSSPropertyLengthOrPercentage),t.CSSPropertyShadowBlur=se([ct({token:{token:Au,named:t.PropertySyntax.SHADOW_BLUR}})],t.CSSPropertyShadowBlur),t.CSSPropertyText=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Co?"unset"===n.value?"":n.value:n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),t.CSSPropertyText=se([ct({token:{token:Au,named:t.PropertySyntax.TEXT}})],t.CSSPropertyText),t.CSSPropertyTextTransform=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n},t}(),t.CSSPropertyTextTransform=se([ct({token:{token:Au,named:t.PropertySyntax.TEXT_TRANSFORM}})],t.CSSPropertyTextTransform),t.CSSPropertyTransform=function(){function t(){this.parser=wu,this.mixer=Pu}return t.prototype.postProcessor=function(t){var e=t.parsedStyle,n=e.transform,r=e.defX,i=e.defY;n&&n.length&&(t.resetLocalTransform(),t.setLocalPosition(r,i),n.forEach((function(e){var n=e.t,r=e.d;if("scale"===n){var i=r.map((function(t){return t.value}))||[1,1];t.scaleLocal(i[0],i[1],1)}else if("scalex"===n){var o=r.map((function(t){return t.value}))||[1];t.scaleLocal(o[0],1,1)}else if("scaley"===n){var a=r.map((function(t){return t.value}))||[1];t.scaleLocal(1,a[0],1)}else if("scalez"===n){var s=r.map((function(t){return t.value}))||[1];t.scaleLocal(1,1,s[0])}else if("scale3d"===n){var u=r.map((function(t){return t.value}))||[1,1,1];t.scaleLocal(u[0],u[1],u[2])}else if("translate"===n){var c=r||[Xo,Xo];t.translateLocal(c[0].value,c[1].value,0)}else if("translatex"===n){t.translateLocal((r||[Xo])[0].value,0,0)}else if("translatey"===n){t.translateLocal(0,(r||[Xo])[0].value,0)}else if("translatez"===n){t.translateLocal(0,0,(r||[Xo])[0].value)}else if("translate3d"===n){var l=r||[Xo,Xo,Xo];t.translateLocal(l[0].value,l[1].value,l[2].value)}else if("rotate"===n){t.rotateLocal(0,0,(r||[Ko])[0].value)}else if("rotatex"===n){t.rotateLocal((r||[Ko])[0].value,0,0)}else if("rotatey"===n){t.rotateLocal(0,(r||[Ko])[0].value,0)}else if("rotatez"===n){t.rotateLocal(0,0,(r||[Ko])[0].value)}})))},t}(),t.CSSPropertyTransform=se([ct({token:{token:Au,named:t.PropertySyntax.TRANSFORM}})],t.CSSPropertyTransform),t.CSSPropertyTransformOrigin=function(){this.parser=Cu},t.CSSPropertyTransformOrigin=se([ct({token:{token:Au,named:t.PropertySyntax.TRANSFORM_ORIGIN}})],t.CSSPropertyTransformOrigin),t.CSSPropertyZIndex=function(){function t(){this.parser=Fs}return t.prototype.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0)}},t}(),t.CSSPropertyZIndex=se([ct({token:{token:Au,named:t.PropertySyntax.Z_INDEX}})],t.CSSPropertyZIndex);var Sl=[{name:"display",keywords:["none"]},{name:"opacity",interpolable:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"fillOpacity",interpolable:!0,inherited:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"strokeOpacity",interpolable:!0,inherited:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"fill",interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.PAINT},{name:"stroke",interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.PAINT},{name:"shadowColor",interpolable:!0,syntax:t.PropertySyntax.COLOR},{name:"shadowOffsetX",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"shadowOffsetY",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"shadowBlur",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.SHADOW_BLUR},{name:"lineWidth",interpolable:!0,inherited:!0,defaultValue:"1",layoutDependent:!0,alias:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"increasedLineWidthForHitTesting",inherited:!0,defaultValue:"0",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"lineJoin",inherited:!0,layoutDependent:!0,alias:["strokeLinejoin"],keywords:["miter","bevel","round"],defaultValue:"miter"},{name:"lineCap",inherited:!0,layoutDependent:!0,alias:["strokeLinecap"],keywords:["butt","round","square"],defaultValue:"butt"},{name:"lineDash",interpolable:!0,inherited:!0,keywords:["none"],alias:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{name:"lineDashOffset",interpolable:!0,inherited:!0,defaultValue:"0",alias:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"offsetPath",syntax:t.PropertySyntax.OFFSET_PATH},{name:"offsetDistance",interpolable:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{name:"dx",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"dy",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"zIndex",independent:!0,interpolable:!0,defaultValue:"0",keywords:["auto"],syntax:t.PropertySyntax.Z_INDEX},{name:"visibility",keywords:["visible","hidden"],independent:!0,inherited:!0,defaultValue:"visible"},{name:"pointerEvents",inherited:!0,keywords:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"],defaultValue:"auto"},{name:"filter",independent:!0,layoutDependent:!0,syntax:t.PropertySyntax.FILTER},{name:"clipPath",syntax:t.PropertySyntax.CLIP_PATH},{name:"transform",parsePriority:100,interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.TRANSFORM},{name:"transformOrigin",parsePriority:100,defaultValue:"left top",layoutDependent:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{name:"anchor",parsePriority:99,defaultValue:"0 0",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{name:"cx",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"cy",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"r",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"rx",interpolable:!0,layoutDependent:!0,defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"ry",interpolable:!0,layoutDependent:!0,defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"x",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"y",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"z",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"width",interpolable:!0,layoutDependent:!0,keywords:["auto","fit-content","min-content","max-content"],defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"height",interpolable:!0,layoutDependent:!0,keywords:["auto","fit-content","min-content","max-content"],defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"radius",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{name:"x1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"y1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"z1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"x2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"y2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"z2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"path",interpolable:!0,layoutDependent:!0,defaultValue:"",alias:["d"],syntax:t.PropertySyntax.PATH},{name:"points",layoutDependent:!0,syntax:t.PropertySyntax.LIST_OF_POINTS},{name:"text",layoutDependent:!0,defaultValue:"",syntax:t.PropertySyntax.TEXT,parsePriority:50},{name:"textTransform",layoutDependent:!0,inherited:!0,keywords:["capitalize","uppercase","lowercase","none"],defaultValue:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,parsePriority:51},{name:"font",layoutDependent:!0},{name:"fontSize",interpolable:!0,inherited:!0,defaultValue:"16px",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"fontFamily",layoutDependent:!0,inherited:!0,defaultValue:"sans-serif"},{name:"fontStyle",layoutDependent:!0,inherited:!0,keywords:["normal","italic","oblique"],defaultValue:"normal"},{name:"fontWeight",layoutDependent:!0,inherited:!0,keywords:["normal","bold","bolder","lighter"],defaultValue:"normal"},{name:"fontVariant",layoutDependent:!0,inherited:!0,keywords:["normal","small-caps"],defaultValue:"normal"},{name:"lineHeight",layoutDependent:!0},{name:"letterSpacing",layoutDependent:!0},{name:"wordWrap",layoutDependent:!0},{name:"wordWrapWidth",layoutDependent:!0},{name:"leading",layoutDependent:!0},{name:"textBaseline",layoutDependent:!0,inherited:!0,keywords:["top","hanging","middle","alphabetic","ideographic","bottom"],defaultValue:"alphabetic"},{name:"textAlign",layoutDependent:!0,inherited:!0,keywords:["start","center","end","left","right"],defaultValue:"start"},{name:"whiteSpace",layoutDependent:!0}];t.DefaultStyleValueRegistry=function(){function e(){this.dirty=!1,this.cache={},this.unresolvedProperties={},this.propertySyntaxFactory=void 0,this.cascadeProperties={}}var n=e.prototype;return n.init=function(){var t=this;Sl.forEach((function(e){t.registerMetadata(e)}))},n.registerMetadata=function(t){var e=this;[t.name].concat(t.alias||[]).forEach((function(n){e.cache[n]=t}))},n.unregisterMetadata=function(t){delete this.cache[t]},n.getMetadata=function(t){return this.cache[t]},n.getPropertySyntax=function(t){return this.propertySyntaxFactory(t)},n.processProperties=function(t,e,n){var r=this;void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1});var i=n.skipUpdateAttribute,o=n.skipParse,a=!1;Object.keys(e).forEach((function(n){var o,s=ai(n,e[n]),u=s[0];i||(t.attributes[u]=s[1]),!a&&(null===(o=r.getMetadata(u))||void 0===o?void 0:o.layoutDependent)&&(a=!0)}));var s=Object.keys(e).sort((function(t,e){var n,i;return((null===(n=r.getMetadata(t))||void 0===n?void 0:n.parsePriority)||0)-((null===(i=r.getMetadata(e))||void 0===i?void 0:i.parsePriority)||0)}));o||s.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t)}));var u=!1;s.forEach((function(e){e in t.computedStyle&&(u=r.computeProperty(e,t.computedStyle[e],t))})),u?this.dirty=!0:(a&&this.updateGeometry(t),s.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t)})),s.forEach((function(e){e in t.parsedStyle&&r.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))})))},n.parseProperty=function(t,e,n){var r=this.getMetadata(t),i=e;if((""===e||De(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=new Co(e);else if(r){var o=r.keywords,a=r.syntax,s=a&&this.getPropertySyntax(a);if(o&&o.indexOf(e)>-1)i=new Co(e);else if(s){s&&s.parser&&(i=s.parser(e,n))}}return i},n.computeProperty=function(t,e,n){var r=this.getMetadata(t),i="g-root"===n.id,o=e instanceof ko?e.clone():e;if(r){var a=r.syntax,s=r.defaultValue;if(e instanceof Co){var u=e.value;if("unset"===u&&(u=r.inherited&&!i?"inherit":"initial"),"initial"===u)De(s)||(e=this.parseProperty(t,s,n));else if("inherit"===u){var c=this.tryToResolveProperty(n,t,{inherited:!0});return c?(n.parsedStyle[t]=c,!1):(this.addUnresolveProperty(n,t),!0)}}var l=a&&this.getPropertySyntax(a);if(l)if(l.calculator)o=l.calculator(t,n.parsedStyle[t],e,n,this);else o=e;else o=e}return n.parsedStyle[t]=o,!1},n.postProcessProperty=function(t,e){var n=this.getMetadata(t);if(n&&n.syntax){var r=n.syntax&&this.getPropertySyntax(n.syntax);r&&r.postProcessor&&r.postProcessor(e)}},n.isPropertyResolved=function(t,e){return!this.unresolvedProperties[t.entity]||0===this.unresolvedProperties[t.entity].length||this.unresolvedProperties[t.entity].includes(e)},n.addUnresolveProperty=function(t,e){this.unresolvedProperties[t.entity]||(this.unresolvedProperties[t.entity]=[]),-1===this.unresolvedProperties[t.entity].indexOf(e)&&this.unresolvedProperties[t.entity].push(e)},n.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&this.isPropertyResolved(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];return(!(r instanceof Co)||"unset"!==r.value&&"initial"!==r.value&&"inherit"!==r.value)&&(!(r instanceof Uo&&Uo.isRelativeUnit(r.unit))&&r)}return!1},n.recalc=function(t){var e=this.unresolvedProperties[t.entity];if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),delete this.unresolvedProperties[t.entity]}},n.updateGeometry=function(e){var n=Vt.get(ml)(e.nodeName);if(n){var r,i=e.geometry;i.contentBounds||(i.contentBounds=new ys),i.renderBounds||(i.renderBounds=new ys);var o=e.parsedStyle,a=n.update(o,e),s=a.width,u=a.height,c=a.depth,l=void 0===c?0:c,h=a.offsetX,p=void 0===h?0:h,f=a.offsetY,d=void 0===f?0:f,y=a.offsetZ,v=void 0===y?0:y,g=0>s,m=0>u,T=Tn(Math.abs(s)/2,Math.abs(u)/2,l/2),b=o.lineWidth,S=o.increasedLineWidthForHitTesting,E=o.shadowColor,w=o.filter,x=void 0===w?[]:w,k=o.transformOrigin,P=o.anchor;e.nodeName===t.Shape.TEXT&&delete o.anchor;var C=Tn((1-2*(P&&P[0].value||0))*s/2+p,(1-2*(P&&P[1].value||0))*u/2+d,(1-2*(P&&(null===(r=P[2])||void 0===r?void 0:r.value)||0))*T[2]+v);i.contentBounds.update(C,T);var _=(((null==b?void 0:b.value)||0)+((null==S?void 0:S.value)||0))/2;if(En(T,T,Tn(_,_,0)),i.renderBounds.update(C,T),E){var N=i.renderBounds,M=N.min,A=N.max,O=o.shadowBlur,I=o.shadowOffsetX,R=o.shadowOffsetY,L=O&&O.value||0,D=I&&I.value||0,U=R&&R.value||0,F=A[0]+L+D,B=M[1]-L+U,V=A[1]+L+U;M[0]=Math.min(M[0],M[0]-L+D),A[0]=Math.max(A[0],F),M[1]=Math.min(M[1],B),A[1]=Math.max(A[1],V),i.renderBounds.setMinMax(M,A)}x.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,En(i.renderBounds.halfExtents,i.renderBounds.halfExtents,Tn(r,r,0)))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=i.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,p=c[1]-s+a,f=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],p),l[1]=Math.max(l[1],f),i.renderBounds.setMinMax(c,l)}})),P=o.anchor;var G=(g?-1:1)*Ds(k[0],0,e),j=(m?-1:1)*Ds(k[1],1,e);e.setOrigin(G-=(g?-1:1)*(P&&P[0].value||0)*i.contentBounds.halfExtents[0]*2,j-=(m?-1:1)*(P&&P[1].value||0)*i.contentBounds.halfExtents[1]*2),e.dispatchEvent(new Ru(t.ElementEvent.GEOMETRY_BOUNDS_CHANGED)),$c(e)}},n.isPropertyInheritable=function(t){var e=this.getMetadata(t);return!!e&&e.inherited},e}(),se([lt(Mu),ce("design:type",Function)],t.DefaultStyleValueRegistry.prototype,"propertySyntaxFactory",void 0),se([Y.postConstruct(),ce("design:type",Function),ce("design:paramtypes",[]),ce("design:returntype",void 0)],t.DefaultStyleValueRegistry.prototype,"init",null),t.DefaultStyleValueRegistry=se([ct({token:Gr})],t.DefaultStyleValueRegistry);var El=At((function(e){Y.decorate(ut(),bo.EventEmitter),e(t.DisplayObjectPool),e(t.DefaultSceneGraphSelector),e({token:Kc,useFactory:function(t){return function(){return t.container.get(Zc)}}}),e(t.DefaultSceneGraphService),e(t.OffscreenCanvasCreator),e(t.TextService),e(t.CircleUpdater),e(t.EllipseUpdater),e(t.RectUpdater),e(t.TextUpdater),e(t.LineUpdater),e(t.PolylineUpdater),e(t.PathUpdater),e({token:ml,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(Tl,n)&&(e[n]=t.container.getNamed(Tl,n)),e[n]}}}),e(t.CSSPropertyAngle),e(t.CSSPropertyClipPath),e(t.CSSPropertyColor),e(t.CSSPropertyFilter),e(t.CSSPropertyLengthOrPercentage),e(t.CSSPropertyLengthOrPercentage12),e(t.CSSPropertyLengthOrPercentage14),e(t.CSSPropertyLocalPosition),e(t.CSSPropertyOffsetDistance),e(t.CSSPropertyOffsetPath),e(t.CSSPropertyOpacity),e(t.CSSPropertyPath),e(t.CSSPropertyPoints),e(t.CSSPropertyShadowBlur),e(t.CSSPropertyText),e(t.CSSPropertyTextTransform),e(t.CSSPropertyTransform),e(t.CSSPropertyTransformOrigin),e(t.CSSPropertyZIndex),e({token:Mu,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(Au,n)&&(e[n]=t.container.getNamed(Au,n)),e[n]}}}),e(t.DefaultStyleValueRegistry),e(t.LayoutRegistry),e(t.LayoutEngine),e(t.LayoutEdges),e({token:uo,useFactory:function(e){return function(n){var r=e.container.createChild();return r.register({token:co,useValue:n}),r.get(t.LayoutEdges)}}}),e({token:Pe,useFactory:function(e){return function(n){var r=e.container.createChild();r.register(t.LayoutContext),r.register(t.LayoutChildren),r.register({token:ro,useFactory:function(e){return function(n){var r=e.container.createChild();return r.register({token:io,useValue:n}),r.get(t.LayoutChildren)}}}),r.register(t.FragmentResult),r.register({token:Ne,useFactory:function(e){return function(n,r){var i=e.container.createChild();return i.register({token:Me,useValue:n}),i.register({token:Ae,useValue:r}),i.get(t.FragmentResult)}}}),r.register(t.LayoutFragment),r.register({token:po,useFactory:function(e){return function(n){var r=e.container.createChild();return r.register({token:fo,useValue:n}),r.get(t.LayoutFragment)}}});var i=r.get(ro),o=r.get(po),a=r.get(Ne);return r.register({token:Ce,useValue:ye({},n,{layoutChildrenFactory:i,layoutFragmentFactory:o,fragmentResultFactory:a})}),r.get(t.LayoutContext)}}})})),wl=function(){function t(t){this.plugins=[],this.config=void 0,this.config=ye({enableDirtyCheck:!0,enableCulling:!0,enableAutoRendering:!0,enableDirtyRectangleRendering:!0},t)}var e=t.prototype;return e.registerPlugin=function(t){this.plugins.push(t)},e.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.getPlugins=function(){return this.plugins},e.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.getConfig=function(){return this.config},e.setConfig=function(t){Object.assign(this.config,t)},t}();let xl=1;const kl="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},Pl=Date.now();let Cl={},_l=Date.now();const Nl=t=>{if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=Date.now(),n=e-_l,r=n>16?0:16-n,i=xl++;return Cl[i]=t,Object.keys(Cl).length>1||setTimeout((()=>{_l=e;const t=Cl;Cl={},Object.keys(t).forEach((e=>t[e](kl.performance&&"function"==typeof kl.performance.now?kl.performance.now():Date.now()-Pl)))}),r),i},Ml=t=>{delete Cl[t]},Al=t=>"string"!=typeof t?Nl:""===t?kl.requestAnimationFrame:kl[t+"RequestAnimationFrame"],Ol=((t,e)=>{let n=0;for(;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}})(["","webkit","moz","ms","o"],(t=>!!Al(t))),Il=Al(Ol),Rl="string"!=typeof(Ll=Ol)?Ml:""===Ll?kl.cancelAnimationFrame:kl[Ll+"CancelAnimationFrame"]||kl[Ll+"CancelRequestAnimationFrame"];var Ll,Dl,Ul;kl.requestAnimationFrame=Il,kl.cancelAnimationFrame=Rl,"undefined"!=typeof module&&module.exports&&(module.exports={requestAnimationFrame:Il,cancelAnimationFrame:Rl});var Fl,Bl,Vl=t.Syringe.defineToken("CullingStrategyContribution"),Gl=(Dl=function(){function e(){this.strategyProvider=void 0,this.renderingContext=void 0}return e.prototype.apply=function(e){var n=this;e.hooks.cull.tap(Ul.tag,(function(e){if(e){var r=e.cullable;return r.visible=!0,!r.isCulled()&&e.isVisible()?e:(n.renderingContext.renderListLastFrame.indexOf(e)>-1&&e.dispatchEvent(new Ru(t.ElementEvent.CULLED)),null)}return e})),e.hooks.afterRender.tap(Ul.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e}(),Dl.tag="Culling",Ul=Dl);se([jt(Vl),ce("design:type",Object)],Gl.prototype,"strategyProvider",void 0),se([lt(al),ce("design:type",Object)],Gl.prototype,"renderingContext",void 0),Gl=Ul=se([ct({contrib:fl})],Gl);var jl,Hl,zl=(Fl=function(){function e(){this.renderingContext=void 0}return e.prototype.apply=function(e){var n=this;e.hooks.dirtycheck.tap(Bl.tag,(function(e){if(e){var r=e.renderable,i=n.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED);return r.dirty||i?e:null}return e}))},e}(),Fl.tag="DirtyCheck",Bl=Fl);se([lt(al),ce("design:type",Object)],zl.prototype,"renderingContext",void 0),zl=Bl=se([ct({contrib:fl})],zl);var Wl=(jl=function(){function t(){var t=this;this.canvasConfig=void 0,this.contextService=void 0,this.renderingService=void 0,this.renderingContext=void 0,this.eventService=void 0,this.autoPreventDefault=!0,this.rootPointerEvent=new _c(null),this.rootWheelEvent=new Nc(null),this.onPointerMove=function(e){var n,r,i=null===(n=t.renderingContext.root)||void 0===n||null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView;if(!i.supportsTouchEvents||"touch"!==e.pointerType){for(var o,a=we(t.normalizeToPointerEvent(e,i));!(o=a()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,o.value,i);t.eventService.mapEvent(s)}t.setCursor(t.eventService.cursor)}}}var e=t.prototype;return e.apply=function(t){var e=this,n=this.renderingContext.root.ownerDocument.defaultView;this.eventService.setPickHandler(function(){var t=pe(le().mark((function t(n){return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.renderingService.hooks.pick.promise({position:n,picked:[],topmost:!0});case 2:return t.abrupt("return",t.sent.picked[0]||null);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.hooks.pointerWheel.tap(Hl.tag,(function(t){var n=e.normalizeWheelEvent(t);e.eventService.mapEvent(n)})),t.hooks.pointerDown.tap(Hl.tag,(function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){var r=e.normalizeToPointerEvent(t,n);if(e.autoPreventDefault&&r[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var i,o=we(r);!(i=o()).done;){var a=e.bootstrapEvent(e.rootPointerEvent,i.value,n);e.eventService.mapEvent(a)}e.setCursor(e.eventService.cursor)}})),t.hooks.pointerUp.tap(Hl.tag,(function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var r,i=e.contextService.getDomElement(),o=i&&t.target&&t.target!==i&&i.contains&&!i.contains(t.target)?"outside":"",a=we(e.normalizeToPointerEvent(t,n));!(r=a()).done;){var s=e.bootstrapEvent(e.rootPointerEvent,r.value,n);s.type+=o,e.eventService.mapEvent(s)}e.setCursor(e.eventService.cursor)}})),t.hooks.pointerMove.tap(Hl.tag,this.onPointerMove),t.hooks.pointerOver.tap(Hl.tag,this.onPointerMove),t.hooks.pointerOut.tap(Hl.tag,this.onPointerMove)},e.bootstrapEvent=function(t,e,n){t.pointerType=e.pointerType;var r=t;r.view=n,r.originalEvent=null,r.nativeEvent=e,r.pointerId=e.pointerId,r.width=e.width,r.height=e.height,r.isPrimary=e.isPrimary,r.pressure=e.pressure,r.tangentialPressure=e.tangentialPressure,r.tiltX=e.tiltX,r.tiltY=e.tiltY,r.twist=e.twist,this.transferMouseData(r,e);var i=this.eventService.client2Viewport(new Ps(e.clientX,e.clientY)),o=i.y;r.viewport.x=i.x,r.viewport.y=o;var a=this.eventService.viewport2Canvas(r.viewport),s=a.y;return r.canvas.x=a.x,r.canvas.y=s,r.global.copyFrom(r.canvas),r.offset.copyFrom(r.canvas),r.isTrusted=e.isTrusted,"pointerleave"===r.type&&(r.type="pointerout"),r.type.startsWith("mouse")&&(r.type=r.type.replace("mouse","pointer")),r.type.startsWith("touch")&&(r.type=Ur[r.type]||r.type),r},e.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.eventService.client2Viewport(new Ps(t.clientX,t.clientY)),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},e.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},e.setCursor=function(t){this.contextService.applyCursorStyle(t||this.canvasConfig.cursor||"default")},e.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];Le(i.button)&&(i.button=t.touches.length?1:0),Le(i.buttons)&&(i.buttons=t.touches.length?1:0),Le(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Le(i.width)&&(i.width=i.radiusX||1),Le(i.height)&&(i.height=i.radiusY||1),Le(i.tiltX)&&(i.tiltX=0),Le(i.tiltY)&&(i.tiltY=0),Le(i.pointerType)&&(i.pointerType="touch"),Le(i.pointerId)&&(i.pointerId=i.identifier||0),Le(i.pressure)&&(i.pressure=i.force||.5),Le(i.twist)&&(i.twist=0),Le(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;Le(o.isPrimary)&&(o.isPrimary=!0),Le(o.width)&&(o.width=1),Le(o.height)&&(o.height=1),Le(o.tiltX)&&(o.tiltX=0),Le(o.tiltY)&&(o.tiltY=0),Le(o.pointerType)&&(o.pointerType="mouse"),Le(o.pointerId)&&(o.pointerId=1),Le(o.pressure)&&(o.pressure=.5),Le(o.twist)&&(o.twist=0),Le(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t}(),jl.tag="Event",Hl=jl);se([lt(Ti),ce("design:type",Object)],Wl.prototype,"canvasConfig",void 0),se([lt(nl),ce("design:type",Object)],Wl.prototype,"contextService",void 0),se([lt(t.RenderingService),ce("design:type",t.RenderingService)],Wl.prototype,"renderingService",void 0),se([lt(al),ce("design:type",Object)],Wl.prototype,"renderingContext",void 0),se([lt(t.EventService),ce("design:type",t.EventService)],Wl.prototype,"eventService",void 0),Wl=Hl=se([ct({contrib:fl})],Wl);var Yl,ql,Xl=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],Kl=function(){function e(){this.camera=void 0}var n=e.prototype;return n.isVisible=function(e){var n,r,i=e.cullable;if(!i.enable)return!0;var o=e.getRenderBounds();if(ys.isEmpty(o))return!1;var a=this.camera.getFrustum(),s=null===(n=e.parentNode)||void 0===n||null===(r=n.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,o,s||t.Mask.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==t.Mask.OUTSIDE,i.visible},n.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var o=t.Mask.INSIDE,a=Xl.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!a||4!==s&&5!==s)){var l=i[s],h=l.normal,p=l.distance;if(0>_n(h,n.getPositiveFarPoint(i[s]))+p)return t.Mask.OUTSIDE;0>_n(h,n.getNegativeFarPoint(i[s]))+p&&(o|=c)}}return o},e}();se([lt(sl),ce("design:type",pl)],Kl.prototype,"camera",void 0),Kl=se([ct({contrib:Vl})],Kl);var Zl=(Yl=function(){function e(){this.renderingContext=void 0,this.styleValueRegistry=void 0,this.rBush=void 0,this.toSync=new Set}var n=e.prototype;return n.pushToSync=function(t){var e=this;t.forEach((function(t){e.toSync.add(t)}))},n.apply=function(e){var n=this,r=function(t){t.target.renderable.dirty=!0,e.dirtify()},i=function(t){t.detail.affectChildren&&t.target.forEach((function(t){n.pushToSync([t])})),n.pushToSync(t.composedPath().slice(0,-2)),e.dirtify()},o=function(t){var r=t.target;n.pushToSync(t.composedPath().slice(0,-2)),n.styleValueRegistry.recalc(r),$c(r),e.dirtify()},a=function(t){var r=t.target,i=r.rBushNode;i.aabb&&(n.rBush.remove(i.aabb),n.toSync.delete(r)),$c(t.target),e.dirtify()};e.hooks.init.tapPromise(ql.tag,pe(le().mark((function e(){return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.renderingContext.root.addEventListener(t.ElementEvent.MOUNTED,o),n.renderingContext.root.addEventListener(t.ElementEvent.UNMOUNTED,a),n.renderingContext.root.addEventListener(t.ElementEvent.ATTR_MODIFIED,r),n.renderingContext.root.addEventListener(t.ElementEvent.BOUNDS_CHANGED,i);case 4:case"end":return e.stop()}}),e)})))),e.hooks.destroy.tap(ql.tag,(function(){n.renderingContext.root.removeEventListener(t.ElementEvent.MOUNTED,o),n.renderingContext.root.removeEventListener(t.ElementEvent.UNMOUNTED,a),n.renderingContext.root.removeEventListener(t.ElementEvent.ATTR_MODIFIED,r),n.renderingContext.root.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,i)})),e.hooks.endFrame.tap(ql.tag,(function(){n.syncRTree()}))},n.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=i.getMin(),a=o[0],s=o[1],u=i.getMax();r.aabb={id:n.entity,minX:a,minY:s,maxX:u[0],maxY:u[1]}}r.aabb&&e.push(r.aabb)})),this.rBush.load(e),this.toSync.clear()},e}(),Yl.tag="Prepare",ql=Yl);se([lt(al),ce("design:type",Object)],Zl.prototype,"renderingContext",void 0),se([lt(Gr),ce("design:type",Object)],Zl.prototype,"styleValueRegistry",void 0),se([lt(Vu),ce("design:type",qt)],Zl.prototype,"rBush",void 0),Zl=ql=se([ct({contrib:fl})],Zl);var Jl,Ql=At((function(e){t.Contribution.register(e,fl,{cache:!1}),t.Contribution.register(e,Vl,{cache:!1}),e({token:Vu,useValue:new qt}),e(t.RenderingService),e(t.EventService),e(Wl),e(Zl),e(zl),e(Gl),e(Kl)}));(Jl=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",Jl.BEFORE_RENDER="beforerender",Jl.AFTER_RENDER="afterrender",Jl.BEFORE_DESTROY="beforedestroy",Jl.AFTER_DESTROY="afterdestroy",Jl.RESIZE="resize";var $l=function(e){function n(n){var r;(r=e.call(this)||this).container=Vt.createChild(),r.document=void 0,r.customElements=void 0,r.requestAnimationFrame=void 0,r.cancelAnimationFrame=void 0,r.devicePixelRatio=void 0,r.supportsPointerEvents=void 0,r.supportsTouchEvents=void 0,r.isTouchEvent=void 0,r.isMouseEvent=void 0,r.Element=ec,r.frameId=void 0,r.eventService=void 0,r.renderingService=void 0,r.inited=!1,r.readyPromise=void 0,r.resolveReadyPromise=void 0,r.document=new Pc,r.document.defaultView=Se(r),r.customElements=new Xc;var i=n.container,o=n.canvas,a=n.offscreenCanvas,s=n.width,u=n.height,c=n.devicePixelRatio,l=n.renderer,h=n.background,p=n.document,f=n.requestAnimationFrame,d=n.cancelAnimationFrame,y=n.createImage,v=n.supportsPointerEvents,g=n.supportsTouchEvents,m=n.isTouchEvent,T=n.isMouseEvent;He(i,Se(r));var b=s,S=u,E=c;return o&&(E=1>(E=c||ze&&window.devicePixelRatio||1)?1:Math.ceil(E),b=s||Lr(o)||o.width/E,S=u||Dr(o)||o.height/E),r.devicePixelRatio=E,r.requestAnimationFrame=null!=f?f:Il.bind(globalThis),r.cancelAnimationFrame=null!=d?d:Rl.bind(globalThis),r.supportsTouchEvents=null!=g?g:"ontouchstart"in globalThis,r.supportsPointerEvents=null!=v?v:!!globalThis.PointerEvent,r.isTouchEvent=null!=m?m:function(t){return r.supportsTouchEvents&&t instanceof globalThis.TouchEvent},r.isMouseEvent=null!=T?T:function(t){return!globalThis.MouseEvent||t instanceof globalThis.MouseEvent&&(!r.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:o,width:b,height:S,renderer:l,offscreenCanvas:a,devicePixelRatio:E,cursor:"default",background:h,createImage:y,document:p}),r.initDefaultCamera(b,S),pe(le().mark((function e(){return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.initRenderer(l);case 2:r.dispatchEvent(new Ru(t.CanvasEvent.READY)),r.readyPromise&&r.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),r}ve(n,e);var r=n.prototype;return r.initRenderingContext=function(e){var n=this;this.container.register({token:Ti,useValue:e}),this.container.register({token:al,useValue:{root:this.document.documentElement,renderListLastFrame:[],renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}),this.document.documentElement.addEventListener(t.ElementEvent.CHILD_INSERTED,(function(t){n.mountChildren(t.detail.child)})),this.document.documentElement.addEventListener(t.ElementEvent.CHILD_REMOVED,(function(t){n.unmountChildren(t.detail.child)}))},r.initDefaultCamera=function(e,n){var r=(new pl).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3);r.canvas=this;var i=this.container.get(al);r.on(ul.UPDATED,(function(){i.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.container.register({token:sl,useValue:r})},r.getConfig=function(){return this.container.get(Ti)},r.getContainer=function(){return this.container},r.getRoot=function(){return this.document.documentElement},r.getCamera=function(){return this.container.get(sl)},r.getContextService=function(){return this.container.get(nl)},r.getEventService=function(){return this.eventService},r.getRenderingService=function(){return this.renderingService},r.getRenderingContext=function(){return this.container.get(al)},r.getStats=function(){return this.getRenderingService().getStats()},r.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=!1),n||this.dispatchEvent(new Ru(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&this.document.destroy(),this.getContextService().destroy(),this.getRenderingService().destroy(),n||this.dispatchEvent(new Ru(t.CanvasEvent.AFTER_DESTROY))},r.changeSize=function(t,e){this.resize(t,e)},r.resize=function(e,n){var r=this.container.get(Ti);r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.container.get(sl),o=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),o===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new Ru(t.CanvasEvent.RESIZE,{width:e,height:n}))},r.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},r.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},r.removeChild=function(t,e){return void 0===e&&(e=!0),this.document.documentElement.removeChild(t,e)},r.removeChildren=function(t){void 0===t&&(t=!0),this.document.documentElement.removeChildren(t)},r.render=function(){(this.dispatchEvent(new Ru(t.CanvasEvent.BEFORE_RENDER)),this.container.isBound(t.RenderingService))&&this.container.get(t.RenderingService).render(this.getConfig());this.dispatchEvent(new Ru(t.CanvasEvent.AFTER_RENDER))},r.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},r.initRenderer=function(){var e=pe(le().mark((function e(n){var r;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.loadCommonContainerModule(),this.loadRendererContainerModule(n),r=this.container.get(nl),this.renderingService=this.container.get(t.RenderingService),this.eventService=this.container.get(t.EventService),e.next=11,r.init();case 11:return e.next=13,this.renderingService.init();case 13:this.inited=!0,this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot()),n.getConfig().enableAutoRendering&&this.run();case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),r.loadCommonContainerModule=function(){this.container.unload(Ql),this.container.load(Ql,!0)},r.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.init(e.container)}))},r.setRenderer=function(){var t=pe(le().mark((function t(e){var n,r,i=this;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.getConfig()).renderer!==e){t.next=3;break}return t.abrupt("return");case 3:return r=n.renderer,n.renderer=e,this.destroy(!1,!0),[].concat(null==r?void 0:r.getPlugins()).reverse().forEach((function(t){t.destroy(i.container)})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),r.setCursor=function(t){this.getContextService().applyCursorStyle(t)},r.unmountChildren=function(e){var n=this;if(this.inited){var r=[];e.forEach((function(t){t.isConnected&&r.push(t)})),r.reverse().forEach((function(e){e instanceof rc&&e.disconnectedCallback&&e.disconnectedCallback(),e.dispatchEvent(new Ru(t.ElementEvent.UNMOUNTED)),e!==n.document.documentElement&&(e.ownerDocument=null),e.isConnected=!1}))}},r.mountChildren=function(e){var n=this;this.inited?e.forEach((function(e){e.isConnected||(e.ownerDocument=n.document,e.isConnected=!0,e.dispatchEvent(new Ru(t.ElementEvent.MOUNTED)),e instanceof rc&&e.connectedCallback&&e.connectedCallback())})):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",e)},r.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},r.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},r.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},r.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},r.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},r.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},de(n,[{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}}]),n}(Lu);Vt.load(El);var th=Vt.get(t.LayoutEngine);t.AABB=ys,t.AbstractLayoutDefinition=oo,t.AbstractRenderer=wl,t.Animation=Ku,t.AnimationEffectTiming=Mc,t.AnimationEvent=qu,t.AnimationTimeline=Ju,t.AsyncParallelHook=Fi,t.AsyncSeriesWaterfallHook=ji,t.BUILT_IN_PROPERTIES=Sl,t.BoundingSphere=gs,t.CSS=mu,t.CSSColorValue=Po,t.CSSGradientValue=Jo,t.CSSKeywordValue=Co,t.CSSMathInvert=Bo,t.CSSMathMax=Wo,t.CSSMathMin=zo,t.CSSMathNegate=Vo,t.CSSMathProduct=qo,t.CSSMathSum=Yo,t.CSSMathValue=Fo,t.CSSMathVariadic=Ho,t.CSSNumericValue=Ao,t.CSSNumericValueType=Mo,t.CSSProperty=Au,t.CSSPropertySyntaxFactory=Mu,t.CSSRGB=Zo,t.CSSStyleValue=ko,t.CSSUnitValue=Uo,t.Camera=pl,t.CameraEvent=ul,t.Canvas=$l,t.CanvasConfig=Ti,t.Circle=oc,t.Container=Bt,t.ContextNode=Ae,t.ContextService=nl,t.Cullable=Uu,t.CustomElement=rc,t.CustomElementRegistry=Xc,t.CustomEvent=Ru,t.DCHECK=Oe,t.DCHECK_EQ=Ie,t.DCHECK_NE=Re,t.DELEGATION_SPLITTER=":",t.DefaultCamera=sl,t.DefaultContributionProvider=kt,t.Deferred=Or,t.DisplayObject=ec,t.Document=Pc,t.EasingFunctions=Nr,t.Element=Yu,t.Ellipse=sc,t.EventTarget=Lu,t.FederatedEvent=Iu,t.FederatedMouseEvent=Cc,t.FederatedPointerEvent=_c,t.FederatedWheelEvent=Nc,t.FragmentResultFactory=Ne,t.FragmentResultOptions=Me,t.Frustum=Ts,t.Geometry=Fu,t.GeometryAABBUpdater=Tl,t.GeometryUpdaterFactory=ml,t.GlobalContainer=Vt,t.Group=cc,t.HTML=kc,t.Image=hc,t.KeyframeEffect=qc,t.LayoutChildrenFactory=ro,t.LayoutChildrenOptions=io,t.LayoutContextFactory=Pe,t.LayoutContextOptions=Ce,t.LayoutEdgesFactory=uo,t.LayoutEdgesOptions=co,t.LayoutFragmentFactory=po,t.LayoutFragmentOptions=fo,t.LayoutObject=ke,t.Line=fc,t.MOUSE_POINTER_ID=1,t.Module=At,t.MutationEvent=zu,t.MutationObserver=Lc,t.MutationRecord=Ac,t.Node=Du,t.ObjectTyped=Ir,t.Odeg=Ko,t.OptionSymbol=pt,t.Opx=Xo,t.Path=yc,t.Plane=ms,t.Point=Ps,t.Polygon=gc,t.Polyline=Tc,t.Provider=mt,t.RBush=qt,t.RBushNode=Bu,t.RBushRoot=Vu,t.Ray=ks,t.Rect=Sc,t.Rectangle=Cs,t.Registration=Rc,t.Renderable=Gu,t.RenderingContext=al,t.RenderingPluginContribution=fl,t.SceneGraphSelector=Zc,t.SceneGraphSelectorFactory=Kc,t.SceneGraphService=tl,t.Sortable=ju,t.StyleValueRegistry=Gr,t.SyncHook=Xi,t.SyncWaterfallHook=to,t.SyringeModule=Nt,t.TOUCH_TO_POINTER=Ur,t.Text=wc,t.Transform=Hu,t.baseTypeToString=No,t.camelCase=Qr,t.clamp=nr,t.clampedMergeNumbers=Vs,t.cleanExistedCanvas=He,t.clonePath=Ci,t.colorStopToString=Fr,t.compareAnimations=Zu,t.computeLinearGradient=function(t,e,n){var r=n*Math.PI/180,i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}},t.computeRadialGradient=function(t,e,n,r){return{x:n*t,y:r*e,r:Math.sqrt(t*t+e*e)/2}},t.contrib=jt,t.convertAngleUnit=Is,t.convertEffectInput=ti,t.convertPercentUnit=Ds,t.convertToDash=hr,t.convertToPath=function(e,n){void 0===n&&(n=!0);var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle;r=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(i.x1.value,i.y1.value,i.x2.value,i.y2.value);break;case t.Shape.CIRCLE:var o=e.parsedStyle,a=o.r;r=Ni(a.value,a.value,o.cx.value,o.cy.value);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=Ni(s.rx.value,s.ry.value,s.cx.value,s.cy.value);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:r=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var u=e.parsedStyle,c=u.width,l=u.height,h=u.x,p=u.y,f=u.radius,d=f&&f.some((function(t){return 0!==t.value}));r=function(t,e,n,r,i){if(i){var o=i[0],a=i[1],s=i[2],u=i[3],c=t>0?1:-1,l=e>0?1:-1,h=c+l!==0?1:0;return[["M",c*o+n,r],["L",t-c*a+n,r],a?["A",a,a,0,0,h,t+n,l*a+r]:null,["L",t+n,e-l*s+r],s?["A",s,s,0,0,h,t+n-c*s,e+r]:null,["L",n+c*u,e+r],u?["A",u,u,0,0,h,n,e+r-l*u]:null,["L",n,l*o+r],o?["A",o,o,0,0,h,c*o+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(c.value,l.value,h.value,p.value,d&&f.map((function(t){return nr(t.value,0,Math.min(Math.abs(c.value)/2,Math.abs(l.value)/2))})));break;case t.Shape.PATH:var y=e.parsedStyle.path,v=y.zCommandIndexes;r=[].concat(y.curve),v.forEach((function(t,e){r.splice(t+e,1,["Z"])}))}if(r.length)return function(t,e,n){var r;void 0===n&&(n=!0),n&&(r=e.getLocalTransform());var i=e.parsedStyle,o=i.defX,a=void 0===o?0:o,s=i.defY,u=void 0===s?0:s;return t.reduce((function(t,e){var i="";if("M"===e[0]||"L"===e[0]){var o=Tn(e[1]-a,e[2]-u,0);n&&An(o,o,r),i=""+e[0]+o[0]+","+o[1]}else if("Z"===e[0])i=e[0];else if("C"===e[0]){var s=Tn(e[1]-a,e[2]-u,0),c=Tn(e[3]-a,e[4]-u,0),l=Tn(e[5]-a,e[6]-u,0);n&&(An(s,s,r),An(c,c,r),An(l,l,r)),i=""+e[0]+s[0]+","+s[1]+","+c[0]+","+c[1]+","+l[0]+","+l[1]}else if("A"===e[0]){var h=Tn(e[6]-a,e[7]-u,0);n&&An(h,h,r),i=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+h[0]+","+h[1]}return t+i}),"")}(r,e,n)},t.createVec3=ir,t.decompose=lr,t.decorate=Y.decorate,t.deg2rad=function(t){return t*(Math.PI/180)},t.deg2turn=function(t){return t/360},t.dirtifyToRoot=$c,t.equalSet=function(t,e){if(t.size!==e.size)return!1;for(var n,r=we(t);!(n=r()).done;){if(!e.has(n.value))return!1}return!0},t.equalizeSegments=Ei,t.formatAttribute=ai,t.fromRotationTranslationScale=ur,t.getAngle=rr,t.getDrawDirection=wi,t.getEasingFunction=Mr,t.getEuler=sr,t.getHeight=Dr,t.getPathArea=ki,t.getRotatedCurve=_i,t.getRotationInRadians=function(t){return Math.atan2(t[1],t[4])},t.getScaling=function(t,e){var n=e[3],r=e[4];return t[0]=Math.hypot(e[0],e[1]),t[1]=Math.hypot(n,r),t},t.getStyle=Rr,t.getTranslation=function(t,e){return t[0]=e[6],t[1]=e[7],t},t.getWidth=Lr,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.inject=lt,t.injectable=ut,t.isBoolean=Be,t.isBrowser=ze,t.isComparison=function(e){return e===t.CSSMathOperator.kMin||e===t.CSSMathOperator.kMax||e===t.CSSMathOperator.kClamp},t.isFunction=Fe,t.isNil=De,t.isNumber=Ue,t.isObject=Ve,t.isPattern=hs,t.isString=$r,t.isSyringeModule=Mt,t.isUndefined=Le,t.layoutEngine=th,t.makePerspective=cr,t.makeQuerablePromise=Ar,t.makeTiming=zc,t.mergeColors=fs,t.mergeDimensionList=Ls,t.mergeDimensions=Os,t.mergeNumberLists=function(t,e){if(t.length===e.length)return[t.map((function(t){return t.value})),e.map((function(t){return t.value})),function(t){return t}]},t.mergeNumbers=Bs,t.mergePaths=fu,t.mergeTransforms=Pu,t.named=ht,t.normalizeKeyframes=Gc,t.normalizeTimingInput=Wc,t.numberToString=Us,t.numericTimingToObject=Yc,t.optional=Y.optional,t.parseAngle=As,t.parseColor=ps,t.parseDimension=_s,t.parseDimensionArray=Rs,t.parseFilter=gu,t.parseGradient=Vr,t.parseLength=Ns,t.parseLengthOrPercentage=Ms,t.parseNumber=Fs,t.parseNumberList=function(t){return $r(t)?t.split(" ").map(Fs):t.map(Fs)},t.parseParam=yu,t.parsePath=pu,t.parsePoints=du,t.parseTransform=wu,t.parseTransformOrigin=Cu,t.parserPercentage=function(t){return _s(new RegExp("%","g"),t)},t.postConstruct=Y.postConstruct,t.rad2deg=or,t.register=Gt,t.registerSideOption=function(t,e){Reflect.defineMetadata(pt,t,e)},t.reverseCurve=Pi,t.setDOMSize=function(t,e,n){ze&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.singleton=ct,t.sortByZIndex=Qc,t.toFontString=no,t.transient=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ut(at(at({},e),{},{lifecycle:t.Syringe.Lifecycle.transient}))},t.turn2deg=ar,t.typeCheck=Go,t.unitTypeToBaseType=_o,t.unmanaged=Y.unmanaged,Object.defineProperty(t,"__esModule",{value:!0})}));