@visactor/vrender 0.21.14 → 0.21.15-alpha.1
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.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +11 -10
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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).VRender={})}(this,(function(t){"use strict";class e{static GenAutoIncrementId(){return e.auto_increment_id++}}e.auto_increment_id=0;class i{constructor(t){this.id=e.GenAutoIncrementId(),this.registry=t}}const n="named",r="inject",s="multi_inject",a="inversify:tagged",o="inversify:paramtypes";class h{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===n?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var l=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),n=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),r=new WeakMap;function s(t,e,i){let s=r.get(t);if(l(s)){if(!i)return;s=new n,r.set(t,s)}let a=s.get(e);if(l(a)){if(!i)return;a=new n,s.set(e,a)}return a}function a(t,e,i){if(o(t,e,i))return!0;const n=g(e);return!c(n)&&a(t,n,i)}function o(t,e,i){const n=s(e,i,!1);return!l(n)&&!!n.has(t)}function h(t,e,i){if(o(t,e,i))return function(t,e,i){const n=s(e,i,!1);if(!l(n))return n.get(t)}(t,e,i);const n=g(e);return c(n)?void 0:h(t,n,i)}function l(t){return void 0===t}function c(t){return null===t}function u(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,i){switch(function(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}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const n=3===i?"string":5===i?"number":"default",r=function(t,e){const i=t[e];if(null!=i){if(!f(i))throw new TypeError;return i}}(t,e);if(void 0!==r){const e=r.call(t,n);if(u(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(f(e)){const i=e.call(t);if(!u(i))return i}const i=t.valueOf;if(f(i)){const e=i.call(t);if(!u(e))return e}}else{const e=t.valueOf;if(f(e)){const i=e.call(t);if(!u(i))return i}const i=t.toString;if(f(i)){const e=i.call(t);if(!u(e))return e}}throw new TypeError}(t,"default"===n?"number":n)}function p(t){const e=d(t,3);return function(t){return"symbol"==typeof t}(e)?e:function(t){return""+t}(e)}function f(t){return"function"==typeof t}function g(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;const s=r.constructor;return"function"!=typeof s||s===t?e:s}t("defineMetadata",(function(t,e,i,n){if(!u(i))throw new TypeError;return function(t,e,i,n){s(i,n,!0).set(t,e)}(t,e,i,n)})),t("hasMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return l(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return l(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return l(i)||(i=p(i)),h(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function c(t,e,i,n){!function(t,e,i,n){const r=[n];let s={};l.hasOwnMetadata(t,e)&&(s=l.getMetadata(t,e));let a=s[i];void 0===a&&(a=[]),a.push(...r),s[i]=a,l.defineMetadata(t,s,e)}(a,t,i.toString(),n)}function u(t){return(e,i,n)=>{c(e,0,n,t)}}function d(t){return e=>(i,n,r)=>u(new h(t,e))(i,n,r)}const p=d(r),f=d(s);function g(){return function(t){return l.defineMetadata(o,null,t),t}}function v(t){return u(new h(n,t))}const m="Singleton",y="Transient",b="ConstantValue",x="DynamicValue",w="Factory",S="Function",A="Instance",T="Invalid";class C{constructor(t,i){this.id=e.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=i,this.type=T,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new C(this.serviceIdentifier,this.scope);return t.activated=t.scope===m&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class _{getConstructorMetadata(t){return{compilerGeneratedMetadata:l.getMetadata(o,t),userGeneratedMetadata:l.getMetadata(a,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const B=(P=n,t=>{const e=e=>{if(null==e)return!1;if(e.key===P&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===P&&i[e].value===t)return!0;return!1};return e.metaData=new h(P,t),e});var P;class R{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=m,this}inTransientScope(){return this._binding.scope=y,this}whenTargetNamed(t){return this._binding.constraint=B(t),this}}class M{constructor(t){this._binding=t}to(t){return this._binding.type=A,this._binding.implementationType=t,new R(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=x,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new R(this._binding)}toConstantValue(t){return this._binding.type=b,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=m,new R(this._binding)}toFactory(t){return this._binding.type=w,this._binding.factory=t,this._binding.scope=m,new R(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}class E{constructor(t){const i=t||{};i.defaultScope=i.defaultScope||y,this.options=i,this.id=e.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new _}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,n,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new C(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new M(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const n=this.bind(i);return t(n,e),n},i=()=>t=>this.unbind(t),n=()=>t=>this.isBound(t),r=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:r(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),a=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const o={inject:n[r],multiInject:n[s]},h=o.inject||o.multiInject,l={serviceIdentifier:h,constructorArgsMetadata:e},c=(this._bindingDictionary.get(h)||[]).filter((t=>t.constraint(l)));if(c.length){const t={injectIdentifier:h,metadata:e,bindings:c};a.push(t)}}return a}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case b:case S:e=t.cache;break;case A:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===m&&(t.cache=e,t.activated=!0)}}const k=Symbol("ContributionProvider");class O{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function I(t,e){t(k).toDynamicValue((t=>{let{container:i}=t;return new O(e,i)})).inSingletonScope().whenTargetNamed(e)}function L(t,e){t(k).toDynamicValue((t=>{let{container:i}=t;return new O(e,i)})).whenTargetNamed(e)}class D{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>i)){n++;break}}this.taps[n]=t}}class j extends D{call(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const U=Symbol.for("EnvContribution"),W=Symbol.for("VGlobal"),N="PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";var G,F=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},z=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},H=function(t,e){return function(i,n){e(i,n,t)}},V=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};t.DefaultGlobal=class{get env(){return this._env}get isImageAnonymous(){return this._isImageAnonymous}set isImageAnonymous(t){this._isImageAnonymous=t}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){this.contributions=t,this._isImageAnonymous=!0,this.id=e.GenAutoIncrementId(),this.hooks={onSetEnv:new j(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const n=i.configure(this,t);n&&n.then&&e.push(n)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const n=this.bindContribution(e);if(n&&n.then)return n.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}loadFont(t,e,i){return V(this,void 0,void 0,(function*(){return this._env||this.setEnv("browser"),this.envContribution.loadFont(t,e,i)}))}isChrome(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}updateDom(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}getElementTop(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}},t.DefaultGlobal=F([g(),H(0,p(k)),H(0,v(U)),z("design:paramtypes",[Object])],t.DefaultGlobal),t.MeasureModeEnum=void 0,(G=t.MeasureModeEnum||(t.MeasureModeEnum={}))[G.estimate=0]="estimate",G[G.actualBounding=1]="actualBounding",G[G.fontBounding=2]="fontBounding";function Y(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var X={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,a=new Array(s);r<s;r++)a[r]=n[r].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},o.prototype.emit=function(t,e,n,r,s,a){var o=i?i+t:t;if(!this._events[o])return!1;var h,l,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,r),!0;case 5:return c.fn.call(c.context,e,n,r,s),!0;case 6:return c.fn.call(c.context,e,n,r,s,a),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,n);break;case 4:c[l].fn.call(c[l].context,e,n,r);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},o.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||r&&!o.once||n&&o.context!==n||a(this,s);else{for(var h=0,l=[],c=o.length;h<c;h++)(o[h].fn!==e||r&&!o[h].once||n&&o[h].context!==n)&&l.push(o[h]);l.length?this._events[s]=1===l.length?l[0]:l:a(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(X);var $=Y(X.exports);var q=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var K=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||q(t,"Boolean")};var Z=t=>"function"==typeof t;var J=t=>null==t;var Q=t=>null!=t;var et=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var it=t=>"object"==typeof t&&null!==t;var nt=function(t){if(!it(t)||!q(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var rt=t=>void 0===t;var st=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||q(t,"String")};var at=t=>Array.isArray?Array.isArray(t):q(t,"Array");var ot=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var ht=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||q(t,"Number")};var lt=t=>ht(t)&&Number.isFinite(t);var ct=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var ut=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);const dt=Object.prototype.hasOwnProperty;var pt=(t,e)=>null!=t&&dt.call(t,e);function ft(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){if(t===e)return;if(Q(e)&&"object"==typeof e){const r=Object(e),s=[];for(const t in r)s.push(t);let{length:a}=s,o=-1;for(;a--;){const a=s[++o];!Q(r[a])||"object"!=typeof r[a]||n&&at(t[a])?vt(t,a,r[a]):gt(t,e,a,i,n)}}}}function gt(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s=t[i],a=e[i];let o=e[i],h=!0;if(at(a)){if(n)o=[];else if(at(s))o=s;else if(ot(s)){o=new Array(s.length);let t=-1;const e=s.length;for(;++t<e;)o[t]=s[t]}}else nt(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):h=!1;h&&ft(o,a,n,r),vt(t,i,o)}function vt(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function mt(t,e){if(!at(t)||!at(e))return!1;if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}const yt="undefined"!=typeof console;function bt(t,e,i){const n=[e].concat([].slice.call(i));yt&&console[t].apply(console,n)}var xt;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(xt||(xt={}));class wt{static getInstance(t,e){return wt._instance&&ht(t)?wt._instance.level(t):wt._instance||(wt._instance=new wt(t,e)),wt._instance}static setInstance(t){return wt._instance=t}static setInstanceLevel(t){wt._instance?wt._instance.level(t):wt._instance=new wt(t)}static clearInstance(){wt._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xt.None,e=arguments.length>1?arguments[1]:void 0;this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=xt.Info}canLogDebug(){return this._level>=xt.Debug}canLogError(){return this._level>=xt.Error}canLogWarn(){return this._level>=xt.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(){for(var t,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this._level>=xt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):bt(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",i)),this}warn(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=xt.Warn&&bt(this._method||"warn","WARN",e),this}info(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=xt.Info&&bt(this._method||"log","INFO",e),this}debug(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=xt.Debug&&bt(this._method||"log","DEBUG",e),this}}wt._instance=null;const St=1e-10,At=1e-10;function Tt(t,e){const i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:St,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:At)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}var Ct=function(t,e,i){return t<e?e:t>i?i:t};const _t=1e-12,Bt=Math.PI,Pt=Bt/2,Rt=2*Bt,Mt=2*Math.PI,Et=Math.abs,kt=Math.atan2,Ot=Math.cos,It=Math.max,Lt=Math.min,Dt=Math.sin,jt=Math.sqrt,Ut=Math.pow;function Wt(t){return t>=1?Pt:t<=-1?-Pt:Math.asin(t)}function Nt(t,e,i,n,r){let s=i,a=n;return"number"==typeof t&&"number"==typeof i&&(s=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(a=(1-r)*e+r*n),{x:s,y:a}}function Gt(t,e){return t[0]*e[1]-t[1]*e[0]}function Ft(t){const e=t.toString().split(/[eE]/),i=(e[0].split(".")[1]||"").length-(+e[1]||0);return i>0?i:0}class zt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=n}clone(){return new zt(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return ht(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return ht(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class Ht{static distancePP(t,e){return jt(Ut(t.x-e.x,2)+Ut(t.y-e.y,2))}static distanceNN(t,e,i,n){return jt(Ut(t-i,2)+Ut(e-n,2))}static distancePN(t,e,i){return jt(Ut(e-t.x,2)+Ut(i-t.y,2))}static pointAtPP(t,e,i){return new zt((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function Vt(t){return t*(Math.PI/180)}const Yt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Rt;)t+=Rt;else if(t>0)for(;t>Rt;)t-=Rt;return t};function Xt(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function $t(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function qt(t,e,i,n){if(!function(t,e,i,n){let r=t[0],s=e[0],a=i[0],o=n[0];return s<r&&([r,s]=[s,r]),o<a&&([o,a]=[a,o]),!(s<a||o<r||(r=t[1],s=e[1],a=i[1],o=n[1],s<r&&([r,s]=[s,r]),o<a&&([o,a]=[a,o]),s<a||o<r))}(t,e,i,n))return!1;const r=[0,0],s=[0,0],a=[0,0];if($t(r,e,t),$t(s,n,i),function(t,e){return Et(t[0]-e[0])+Et(t[1]-e[1])<1e-12}(r,s))return!0;$t(a,i,t);const o=Gt(a,s)/Gt(r,s);return o>=0&&o<=1&&[t[0]+r[0]*o,t[1]+r[1]*o]}var Kt;!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Kt||(Kt={}));const Zt=(t,e,i)=>{let n=t.x1,r=t.x2,s=t.y1,a=t.y2,o=e.x1,h=e.x2,l=e.y1,c=e.y2;return i&&(n>r&&([n,r]=[r,n]),s>a&&([s,a]=[a,s]),o>h&&([o,h]=[h,o]),l>c&&([l,c]=[c,l])),{x11:n,x12:r,y11:s,y12:a,x21:o,x22:h,y21:l,y22:c}};function Jt(t,e,i){if(t&&e){if(!i)return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1);const{x11:n,x12:r,y11:s,y12:a,x21:o,x22:h,y21:l,y22:c}=Zt(t,e,!0);return!(n>h||r<o||s>c||a<l)}return!0}function Qt(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function te(t,e){let{x:i,y:n}=t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(i-r.x)*Math.cos(e)-(n-r.y)*Math.sin(e)+r.x,y:(i-r.x)*Math.sin(e)+(n-r.y)*Math.cos(e)+r.y}}function ee(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function ie(t,e){const i=e?Vt(t.angle):t.angle,n=ee(t);return[te({x:t.x1,y:t.y1},i,n),te({x:t.x2,y:t.y1},i,n),te({x:t.x2,y:t.y2},i,n),te({x:t.x1,y:t.y2},i,n)]}function ne(t,e,i,n,r,s){if(s>e&&s>n||s<e&&s<n)return 0;if(n===e)return 0;const a=(s-e)/(n-e);let o=n<e?1:-1;1!==a&&0!==a||(o=n<e?.5:-.5);const h=a*(i-t)+t;return h===r?1/0:h>r?o:0}const re=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,n=e<<10|i,n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};function se(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(s?s+" ":"")+a*i+"px "+(o||"sans-serif")}class ae{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),Q(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=Q(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(J(this._canvas)&&(Q(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),J(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&Q(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),J(this._context)&&Q(this._canvas)){const t=this._canvas.getContext("2d");Q(t)&&(t.save(),t.font=se(this.textSpec),this._contextSaved=!0,this._context=t)}return!J(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:n={}}=this._option,{fontStyle:r=n.fontStyle,fontVariant:s=n.fontVariant,fontWeight:a=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=n.fontSize)&&void 0!==e?e:12),fontFamily:h=(null!==(i=n.fontFamily)&&void 0!==i?i:"sans-serif"),align:l,textAlign:c=(null!=l?l:"center"),baseline:u,textBaseline:d=(null!=u?u:"middle"),ellipsis:p,limit:f}=this._userSpec;let{lineHeight:g=o}=this._userSpec;if(st(g)&&"%"===g[g.length-1]){const t=Number.parseFloat(g.substring(0,g.length-1))/100;g=o*t}return{fontStyle:r,fontVariant:s,fontFamily:h,fontSize:o,fontWeight:a,textAlign:c,textBaseline:d,ellipsis:p,limit:f,lineHeight:g}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(J(t))return{width:0,height:0};if(J(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:n,textAlign:r,textBaseline:s,ellipsis:a,limit:o,lineHeight:h}=this.textSpec;let l;try{const c=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:n,textAlign:r,textBaseline:s,ellipsis:!!a,maxLineWidth:o||1/0,lineHeight:h});l={width:c.width(),height:c.height()}}catch(e){this._notSupportVRender=!0,l=this.measureWithNaiveCanvas(t)}return l}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:n,lineHeight:r}=this.textSpec;return{width:i.width,height:null!==(e=r)&&void 0!==e?e:n,fontBoundingBoxAscent:i.fontBoundingBoxAscent,fontBoundingBoxDescent:i.fontBoundingBoxDescent}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;i<t.length;i++){const n=t[i];let r=this._measureSpecialChar(n);J(r)&&ae.NUMBERS_CHAR_SET.includes(n)&&(r=this._measureNumberChar()),J(r)&&["F","W"].includes(re(n))&&(r=this._measureFullSizeChar()),J(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height),!J(r.fontBoundingBoxAscent)&&(e.fontBoundingBoxAscent=r.fontBoundingBoxAscent),!J(r.fontBoundingBoxDescent)&&(e.fontBoundingBoxDescent=r.fontBoundingBoxDescent)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:n,lineHeight:r}=this.textSpec;for(let e=0;e<t.length;e++){const r=t[e],s=["F","W"].includes(re(r))?1:.53;i.width+=s*n}return i.height=null!==(e=r)&&void 0!==e?e:n,i}_measureReduce(t,e){var i;const{fontSize:n,lineHeight:r}=this.textSpec,s={width:0,height:0};if(J(t))return s;if(at(t)){const a=t.filter(Q).map((t=>t.toString()));return 0===a.length?s:1===a.length?e(a[0]):{width:a.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:a.length*((null!==(i=r)&&void 0!==i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(J(this._numberCharSize)){const t=this._standardMethod(ae.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/ae.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return J(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(ae.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(J(this._letterCharSize)){const t=this._standardMethod(ae.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/ae.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(t){return Q(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){Q(this._canvas)&&(this._canvas=null),Q(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}ae.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",ae.NUMBERS_CHAR_SET="0123456789",ae.FULL_SIZE_CHAR="字";function oe(t,e,i){const{x1:n,y1:r,x2:s,y2:a}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*r+i.e,i.b*n+i.d*r+i.f),t.add(i.a*s+i.c*r+i.e,i.b*s+i.d*r+i.f),t.add(i.a*s+i.c*a+i.e,i.b*s+i.d*a+i.f),t.add(i.a*n+i.c*a+i.e,i.b*n+i.d*a+i.f),e)}class he{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new he(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}add(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return at(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}scale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return oe(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:n,y1:r,x2:s,y2:a}=this,o=Math.cos(t),h=Math.sin(t),l=e-e*o+i*h,c=i-e*h-i*o;return[o*n-h*r+l,h*n+o*r+c,o*n-h*a+l,h*n+o*a+c,o*s-h*r+l,h*s+o*r+c,o*s-h*a+l,h*s+o*a+c]}scalePoints(t,e,i,n){const{x1:r,y1:s,x2:a,y2:o}=this;return[t*r+(1-t)*i,e*s+(1-e)*n,t*a+(1-t)*i,e*o+(1-e)*n]}}class le extends he{}class ce extends he{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;var i;super(t),t&&(this.angle=null!==(i=t.angle)&&void 0!==i?i:e)}intersects(t){return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=ie(t,i),r=ie(e,i),s=(t,e)=>[e.x-t.x,e.y-t.y],a=s(ee(t),ee(e)),o=s(n[0],n[1]),h=s(n[1],n[2]),l=s(r[0],r[1]),c=s(r[1],r[2]),u=i?Vt(t.angle):t.angle;let d=i?Vt(90-t.angle):t.angle+Pt;const p=i?Vt(e.angle):e.angle;let f=i?Vt(90-e.angle):e.angle+Pt;d>Mt&&(d-=Mt),f>Mt&&(f-=Mt);const g=(t,e,i,n)=>{const r=[Math.cos(e),Math.sin(e)];return t+(Qt(r,i)+Qt(r,n))/2>Qt(r,a)};return g((t.x2-t.x1)/2,u,l,c)&&g((t.y2-t.y1)/2,d,l,c)&&g((e.x2-e.x1)/2,p,o,h)&&g((e.y2-e.y1)/2,f,o,h)}(this,t)}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return super.setValue(t,e,i,n),this.angle=r,this}clone(){return new ce(this)}}class ue{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,n,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}setValue(t,e,i,n,r,s){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,n=this.d,r=this.e,s=this.f,a=new ue,o=t*n-e*i;return a.a=n/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*s-n*r)/o,a.f=-(t*s-e*r)/o,a}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,r=this.b*e+this.d*i,s=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=n,this.b=r,this.c=s,this.d=a,this}rotateByCenter(t,e,i){const n=Math.cos(t),r=Math.sin(t),s=(1-n)*e+r*i,a=(1-n)*i-r*e,o=n*this.a-r*this.b,h=r*this.a+n*this.b,l=n*this.c-r*this.d,c=r*this.c+n*this.d,u=n*this.e-r*this.f+s,d=r*this.e+n*this.f+a;return this.a=o,this.b=h,this.c=l,this.d=c,this.e=u,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,n,r,s){return this.multiply(t,e,i,n,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:n,e:r,f:s}=this;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=s,this.f=r,this}multiply(t,e,i,n,r,s){const a=this.a,o=this.b,h=this.c,l=this.d,c=a*t+h*e,u=o*t+l*e,d=a*i+h*n,p=o*i+l*n,f=a*r+h*s+this.e,g=o*r+l*s+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=f,this.f=g,this}interpolate(t,e){const i=new ue;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:n,c:r,d:s,e:a,f:o}=this,h=i*s-n*r,l=s/h,c=-n/h,u=-r/h,d=i/h,p=(r*o-s*a)/h,f=-(i*o-n*a)/h,{x:g,y:v}=t;e.x=g*l+v*u+p,e.y=g*c+v*d+f}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new ue(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,n=this.d,r=t*n-e*i,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),s.scaleX=a,s.scaleY=r/a,s.skewX=(t*i+e*n)/r,s.skewY=0}else if(0!==i||0!==n){const a=Math.sqrt(i*i+n*n);s.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/a):-Math.acos(i/a)),s.scaleX=r/a,s.scaleY=a,s.skewX=0,s.skewY=(t*i+e*n)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}class de{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:n=this.L_TIME,R_COUNT:r=this.R_COUNT}=e;if(t.size<i)return 0;let s=0;const a=e=>{s++,t.delete(e)},o=Date.now();return t.forEach(((t,e)=>{if(t.timestamp.length<r)return a(e);let i=0;for(;o-t.timestamp[t.timestamp.length-1-i]<n&&(i++,!(i>=r)););if(i<r)return a(e);for(;o-t.timestamp[0]>n;)t.timestamp.shift()})),s}addLimitedTimestamp(t,e,i){const{R_TIMESTAMP_MAX_SIZE:n=this.R_TIMESTAMP_MAX_SIZE}=i;t.timestamp.length>n&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:i=this.L_TIME}=e,n=Date.now();t.forEach((t=>{for(;n-t.timestamp[0]>i;)t.timestamp.shift()}))}clearItemTimestamp(t,e){const{L_TIME:i=this.L_TIME}=e,n=Date.now();for(;n-t.timestamp[0]>i;)t.timestamp.shift()}}function pe(t,e,i){e/=100,i/=100;const n=(1-Math.abs(2*i-1))*e,r=n*(1-Math.abs(t/60%2-1)),s=i-n/2;let a=0,o=0,h=0;return 0<=t&&t<60?(a=n,o=r,h=0):60<=t&&t<120?(a=r,o=n,h=0):120<=t&&t<180?(a=0,o=n,h=r):180<=t&&t<240?(a=0,o=r,h=n):240<=t&&t<300?(a=r,o=0,h=n):300<=t&&t<360&&(a=n,o=0,h=r),a=Math.round(255*(a+s)),o=Math.round(255*(o+s)),h=Math.round(255*(h+s)),{r:a,g:o,b:h}}function fe(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,e,i),r=Math.max(t,e,i),s=r-n;let a=0,o=0,h=0;return a=0===s?0:r===t?(e-i)/s%6:r===e?(i-t)/s+2:(t-e)/s+4,a=Math.round(60*a),a<0&&(a+=360),h=(r+n)/2,o=0===s?0:s/(1-Math.abs(2*h-1)),o=+(100*o).toFixed(1),h=+(100*h).toFixed(1),{h:a,s:o,l:h}}const ge=/^#([0-9a-f]{3,8})$/,ve={transparent:4294967040},me={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 ye(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function be(t){return ht(t)?new Te(t>>16,t>>8&255,255&t,1):at(t)?new Te(t[0],t[1],t[2]):new Te(255,255,255)}function xe(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function we(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Se=(t,e)=>{const i=ge.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new Te((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?be(t):8===e?new Te(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class Ae{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Ae(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Ae(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof Ae?t:new Ae(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3();case"wcag":return i.getLuminanceWCAG()}}static parseColorString(t){if(Q(ve[t]))return function(t){return ht(t)?new Te(t>>>24,t>>>16&255,t>>>8&255,255&t):at(t)?new Te(t[0],t[1],t[2],t[3]):new Te(255,255,255,1)}(ve[t]);if(Q(me[t]))return be(me[t]);const e=`${t}`.trim().toLowerCase(),i=Se(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Te(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=pe(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Te(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=Ae.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new Te(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t))),this}add(t){const{r:e,g:i,b:n}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,n+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const n=this.color.opacity,r=fe(this.color.r,this.color.g,this.color.b),s=pe(J(t)?r.h:Ct(t,0,360),J(e)?r.s:e>=0&&e<=1?100*e:e,J(i)?r.l:i<=1&&i>=0?100*i:i);return this.color=new Te(s.r,s.g,s.b,n),this}setRGB(t,e,i){return!J(t)&&(this.color.r=t),!J(e)&&(this.color.g=e),!J(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=Se(e,!0);return null!=i?i:this}setColorName(t){const e=me[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){const t=this.color.r/255,e=this.color.g/255,i=this.color.b/255;let n,r,s;return n=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),r=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),s=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*r+.0722*s}clone(){return new Ae(this.color.toString())}copyGammaToLinear(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=xe(t.color.r),this.color.g=xe(t.color.g),this.color.b=xe(t.color.b),this}copyLinearToSRGB(t){return this.color.r=we(t.color.r),this.color.g=we(t.color.g),this.color.b=we(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Te{constructor(t,e,i,n){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),Q(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${ye(this.r)+ye(this.g)+ye(this.b)+(1===this.opacity?"":ye(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:n}=fe(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}const Ce=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),_e=Rt-1e-8;class Be{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,s){if(Math.abs(r-n)>_e)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,h,l,c=1/0,u=-1/0,d=1/0,p=-1/0;function f(t){h=i*Math.cos(t),l=i*Math.sin(t),h<c&&(c=h),h>u&&(u=h),l<d&&(d=l),l>p&&(p=l)}if(f(n),f(r),r!==n)if((n%=Rt)<0&&(n+=Rt),(r%=Rt)<0&&(r+=Rt),r<n&&(s=!s,a=n,n=r,r=a),s)for(r-=Rt,a=n-n%Pt,o=0;o<4&&a>r;++o,a-=Pt)f(a);else for(a=n-n%Pt+Pt,o=0;o<4&&a<r;++o,a+=Pt)f(a);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,n,r){this.bounds.add(t,e)}bezierCurveTo(t,e,i,n,r,s){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(){}}class Pe{constructor(){this.curves=[],this.bounds=new le}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Re=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Me={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},Ee={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let ke,Oe,Ie,Le,De,je;function Ue(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const r=[];for(let t=0,s=e.length;t<s;t++)if(ke=e[t],Oe=ke.slice(1),Ie=ke[0],i=[Ie],n=Oe.match(Re),null!==n){for(let t=0,e=n.length;t<e;t++)Le=n[t],De=parseFloat(Le),Number.isNaN(De)||i.push(De);if(je=Me[Ie],i.length-1>je){let t,e=Ie;for(let n=1,s=i.length;n<s;n+=je){t=[e];for(let e=n,r=n+je;e<r;e++)t.push(i[e]);r.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else r.push(i)}else r.push(i);return r}var We,Ne,Ge,Fe,ze,He,Ve,Ye;function Xe(t,e,i,n,r,s,a,o,h){const l=Vt(a),c=Math.sin(l),u=Math.cos(l),d=u*(o-t)*.5+c*(h-e)*.5,p=u*(h-e)*.5-c*(o-t)*.5;let f=d*d/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);f>1&&(f=Math.sqrt(f),i*=f,n*=f);const g=u/i,v=c/i,m=-c/n,y=u/n,b=g*o+v*h,x=m*o+y*h,w=g*t+v*e,S=m*t+y*e;let A=1/((w-b)*(w-b)+(S-x)*(S-x))-.25;A<0&&(A=0);let T=Math.sqrt(A);s===r&&(T=-T);const C=.5*(b+w)-T*(S-x),_=.5*(x+S)+T*(w-b),B=Math.atan2(x-_,b-C);let P=Math.atan2(S-_,w-C)-B;P<0&&1===s?P+=Rt:P>0&&0===s&&(P-=Rt);const R=Math.ceil(Math.abs(P/(Pt+.001))),M=[];for(let t=0;t<R;++t){const e=B+t*P/R,r=B+(t+1)*P/R;M[t]=[C,_,e,r,i,n,c,u]}return M}function $e(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=h*s,c=-o*a,u=o*s,d=h*a,p=Math.cos(n),f=Math.sin(n),g=Math.cos(r),v=Math.sin(r),m=.5*(r-n),y=Math.sin(.5*m),b=8/3*y*y/Math.sin(m),x=e+p-b*f,w=i+f+b*p,S=e+g,A=i+v,T=S+b*v,C=A-b*g;return[l*x+c*w,u*x+d*w,l*T+c*C,u*T+d*C,l*S+c*A,u*S+d*A]}function qe(t,e,i,n){const r=Xe(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<r.length;++e){const i=$e(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(We=t.UpdateTag||(t.UpdateTag={}))[We.NONE=0]="NONE",We[We.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",We[We.UPDATE_SHAPE=2]="UPDATE_SHAPE",We[We.CLEAR_SHAPE=253]="CLEAR_SHAPE",We[We.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",We[We.INIT=179]="INIT",We[We.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",We[We.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",We[We.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",We[We.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",We[We.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",We[We.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",We[We.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",We[We.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",t.IContainPointMode=void 0,(Ne=t.IContainPointMode||(t.IContainPointMode={}))[Ne.GLOBAL=1]="GLOBAL",Ne[Ne.LOCAL=16]="LOCAL",Ne[Ne.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",Ne[Ne.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(Ge=t.AttributeUpdateType||(t.AttributeUpdateType={}))[Ge.INIT=0]="INIT",Ge[Ge.DEFAULT=1]="DEFAULT",Ge[Ge.STATE=2]="STATE",Ge[Ge.ANIMATE_BIND=10]="ANIMATE_BIND",Ge[Ge.ANIMATE_PLAY=11]="ANIMATE_PLAY",Ge[Ge.ANIMATE_START=12]="ANIMATE_START",Ge[Ge.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",Ge[Ge.ANIMATE_END=14]="ANIMATE_END",Ge[Ge.TRANSLATE=20]="TRANSLATE",Ge[Ge.TRANSLATE_TO=21]="TRANSLATE_TO",Ge[Ge.SCALE=22]="SCALE",Ge[Ge.SCALE_TO=23]="SCALE_TO",Ge[Ge.ROTATE=24]="ROTATE",Ge[Ge.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(Fe=t.AnimateStatus||(t.AnimateStatus={}))[Fe.INITIAL=0]="INITIAL",Fe[Fe.RUNNING=1]="RUNNING",Fe[Fe.PAUSED=2]="PAUSED",Fe[Fe.END=3]="END",t.AnimateMode=void 0,(ze=t.AnimateMode||(t.AnimateMode={}))[ze.NORMAL=0]="NORMAL",ze[ze.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(He=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",He.from="from",He.to="to",He.customAnimate="customAnimate",t.Direction=void 0,function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(t.Direction||(t.Direction={})),t.CurveTypeEnum=void 0,(Ve=t.CurveTypeEnum||(t.CurveTypeEnum={}))[Ve.CubicBezierCurve=0]="CubicBezierCurve",Ve[Ve.QuadraticBezierCurve=1]="QuadraticBezierCurve",Ve[Ve.ArcCurve=2]="ArcCurve",Ve[Ve.LineCurve=3]="LineCurve",Ve[Ve.EllipseCurve=4]="EllipseCurve",Ve[Ve.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(Ye=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[Ye.beforeFillStroke=0]="beforeFillStroke",Ye[Ye.afterFillStroke=1]="afterFillStroke";const Ke=(t,e,i,n,r,s,a)=>{const o=Math.abs(i-e),h=o>.5*Math.PI?Math.ceil(2*o/Math.PI):1,l=(i-e)/h;for(let i=0;i<h;i++){const o=e+l*i,h=e+l*(i+1),c=4*Math.tan(Math.abs(l)/4)/3,u=h<o?-1:1,d=Math.cos(o),p=Math.sin(o),f=Math.cos(h),g=Math.sin(h),v=d*s+n,m=p*a+r,y=f*s+n,b=g*a+r,x=s*c*u,w=a*c*u;t.push(v-x*p,m+w*d,y+x*g,b-w*f,y,b)}},Ze=[(t,e,i,n,r,s,a)=>e.arc(t[1]*r+i,t[2]*s+n,t[3]*(r+s)/2,t[4],t[5],t[6],a),(t,e,i,n,r,s,a)=>e.arcTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*(r+s)/2,a),(t,e,i,n,r,s,a)=>e.bezierCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*r+i,t[6]*s+n,a),(t,e,i,n)=>e.closePath(),(t,e,i,n,r,s)=>e.ellipse(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,i,n,r,s,a)=>e.lineTo(t[1]*r+i,t[2]*s+n,a),(t,e,i,n,r,s,a)=>e.moveTo(t[1]*r+i,t[2]*s+n,a),(t,e,i,n,r,s,a)=>e.quadraticCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,a),(t,e,i,n,r,s,a)=>e.rect(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,a)];function Je(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0;for(let o=0;o<t.length;o++){const h=t[o];Ze[h[0]](h,e,i,n,r,s,a)}}class Qe{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function ti(t,e){let i=0;const n=t.length;for(let r=0;r<n;r++){const s=t[r],a=e[r],o=t[(r+1)%n],h=e[(r+1)%n];i+=Ht.distanceNN(s,a,o,h)}return i/2}function ei(t,e,i,n,r){return ti([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function ii(t,e,i,n,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*i*r*r*s+n*r*r*r}function ni(t,e,i,n,r){const s=ii(t.x,e.x,i.x,n.x,r),a=ii(t.y,e.y,i.y,n.y,r);return new zt(s,a)}function ri(t,e){const{p0:i,p1:n,p2:r,p3:s}=t,a=ni(i,n,r,s,e),o=Ht.pointAtPP(i,n,e),h=Ht.pointAtPP(n,r,e),l=Ht.pointAtPP(r,s,e),c=Ht.pointAtPP(o,h,e),u=Ht.pointAtPP(h,l,e);return[new si(i,o,c,a),new si(a,u,l,s)]}class si extends Qe{constructor(e,i,n,r){super(),this.type=t.CurveTypeEnum.CubicBezierCurve,this.p0=e,this.p1=i,this.p2=n,this.p3=r}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return ni(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?ei(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(e){return e===t.Direction.ROW?Et(this.p0.x-this.p3.x):e===t.Direction.COLUMN?Et(this.p0.y-this.p3.y):0}getAngleAt(t){const e=It(t-.01,0),i=Lt(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return kt(r.y-n.y,r.x-n.x)}}function ai(t,e){const{p0:i,p1:n}=t,r=Ht.pointAtPP(i,n,e);return[new oi(i,r),new oi(r,n)]}class oi extends Qe{constructor(e,i){super(),this.type=t.CurveTypeEnum.LineCurve,this.p0=e,this.p1=i}getPointAt(t){if(!1!==this.defined)return Ht.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=kt(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?Ht.distancePP(this.p0,this.p1):60}calcProjLength(e){return e===t.Direction.ROW?Et(this.p0.x-this.p1.x):e===t.Direction.COLUMN?Et(this.p0.y-this.p1.y):0}}class hi{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,r,s,a,o){const h=new si(new zt(this._lastX,this._lastY),new zt(t,e),new zt(i,n),new zt(r,s));h.originP1=this._lastOriginP,h.originP2=o,h.defined=a,this.curves.push(h),this._lastX=r,this._lastY=s,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const r=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,n,r){const s=new oi(new zt(this._lastX,this._lastY),new zt(t,e));return s.originP1=n,s.originP2=r,s.defined=i,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(e){var i,n;if(e===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(i=e.p3)&&void 0!==i?i:e.p1;return Et(t.p0.y-n.y)}if(e===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return Et(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class li extends hi{bezierCurveTo(t,e,i,n,r,s,a,o){return super.bezierCurveTo(e,t,n,i,s,r,a,o)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function ci(t,e){let i=!1;for(let n=0,r=e.length;n<=r;n++)n>=r===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function ui(e,i,n){const r=null!=i?i:Et(n[n.length-1].x-n[0].x)>Et(n[n.length-1].y-n[0].y)?t.Direction.ROW:t.Direction.COLUMN;return"monotoneY"===e?new li(e,r):new hi(e,r)}class di{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function pi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const r=ui("linear",i,t);return fi(new di(r,n),t),r}function fi(t,e){return ci(t,e)}function gi(t,e,i,n,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n,t.lastPoint1)}class vi{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&gi(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:gi(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function mi(t,e){return ci(t,e)}function yi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return pi(t,e);const r=ui("basis",i,t);return mi(new vi(r,n),t),r}function bi(t){return t<0?-1:1}function xi(t,e,i){const n=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(n||Number(r<0&&-0)),a=(i-t._y1)/(r||Number(n<0&&-0)),o=(s*r+a*n)/(n+r);return(bi(s)+bi(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function wi(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Si(t,e,i,n,r){const s=t._x0,a=t._y0,o=t._x1,h=t._y1,l=(o-s)/3;t.context.bezierCurveTo(s+l,a+l*e,o-l,h-l*i,o,h,n,t.lastPoint1)}class Ai{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:Si(this,this._t0,wi(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,Si(this,wi(this,e=xi(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Si(this,this._t0,e=xi(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class Ti extends Ai{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Ci(t,e){return ci(t,e)}function _i(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return pi(t,e);const r=ui("monotoneX",i,t);return Ci(new Ai(r,n),t),r}function Bi(t,e){return ci(t,e)}function Pi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return pi(t,e);const r=ui("monotoneY",i,t);return Bi(new Ti(r,n),t),r}let Ri=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(n,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function Mi(e,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:s}=n;if(e.length<2-Number(!!s))return null;const a=new hi("step",null!=r?r:Et(e[e.length-1].x-e[0].x)>Et(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Ei(new Ri(a,i,s),e),a}function Ei(t,e){return ci(t,e)}class ki extends di{lineEnd(){this.context.closePath()}}function Oi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const r=ui("linear",i,t);return Ii(new ki(r,n),t),r}function Ii(t,e){return ci(t,e)}function Li(t,e,i,n,r){let s=t._x1,a=t._y1,o=t._x2,h=t._y2;if(t._l01_a>_t){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);s=(s*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>_t){const n=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,r=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*n+t._x1*t._l23_2a-e*t._l12_2a)/r,h=(h*n+t._y1*t._l23_2a-i*t._l12_2a)/r}t.context.bezierCurveTo(s,a,o,h,t._x2,t._y2,n,t.lastPoint1)}function Di(t,e){return function(i,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:a}=r;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return pi(i,r);const o=ui(t,s,i);return ci(new e(o,n,a),i),o}}const ji=Di("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:Li(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const Ui=Di("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:Li(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});function Wi(t,e,i){var n,r;switch(e){case"linear":default:return pi(t,i);case"basis":return yi(t,i);case"monotoneX":return _i(t,i);case"monotoneY":return Pi(t,i);case"step":return Mi(t,.5,i);case"stepBefore":return Mi(t,0,i);case"stepAfter":return Mi(t,1,i);case"catmullRom":return ji(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return Ui(t,null!==(r=null==i?void 0:i.curveTension)&&void 0!==r?r:.5,i);case"linearClosed":return Oi(t,i)}}class Ni extends Pe{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Be(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Ee.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Ee.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Ee.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,s){return this.commandList.push([Ee.C,t,e,i,n,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,s),this}arcTo(t,e,i,n,r){return this.commandList.push([Ee.AT,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}ellipse(t,e,i,n,r,s,a,o){return this.commandList.push([Ee.E,t,e,i,n,r,s,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,s,a,o),this}rect(t,e,i,n){return this.commandList.push([Ee.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,r,s){return this.commandList.push([Ee.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([Ee.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[Ee.M]=t=>`M${t[1]} ${t[2]}`,t[Ee.L]=t=>`L${t[1]} ${t[2]}`,t[Ee.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Ee.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Ee.A]=t=>{const e=[];Ke(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[Ee.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[Ee.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,r){this.clear();const s=Ue(t);return this._runCommandStrList(s,e,i,n,r),this._updateBounds(),this}fromLine(e){const{points:i,curveType:n,clipRangeByDimension:r}=e.attribute;if(!i)return;const s=Wi(i,n);"x"===r?this.direction=t.Direction.ROW:"y"===r?this.direction=t.Direction.COLUMN:"auto"===r&&(this.direction=s.direction),this.curves=s.curves}fromCustomPath2D(t,e,i,n,r){return this.clear(),this._runCommandList(t.commandList,e,i,n,r),this._updateBounds(),this}transform(t,e,i,n){const r=this.commandList;if(!this.transformCbList){const t=[];t[Ee.M]=this.moveToTransform,t[Ee.L]=this.lineToTransform,t[Ee.Q]=this.quadraticCurveToTransform,t[Ee.C]=this.bezierCurveToTransform,t[Ee.AT]=this.arcToTransform,t[Ee.E]=this.ellipseTransform,t[Ee.R]=this.rectTransform,t[Ee.A]=this.arcTransform,t[Ee.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}ellipseTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}rectTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}arcTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}closePathTransform(){}_runCommandStrList(t){let e,i,n,r,s,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,u=0,d=0,p=0,f=0;for(let g=0,v=t.length;g<v;++g){switch(e=t[g],1===h&&1===l||(e=Fi(e,h,l)),e[0]){case"l":u+=e[1],d+=e[2],this.lineTo(u+a,d+o);break;case"L":u=e[1],d=e[2],this.lineTo(u+a,d+o);break;case"h":u+=e[1],this.lineTo(u+a,d+o);break;case"H":u=e[1],this.lineTo(u+a,d+o);break;case"v":d+=e[1],this.lineTo(u+a,d+o);break;case"V":d=e[1],this.lineTo(u+a,d+o);break;case"m":u+=e[1],d+=e[2],this.moveTo(u+a,d+o);break;case"M":u=e[1],d=e[2],this.moveTo(u+a,d+o);break;case"c":i=u+e[5],n=d+e[6],p=u+e[3],f=d+e[4],this.bezierCurveTo(u+e[1]+a,d+e[2]+o,p+a,f+o,i+a,n+o),u=i,d=n;break;case"C":u=e[5],d=e[6],p=e[3],f=e[4],this.bezierCurveTo(e[1]+a,e[2]+o,p+a,f+o,u+a,d+o);break;case"s":i=u+e[3],n=d+e[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+a,f+o,u+e[1]+a,d+e[2]+o,i+a,n+o),p=u+e[1],f=d+e[2],u=i,d=n;break;case"S":i=e[3],n=e[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+a,f+o,e[1]+a,e[2]+o,i+a,n+o),u=i,d=n,p=e[1],f=e[2];break;case"q":i=u+e[3],n=d+e[4],p=u+e[1],f=d+e[2],this.quadraticCurveTo(p+a,f+o,i+a,n+o),u=i,d=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+a,e[2]+o,i+a,n+o),u=i,d=n,p=e[1],f=e[2];break;case"t":i=u+e[1],n=d+e[2],null===c[0].match(/[QqTt]/)?(p=u,f=d):"t"===c[0]?(p=2*u-r,f=2*d-s):"q"===c[0]&&(p=2*u-p,f=2*d-f),r=p,s=f,this.quadraticCurveTo(p+a,f+o,i+a,n+o),u=i,d=n,p=u+e[1],f=d+e[2];break;case"T":i=e[1],n=e[2],p=2*u-p,f=2*d-f,this.quadraticCurveTo(p+a,f+o,i+a,n+o),u=i,d=n;break;case"a":qe(this,u+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+u+a,e[7]+d+o]),u+=e[6],d+=e[7];break;case"A":qe(this,u+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+o]),u=e[6],d=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==r)for(let s=0,a=t.length;s<a;++s){const a=t[s].slice();switch(a[0]){case Ee.L:this.lineToTransform(a,e,i,n,r);break;case Ee.M:this.moveToTransform(a,e,i,n,r);break;case Ee.C:this.bezierCurveToTransform(a,e,i,n,r);break;case Ee.Q:this.quadraticCurveToTransform(a,e,i,n,r);break;case Ee.A:this.arcToTransform(a,e,i,n,r);break;case Ee.E:this.ellipseTransform(a,e,i,n,r);break;case Ee.R:this.rectTransform(a,e,i,n,r);break;case Ee.AT:this.arcToTransform(a,e,i,n,r);break;case Ee.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Je(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Et(t.p0.y-e.p1.y)}if(this.direction===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Et(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this.curves.length;n++){e=this.curves[n];const r=e.getLength(this.direction);if(i+r>=t)break;i+=r}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}}const Gi=["l",0,0,0,0,0,0,0];function Fi(t,e,i){const n=Gi[0]=t[0];if("a"===n||"A"===n)Gi[1]=e*t[1],Gi[2]=i*t[2],Gi[3]=t[3],Gi[4]=t[4],Gi[5]=t[5],Gi[6]=e*t[6],Gi[7]=i*t[7];else if("h"===n||"H"===n)Gi[1]=e*t[1];else if("v"===n||"V"===n)Gi[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)Gi[n]=(n%2==1?e:i)*t[n];return Gi}const zi={alignSelf:"auto"},Hi={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new ue},Vi={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Yi={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Xi=Object.assign({outerBorder:Object.assign(Object.assign({},Yi),{distance:0}),innerBorder:Object.assign(Object.assign({},Yi),{distance:0})},Yi),$i={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:t.MeasureModeEnum.fontBounding,keepCenterInLine:!1},qi={pickStrokeBuffer:0},Ki=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},Vi),Xi),zi),qi),Zi={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Ji={_debug_bounds:!1},Qi=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1},Ji),Ki),Hi);const tn=Object.assign(Object.assign({},Qi),{startAngle:0,endAngle:Mt,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),en=Object.assign(Object.assign(Object.assign({},Qi),Zi),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),nn=Object.assign(Object.assign({},Qi),{radius:1,startAngle:0,endAngle:Mt}),rn=Object.assign(Object.assign({},Qi),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1}),sn=Object.assign(Object.assign({},Qi),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),an=Object.assign(Object.assign(Object.assign({},Qi),Zi),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),on=Object.assign(Object.assign({},Qi),{path:new Ni,fillStrokeOrder:1,customPath:()=>{wt.getInstance().warn("空函数")}}),hn=Object.assign(Object.assign({},Qi),{points:[],cornerRadius:0,closePath:!0}),ln=Object.assign(Object.assign({},Qi),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),cn=Object.assign(Object.assign({},Qi),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),un=Object.assign(Object.assign({},Qi),{symbolType:"circle",size:10,keepDirIn3d:!0}),dn=Object.assign(Object.assign(Object.assign({},Qi),$i),{strokeBoundsBuffer:0,keepDirIn3d:!0}),pn=Object.assign(Object.assign(Object.assign({},Qi),$i),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),fn=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Qi),{fill:!0,cornerRadius:0}),gn=Object.assign(Object.assign({},fn),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});class vn{}const mn=new vn,yn=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function n(){return r("linear",t.linearGradient,s)||r("radial",t.radialGradient,o)||r("conic",t.conicGradient,a)}function r(e,n,r){return function(n,s){const a=m(n);if(a){m(t.startCall)||i("Missing (");const n=function(n){const s=r();return s&&(m(t.comma)||i("Missing comma before color stops")),{type:e,orientation:s,colorStops:d(p)}}();return m(t.endCall)||i("Missing )"),n}}(n)}function s(){return v("directional",t.sideOrCorner,1)||v("angular",t.angleValue,1)}function a(){return v("angular",t.fromAngleValue,1)}function o(){let i,n,r=h();return r&&(i=[],i.push(r),n=e,m(t.comma)&&(r=h(),r?i.push(r):e=n)),i}function h(){let t=function(){const t=v("shape",/^(circle)/i,0);return t&&(t.style=g()||l()),t}()||function(){const t=v("shape",/^(ellipse)/i,0);return t&&(t.style=f()||l()),t}();if(t)t.at=c();else{const e=l();if(e){t=e;const i=c();i&&(t.at=i)}else{const e=u();e&&(t={type:"default-radial",at:e})}}return t}function l(){return v("extent-keyword",t.extentKeywords,1)}function c(){if(v("position",/^at/,0)){const t=u();return t||i("Missing positioning value"),t}}function u(){const t={x:f(),y:f()};if(t.x||t.y)return{type:"position",value:t}}function d(e){let n=e();const r=[];if(n)for(r.push(n);m(t.comma);)n=e(),n?r.push(n):i("One extra comma");return r}function p(){const e=v("hex",t.hexColor,1)||v("rgba",t.rgbaColor,1)||v("rgb",t.rgbColor,1)||v("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=f(),e}function f(){return v("%",t.percentageValue,1)||v("position-keyword",t.positionKeywords,1)||g()}function g(){return v("px",t.pixelValue,1)||v("em",t.emValue,1)}function v(t,e,i){const n=m(e);if(n)return{type:t,value:n[i]}}function m(t){const i=/^[\n\r\t\s]+/.exec(e);i&&y(i[0].length);const n=t.exec(e);return n&&y(n[0].length),n}function y(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=d(n);return e.length>0&&i("Invalid input not EOF"),t}()}}();class bn{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(bn.IsGradientStr(t))try{const e=yn(t)[0];if(e){if("linear"===e.type)return bn.ParseLinear(e);if("radial"===e.type)return bn.ParseRadial(e);if("conic"===e.type)return bn.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,n=Bt/2,r=parseFloat(e.value)/180*Bt-n;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+Mt,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,n=Bt/2;let r="angular"===e.type?parseFloat(e.value)/180*Bt:0;for(;r<0;)r+=Mt;for(;r>=Mt;)r-=Mt;let s=0,a=0,o=0,h=0;return r<n?(s=0,a=1,o=Math.sin(r),h=a-Math.cos(r)):r<Bt?(s=0,a=0,o=Math.cos(r-n),h=Math.sin(r-n)):r<Bt+n?(s=1,a=0,o=s-Math.sin(r-Bt),h=Math.cos(r-Bt)):(s=1,o=s-Math.cos(r-n-Bt),h-=Math.sin(r-n-Bt)),{gradient:"linear",x0:s,y0:a,x1:o,y1:h,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function xn(t,e,i){let n=e;const{a:r,b:s,c:a,d:o}=t.currentMatrix,h=Math.sign(r)*Math.sqrt(r*r+s*s),l=Math.sign(o)*Math.sqrt(a*a+o*o);return h+l===0?0:(n=n/Math.abs(h+l)*2*i,n)}function wn(t,e,i){let n,r,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!e||!0===e)return"black";if(at(e))for(let t=0;t<e.length&&(r=e[t],!r);t++);else r=e;if(r=bn.Parse(r),"string"==typeof r)return r;if(i.AABBBounds&&(!i.attribute||0!==i.attribute.scaleX||0!==i.attribute.scaleY)){const e=i.AABBBounds;let o=e.x2-e.x1,h=e.y2-e.y1,l=e.x1-s,c=e.y1-a;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;o/=t,h/=e,l/=t,c/=e}"linear"===r.gradient?n=function(t,e,i,n,r,s){var a,o,h,l;const c=t.createLinearGradient(i+(null!==(a=e.x0)&&void 0!==a?a:0)*r,n+(null!==(o=e.y0)&&void 0!==o?o:0)*s,i+(null!==(h=e.x1)&&void 0!==h?h:1)*r,n+(null!==(l=e.y1)&&void 0!==l?l:0)*s);return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c}(t,r,l,c,o,h):"conical"===r.gradient?n=function(t,e,i,n,r,s){var a,o;const h=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*r,n+(null!==(o=e.y)&&void 0!==o?o:0)*s,e.startAngle,e.endAngle);return e.stops.forEach((t=>{h.addColorStop(t.offset,t.color)})),h.GetPattern(r+i,s+n,void 0)}(t,r,l,c,o,h):"radial"===r.gradient&&(n=function(t,e,i,n,r,s){var a,o,h,l,c,u;const d=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*r,n+(null!==(o=e.y0)&&void 0!==o?o:.5)*s,Math.max(r,s)*(null!==(h=e.r0)&&void 0!==h?h:0),i+(null!==(l=e.x1)&&void 0!==l?l:.5)*r,n+(null!==(c=e.y1)&&void 0!==c?c:.5)*s,Math.max(r,s)*(null!==(u=e.r1)&&void 0!==u?u:.5));return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d}(t,r,l,c,o,h))}return n||"orange"}const Sn={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},An=!0,Tn=!1,Cn=/\w|\(|\)|-/,_n=/[.?!,;:/,。?!、;:]/,Bn=/\S/,Pn=(t,e)=>{let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily})};function Rn(t,e,i,n,r){if(!e||e<=0)return 0;const s=mn.graphicUtil.textMeasure;let a=n,o=t.slice(0,a),h=Math.floor(s.measureText(o,i).width),l=t.slice(0,a+1),c=Math.floor(s.measureText(l,i).width);for(;h>e||c<=e;){if(h>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),h=Math.floor(s.measureText(o,i).width),l=t.slice(0,a+1),c=Math.floor(s.measureText(l,i).width)}return r&&(a=Mn(t,a)),a}function Mn(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e;for(;Cn.test(t[n-1])&&Cn.test(t[n])||_n.test(t[n]);)if(n--,n<=0)return i?En(t,e):e;return n}function En(t,e){let i=e;for(;Cn.test(t[i-1])&&Cn.test(t[i])||_n.test(t[i]);)if(i++,i>=t.length)return i;return i}function kn(t,e){const i=mn.graphicUtil.textMeasure.measureText(t,e),n={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(n.width=Math.floor(i.width),n.height=e.fontSize||0,n.ascent=n.height,n.descent=0):(n.width=Math.floor(i.width),n.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),n.ascent=Math.floor(i.actualBoundingBoxAscent),n.descent=n.height-n.ascent),n}var On=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let In=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}_measureTextWithoutAlignBaseline(t,e,i){this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return i?this.compatibleMetrics(n,e):n}_measureTextWithAlignBaseline(t,e,i){this.context.setTextStyle(e);const n=this.context.measureText(t);return i?this.compatibleMetrics(n,e):n}compatibleMetrics(t,e){if(null==t.actualBoundingBoxAscent||null==t.actualBoundingBoxDescent||null==t.fontBoundingBoxAscent||null==t.fontBoundingBoxDescent){t={width:t.width};const{ascent:i,descent:n}=this.measureTextBoundADscentEstimate(e);t.actualBoundingBoxAscent=i,t.actualBoundingBoxDescent=n,t.fontBoundingBoxAscent=i,t.fontBoundingBoxDescent=n}if(null==t.actualBoundingBoxLeft||null==t.actualBoundingBoxRight){t={width:t.width,actualBoundingBoxAscent:t.actualBoundingBoxAscent,actualBoundingBoxDescent:t.actualBoundingBoxDescent,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent};const{left:i,right:n}=this.measureTextBoundLeftRightEstimate(e);t.actualBoundingBoxLeft=i,t.actualBoundingBoxRight=n}return t}estimate(t,e){let{fontSize:i=dn.fontSize}=e,n=0,r=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?n++:r++;return{width:~~(.8*n*i+r*i),height:i}}measureTextWidth(t,e,i){return this.context?(i=null!=i?i:this._measureTextWithoutAlignBaseline(t,e)).width:this.estimate(t,e).width}measureTextBoundsWidth(t,e,i){return this.context?(i=null!=i?i:this._measureTextWithoutAlignBaseline(t,e)).width:this.estimate(t,e).width}measureTextBoundsLeftRight(t,e,i){return this.context?{left:(i=null!=i?i:this._measureTextWithAlignBaseline(t,e,!0)).actualBoundingBoxLeft,right:i.actualBoundingBoxRight}:this.measureTextBoundLeftRightEstimate(e)}measureTextPixelHeight(t,e,i){var n;return this.context?(i=null!=i?i:this._measureTextWithoutAlignBaseline(t,e,!0),Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)):null!==(n=e.fontSize)&&void 0!==n?n:$i.fontSize}measureTextPixelADscent(t,e,i){return this.context?{ascent:(i=null!=i?i:this._measureTextWithAlignBaseline(t,e,!0)).actualBoundingBoxAscent,descent:i.actualBoundingBoxDescent}:this.measureTextBoundADscentEstimate(e)}measureTextBoundHieght(t,e,i){var n;return this.context?(i=null!=i?i:this._measureTextWithoutAlignBaseline(t,e,!0),Math.abs(i.fontBoundingBoxAscent-i.fontBoundingBoxDescent)):null!==(n=e.fontSize)&&void 0!==n?n:$i.fontSize}measureTextBoundADscent(t,e,i){return this.context?{ascent:(i=null!=i?i:this._measureTextWithAlignBaseline(t,e,!0)).fontBoundingBoxAscent,descent:i.fontBoundingBoxDescent}:this.measureTextBoundADscentEstimate(e)}measureTextBoundADscentEstimate(t){var e;const i=null!==(e=t.fontSize)&&void 0!==e?e:$i.fontSize;return{ascent:.79*i,descent:.21*i}}measureTextBoundLeftRightEstimate(t){var e;const i=null!==(e=t.fontSize)&&void 0!==e?e:$i.fontSize,{textAlign:n}=t;return"center"===n?{left:i/2,right:i/2}:"right"===n||"end"===n?{left:i,right:0}:{left:0,right:i}}measureTextPixelADscentAndWidth(e,i,n){if(!this.context)return Object.assign(Object.assign({},this.measureTextBoundADscentEstimate(i)),{width:this.estimate(e,i).width});const r=this._measureTextWithoutAlignBaseline(e,i,!0);if(n===t.MeasureModeEnum.actualBounding)return{ascent:r.actualBoundingBoxAscent,descent:r.actualBoundingBoxDescent,width:r.width};if(n===t.MeasureModeEnum.estimate)return Object.assign(Object.assign({},this.measureTextBoundADscentEstimate(i)),{width:r.width});if(n===t.MeasureModeEnum.fontBounding){let t=r.fontBoundingBoxAscent,e=r.fontBoundingBoxDescent;if(r.actualBoundingBoxDescent&&e<r.actualBoundingBoxDescent){const i=r.actualBoundingBoxDescent-e;e+=i,t-=i}else if(r.actualBoundingBoxAscent&&t<r.actualBoundingBoxAscent){const i=r.actualBoundingBoxAscent-t;t+=i,e-=i}return{ascent:t,descent:e,width:r.width}}return{ascent:r.actualBoundingBoxAscent,descent:r.actualBoundingBoxDescent,width:r.width}}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,n){if(0===t.length)return{verticalList:t,width:0};const{fontSize:r=12}=e;t.forEach((t=>{t.width=0===t.direction?r:this.measureTextWidth(t.text,e)}));const s=[];let a=0,o=0;for(;o<t.length&&a+t[o].width<i;o++)a+=t[o].width,s.push(t[o]);if(t[o]&&t[o].text.length>1){const r=this._clipText(t[o].text,e,i-a,0,t[o].text.length-1,"end",!1);if(n&&r.str!==t[o].text){let i="",n=0;for(let e=0;e<o;e++){const r=t[e];i+=r.text,n+=r.text.length}i+=t[o].text;let s=Mn(i,n+r.str.length);s-=n,s!==r.str.length-1&&(r.str=r.str.substring(0,s),r.width=this.measureTextWidth(r.str,e))}s.push(Object.assign(Object.assign({},t[o]),{text:r.str,width:r.width})),a+=r.width}return{verticalList:s,width:a}}clipText(t,e,i,n,r){if(0===t.length)return{str:"",width:0};let s=this.measureTextWidth(t,e);if(s<=i)return{str:t,width:s};if(s=this.measureTextWidth(t[0],e),s>i)return{str:"",width:0};const a=this._clipText(t,e,i,0,t.length-1,"end",!1);if(n&&a.str!==t){let i=Mn(t,a.str.length,r);i!==a.str.length&&(i>a.str.length&&(a.wordBreaked=i,i=a.str.length),a.str=t.substring(0,i),a.width=this.measureTextWidth(a.str,e))}return a}_clipText(t,e,i,n,r,s,a){let o;if("start"===s)o=this._clipTextStart(t,e,i,n,r),a&&(o.result=a+o.str);else if("middle"===s){const n=this._clipTextMiddle(t,e,i,"","",0,0,1);o={str:"none",width:n.width,result:n.left+a+n.right}}else o=this._clipTextEnd(t,e,i,n,r),a&&(o.result=o.str+a);return o}_clipTextEnd(t,e,i,n,r){if(n===r){wt.getInstance().warn(`【_clipTextEnd】不应该走到这里${t}, ${n}, ${r}`);const i=t.substring(0,r+1);return{str:i,width:this.measureTextWidth(i,e)}}const s=Math.floor((n+r)/2),a=t.substring(0,s+1),o=this.measureTextWidth(a,e);let h;if(o>i){if(a.length<=1)return{str:"",width:0};const r=t.substring(0,s);return h=this.measureTextWidth(r,e),h<=i?{str:r,width:h}:this._clipTextEnd(t,e,i,n,s)}if(o<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(0,s+2);return h=this.measureTextWidth(n,e),h>=i?{str:a,width:o}:this._clipTextEnd(t,e,i,s,r)}return{str:a,width:o}}_clipTextStart(t,e,i,n,r){const s=Math.ceil((n+r)/2),a=t.substring(s-1,t.length),o=this.measureTextWidth(a,e);let h;if(o>i){if(a.length<=1)return{str:"",width:0};const n=t.substring(s,t.length);return h=this.measureTextWidth(n,e),h<=i?{str:n,width:h}:this._clipTextStart(t,e,i,s,t.length)}if(o<i){if(s<=0)return{str:t,width:this.measureTextWidth(t,e)};const r=t.substring(s-2,t.length);return h=this.measureTextWidth(r,e),h>=i?{str:a,width:o}:this._clipTextStart(t,e,i,n,s)}return{str:a,width:o}}_clipTextMiddle(t,e,i,n,r,s,a,o){const h=t.substring(0,o),l=this.measureTextWidth(h,e);if(l+a>i)return{left:n,right:r,width:s+a};const c=t.substring(t.length-o,t.length),u=this.measureTextWidth(c,e);return l+u>i?{left:h,right:r,width:l+a}:this._clipTextMiddle(t,e,i,h,c,l,u,o+1)}clipTextWithSuffixVertical(t,e,i,n,r,s){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};const a=this.clipTextVertical(t,e,i,r);if(a.verticalList.length===t.length&&a.verticalList[a.verticalList.length-1].width===t[t.length-1].width)return a;const o=this.measureTextWidth(n,e);if(o>i)return a;let h;if(i-=o,"start"===s){const s=this.revertVerticalList(t);h=this.clipTextVertical(s,e,i,r);const a=this.revertVerticalList(h.verticalList);a.unshift({text:n,direction:1,width:o}),h.verticalList=a}else if("middle"===s){const s=this.clipTextVertical(t,e,i/2,r),a=this.revertVerticalList(t),l=this.clipTextVertical(a,e,i/2,r);s.verticalList.push({text:n,direction:1,width:o}),this.revertVerticalList(l.verticalList).forEach((t=>s.verticalList.push(t))),h={verticalList:s.verticalList,width:s.width+l.width}}else h=this.clipTextVertical(t,e,i,r),h.verticalList.push({text:n,direction:1,width:o});return h.width+=o,h}revertVerticalList(t){return t.reverse().map((t=>{const e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}clipTextWithSuffix(t,e,i,n,r,s){let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};const o=this.measureTextWidth(t,e);if(!a&&o<=i)return{str:t,width:o};const h=this.measureTextWidth(n,e);if(h>i)return{str:"",width:0};if(a&&o+h<=i)return{str:t+n,width:o+h};i-=h;const l=this._clipText(t,e,i,0,t.length-1,s,n);if(r&&l.str!==t){const i=Mn(t,l.str.length);i!==l.str.length&&(l.result=t.substring(0,i),l.width=this.measureTextWidth(l.str,e))}else a&&l.str===t&&(l.result=t+n);return l.str=l.result,l.width+=h,l}};In=On([g()],In);var Ln=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};const Dn=Symbol.for("TextMeasureContribution");t.DefaultTextMeasureContribution=class extends In{},t.DefaultTextMeasureContribution=Ln([g()],t.DefaultTextMeasureContribution);const jn=new E,Un=Symbol.for("CanvasFactory"),Wn=Symbol.for("Context2dFactory");function Nn(t){return jn.getNamed(Un,mn.global.env)(t)}const Gn=1e-4,Fn=Math.sqrt(3),zn=1/3;function Hn(t){return t>-nr&&t<nr}function Vn(t){return t>nr||t<-nr}const Yn=[0,0],Xn=[0,0],$n=[0,0];function qn(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Kn(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function Zn(t,e,i,n,r){const s=1-r;return s*s*(s*t+3*r*e)+r*r*(r*n+3*s*i)}function Jn(t){return(t%=Mt)<0&&(t+=Mt),t}function Qn(t,e,i,n,r,s,a,o,h){if(0===a)return!1;const l=a;return!(h>e+l&&h>n+l&&h>s+l||h<e-l&&h<n-l&&h<s-l||o>t+l&&o>i+l&&o>r+l||o<t-l&&o<i-l&&o<r-l)&&function(t,e,i,n,r,s,a,o,h){let l=0,c=.005,u=1/0;Yn[0]=a,Yn[1]=o;for(let a=0;a<1;a+=.05){Xn[0]=Kn(t,i,r,a),Xn[1]=Kn(e,n,s,a);const o=qn(Yn,Xn);o<u&&(l=a,u=o)}u=1/0;for(let a=0;a<32&&!(c<Gn);a++){const a=l-c,o=l+c;Xn[0]=Kn(t,i,r,a),Xn[1]=Kn(e,n,s,a);const h=qn(Xn,Yn);if(a>=0&&h<u)l=a,u=h;else{$n[0]=Kn(t,i,r,o),$n[1]=Kn(e,n,s,o);const a=qn($n,Yn);o<=1&&a<u?(l=o,u=a):c*=.5}}return h&&(h[0]=Kn(t,i,r,l),h[1]=Kn(e,n,s,l)),Math.sqrt(u)}(t,e,i,n,r,s,o,h,null)<=l/2}function tr(t,e,i,n,r,s,a,o,h,l,c){if(0===h)return!1;const u=h;return!(c>e+u&&c>n+u&&c>s+u&&c>o+u||c<e-u&&c<n-u&&c<s-u&&c<o-u||l>t+u&&l>i+u&&l>r+u&&l>a+u||l<t-u&&l<i-u&&l<r-u&&l<a-u)&&function(t,e,i,n,r,s,a,o,h,l,c){let u,d,p,f,g=0,v=.005,m=1/0;Yn[0]=h,Yn[1]=l;for(let h=0;h<1;h+=.05)Xn[0]=Zn(t,i,r,a,h),Xn[1]=Zn(e,n,s,o,h),p=qn(Yn,Xn),p<m&&(g=h,m=p);m=1/0;for(let h=0;h<32&&!(v<Gn);h++)u=g-v,d=g+v,Xn[0]=Zn(t,i,r,a,u),Xn[1]=Zn(e,n,s,o,u),p=qn(Xn,Yn),u>=0&&p<m?(g=u,m=p):($n[0]=Zn(t,i,r,a,d),$n[1]=Zn(e,n,s,o,d),f=qn($n,Yn),d<=1&&f<m?(g=d,m=f):v*=.5);return c&&(c[0]=Zn(t,i,r,a,g),c[1]=Zn(e,n,s,o,g)),Math.sqrt(m)}(t,e,i,n,r,s,a,o,l,c,null)<=u/2}function er(t,e,i,n,r,s,a,o,h){if(0===a)return!1;const l=a;o-=t,h-=e;const c=Math.sqrt(o*o+h*h);if(c-l>i||c+l<i)return!1;if(Math.abs(n-r)%Mt<1e-4)return!0;if(s){const t=n;n=Jn(r),r=Jn(t)}else n=Jn(n),r=Jn(r);n>r&&(r+=Mt);let u=Math.atan2(h,o);return u<0&&(u+=Mt),u>=n&&u<=r||u+Mt>=n&&u+Mt<=r}function ir(t,e,i,n,r,s,a){if(0===r)return!1;const o=r,h=r/2;let l=0,c=t;if(a>e+h&&a>n+h||a<e-h&&a<n-h||s>t+h&&s>i+h||s<t-h&&s<i-h)return!1;if(t===i)return Math.abs(s-t)<=o/2;l=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=l*s-a+c;return u*u/(l*l+1)<=o/2*o/2}const nr=1e-4;function rr(t,e,i,n,r){const s=6*i-12*e+6*t,a=9*e+3*n-3*t-9*i,o=3*e-3*t;let h=0;if(Hn(a)){if(Vn(s)){const t=-o/s;t>=0&&t<=1&&(r[h++]=t)}}else{const t=s*s-4*a*o;if(Hn(t))r[0]=-s/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-s+e)/(2*a),n=(-s-e)/(2*a);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}const sr=[-1,-1,-1],ar=[-1,-1];function or(){const t=ar[0];ar[0]=ar[1],ar[1]=t}function hr(t,e,i,n,r,s,a,o,h,l){if(l>e&&l>n&&l>s&&l>o||l<e&&l<n&&l<s&&l<o)return 0;const c=function(t,e,i,n,r,s){const a=n+3*(e-i)-t,o=3*(i-2*e+t),h=3*(e-t),l=t-r,c=o*o-3*a*h,u=o*h-9*a*l,d=h*h-3*o*l;let p=0;if(Hn(c)&&Hn(u))if(Hn(o))s[0]=0;else{const t=-h/o;t>=0&&t<=1&&(s[p++]=t)}else{const t=u*u-4*c*d;if(Hn(t)){const t=u/c,e=-o/a+t,i=-t/2;e>=0&&e<=1&&(s[p++]=e),i>=0&&i<=1&&(s[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*o+1.5*a*(-u+e),n=c*o+1.5*a*(-u-e);i=i<0?-Math.pow(-i,zn):Math.pow(i,zn),n=n<0?-Math.pow(-n,zn):Math.pow(n,zn);const r=(-o-(i+n))/(3*a);r>=0&&r<=1&&(s[p++]=r)}else{const t=(2*c*o-3*a*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),r=(-o-2*i*n)/(3*a),h=(-o+i*(n+Fn*Math.sin(e)))/(3*a),l=(-o+i*(n-Fn*Math.sin(e)))/(3*a);r>=0&&r<=1&&(s[p++]=r),h>=0&&h<=1&&(s[p++]=h),l>=0&&l<=1&&(s[p++]=l)}}return p}(e,n,s,o,l,sr);if(0===c)return 0;let u=0,d=-1,p=0,f=0;for(let l=0;l<c;l++){const c=sr[l],g=0===c||1===c?.5:1;Zn(t,i,r,a,c)<h||(d<0&&(d=rr(e,n,s,o,ar),ar[1]<ar[0]&&d>1&&or(),p=Zn(e,n,s,o,ar[0]),d>1&&(f=Zn(e,n,s,o,ar[1]))),2===d?c<ar[0]?u+=p<e?g:-g:c<ar[1]?u+=f<p?g:-g:u+=o<f?g:-g:c<ar[0]?u+=p<e?g:-g:u+=o<p?g:-g)}return u}function lr(t,e,i,n,r,s,a,o){if(o>e&&o>n&&o>s||o<e&&o<n&&o<s)return 0;const h=function(t,e,i,n,r){const s=t-2*e+i,a=2*(e-t),o=t-n;let h=0;if(Hn(s)){if(Vn(a)){const t=-o/a;t>=0&&t<=1&&(r[h++]=t)}}else{const t=a*a-4*s*o;if(Hn(t)){const t=-a/(2*s);t>=0&&t<=1&&(r[h++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*s),n=(-a-e)/(2*s);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}(e,n,s,o,sr);if(0===h)return 0;const l=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,s);if(l>=0&&l<=1){let o=0;const c=Kn(e,n,s,l);for(let n=0;n<h;n++){const h=0===sr[n]||1===sr[n]?.5:1;Kn(t,i,r,sr[n])<a||(sr[n]<l?o+=c<e?h:-h:o+=s<c?h:-h)}return o}const c=0===sr[0]||1===sr[0]?.5:1;return Kn(t,i,r,sr[0])<a?0:s<e?c:-c}function cr(t,e,i,n,r,s,a,o){if((o-=e)>i||o<-i)return 0;const h=Math.sqrt(i*i-o*o);sr[0]=-h,sr[1]=h;const l=Math.abs(n-r);if(l<1e-4)return 0;if(l>=Mt-1e-4){n=0,r=Mt;const e=s?1:-1;return a>=sr[0]+t&&a<=sr[1]+t?e:0}if(n>r){const t=n;n=r,r=t}n<0&&(n+=Mt,r+=Mt);let c=0;for(let e=0;e<2;e++){const i=sr[e];if(i+t>a){let t=Math.atan2(o,i),e=s?1:-1;t<0&&(t=Mt+t),(t>=n&&t<=r||t+Mt>=n&&t+Mt<=r)&&(t>Bt/2&&t<1.5*Bt&&(e=-e),c+=e)}}return c}function ur(t){return Math.round(t/Bt*1e8)/1e8%2*Bt}function dr(t,e){let i=ur(t[0]);i<0&&(i+=Mt);const n=i-t[0];let r=t[1];r+=n,!e&&r-i>=Mt?r=i+Mt:e&&i-r>=Mt?r=i-Mt:!e&&i>r?r=i+(Mt-ur(i-r)):e&&i<r&&(r=i-(Mt-ur(r-i))),t[0]=i,t[1]=r}const pr=[0,0];function fr(t,e,i,n,r){const s=t,a=t.length;let o,h,l=0,c=0,u=0,d=0,p=0;for(let t=0;t<a;t++){const a=s[t],f=0===t;a[0]===Ee.M&&t>1&&(i||(l+=ne(c,u,d,p,n,r))),f&&(c=a[1],u=a[2],d=c,p=u);const g=a[0],v=a[1],m=a[2],y=a[3],b=a[4],x=a[5],w=a[6];let S=b,A=x;pr[0]=S,pr[1]=A,dr(pr,Boolean(a[6])),S=pr[0],A=pr[1];const T=S,C=A-S,_=!!(1-(a[6]?0:1)),B=(n-v)*y/y+v;switch(g){case Ee.M:d=v,p=m,c=d,u=p;break;case Ee.L:if(i){if(ir(c,u,v,m,e,n,r))return!0}else l+=ne(c,u,v,m,n,r)||0;c=v,u=m;break;case Ee.C:if(i){if(tr(c,u,v,m,y,b,x,w,e,n,r))return!0}else l+=hr(c,u,v,m,y,b,x,w,n,r)||0;c=x,u=w;break;case Ee.Q:if(i){if(Qn(c,u,v,m,y,b,e,n,r))return!0}else l+=lr(c,u,v,m,y,b,n,r)||0;c=y,u=b;break;case Ee.A:if(o=Math.cos(T)*y+v,h=Math.sin(T)*y+m,f?(d=o,p=h):l+=ne(c,u,o,h,n,r),i){if(er(v,m,y,T,T+C,_,e,B,r))return!0}else l+=cr(v,m,y,T,T+C,_,B,r);c=Math.cos(T+C)*y+v,u=Math.sin(T+C)*y+m;break;case Ee.R:if(d=c=v,p=u=m,o=d+y,h=p+b,i){if(ir(d,p,o,p,e,n,r)||ir(o,p,o,h,e,n,r)||ir(o,h,d,h,e,n,r)||ir(d,h,d,p,e,n,r))return!0}else l+=ne(o,p,o,h,n,r),l+=ne(d,h,d,p,n,r);break;case Ee.Z:if(i){if(ir(c,u,d,p,e,n,r))return!0}else l+=ne(c,u,d,p,n,r);c=d,u=p}}return i||function(t,e){return Math.abs(t-e)<nr}(u,p)||(l+=ne(c,u,d,p,n,r)||0),0!==l}class gr{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=Nn(Object.assign({nativeCanvas:mn.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=Nn(Object.assign({nativeCanvas:mn.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const vr=new gr;var mr=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},yr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const br=Symbol.for("VWindow"),xr=Symbol.for("WindowHandlerContribution");t.DefaultWindow=class{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){this.hooks={onChange:new j(["x","y","width","height"])},this.active=()=>{const t=this.global;t.env&&!this.actived&&(jn.getNamed(xr,t.env).configure(this,t),this.actived=!0)},this._uid=e.GenAutoIncrementId(),this.global=mn.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}}set style(t){this._handler.setStyle(t)}create(t){var e,i;this._handler.createWindow(t);const n=this._handler.getWH();this._width=n.width,this._height=n.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(i=t.height)&&void 0!==i?i:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t){this._handler.clearViewBox(t)}setViewBox(t){this._handler.setViewBox(t)}setViewBoxTransform(t,e,i,n,r,s){this._handler.setViewBoxTransform(t,e,i,n,r,s)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){const i=this._handler.getViewBox(),n={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},n),n.x-=i.x1,n.y-=i.y1,n}hasSubView(){const t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&Tt(this.width,t.width())&&Tt(this.height,t.height()))}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}},t.DefaultWindow=mr([g(),yr("design:paramtypes",[])],t.DefaultWindow);var wr,Sr=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Ar=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Tr=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultGraphicUtil=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(t){this.contributions=t,this.configured=!1,this.global=mn.global,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){this.configured||(this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const t=vr.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure=t}measureText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";var n;this.configure(this.global,this.global.env);const r=this.global.measureTextMethod;this.global.measureTextMethod=i;const s={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:$i.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new ae(Object.assign({defaultFontParams:{fontFamily:$i.fontFamily,fontSize:$i.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+ae.ALPHABET_CHAR_SET+ae.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const n=jn.get(br),r=t.AABBBounds,s=r.width(),a=r.height(),o=-r.x1,h=-r.y1;n.create({viewBox:{x1:o,y1:h,x2:r.x2,y2:r.y2},width:s,height:a,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});const l=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(n,[t],{transMatrix:n.getViewBoxTransform(),viewBox:n.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=l;const c=n.getNativeHandler();return c.nativeCanvas?c.nativeCanvas:null}},t.DefaultGraphicUtil=Sr([g(),Tr(0,p(k)),Tr(0,v(Dn)),Ar("design:paramtypes",[Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(wr||(wr={}));const Cr=new ue;t.DefaultTransformUtil=class{constructor(){this.matrix=new ue}init(t){return this.mode=wr.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=wr.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(Cr.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){const{x:n,y:r}=i;this.outTargetMatrix.translate(n,r),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-n,-r)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Cr.a,Cr.b,Cr.c,Cr.d,Cr.e,Cr.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(Cr.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:n}=e;this.outTargetMatrix.translate(i,n),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-n)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(Cr.a,Cr.b,Cr.c,Cr.d,Cr.e,Cr.f),this}scale(t,e,i){return this.mode===wr.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===wr.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return Cr.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Cr.a,Cr.b,Cr.c,Cr.d,Cr.e,Cr.f),this}translate(t,e){return this.mode===wr.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===wr.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=Sr([g(),Ar("design:paramtypes",[])],t.DefaultTransformUtil);const _r={arc:tn,area:en,circle:nn,line:an,path:on,symbol:un,text:dn,rect:ln,polygon:hn,richtext:pn,richtextIcon:gn,image:fn,group:rn,glyph:sn},Br=Object.keys(_r);function Pr(){return{arc:Object.assign({},_r.arc),area:Object.assign({},_r.area),circle:Object.assign({},_r.circle),line:Object.assign({},_r.line),path:Object.assign({},_r.path),symbol:Object.assign({},_r.symbol),text:Object.assign({},_r.text),rect:Object.assign({},_r.rect),polygon:Object.assign({},_r.polygon),richtext:Object.assign({},_r.richtext),richtextIcon:Object.assign({},_r.richtextIcon),image:Object.assign({},_r.image),group:Object.assign({},_r.group),glyph:Object.assign({},_r.glyph)}}function Rr(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Mr=Pr();class Er{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Br.forEach((t=>{this._defaultTheme[t]=Object.create(Mr[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,wt.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Br.forEach((n=>{const r=Object.create(Mr[n]);t&&t[n]&&Rr(r,t[n]),i[n]&&Rr(r,i[n]),e[n]&&Rr(r,e[n]),this.combinedTheme[n]=r})),e.common&&Br.forEach((t=>{Rr(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const kr=new Er;function Or(t,e){return t.glyphHost?Or(t.glyphHost):e?(t.isContainer,e):Ir(t)||t.attachedThemeGraphic&&Or(t.attachedThemeGraphic)||kr.getTheme()}function Ir(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):kr.getTheme()}return null}var Lr=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};class Dr extends ${get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=e.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Lr(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&wt.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=K(i,!0)&&i||et(i)&&i.capture,r=et(i)&&i.once,s=Z(e)?void 0:e;return t=n?`${t}capture`:t,e=Z(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=K(i,!0)&&i||et(i)&&i.capture,r=Z(e)?void 0:e;t=n?`${t}capture`:t,e=Z(e)?e:e.handleEvent;const s=et(i)&&i.once;return super.off(t,e,r,s),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return et(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class jr{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=jr.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=this.pickParams.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&Z(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&Z(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Ur extends jr{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f){throw new Error("Method not implemented.")}}class Wr extends Ur{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const n=new Wr(this.manager);n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.detailPath=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice();const r=this.composedDetailPath();return n.detailPath=r&&r.slice(),n.type=this.type,n}}class Nr extends Ur{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const n=new Nr(this.manager);n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.detailPath=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice();const r=this.composedDetailPath();return n.detailPath=r&&r.slice(),n.type=this.type,n}}Nr.DOM_DELTA_PIXEL=0,Nr.DOM_DELTA_LINE=1,Nr.DOM_DELTA_PAGE=2;class Gr extends jr{constructor(t,e){super(),this.type=t,this.detail=e}}const Fr="object"==typeof performance&&performance.now?performance:Date;function zr(t){return"mouse"===t||"pen"===t}class Hr{constructor(t,e){this.dispatch=new $,this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof Wr))return void wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(zr(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,n;if(!(t instanceof Wr))return void wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.createPointerEvent(t,t.type,e),s=zr(r.pointerType),a=this.trackingData(t.pointerId),o=this.findMountedTarget(a.overTargets);if(a.overTargets&&o&&o!==this.rootTarget&&o!==r.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,o||void 0);if(this.dispatchEvent(i,"pointerout"),s&&this.dispatchEvent(i,"mouseout"),!r.composedPath().includes(o)){const e=this.createPointerEvent(t,"pointerleave",o||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!r.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),s&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(o!==r.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(r,e);this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover");let n=null==o?void 0:o.parent;for(;n&&n!==this.rootTarget.parent&&n!==r.target;)n=n.parent;if(!n||n===this.rootTarget.parent){const t=this.clonePointerEvent(r,"pointerenter");t.eventPhase=t.AT_TARGET;let e=t.target;const i=new Set;let n=o;for(;n&&n!==this.rootTarget;)i.add(n),n=n.parent;for(;e&&e!==o&&e!==this.rootTarget.parent;)i.has(e)||(t.currentTarget=e,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter")),e=e.parent;this.freeEvent(t)}this.freeEvent(i)}this.dispatchEvent(r,"pointermove"),"touch"===r.pointerType&&this.dispatchEvent(r,"touchmove"),s&&(this.dispatchEvent(r,"mousemove"),this.cursorTarget=r.target,this.cursor=(null===(n=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor()),a.overTargets=r.composedPath(),this.freeEvent(r)},this.onPointerOver=(t,e)=>{var i,n;if(!(t instanceof Wr))return void wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(t.pointerId),s=this.createPointerEvent(t,t.type,e),a=zr(s.pointerType);this.dispatchEvent(s,"pointerover"),a&&this.dispatchEvent(s,"mouseover"),"mouse"===s.pointerType&&(this.cursorTarget=s.target,this.cursor=(null===(n=null===(i=s.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor());const o=this.clonePointerEvent(s,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),a&&this.notifyTarget(o,"mouseenter"),o.target=o.target.parent;r.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(o)},this.onPointerOut=(t,e)=>{if(!(t instanceof Wr))return void wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=zr(t.pointerType),n=this.findMountedTarget(i.overTargets),r=this.createPointerEvent(t,"pointerout",n||void 0);this.dispatchEvent(r),e&&this.dispatchEvent(r,"mouseout");const s=this.createPointerEvent(t,"pointerleave",n||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),e&&this.notifyTarget(s,"mouseleave"),s.target=s.target.parent;i.overTargets=[],this.freeEvent(r),this.freeEvent(s)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,e)=>{var i;if(!(t instanceof Wr))return void wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=Fr.now(),r=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)this.dispatchEvent(r,"touchend");else if(zr(r.pointerType)){const t=2===r.button;this.dispatchEvent(r,t?"rightup":"mouseup")}const s=this.trackingData(t.pointerId),a=this.findMountedTarget(s.pressTargetsByButton[t.button]);let o=a;if(a&&!r.composedPath().includes(a)){let e=a;for(;e&&!r.composedPath().includes(e);){if(r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)this.notifyTarget(r,"touchendoutside");else if(zr(r.pointerType)){const t=2===r.button;this.notifyTarget(r,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete s.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(r,"click");e.target=o,e.path=[],e.detailPath=[],s.clicksByButton[t.button]||(s.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:n});const a=s.clicksByButton[t.button];a.target===e.target&&n-a.timeStamp<(null!==(i=this._config.clickInterval)&&void 0!==i?i:200)?++a.clickCount:a.clickCount=1,a.target=e.target,a.timeStamp=n,e.detail=a.clickCount,zr(e.pointerType)?(this.dispatchEvent(e,"click"),2===a.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&this._config.supportsTouchEvents&&(this.dispatchEvent(e,"tap"),2===a.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(r)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof Wr))return void wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.pressTargetsByButton[t.button]),r=this.createPointerEvent(t,t.type,e);if(n){let e=n;for(;e;)r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):zr(r.pointerType)&&this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)},this.onWheel=(t,e)=>{if(!(t instanceof Nr))return void wt.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,i,n,r,s,a,o;if(!this.rootTarget)return;const h=this.mappingTable[t.type];let l;const c=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[c])&&(null===(n=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[c])||void 0===n?void 0:n.stage)&&(null===(s=null===(r=this._prePointTargetCache)||void 0===r?void 0:r[c])||void 0===s?void 0:s.stage.renderCount)===(null===(a=this._prePointTargetCache)||void 0===a?void 0:a.stageRenderCount)?l=this._prePointTargetCache[c]:(l=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[c]:l,stageRenderCount:null!==(o=null==l?void 0:l.stage.renderCount)&&void 0!==o?o:-1})),h)for(let e=0,i=h.length;e<i;e++)h[e].fn(t,l);else wt.getInstance().warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let n=0,r=i.length-1;n<r;n++)if(t.currentTarget=i[n],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){t.eventPhase=t.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){if(this.pauseNotify)return;e=null!=e?e:t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){var n,r;const s=this.allocateEvent(Wr);return this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.nativeEvent=t.nativeEvent,s.originalEvent=t,s.target=i||this.pickTarget(null!==(n=s.viewX)&&void 0!==n?n:s.global.x,null!==(r=s.viewY)&&void 0!==r?r:s.global.y,s),"string"==typeof e&&(s.type=e),s}createWheelEvent(t,e){var i,n;const r=this.allocateEvent(Nr);return this.copyWheelData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=e||this.pickTarget(null!==(i=r.viewX)&&void 0!==i?i:r.global.x,null!==(n=r.viewY)&&void 0!==n?n:r.global.y,r),r}clonePointerEvent(t,e){const i=this.allocateEvent(Wr);i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice();const n=t.composedDetailPath();return i.detailPath=n&&n.slice(),i.type=null!=e?e:i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof Wr&&e instanceof Wr&&(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)}copyMouseData(t,e){t instanceof Ur&&e instanceof Ur&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach((i=>{e[i].x=t[i].x,e[i].y=t[i].y})))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Fr.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.detailPath=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].once&&t.currentTarget.removeEventListener(e,i[n].fn,{once:!0}),i[n].fn.call(i[n].context,t);this.emitDelegation(t,e)}emitDelegation(t,e){const i=t.currentTarget._events["*"];if(i)if("fn"in i)i.fn.call(i.context,t,e);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,t,e)}pickTarget(t,e,i){let n;const r=this.rootTarget.pick(t,e);return n=r&&r.graphic?r.graphic:r&&r.group?r.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,i&&(i.pickParams=r.params),n}release(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}}const Vr={dispatchEvent(t){var e;if(!(t instanceof jr))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new Gr(t,e))}},Yr={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Xr{constructor(t){this.resolution=1,this.onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,i=e.length;t<i;t++){const i=e[t],n=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(n)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerMove=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,n=i.length;t<n;t++){const n=this.bootstrapEvent(this.rootPointerEvent,i[t]);n.type+=e,this.manager.mapEvent(n)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerOverOut=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:n,global:r,autoPreventDefault:s=!1,clickInterval:a,supportsTouchEvents:o=r.supportsTouchEvents,supportsPointerEvents:h=r.supportsPointerEvents}=t;this.manager=new Hr(n,{clickInterval:a,supportsTouchEvents:o}),this.globalObj=r,this.supportsPointerEvents=h,this.supportsTouchEvents=o,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=s,this.eventsAdded=!1,this.rootPointerEvent=new Wr,this.rootWheelEvent=new Nr,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:n}=this;if(this.currentCursor===t)return;this.currentCursor=t;const r=this.cursorStyles[t];r?"string"==typeof r&&i?n.style.cursor=r:"function"==typeof r?r(t):"object"==typeof r&&i&&Object.assign(n.style,r):i&&st(t)&&!pt(this.cursorStyles,t)&&(n.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e,i;const n=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(n)return n;let r=0,s=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};r=e.clientX||0,s=e.clientY||0}else r=t.clientX||0,s=t.clientY||0;const a=this.domElement.getBoundingClientRect();return{x:r-a.left,y:s-a.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,n=t.changedTouches.length;i<n;i++){const n=t.changedTouches[i];rt(n.button)&&(n.button=0),rt(n.buttons)&&(n.buttons=1),rt(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),rt(n.width)&&(n.width=n.radiusX||1),rt(n.height)&&(n.height=n.radiusY||1),rt(n.tiltX)&&(n.tiltX=0),rt(n.tiltY)&&(n.tiltY=0),rt(n.pointerType)&&(n.pointerType="touch"),rt(n.pointerId)&&(n.pointerId=n.identifier||0),rt(n.pressure)&&(n.pressure=n.force||.5),rt(n.twist)&&(n.twist=0),rt(n.tangentialPressure)&&(n.tangentialPressure=0),rt(n.layerX)&&(n.layerX=n.offsetX=n.clientX),rt(n.layerY)&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=t.type,e.push(n)}else if(!this.globalObj.supportsMouseEvents||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof PointerEvent)){const i=t;rt(i.isPrimary)&&(i.isPrimary=!0),rt(i.width)&&(i.width=1),rt(i.height)&&(i.height=1),rt(i.tiltX)&&(i.tiltX=0),rt(i.tiltY)&&(i.tiltY=0),rt(i.pointerType)&&(i.pointerType="mouse"),rt(i.pointerId)&&(i.pointerId=1),rt(i.pressure)&&(i.pressure=.5),rt(i.twist)&&(i.twist=0),rt(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}else e.push(t);return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:i,y:n}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=n,e.global.x=i,e.global.y=n,e.offset.x=i,e.offset.y=n;const{x:r,y:s}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:i,y:n}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=n,t.global.x=i,t.global.y=n,t.offset.x=i,t.offset.y=n;const{x:r,y:s}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Yr[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Fr.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetViewPort(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){const e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),i=this.domElement.getViewBox(),n=i.width(),r=i.height();return!(e.x<n&&e.y<r&&e.x>0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}var $r;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}($r||($r={}));class qr{static Avaliable(){return!!mn.global.getRequestAnimationFrame()}avaliable(){return qr.Avaliable()}tick(t,e){mn.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class Kr{static Avaliable(){return!0}avaliable(){return Kr.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class Zr extends ${set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(),i||t.tick(this.interval,this.handleTick))},this._handlerTick=()=>{const t=this.tickerHandler.getTime();let e=0;this.lastFrameTime>=0&&(e=t-this.lastFrameTime),this.lastFrameTime=t,this.status===$r.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(e)})),this.emit("afterTick"))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=$r.INITIAL,mn.global.hooks.onSetEnv.tap("default-ticker",(()=>{this.initHandler()})),mn.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:qr},{mode:"timeout",cons:Kr}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new qr;break;case"timeout":t=new Kr;break;default:wt.getInstance().warn("非法的计时器模式"),t=new qr}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==$r.INITIAL&&(this.status=$r.PAUSE,!0)}resume(){return this.status!==$r.INITIAL&&(this.status=$r.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===$r.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===$r.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=$r.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=$r.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}trySyncTickStatus(){this.status===$r.RUNNING&&this._handlerTick()}}class Jr{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return Jr.Avaliable()}tick(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}tickTo(t,e){this.time=Math.max(0,t),e(this,{once:!0})}release(){this.timerId>0&&(this.timerId=-1)}getTime(){return this.time}}class Qr{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-Qr.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Qr.bounceIn(2*t):.5*Qr.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/Mt*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Mt/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/Mt*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*Mt/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/Mt*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Mt/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*Mt/e)*.5+1}}}Qr.quadIn=Qr.getPowIn(2),Qr.quadOut=Qr.getPowOut(2),Qr.quadInOut=Qr.getPowInOut(2),Qr.cubicIn=Qr.getPowIn(3),Qr.cubicOut=Qr.getPowOut(3),Qr.cubicInOut=Qr.getPowInOut(3),Qr.quartIn=Qr.getPowIn(4),Qr.quartOut=Qr.getPowOut(4),Qr.quartInOut=Qr.getPowInOut(4),Qr.quintIn=Qr.getPowIn(5),Qr.quintOut=Qr.getPowOut(5),Qr.quintInOut=Qr.getPowInOut(5),Qr.backIn=Qr.getBackIn(1.7),Qr.backOut=Qr.getBackOut(1.7),Qr.backInOut=Qr.getBackInOut(1.7),Qr.elasticIn=Qr.getElasticIn(1,.3),Qr.elasticOut=Qr.getElasticOut(1,.3),Qr.elasticInOut=Qr.getElasticInOut(1,.3*1.5);class ts{constructor(){this.id=e.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(e){if(this.paused)return;let i=this.animateHead;for(this.animateCount=0;i;)i.status===t.AnimateStatus.END?this.removeAnimate(i):i.status===t.AnimateStatus.RUNNING||i.status===t.AnimateStatus.INITIAL?(this.animateCount++,i.advance(e)):i.status===t.AnimateStatus.PAUSED&&this.animateCount++,i=i.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}const es=new ts;class is{constructor(t,e,i,n,r){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class ns extends is{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class rs{constructor(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.GenAutoIncrementId(),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:es,r=arguments.length>2?arguments[2]:void 0;this.id=i,this.timeline=n||es,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new ss(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=r}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=It(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){rs.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rs.mode;e&&i&t.AnimateMode.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_PLAY})}runCb(t){const e=new ns((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const a=rs.interpolateMap.get(t)||rs.interpolateMap.get("");return!!a&&a(t,e,i,n,r,s)}pause(){this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.PAUSED)}resume(){this.status===t.AnimateStatus.PAUSED&&(this.status=t.AnimateStatus.RUNNING)}to(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new ss(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(e){if(this._duringTime<this._startTime){if(this._duringTime+e*this.timeScale<this._startTime)return void(this._duringTime+=e*this.timeScale);e=this._duringTime+e*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===t.AnimateStatus.INITIAL&&(this.status=t.AnimateStatus.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+e*this.timeScale)&&this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const n=this.rawPosition,r=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const s=t>=r;if(s&&(t=r),t===n)return s;for(let n=0;n<this.subAnimates.length&&(e=this.subAnimates[n],!(i+e.totalDuration>=t));n++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=t.AnimateStatus.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}rs.mode=t.AnimateMode.NORMAL,rs.interpolateMap=new Map;class ss{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new as(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(e){let i=e.duration;(null==i||i<0)&&(i=0);const n=e.easing,r="string"==typeof n?Qr[n]:n,s=this._addStep(i,null,r);return s.type=t.AnimateStepType.customAnimate,this._appendProps(e.getEndProps(),s,!1),this._appendCustomAnimate(e,s),this}to(e,i,n,r){(null==i||i<0)&&(i=0);const s="string"==typeof n?Qr[n]:n,a=this._addStep(i,null,s);return a.type=t.AnimateStepType.to,this._appendProps(e,a,!!r&&r.tempProps),a.propKeys||(a.propKeys=Object.keys(a.props)),r&&r.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(a.propKeys)})),this}from(e,i,n,r){this.to(e,0,n,r);const s={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{s[t]=this.getLastPropByName(t,this.stepTail)})),this.to(s,i,n,r),this.stepTail.type=t.AnimateStepType.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(e){if(e>0){const i=this._addStep(+e,null);i.type=t.AnimateStepType.wait,i.prev.customAnimate?i.props=i.prev.customAnimate.getEndProps():i.props=i.prev.props,this.target.onAddStep&&this.target.onAddStep(i)}return this}_addStep(t,e,i){const n=new as(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=n.props[t])}))),e.propKeys=Object.keys(e.props),n=n.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach((t=>{if(void 0===s[t]){const e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,n=this.loop,r=this.rawPosition;let s,a,o=!1;const h=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,i<=0&&(o=!0,i<0))return o;if(s=Math.floor(t/i),a=t-s*i,o=t>=n*i+i,o&&(a=i,s=n,t=a*s+i),t===r)return o;const l=!this.reversed!=!(this.bounce&&s%2);return l&&(a=i-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+h,this.updatePosition(o,l),o}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,r=this.duration;if(this.target&&i){let s=i.next;for(;s&&s.position<=n;)i=s,s=i.next;let a=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,a)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return wt.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class as{constructor(t,e,i,n){this.duration=e,this.position=t,this.props=i,this.easing=n}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const os={duration:200,easing:"cubicOut"},hs={duration:1e3,easing:"quadInOut"};var ls;t.Edge=void 0,(ls=t.Edge||(t.Edge={}))[ls.Top=1]="Top",ls[ls.Right=2]="Right",ls[ls.Bottom=4]="Bottom",ls[ls.Left=8]="Left",ls[ls.ALL=15]="ALL";const cs=[!1,!1,!1,!1],us=t=>{var e;let i=!0;if(K(t,!0)){for(let n=0;n<4;n++)cs[n]=t,i&&(i=!(null!==(e=cs[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)cs[e]=!!t[e],i&&(i=!!cs[e]);else cs[0]=!1,cs[1]=!1,cs[2]=!1,cs[3]=!1;return{isFullStroke:i,stroke:cs}},ds=[0,0,0,0],ps=t=>t?at(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(ds[0]=t[0],ds[2]=t[0],ds[1]=t[1],ds[3]=t[1],ds):t:t:0,fs=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],gs=[1,2,3,0,1,2,3,0];function vs(t,e,i,n){for(;t>=Mt;)t-=Mt;for(;t<0;)t+=Mt;for(;t>e;)e+=Mt;fs[0].x=i,fs[1].y=i,fs[2].x=-i,fs[3].y=-i;const r=Math.ceil(t/Pt)%4,s=Math.ceil(e/Pt)%4;if(n.add(Ot(t)*i,Dt(t)*i),n.add(Ot(e)*i,Dt(e)*i),r!==s||e-t>Bt){let t=!1;for(let e=0;e<gs.length;e++)if(t||r!==gs[e]){if(t&&s===gs[e])break;if(t){const t=fs[gs[e]];n.add(t.x,t.y)}}else{t=!0;const e=fs[r];n.add(e.x,e.y)}}}function ms(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function ys(t,e,i){const{x:n,y:r}=Nt(t.x,t.y,e.x,e.y,i),{x:s,y:a}=Nt(t.x1,t.y1,e.x1,e.y1,i),o=new zt(n,r,s,a);return o.defined=e.defined,o}function bs(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let n=[];if(t.length>e.length){n=e.map((t=>{const e=new zt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)n[r]=ys(t[r],e[r],i)}else{n=e.map((t=>{const e=new zt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)n[r]=ys(t[r],e[r],i)}return n}const xs=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],ws=t=>xs.includes(t);function Ss(t,e){if(at(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}class As{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:As.TimeOut;this.durations=[],this.timeout=t,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout((()=>{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}As.TimeOut=1e3/60;const Ts=new As,Cs=(t,e)=>st(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t,_s=(t,e)=>{const i=Cs(t,e);return isNaN(i)?i:Math.max(e,i)};var Bs;!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(Bs||(Bs={}));class Ps extends is{constructor(t,e,i,n,r){super(null,null,i,n,r),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==r?void 0:r.group,this._clipGraphic=null==r?void 0:r.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:t.AttributeUpdateType.ANIMATE_END})}onUpdate(e,i,n){if(!this._clipGraphic)return;const r={};Object.keys(this.clipFromAttribute).forEach((t=>{r[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*i})),this._clipGraphic.setAttributes(r,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:i,end:e}})}}function Rs(t,e,i,n,r,s){const a=(e-t)*r+t,o=(i-e)*r+e,h=(n-i)*r+i,l=(o-a)*r+a,c=(h-o)*r+o,u=(c-l)*r+l;s[0]=t,s[1]=a,s[2]=l,s[3]=u,s[4]=u,s[5]=c,s[6]=h,s[7]=n}function Ms(t,e){const i=t.length,n=e.length;if(i===n)return[t,e];const r=[],s=[],a=i<n?t:e,o=Math.min(i,n),h=Math.abs(n-i)/6,l=(o-2)/6,c=Math.ceil(h/l),u=[a[0],a[1]];let d=h;for(let t=2;t<o;t+=6){let e=a[t-2],i=a[t-1],n=a[t],o=a[t+1],h=a[t+2],l=a[t+3];const p=a[t+4],f=a[t+5];if(d<=0){u.push(n,o,h,l,p,f);continue}const g=Math.min(d,c)+1;for(let t=1;t<=g;t++){const a=t/g;Rs(e,n,h,p,a,r),Rs(i,o,l,f,a,s),e=r[3],i=s[3],u.push(r[1],s[1],r[2],s[2],e,i),n=r[5],o=s[5],h=r[6],l=s[6]}d-=g-1}return a===t?[u,e]:[t,u]}function Es(t,e){const i=t||e,n=i.length,r=i[n-2],s=i[n-1],a=[];for(let t=0;t<e.length;t+=2)a[t]=r,a[t+1]=s;return a}function ks(t){const e=[],i=t.length;for(let n=0;n<i;n+=2)e[n]=t[i-n-2],e[n+1]=t[i-n-1];return e}function Os(t){let e=0,i=0,n=0;const r=t.length;for(let s=0,a=r-2;s<r;a=s,s+=2){const r=t[a],o=t[a+1],h=t[s],l=t[s+1],c=r*l-h*o;e+=c,i+=(r+h)*c,n+=(o+l)*c}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,n/e/3,e]}function Is(t,e,i,n){const r=(t.length-2)/6;let s=1/0,a=0;const o=t.length,h=o-2;for(let l=0;l<r;l++){const r=6*l;let c=0;for(let s=0;s<o;s+=2){const a=0===s?r:(r+s-2)%h+2,o=t[a]-i[0],l=t[a+1]-i[1],u=e[s]-n[0]-o,d=e[s+1]-n[1]-l;c+=u*u+d*d}c<s&&(s=c,a=l)}return a}function Ls(t,e,i,n){const r=[];let s;for(let a=0;a<t.length;a++){let o=t[a];const h=e[a],l=Os(o),c=Os(h);null==s&&(s=l[2]<0!=c[2]<0);const u=[],d=[];let p=0,f=1/0;const g=[],v=o.length;s&&(o=ks(o));const m=6*Is(o,h,l,c),y=v-2;for(let t=0;t<y;t+=2){const e=(m+t)%y+2;u[t+2]=o[e]-l[0],u[t+3]=o[e+1]-l[1]}if(u[0]=o[m]-l[0],u[1]=o[m+1]-l[1],i>0){const t=n/i;for(let e=-n/2;e<=n/2;e+=t){const t=Math.sin(e),i=Math.cos(e);let n=0;for(let e=0;e<o.length;e+=2){const r=u[e],s=u[e+1],a=h[e]-c[0],o=h[e+1]-c[1],l=a*i-o*t,d=a*t+o*i;g[e]=l,g[e+1]=d;const p=l-r,f=d-s;n+=p*p+f*f}if(n<f){f=n,p=e;for(let t=0;t<g.length;t++)d[t]=g[t]}}}else for(let t=0;t<v;t+=2)d[t]=h[t]-c[0],d[t+1]=h[t+1]-c[1];r.push({from:u,to:d,fromCp:l,toCp:c,rotation:-p})}return r}function Ds(t,e){let i,n;const r=[],s=[];for(let a=0;a<Math.max(t.length,e.length);a++){const o=t[a],h=e[a];let l,c;o?h?([l,c]=Ms(o,h),i=l,n=c):(c=Es(n,o),l=o):(l=Es(i,h),c=h),r.push(l),s.push(c)}return[r,s]}const js=(t,e,i,n,r)=>{Tt(e,n)&&Tt(i,r)||t.push(e,i,n,r,n,r)};function Us(t){const e=t.commandList,i=[];let n,r=0,s=0,a=0,o=0;const h=(t,e)=>{n&&n.length>2&&i.push(n),n=[t,e]};let l,c,u,d;for(let t=0,i=e.length;t<i;t++){const i=e[t],p=0===t;switch(p&&(a=r=i[1],o=s=i[2],[Ee.L,Ee.C,Ee.Q].includes(i[0])&&(n=[a,o])),i[0]){case Ee.M:r=a=i[1],s=o=i[2],h(a,o);break;case Ee.L:l=i[1],c=i[2],js(n,r,s,l,c),r=l,s=c;break;case Ee.C:n.push(i[1],i[2],i[3],i[4],r=i[5],s=i[6]);break;case Ee.Q:l=i[1],c=i[2],u=i[3],d=i[4],n.push(r+2/3*(l-r),s+2/3*(c-s),u+2/3*(l-u),d+2/3*(c-d),u,d),r=u,s=d;break;case Ee.A:{const t=i[1],e=i[2],u=i[3],d=u,f=i[4],g=i[5],v=!!i[6];l=Math.cos(f)*u+t,c=Math.sin(f)*u+e,p?(a=l,o=c,h(a,o)):js(n,r,s,l,c),r=Math.cos(g)*u+t,s=Math.sin(g)*u+e;const m=(v?-1:1)*Math.PI/2;for(let i=f;v?i>g:i<g;i+=m){const r=v?Math.max(i+m,g):Math.min(i+m,g);Ke(n,i,r,t,e,u,d)}break}case Ee.E:{const t=i[1],e=i[2],u=i[3],d=i[4],f=i[5],g=i[6],v=i[7]+g,m=!!i[8],y=!Tt(f,0),b=Math.cos(f),x=Math.sin(f);let w=Math.cos(g)*u,S=Math.sin(g)*d;y?(l=w*b-S*x+t,c=w*x+S*b+e):(l=w+t,c=S+e),p?(a=l,o=c,h(a,o)):js(n,r,s,l,c),w=Math.cos(v)*u,S=Math.sin(v)*d,y?(r=w*b-S*x+t,s=w*x+S*b+e):(r=w+t,s=S+e);const A=(m?-1:1)*Math.PI/2;for(let i=g;m?i>v:i<v;i+=A){const r=m?Math.max(i+A,v):Math.min(i+A,v);if(Ke(n,i,r,t,e,u,d),y){const i=n.length;for(let r=i-6;r<=i-1;r+=2)w=n[r],S=n[r+1],n[r]=(w-t)*b-(S-e)*x+t,n[r+1]=(w-t)*x+(S-e)*b+e}}break}case Ee.R:a=r=i[1],o=s=i[2],l=a+i[3],c=o+i[4],h(l,o),js(n,l,o,l,c),js(n,l,c,a,c),js(n,a,c,a,o),js(n,a,o,l,o);break;case Ee.AT:{const t=i[1],e=i[2],h=i[3],l=i[4],c=i[5],u=Ht.distancePP({x:r,y:s},{x:t,y:e}),d=Ht.distancePP({x:h,y:l},{x:t,y:e}),p=((r-t)*(h-t)+(s-e)*(l-e))/(u*d),f=c/Math.sin(p/2),g=(r+h-2*t)/2,v=(s+l-2*e)/2,m=Ht.distancePP({x:g,y:v},{x:0,y:0}),y=t+f*g/m,b=h+f*v/m,x=Math.sqrt(f*f-c*c);a=t+x*(r-t)/u,o=e+x*(s-e)/u,js(n,r,s,a,o),r=t+x*(h-t)/d,s=e+x*(l-e)/d;const w=Xt({x:y,y:b},{x:a,y:o}),S=Xt({x:y,y:b},{x:r,y:s});Ke(n,w,S,y,b,c,c);break}case Ee.Z:n&&js(n,r,s,a,o),r=a,s=o}}return n&&n.length>2&&i.push(n),i}function Ws(t,e){for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<n.length;t+=2){const i=n[t],r=n[t+1],s={x:i,y:r};e.transformPoint({x:i,y:r},s),n[t]=s.x,n[t+1]=s.y}}}function Ns(t){const e=new Ni;for(let i=0;i<t.length;i++){const n=t[i];if(n.length>2){e.moveTo(n[0],n[1]);for(let t=2;t<n.length;t+=6)e.bezierCurveTo(n[t],n[t+1],n[t+2],n[t+3],n[t+4],n[t+5])}}return e}const Gs=t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=J(t.width)?t.x1-t.x:t.width,i=J(t.height)?t.y1-t.y:t.height,n=0,r=0;return e<0?(n=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(r=i,i=-i):Number.isNaN(i)&&(i=0),{x:n,y:r,width:e,height:i}};function Fs(t,e,i){const n=t/e;let r,s;t>=e?(s=Math.ceil(Math.sqrt(i*n)),r=Math.floor(i/s),0===r&&(r=1,s=i)):(r=Math.ceil(Math.sqrt(i/n)),s=Math.floor(i/r),0===s&&(s=1,r=i));const a=[];for(let t=0;t<r;t++)a.push(s);const o=i-r*s;if(o>0)for(let t=0;t<o;t+=s)t+s<o?a.push(s):a.push(o-t);return a}const zs=(t,e)=>{const{width:i,height:n}=Gs(t.attribute),r=Fs(i,n,e),s=[],a=n/r.length;for(let t=0,e=r.length;t<e;t++){const e=r[t],n=i/e;for(let i=0;i<e;i++)s.push({x:0+i*n,y:0+t*a,width:n,height:a})}return s},Hs=(t,e)=>{const i=t.getParsedAngle(),n=i.startAngle,r=i.endAngle,s=t.getComputedAttribute("innerRadius"),a=t.getComputedAttribute("outerRadius"),o=Math.abs(n-r),h=Math.abs(a-s),l=Fs(o*(s+a)/2,h,e),c=[],u=h/l.length,d=a>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=l.length;t<e;t++){const e=l[t],i=o/e;for(let r=0;r<e;r++)c.push({innerRadius:a-u*t*d,outerRadius:a-u*(t+1)*d,startAngle:n+i*r*p,endAngle:n+i*(r+1)*p})}return c},Vs=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),a=Fs(s*r,r,e),o=[],h=s/a[0],l=r/a.length,c=n>=i?1:-1;for(let t=0,e=a.length;t<e;t++)for(let e=0,n=a[t];e<n;e++)o.push({innerRadius:l*t,outerRadius:l*(t+1),startAngle:i+h*e*c,endAngle:i+h*(e+1)*c});return o},Ys=(t,e)=>{const i=t.filter((t=>!1!==t.defined&&ht(t.x)&&ht(t.y)));if(0===i.length)return[];if(1===i.length)return new Array(e).fill(0).map((t=>i[0]));const n=[];if(e<=i.length){const t=i.length/e;let r=0,s=0;for(;r<e;)n.push(i[Math.floor(s)]),s+=t,r++;return n}const r=e-i.length,s=1/(r/(i.length-1)+1);let a=0;for(let e=0,i=t.length;e<i;e++)if(n.push(t[e]),e<i-1){let i=s;const o=t[e].x,h=t[e].y,l=t[e+1].x,c=t[e+1].y;for(;i<1&&a<r;)n.push({x:o+(l-o)*i,y:h+(c-h)*i}),i+=s,a+=1}return n},Xs=(t,e)=>{var i,n;const r=t.attribute;let s=r.points;const a=r.segments;s||(s=a.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]));const o=s.filter((t=>!1!==t.defined&&ht(t.x)&&ht(t.y)));if(!o.length)return[];const h=[];o.forEach((t=>{h.push({x:t.x,y:t.y})}));for(let t=o.length-1;t>=0;t--){const e=o[t];h.push({x:null!==(i=e.x1)&&void 0!==i?i:e.x,y:null!==(n=e.y1)&&void 0!==n?n:e.y})}const l=[];return Js(s,e,l),l},$s=(t,e)=>{const i=t.attribute,n=i.points;if(n)return Ys(n,e);if(i.segments){const t=i.segments.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]);return Ys(t,e)}return[]};const qs=t=>t.map((t=>({x:t.x,y:t.y}))),Ks=(t,e,i)=>{const n=t.length,r=[];for(let o=0;o<n;o++){const h=t[o],l=o===n-1?t[0]:t[o+1],c=qt([e.x,e.y],[i.x,i.y],[h.x,h.y],[l.x,l.y]);c&&"boolean"!=typeof c&&r.push({dot:(s=[c[0]-e.x,c[1]-e.x],a=[i.x-e.x,i.y-e.x],s[0]*a[1]-s[1]*a[0]),point:{x:c[0],y:c[1]},edgeIndex:o})}var s,a;if(r.length<2)return[qs(t),qs(t)];r.sort(((t,e)=>t.dot-e.dot));let o=r[0],h=r[r.length-1];o.edgeIndex>h.edgeIndex&&([o,h]=[h,o]);const l=o.point,c=h.point,u=[{x:l.x,y:l.y}];for(let e=o.edgeIndex+1;e<=h.edgeIndex;e++)u.push({x:t[e].x,y:t[e].y});u.push({x:c.x,y:c.y});const d=[{x:c.x,y:c.y}];for(let e=h.edgeIndex+1,i=o.edgeIndex+n;e<=i;e++){const i=t[e%n];d.push({x:i.x,y:i.y})}return d.push({x:l.x,y:l.y}),[u,d]},Zs=t=>{const e=new he;t.forEach((t=>{e.add(t.x,t.y)}));const i=e.width(),n=e.height();if(i>=n){const n=e.x1+i/2;return Ks(t,{x:n,y:e.y1},{x:n,y:e.y2})}const r=e.y1+n/2;return Ks(t,{x:e.x1,y:r},{x:e.x2,y:r})},Js=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=Zs(t);Js(r[0],n,i),Js(r[1],e-n,i)}},Qs=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:qs(i)}];const n=[];return Js(i,e,n),n},ta=(t,e)=>{const i=Us(t.getParsedPathShape());if(!i.length||e<0)return[];const n=i.length;if(i.length>=e){const t=[],r=Math.floor(i.length/e);for(let s=0;s<e;s++){const a=i.slice(s*r,s===e-1?n:(s+1)*r);t.push({path:Ns(a)})}return t}const r=[],s=Math.floor(e/n);let a=e;for(let t=0;t<n;t++){const e=[];for(let n=2,r=i[t].length;n<r;n+=2)e.push({x:i[0][n],y:i[0][n+1]});Js(e,t===n-1?a:s,r),a-=s}return r};var ea;t.ColorType=void 0,(ea=t.ColorType||(t.ColorType={}))[ea.Color255=0]="Color255",ea[ea.Color1=1]="Color1";class ia{static Get(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.ColorType.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(i===t.ColorType.Color1){const t=ia.store1[e];if(t)return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n;const i=Ae.parseColorString(e);if(i){const t=[i.r/255,i.g/255,i.b/255,i.opacity];ia.store1[e]=t,ia.store255[e]=[i.r,i.g,i.b,i.opacity],n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]}return n}const r=ia.store255[e];if(r)return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n;const s=Ae.parseColorString(e);return s&&(ia.store1[e]=[s.r/255,s.g/255,s.b/255,s.opacity],ia.store255[e]=[s.r,s.g,s.b,s.opacity],n[0]=s.r,n[1]=s.g,n[2]=s.b,n[3]=s.opacity),n}static Set(e,i,n){if(i===t.ColorType.Color1){if(ia.store1[e])return;ia.store1[e]=n,ia.store255[e]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(ia.store255[e])return;ia.store255[e]=n,ia.store1[e]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function na(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&ht(t[0])?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function ra(t,e,i,n,r){return Array.isArray(t)&&!ht(t[0])||Array.isArray(e)&&!ht(e[0])?new Array(4).fill(0).map(((r,s)=>sa(at(t)?t[s]:t,at(e)?e[s]:e,i,n))):sa(t,e,i,n,r)}function sa(e,i,n,r,s){if(!e||!i)return e&&na(e)||i&&na(i)||!1;let a,o,h=!1,l=!1;if(Array.isArray(e)?a=e:"string"==typeof e?a=ia.Get(e,t.ColorType.Color255):h=!0,Array.isArray(i)?o=i:"string"==typeof i?o=ia.Get(i,t.ColorType.Color255):l=!0,h!==l){const t=h?e:i,a=h?i:e,o=Object.assign(Object.assign({},t),{stops:t.stops.map((t=>Object.assign(Object.assign({},t),{color:na(a)})))});return h?ra(t,o,n,r,s):ra(o,t,n,r,s)}if(h){if(e.gradient===i.gradient){const t=e,r=i,s=t.stops,a=r.stops;if(s.length!==a.length)return!1;if("linear"===t.gradient)return aa(t,r,n);if("radial"===t.gradient)return oa(t,r,n);if("conical"===t.gradient)return ha(t,r,n)}return!1}return s&&s(a,o),na(la(a,o,n),r)}function aa(t,e,i){const n=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:da(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function oa(t,e,i){const n=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:da(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function ha(t,e,i){const n=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:da(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function la(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}ia.store255={},ia.store1={};const ca=[0,0,0,0],ua=[0,0,0,0];function da(e,i,n){return ia.Get(e,t.ColorType.Color255,ca),ia.Get(i,t.ColorType.Color255,ua),`rgba(${Math.round(ca[0]+(ua[0]-ca[0])*n)},${Math.round(ca[1]+(ua[1]-ca[1])*n)},${Math.round(ca[2]+(ua[2]-ca[2])*n)},${ca[3]+(ua[3]-ca[3])*n})`}const pa=(t,e,i)=>{t.forEach((t=>{if(Number.isFinite(t.to))e[t.key]=t.from+(t.to-t.from)*i;else if("fill"===t.key||"stroke"===t.key){const n=ra(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},fa=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const a=t[s],o=a.from,h=a.to,l=a.rotation*i,c=a.fromCp,u=a.toCp,d=Math.sin(l),p=Math.cos(l);r[0]=c[0]+(u[0]-c[0])*i,r[1]=c[1]+(u[1]-c[1])*i;for(let t=0;t<o.length;t+=2){const e=o[t],s=o[t+1],a=e*(1-i)+h[t]*i,l=s*(1-i)+h[t+1]*i;n[t]=a*p-l*d+r[0],n[t+1]=a*d+l*p+r[1]}let f=n[0],g=n[1];e.moveTo(f,g);for(let t=2;t<o.length;t+=6){const i=n[t],r=n[t+1],s=n[t+2],a=n[t+3],o=n[t+4],h=n[t+5];f===i&&g===r&&s===o&&a===h?e.lineTo(o,h):e.bezierCurveTo(i,r,s,a,o,h),f=o,g=h}}},ga=(t,e,i)=>{const n=t?Us(t):[],r=Us(e);i&&n&&(i.fromTransform&&Ws(n,i.fromTransform.clone().getInverse()),Ws(n,i.toTransfrom));const[s,a]=Ds(n,r);return t?Ls(s,a,10,Math.PI):a.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},va=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],ma=(e,i)=>{if(!e||!i)return null;const n=[];let r=!1;return Object.keys(e).forEach((s=>{if(!va.includes(s))return;const a=i[s];J(a)||J(e[s])||a===e[s]||("fill"===s||"stroke"===s?n.push({from:"string"==typeof e[s]?ia.Get(e[s],t.ColorType.Color255):e[s],to:"string"==typeof a?ia.Get(a,t.ColorType.Color255):a,key:s}):n.push({from:e[s],to:a,key:s}),r=!0)})),r?n:null};class ya extends is{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}getEndProps(){return{}}onBind(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}onEnd(){}onUpdate(t,e,i){const n=this.target,r="function"==typeof n.pathProxy?n.pathProxy(n.attribute):n.pathProxy;fa(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&pa(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const ba=(t,e,i,n)=>{var r,s,a;if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;let o=null==t?void 0:t.globalTransMatrix;n&&o&&(o=n.clone().multiply(o.a,o.b,o.c,o.d,o.e,o.f));const h=ga(null===(r=null==t?void 0:t.toCustomPath)||void 0===r?void 0:r.call(t),e.toCustomPath(),{fromTransform:o,toTransfrom:e.globalTransMatrix}),l=ma(null==t?void 0:t.attribute,e.attribute),c=e.animate(i);return(null==i?void 0:i.delay)&&c.wait(i.delay),c.play(new ya({morphingData:h,otherAttrs:l},null!==(s=null==i?void 0:i.duration)&&void 0!==s?s:hs.duration,null!==(a=null==i?void 0:i.easing)&&void 0!==a?a:hs.easing)),c};class xa extends is{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}getEndProps(){return{}}onBind(){this.addPathProxy()}addPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.createPathProxy()})),this.onUpdate(!1,0,this.target.attribute)}clearPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.pathProxy=null}))}onEnd(){}onUpdate(t,e,i){this.target.shadowRoot.forEachChildren(((t,i)=>{var n;fa(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),(null===(n=this.otherAttrs)||void 0===n?void 0:n[i])&&this.otherAttrs[i].length&&pa(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const wa=t=>{const e={};return Object.keys(t).forEach((i=>{ws(i)||(e[i]=t[i])})),e},Sa=(t,e,i)=>{const n=wa(t.attribute),r=t.attachShadow();if(e.length)r.setTheme({[e[0].type]:n}),e.forEach((t=>{t.setAttributes({pickable:!1}),r.appendChild(t)}));else{const s=t.AABBBounds,a=s.width(),o=s.height();r.setTheme({rect:n}),new Array(i).fill(0).forEach((t=>{const i=mn.graphicService.creator.rect({x:0,y:0,width:a,height:o,pickable:!1});r.appendChild(i),e.push(i)}))}},Aa=(t,e,i)=>{const n=[],r=i?null:wa(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new Ni).fromCustomPath2D(s)};n.push(mn.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&Sa(t,n,e),n},Ta=(t,e,i)=>{const n=[],r=i?null:wa(t.attribute);if("rect"===t.type)zs(t,e).forEach((t=>{n.push(mn.graphicService.creator.rect(i?t:Object.assign({},r,t)))}));else if("arc"===t.type)Hs(t,e).forEach((t=>{n.push(mn.graphicService.creator.arc(i?t:Object.assign({},r,t)))}));else if("circle"===t.type)Vs(t,e).forEach((t=>{n.push(mn.graphicService.creator.arc(i?t:Object.assign({},r,t)))}));else if("line"===t.type){const s=$s(t,e),a={size:10,symbolType:"circle"};s.forEach((t=>{n.push(mn.graphicService.creator.symbol(i?Object.assign({},t,a):Object.assign({},r,t,a)))}))}else"polygon"===t.type?Qs(t,e).forEach((t=>{n.push(mn.graphicService.creator.polygon(i?t:Object.assign({},r,t)))})):"area"===t.type?Xs(t,e).forEach((t=>{n.push(mn.graphicService.creator.polygon(i?t:Object.assign({},r,t)))})):"path"===t.type&&ta(t,e).forEach((t=>{"path"in t?n.push(mn.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(mn.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}));return i&&Sa(t,n,e),n};class Ca{static GetImage(t,e){var i;const n=Ca.cache.get(t);n?"fail"===n.loadState?mn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):Ca.loadImage(t,e)}static GetSvg(t,e){var i;let n=Ca.cache.get(t);n?"fail"===n.loadState?mn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):(n={type:"image",loadState:"init"},Ca.cache.set(t,n),n.dataPromise=mn.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))})),n.waitingMark&&(n.waitingMark=[])}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Ca.cache.get(t);return i?"fail"===i.loadState?Promise.reject():"init"===i.loadState||"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Ca.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=mn.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=mn.global.loadBlob(t):"json"===e&&(i.dataPromise=mn.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Ca.isLoading&&Ca.toLoadAueue.length){Ca.isLoading=!0;const t=Ca.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,r={type:"image",loadState:"init"};if(Ca.cache.set(i,r),r.dataPromise=mn.global.loadImage(i),r.dataPromise){r.waitingMark=n;const t=r.dataPromise.then((t=>{var e;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(e=r.waitingMark)||void 0===e||e.map(((e,n)=>{(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,e.imageLoadSuccess(i,t.data)):(r.loadState="fail",e.imageLoadFail(i))})),r.waitingMark&&(r.waitingMark=[])}));e.push(t)}else r.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Ca.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Ca.loading()})).catch((t=>{console.error(t),Ca.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Ca.loading()}))}}),0)}static loadImage(t,e){const i=_a(t,Ca.toLoadAueue);if(-1!==i)return Ca.toLoadAueue[i].marks.push(e),void Ca.loading();Ca.toLoadAueue.push({url:t,marks:[e]}),Ca.loading()}static improveImageLoading(t){const e=_a(t,Ca.toLoadAueue);if(-1!==e){const t=Ca.toLoadAueue.splice(e,1);Ca.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function _a(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}Ca.cache=new Map,Ca.isLoading=!1,Ca.toLoadAueue=[],Ca.onLoadSuccessCb=[];const Ba=new ue,Pa=new le,Ra=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Ma=["x","y"],Ea=["scaleX","scaleY"],ka=["angle"],Oa=new zt,Ia={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class La extends Dr{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(La.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var i;super(),this._AABBBounds=new le,this._updateTag=t.UpdateTag.INIT,this.attribute=e,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,e.background?this.loadImage(null!==(i=e.background.background)&&void 0!==i?i:e.background,!0):e.shadowGraphic&&this.setShadowGraphic(e.shadowGraphic)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,n;const{dx:r=t.dx,dy:s=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;Oa.x=r+(null!==(i=t.scrollX)&&void 0!==i?i:0),Oa.y=s+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else Oa.x=r,Oa.y=s;return Oa}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;mn.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return mn.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new ce),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,n=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=i,s=ps(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new Be(t);return Je(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new ue),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&mn.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)&&mn.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&t.UpdateTag.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=t.UpdateTag.CLEAR_SHAPE}containsPoint(e,i,n,r){if(!r)return!1;if(n===t.IContainPointMode.GLOBAL){const t=new zt(e,i);this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),e=t.x,i=t.y}return r.containsPoint(this,{x:e,y:i})}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);s?this._setAttributes(s,i,n):J(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ra;for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ra;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(e){const i={type:t.AttributeUpdateType.INIT};e=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,null,i)||e,this.attribute=e,e.background?this.loadImage(e.background,!0):e.shadowGraphic&&this.setShadowGraphic(e.shadowGraphic),this._updateTag=t.UpdateTag.INIT,this.valid=this.isValid(),this.onAttributeUpdate(i)}translate(e,i){var n,r;if(0===e&&0===i)return this;const s={type:t.AttributeUpdateType.TRANSLATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,Ma,s);a&&(e=a.x,i=a.y,delete a.x,delete a.y,this._setAttributes(a));const o=this.attribute,h=o.postMatrix;return h?mn.transformUtil.fromMatrix(h,h).translate(e,i):(o.x=(null!==(n=o.x)&&void 0!==n?n:Hi.x)+e,o.y=(null!==(r=o.y)&&void 0!==r?r:Hi.y)+i),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(e,i){const n=this.attribute;if(n.x===e&&n.y===i)return this;const r={type:t.AttributeUpdateType.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,Ma,r);return s?(this._setAttributes(s,!1,r),this):(n.x=e,n.y=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}scale(e,i,n){var r,s;if(1===e&&1===i)return this;const a={type:t.AttributeUpdateType.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i,scaleCenter:n},this.attribute,Ea,a);o&&(e=o.scaleX,i=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));const h=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new ue,h.postMatrix=t),mn.transformUtil.fromMatrix(t,t).scale(e,i,n)}else h.scaleX=(null!==(r=h.scaleX)&&void 0!==r?r:Hi.scaleX)*e,h.scaleY=(null!==(s=h.scaleY)&&void 0!==s?s:Hi.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(a),this}scaleTo(e,i){const n=this.attribute;if(n.scaleX===e&&n.scaleY===i)return this;const r={type:t.AttributeUpdateType.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i},this.attribute,Ea,r);return s?(this._setAttributes(s,!1,r),this):(n.scaleX=e,n.scaleY=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}rotate(e,i){var n;if(0===e)return this;const r={type:t.AttributeUpdateType.ROTATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:e,rotateCenter:i},this.attribute,ka,r);s&&(delete s.angle,this._setAttributes(s,!1,r));const a=this.attribute;if(i){let{postMatrix:t}=this.attribute;t||(t=new ue,a.postMatrix=t),mn.transformUtil.fromMatrix(t,t).rotate(e,i)}else a.angle=(null!==(n=a.angle)&&void 0!==n?n:Hi.angle)+e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}rotateTo(e){const i=this.attribute;if(i.angle===e)return this;const n={type:t.AttributeUpdateType.ROTATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,ka,n);return r?(this._setAttributes(r,!1,n),this):(i.angle=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new rs(null==t?void 0:t.id,this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(e.bind(this),t){const{onStart:i,onFrame:n,onEnd:r,onRemove:s}=t;null!=i&&e.onStart(i),null!=n&&e.onFrame(n),null!=r&&e.onEnd(r),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(mn.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!J(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(e,i,n,r){var s,a,o,h;if(n){const n=Object.keys(e),l=this.getNoWorkAnimateAttr(),c={};let u;n.forEach((t=>{l[t]?(u||(u={}),u[t]=e[t]):c[t]=r&&void 0===e[t]?this.getDefaultAttribute(t):e[t]}));const d=this.animate({slience:!0});d.stateNames=i,d.to(c,null!==(a=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==a?a:os.duration,null!==(h=null===(o=this.stateAnimateConfig)||void 0===o?void 0:o.easing)&&void 0!==h?h:os.easing),u&&this.setAttributes(u,!1,{type:t.AttributeUpdateType.STATE})}else this.stopStateAnimates(),this.setAttributes(e,!1,{type:t.AttributeUpdateType.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const n=i.getEndProps();pt(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const n={};t.forEach((e=>{var i;const r=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];r&&Object.assign(n,r)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS)===t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=t.UpdateTag.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=t.UpdateTag.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&t.UpdateTag.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],n=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:n}=this.attribute;return Pa.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(Pa),this.setAttributes({scaleX:t,scaleY:i,angle:n}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,r=n();i[0]=r.x1+(r.x2-r.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,r=n();i[1]=r.y1+(r.y2-r.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=Hi.x,y:e=Hi.y,scaleX:i=Hi.scaleX,scaleY:n=Hi.scaleY,angle:r=Hi.angle,scaleCenter:s,anchor:a,postMatrix:o}=this.attribute;let h=[0,0];const l={};if(a&&(h=this.getAnchor(a,l)),!s||1===i&&1===n)!function(t,e,i,n,r,s,a,o){const h=e.a,l=e.b,c=e.c,u=e.d,d=e.e,p=e.f,f=Ot(a),g=Dt(a);let v,m;o?(v=o[0],m=o[1]):(v=i,m=n);const y=v-i,b=m-n,x=h*f+c*g,w=l*f+u*g,S=c*f-h*g,A=u*f-l*g;t.a=r*x,t.b=r*w,t.c=s*S,t.d=s*A,t.e=d+h*v+c*m-x*y-S*b,t.f=p+l*v+u*m-w*y-A*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,a&&h);else{const a=this._transMatrix;a.reset(),a.translate(h[0],h[1]),a.rotate(r),a.translate(-h[0],-h[1]),a.translate(t,e),h=this.getAnchor(s,l),mn.transformUtil.fromMatrix(a,a).scale(i,n,{x:h[0],y:h[1]})}const c=this.getOffsetXY(Hi);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,o){const t=Ba.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),mn.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(e){e&&this.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_END})}onStep(e,i,n,r,s){const a={};if(n.customAnimate)n.customAnimate.update(s,r,a);else{const t=n.props,o=n.parsedProps,h=n.propKeys;this.stepInterpolate(e,i,a,n,r,s,t,void 0,o,h)}this.setAttributes(a,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:r,end:s,step:n,isFirstFrameOfStep:e.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,r,s,a,o,h,l){l||(l=Object.keys(a),n.propKeys=l),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):l.forEach((s=>{var l;if(!e.validAttr(s))return;const c=a[s],u=null!==(l=o&&o[s])&&void 0!==l?l:t.getLastPropByName(s,n);if(null==c||null==u||c===u)return void(i[s]=c);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,u,c,i),d||(d=e.customInterpolate(s,r,u,c,this,i),d||this.defaultInterpolate(c,u,s,i,h,r)||this._interpolate(s,r,u,c,i))})),n.parsedProps=h}defaultInterpolate(t,e,i,n,r,s){if(Number.isFinite(t))return n[i]=e+(t-e)*s,!0;if("fill"===i){r||(r={});const a=r.fillColorArray,o=ra(e,null!=a?a:t,s,!1,((t,e)=>{r.fillColorArray=e}));return o&&(n[i]=o),!0}if("stroke"===i){r||(r={});const a=r.strokeColorArray,o=ra(e,null!=a?a:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return o&&(n[i]=o),!0}if("shadowColor"===i){r||(r={});const a=r.shadowColorArray,o=ra(e,null!=a?a:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return o&&(n[i]=o),!0}return!1}_interpolate(t,e,i,n,r){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:mn.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return st(t,!0)?this.pathProxy=(new Ni).fromString(t):this.pathProxy=new Ni,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(i,n),"string"==typeof t?(n.state="loading",t.startsWith("<svg")?(Ca.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(ct(t)||t.includes("/")||ut(t))&&(Ca.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):et(t)?(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e):n.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",mn.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const r=new Gr(t,e);r.bubbles=!1,r.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(r)}}}La.mixin(Vr);class Da{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function ja(t,e,i,n){const r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function Ua(t,e,i){const n=function(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="";for(let s=e;s<t.length;s++){let e=t[s];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!n)return;let r=n.data;const s=n.index,a=r.search(/\s/);let o=r,h=!0;-1!==a&&(o=r.substr(0,a).replace(/\s\s*$/,""),r=r.substr(a+1));const l=o;if(i){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1),h=o!==n.data.substr(t+1))}return{tagName:o,tagExp:r,closeIndex:s,attrExpPresent:h,rawTagName:l}}const Wa=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class Na{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const r=function(t,e){const i=[];let n=e.exec(t);for(;n;){const r=[];r.startIndex=e.lastIndex-n[0].length;const s=n.length;for(let t=0;t<s;t++)r.push(n[t]);i.push(r),n=e.exec(t)}return i}(t,Wa),s=r.length;for(let t=0;t<s;t++){const e=r[t][1],i=r[t][4];e&&(n[e]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Da("!xml");let i=e,n="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=ja(t,">",s,"Closing Tag is not closed."),a=r.lastIndexOf(".");r=r.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",s=e}else if("?"===t[s+1])s=Ua(t,s,!1,"?>").closeIndex+1;else if("!--"===t.substr(s+1,3))s=ja(t,"--\x3e",s+4,"Comment is not closed.");else{const a=Ua(t,s,!1);let o=a.tagName,h=a.tagExp;const l=a.attrExpPresent,c=a.closeIndex;if(o!==e.tagname&&(r+=r?"."+o:o),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),r=r.substr(0,r.length-1),h=o):h=h.substr(0,h.length-1);const t=new Da(o);o!==h&&l&&(t[":@"]=this.buildAttributesMap(h,r,o)),this.addChild(i,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new Da(o);this.tagsNodeStack.push(i),o!==h&&l&&(t[":@"]=this.buildAttributesMap(h,r,o)),this.addChild(i,t,r),i=t}n="",s=c}else n+=t[s];return e.child}}function Ga(t,e){return Fa(t)}function Fa(t,e){const i={};for(let e=0;e<t.length;e++){const r=t[e],s=za(r);if(void 0!==s&&r[s]){const t=Fa(r[s]);n=t,Object.keys(n).length,r[":@"]&&Ha(t,r[":@"]),void 0!==i[s]&&i.hasOwnProperty(s)?(Array.isArray(i[s])||(i[s]=[i[s]]),i[s].push(t)):i[s]=t}}var n;return i}function za(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Ha(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let r=0;r<n;r++){const n=i[r];t[n]=e[n]}}}class Va{constructor(t){this.options=Object.assign({},Va.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Ga(new Na(this.options).parseXml(t),this.options)}}function Ya(t){return t.startsWith("<svg")||t.startsWith("<?xml")}function Xa(t){return t.startsWith("<")}Va.defaultOptions={};var $a=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};function qa(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}let Ka=0;function Za(){return Ka++}var Ja;function Qa(e){const i=[];let n=0,r="";for(let s=0;s<e.length;s++)io(e[s])?n?r+=e[s]:(n=1,r=e[s]):(n&&(i.push({text:r,direction:t.TextDirection.VERTICAL}),r="",n=0),i.push({text:e[s],direction:t.TextDirection.HORIZONTAL}));return r&&i.push({text:r,direction:t.TextDirection.VERTICAL}),i}t.TextDirection=void 0,(Ja=t.TextDirection||(t.TextDirection={}))[Ja.HORIZONTAL=0]="HORIZONTAL",Ja[Ja.VERTICAL=1]="VERTICAL";const to=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>to.set(t,!0)));const eo=new Map;function io(t){if(to.has(t))return!0;if(eo.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}function no(t,e){const i=t.attribute;i&&i.split(";").forEach((t=>{if(!t)return;const i=t.split(":");if(2===i.length){const t=parseFloat(i[1]);e[i[0].trim()]=isFinite(t)?t:i[1].trim()}else{let t="";for(let e=1;e<i.length;e++)e>1&&(t+=":"),t+=i[e].trim();e[i[0].trim()]=t}}))}[""].forEach((t=>eo.set(t,!0)));const ro=Za(),so=Za(),ao=Za(),oo=Za(),ho=Za(),lo=Za(),co=Za(),uo=Za(),po=Za(),fo=Za(),go=Za(),vo=Za(),mo=Za(),yo=Za(),bo=Za(),xo=Za(),wo=Symbol.for("GraphicService"),So=Symbol.for("GraphicCreator"),Ao={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"},To=Object.keys(Ao),Co={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},_o=Object.keys(Co);var Bo;t.GroupUpdateAABBBoundsMode=void 0,(Bo=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[Bo.LESS_GROUP=0]="LESS_GROUP",Bo[Bo.MORE_GROUP=1]="MORE_GROUP";class Po extends La{constructor(e){super(e),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=lo,this._childUpdateTag=t.UpdateTag.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new Er),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Er)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(e,i,n){if(n===t.IContainPointMode.GLOBAL){const t=new zt(e,i);return this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),this.AABBBounds.contains(t.x,t.y)}return this.AABBBounds.contains(e,i)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;mn.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),mn.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=Hi.x,y:e=Hi.y,dx:i=Hi.dx,dy:n=Hi.dy,scaleX:r=Hi.scaleX,scaleY:s=Hi.scaleY,angle:a=Hi.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==r||1!==s||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Or(this).group}updateAABBBounds(t,e,i){const n=i;i=i.clone();const{width:r,height:s,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=r&&null!=s&&i.set(0,0,Math.max(0,r),Math.max(0,s)),!o){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:n=0}=t;i.translate(e,n)}return mn.graphicService.updateTempAABBBounds(i),mn.graphicService.transformAABBBounds(t,i,e,!1,this),n.copy(i),n}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS,this._childUpdateTag&=t.UpdateTag.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS||(this._childUpdateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),mn.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),mn.graphicService.onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,mn.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{mn.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),mn.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=mn.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new Po(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Po.NOWORK_ANIMATE_ATTR}}function Ro(t){return new Po(t)}Po.NOWORK_ANIMATE_ATTR=Ia;class Mo extends Po{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,n){var r;super({}),this.stage=t,this.global=e,this.window=i,this.main=n.main,this.layerHandler=n.layerHandler,this.layerHandler.init(this,i,{main:n.main,canvasId:n.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(r=n.zIndex)&&void 0!==r?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new Er,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{mn.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)}))}render(t,e){var i;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this))),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{mn.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}const Eo=Symbol.for("TransformUtil"),ko=Symbol.for("GraphicUtil"),Oo=Symbol.for("LayerService"),Io=Symbol.for("StaticLayerHandlerContribution"),Lo=Symbol.for("DynamicLayerHandlerContribution"),Do=Symbol.for("VirtualLayerHandlerContribution");var jo,Uo=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Wo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.DefaultLayerService=jo=class{static GenerateLayerId(){return`${jo.idprefix}_${jo.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=mn.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}getRecommendedLayerType(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}getLayerHandler(t){let e;return e="static"===t?jn.get(Io):"dynamic"===t?jn.get(Lo):jn.get(Do),e}createLayer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};var i;this.tryInit();let n=this.getRecommendedLayerType(e.layerMode);n=e.main||e.canvasId?"static":n;const r=this.getLayerHandler(n),s=new Mo(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:n,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:jo.GenerateLayerId(),layerHandler:r})),a=this.layerMap.get(t)||[];return a.push(s),this.layerMap.set(t,a),this.staticLayerCountInEnv--,s}prepareStageLayer(t){let e;t.forEachChildren((t=>{const i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i,e.secondaryHandlers=[])}))}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}releaseStage(t){this.layerMap.delete(t)}},t.DefaultLayerService.idprefix="visactor_layer",t.DefaultLayerService.prefix_count=0,t.DefaultLayerService=jo=Uo([g(),Wo("design:paramtypes",[])],t.DefaultLayerService);var No=new i((e=>{e(W).to(t.DefaultGlobal).inSingletonScope(),e(br).to(t.DefaultWindow),e(ko).to(t.DefaultGraphicUtil).inSingletonScope(),e(Eo).to(t.DefaultTransformUtil).inSingletonScope(),e(Oo).to(t.DefaultLayerService).inSingletonScope()}));function Go(t,e){return!(!t&&!e)}function Fo(t,e){let i;return i=at(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function zo(t,e,i){return i&&t*e>0}function Ho(t,e,i,n,r){return r&&t*e>0&&0!==i&&0!==n}function Vo(t,e){return t*e>0}function Yo(t,e,i,n){return t*e>0&&0!==i&&0!==n}function Xo(t,e,i,n,r,s,a,o){if(!t.pathProxy)return!1;const h=Or(t,null==s?void 0:s.theme)[t.type.replace("3d","")],{fill:l=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:g=h.visible,x:v=h.x,y:m=h.y}=t.attribute,y=zo(u,d,l),b=Vo(u,f),x=Go(l),w=Fo(c,p);if(!g)return!0;if(!x&&!w)return!0;if(!(y||b||a||o))return!0;e.beginPath();return Je(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),w&&(o?o(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,i-v,n-m,h),e.stroke())),x&&(a?a(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,i-v,n-m,h),e.fill())),!0}function $o(t,e,i,n,r,s,a,o){const h=i-t,l=n-e,c=a-r,u=o-s;let d=u*h-c*l;return d*d<_t?[]:(d=(c*(e-s)-u*(t-r))/d,[t+d*h,e+d*l])}function qo(t,e,i,n,r,s,a){const o=t-i,h=e-n,l=(a?s:-s)/Math.sqrt(o*o+h*h),c=l*h,u=-l*o,d=t+c,p=e+u,f=i+c,g=n+u,v=(d+f)/2,m=(p+g)/2,y=f-d,b=g-p,x=y*y+b*b,w=r-s,S=d*g-f*p,A=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-S*S));let T=(S*b-y*A)/x,C=(-S*y-b*A)/x;const _=(S*b+y*A)/x,B=(-S*y+b*A)/x,P=T-v,R=C-m,M=_-v,E=B-m;return P*P+R*R>M*M+E*E&&(T=_,C=B),{cx:T,cy:C,x01:-c,y01:-u,x11:T*(r/w-1),y11:C*(r/w-1)}}function Ko(t,e,i,n,r){const s=Et(i-e),a=t.getParsedCornerRadius(),o=at(a),{outerDeltaAngle:h,innerDeltaAngle:l,outerStartAngle:c,outerEndAngle:u,innerEndAngle:d,innerStartAngle:p}=t.getParsePadAngle(e,i),f=o?a[0]:a,g=o?a[1]:a,v=o?a[2]:a,m=o?a[3]:a,y=Math.max(g,f),b=Math.max(v,m);let x=y,w=b;const S=r*Ot(c),A=r*Dt(c),T=n*Ot(d),C=n*Dt(d);let _,B,P,R;if((b>_t||y>_t)&&(_=r*Ot(u),B=r*Dt(u),P=n*Ot(p),R=n*Dt(p),s<Bt)){const t=$o(S,A,P,R,_,B,T,C);if(t){const e=S-t[0],i=A-t[1],s=_-t[0],a=B-t[1],o=1/Dt(function(t){return t>1?0:t<-1?Bt:Math.acos(t)}((e*s+i*a)/(jt(e*e+i*i)*jt(s*s+a*a)))/2),h=jt(t[0]*t[0]+t[1]*t[1]);w=Lt(b,(n-h)/(o-1)),x=Lt(y,(r-h)/(o+1))}}return{outerDeltaAngle:h,xors:S,yors:A,xirs:P,yirs:R,xore:_,yore:B,xire:T,yire:C,limitedOcr:x,limitedIcr:w,outerCornerRadiusStart:f,outerCornerRadiusEnd:g,maxOuterCornerRadius:y,maxInnerCornerRadius:b,outerStartAngle:c,outerEndAngle:u,innerDeltaAngle:l,innerEndAngle:d,innerStartAngle:p,innerCornerRadiusStart:m,innerCornerRadiusEnd:v}}function Zo(t,e,i,n,r,s,a){const{startAngle:o,endAngle:h}=t.getParsedAngle(),l=Et(h-o),c=h>o;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=_t)e.moveTo(i,n);else if(l>=Mt-_t)e.moveTo(i+r*Ot(o),n+r*Dt(o)),e.arc(i,n,r,o,h,!c),s>_t&&(e.moveTo(i+s*Ot(h),n+s*Dt(h)),e.arc(i,n,s,h,o,c));else{const{outerDeltaAngle:l,xors:d,yors:p,xirs:f,yirs:g,limitedOcr:v,outerCornerRadiusStart:m,outerCornerRadiusEnd:y,maxOuterCornerRadius:b,xore:x,yore:w,xire:S,yire:A,outerStartAngle:T,outerEndAngle:C,limitedIcr:_,innerDeltaAngle:B,innerEndAngle:P,innerStartAngle:R,innerCornerRadiusStart:M,innerCornerRadiusEnd:E,maxInnerCornerRadius:k}=Ko(t,o,h,s,r);if(l<.001)a&&(a[3]||a[1])&&e.moveTo(i+d,n+p),u=!0;else if(v>_t){const t=Lt(m,v),s=Lt(y,v),o=qo(f,g,d,p,r,t,Number(c)),h=qo(x,w,S,A,r,s,Number(c));v<b&&t===s?!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,v,kt(o.y01,o.x01),kt(h.y01,h.x01),!c)):e.moveTo(i+o.cx+v*Ot(kt(h.y01,h.x01)),n+o.cy+v*Dt(kt(h.y01,h.x01))):!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),t>0&&e.arc(i+o.cx,n+o.cy,t,kt(o.y01,o.x01),kt(o.y11,o.x11),!c),e.arc(i,n,r,kt(o.cy+o.y11,o.cx+o.x11),kt(h.cy+h.y11,h.cx+h.x11),!c),s>0&&e.arc(i+h.cx,n+h.cy,s,kt(h.y11,h.x11),kt(h.y01,h.x01),!c)):s>0?e.moveTo(i+h.cx+s*Ot(kt(h.y01,h.x01)),n+h.cy+s*Dt(kt(h.y01,h.x01))):e.moveTo(i+x,n+r*Dt(C))}else!a||a[0]?(e.moveTo(i+d,n+p),e.arc(i,n,r,T,C,!c)):e.moveTo(i+r*Ot(C),n+r*Dt(C));if(!(s>_t)||B<.001)!a||a[1]?e.lineTo(i+S,n+A):e.moveTo(i+S,n+A),u=!0;else if(_>_t){const t=Lt(M,_),r=Lt(E,_),o=qo(S,A,x,w,s,-r,Number(c)),h=qo(d,p,f,g,s,-t,Number(c));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),_<k&&t===r){const t=kt(h.y01,h.x01);!a||a[2]?e.arc(i+o.cx,n+o.cy,_,kt(o.y01,o.x01),t,!c):e.moveTo(i+o.cx+Ot(t),n+o.cy+Dt(t))}else!a||a[2]?(r>0&&e.arc(i+o.cx,n+o.cy,r,kt(o.y01,o.x01),kt(o.y11,o.x11),!c),e.arc(i,n,s,kt(o.cy+o.y11,o.cx+o.x11),kt(h.cy+h.y11,h.cx+h.x11),c),t>0&&e.arc(i+h.cx,n+h.cy,t,kt(h.y11,h.x11),kt(h.y01,h.x01),!c)):t>0?e.moveTo(i+h.cx+t*Ot(kt(h.y01,h.x01)),n+h.cy+t*Dt(kt(h.y01,h.x01))):e.moveTo(i+f,n+g)}else!a||a[1]?e.lineTo(i+S,n+A):e.moveTo(i+S,n+A),!a||a[2]?e.arc(i,n,s,P,R,c):e.moveTo(i+s*Ot(R),n+s*Dt(R))}return a?a[3]&&e.lineTo(i+r*Ot(o),n+r*Dt(o)):e.closePath(),u}class Jo{static GetCanvas(){try{return Jo.canvas||(Jo.canvas=mn.global.createCanvas({})),Jo.canvas}catch(t){return null}}static GetCtx(){if(!Jo.ctx){const t=Jo.GetCanvas();Jo.ctx=t.getContext("2d")}return Jo.ctx}}class Qo extends de{static getInstance(){return Qo._instance||(Qo._instance=new Qo),Qo._instance}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=Jo.GetCanvas(),n=Jo.GetCtx();if(i.width=e,i.height=1,!n)return;if(n.translate(0,0),!n)throw new Error("获取ctx发生错误");const r=n.createLinearGradient(0,0,e,0);t.forEach((t=>{r.addColorStop(t[0],t[1])})),n.fillStyle=r,n.fillRect(0,0,e,1),this.rgbaSet=n.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:100,a=`${t}${e}${i}${n}`;r.forEach((t=>a+=t.join())),a+=s;let o=this.dataMap.get(a);return o||(o={data:new Qo(r,s),timestamp:[]},this.addLimitedTimestamp(o,Date.now(),{}),this.dataMap.set(a,o)),this.clearCache(this.dataMap,this.cacheParams),o.data}}class th{static GetSize(t){for(let e=0;e<th.ImageSize.length;e++)if(th.ImageSize[e]>=t)return th.ImageSize[e];return t}static Get(t,e,i,n,r,s,a){const o=th.GenKey(t,e,i,n,r),h=th.cache[o];if(!h||0===h.length)return null;for(let t=0;t<h.length;t++)if(h[t].width>=s&&h[t].height>=a)return h[t].pattern;return null}static Set(t,e,i,n,r,s,a,o){const h=th.GenKey(t,e,i,n,r);th.cache[h]?th.cache[h].push({width:a,height:o,pattern:s}):th.cache[h]=[{width:a,height:o,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function eh(t,e,i,n){const{stops:r,startAngle:s,endAngle:a}=n;for(;i<0;)i+=Mt;for(;i>Mt;)i-=Mt;if(i<s)return r[0].color;if(i>a)return r[0].color;let o,h,l=(i-s)/(a-s);for(let t=0;t<r.length;t++)if(r[t].offset>=l){o=r[t-1],h=r[t];break}return l=(l-o.offset)/(h.offset-o.offset),ra(o.color,h.color,l,!1)}function ih(t,e,i,n,r,s,a,o,h){const l=Math.floor(180*r/Math.PI),c=Jo.GetCanvas(),u=Jo.GetCtx();if(!u)return null;const d=th.GetSize(o),p=th.GetSize(h);let f=th.Get(e,i,n,s,a,d,p);if(f)return f;const g=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(n,2),Math.pow(d-i,2)+Math.pow(n,2)),Math.max(Math.pow(d-i,2)+Math.pow(p-n,2),Math.pow(i,2)+Math.pow(p-n,2)))),v=l+1,m=r/Math.max(1,v-1),y=Qo.getInstance().GetOrCreate(i,n,d,p,e,v),b=2*Math.PI*g/360;c.width=d,c.height=p,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,d,p),u.translate(i,n),u.rotate(s);for(let t=0,e=v-1;t<e&&!(s+t*m>a);t++){const e=y.getColor(t);u.beginPath(),u.rotate(m),u.moveTo(0,0),u.lineTo(g,-2*b),u.lineTo(g,0),u.fillStyle=e,u.closePath(),u.fill()}const x=u.getImageData(0,0,d,p);return c.width=x.width,c.height=x.height,u.putImageData(x,0,0),f=t.createPattern(c,"no-repeat"),f&&th.Set(e,i,n,s,a,f,d,p),f}th.cache={},th.ImageSize=[20,40,80,160,320,640,1280,2560];const nh=Symbol.for("ArcRenderContribution"),rh=Symbol.for("AreaRenderContribution"),sh=Symbol.for("CircleRenderContribution"),ah=Symbol.for("GroupRenderContribution"),oh=Symbol.for("ImageRenderContribution"),hh=Symbol.for("PathRenderContribution"),lh=Symbol.for("PolygonRenderContribution"),ch=Symbol.for("RectRenderContribution"),uh=Symbol.for("SymbolRenderContribution"),dh=Symbol.for("TextRenderContribution"),ph=Symbol.for("CommonRenderContribution"),fh=Symbol.for("InteractiveSubRenderContribution");function gh(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function vh(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function mh(t){const e={},i=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`;return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((i=>{t[i]&&(e[Ce(i)]=t[i])})),["fontSize","lineHeight"].forEach((n=>{const r=Ce(n);J(t[n])||(e[r]=i(t[n]))})),Q(t.maxLineWidth)&&(e["max-width"]=i(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&st(t.fill)&&(e.color=t.fill),e}function yh(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 bh(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],a=e[5],o=e[6],h=e[7],l=e[8],c=e[9],u=e[10],d=e[11];return 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]=s*r+l*n,t[5]=a*r+c*n,t[6]=o*r+u*n,t[7]=h*r+d*n,t[8]=l*r-s*n,t[9]=c*r-a*n,t[10]=u*r-o*n,t[11]=d*r-h*n,t}function xh(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],a=e[1],o=e[2],h=e[3],l=e[8],c=e[9],u=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-l*n,t[1]=a*r-c*n,t[2]=o*r-u*n,t[3]=h*r-d*n,t[8]=s*n+l*r,t[9]=a*n+c*r,t[10]=o*n+u*r,t[11]=h*n+d*r,t}function wh(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],a=e[1],o=e[2],h=e[3],l=e[4],c=e[5],u=e[6],d=e[7];return e!==t&&(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[0]=s*r+l*n,t[1]=a*r+c*n,t[2]=o*r+u*n,t[3]=h*r+d*n,t[4]=l*r-s*n,t[5]=c*r-a*n,t[6]=u*r-o*n,t[7]=d*r-h*n,t}function Sh(t,e,i){const n=i[0],r=i[1],s=i[2];let a,o,h,l,c,u,d,p,f,g,v,m;return e===t?(t[12]=e[0]*n+e[4]*r+e[8]*s+e[12],t[13]=e[1]*n+e[5]*r+e[9]*s+e[13],t[14]=e[2]*n+e[6]*r+e[10]*s+e[14],t[15]=e[3]*n+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],h=e[2],l=e[3],c=e[4],u=e[5],d=e[6],p=e[7],f=e[8],g=e[9],v=e[10],m=e[11],t[0]=a,t[1]=o,t[2]=h,t[3]=l,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=f,t[9]=g,t[10]=v,t[11]=m,t[12]=a*n+c*r+f*s+e[12],t[13]=o*n+u*r+g*s+e[13],t[14]=h*n+d*r+v*s+e[14],t[15]=l*n+p*r+m*s+e[15]),t}function Ah(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function Th(t,e,i){const n=i[0],r=i[1],s=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ch(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i[0],x=i[1],w=i[2],S=i[3];return t[0]=b*n+x*o+w*u+S*g,t[1]=b*r+x*h+w*d+S*v,t[2]=b*s+x*l+w*p+S*m,t[3]=b*a+x*c+w*f+S*y,b=i[4],x=i[5],w=i[6],S=i[7],t[4]=b*n+x*o+w*u+S*g,t[5]=b*r+x*h+w*d+S*v,t[6]=b*s+x*l+w*p+S*m,t[7]=b*a+x*c+w*f+S*y,b=i[8],x=i[9],w=i[10],S=i[11],t[8]=b*n+x*o+w*u+S*g,t[9]=b*r+x*h+w*d+S*v,t[10]=b*s+x*l+w*p+S*m,t[11]=b*a+x*c+w*f+S*y,b=i[12],x=i[13],w=i[14],S=i[15],t[12]=b*n+x*o+w*u+S*g,t[13]=b*r+x*h+w*d+S*v,t[14]=b*s+x*l+w*p+S*m,t[15]=b*a+x*c+w*f+S*y,t}function _h(t,e,i,n){let r,s,a,o,h,l,c,u,d,p;const f=e[0],g=e[1],v=e[2],m=n[0],y=n[1],b=n[2],x=i[0],w=i[1],S=i[2];return Math.abs(f-x)<_t&&Math.abs(g-w)<_t&&Math.abs(v-S)<_t?yh(t):(c=f-x,u=g-w,d=v-S,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,r=y*d-b*u,s=b*c-m*d,a=m*u-y*c,p=Math.hypot(r,s,a),p?(p=1/p,r*=p,s*=p,a*=p):(r=0,s=0,a=0),o=u*a-d*s,h=d*r-c*a,l=c*s-u*r,p=Math.hypot(o,h,l),p?(p=1/p,o*=p,h*=p,l*=p):(o=0,h=0,l=0),t[0]=r,t[1]=o,t[2]=c,t[3]=0,t[4]=s,t[5]=h,t[6]=u,t[7]=0,t[8]=a,t[9]=l,t[10]=d,t[11]=0,t[12]=-(r*f+s*g+a*v),t[13]=-(o*f+h*g+l*v),t[14]=-(c*f+u*g+d*v),t[15]=1,t)}function Bh(t,e,i,n,r,s,a){const o=1/(e-i),h=1/(n-r),l=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+i)*o,t[13]=(r+n)*h,t[14]=(a+s)*l,t[15]=1,t}function Ph(t,e,i){const n=e[0],r=e[1],s=e[2];let a=i[3]*n+i[7]*r+i[11]*s+i[15];return a=a||1,t[0]=(i[0]*n+i[4]*r+i[8]*s+i[12])/a,t[1]=(i[1]*n+i[5]*r+i[9]*s+i[13])/a,t[2]=(i[2]*n+i[6]*r+i[10]*s+i[14])/a,t}const Rh=Symbol.for("MatrixAllocate"),Mh=Symbol.for("Mat4Allocate");function Eh(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class kh{constructor(){this.pools=[]}allocate(t,e,i,n,r,s){if(!this.pools.length)return new ue(t,e,i,n,r,s);const a=this.pools.pop();return a.a=t,a.b=e,a.c=i,a.d=n,a.e=r,a.f=s,a}allocateByObj(t){if(!this.pools.length)return new ue(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}class Oh{constructor(){this.pools=[]}static identity(t){return yh(t)}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return Oh.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const Ih=new kh,Lh=new Oh;var Dh=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},jh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Uh=function(t,e){return function(i,n){e(i,n,t)}};function Wh(t,e,i){var n;const{x:r=i.x,y:s=i.y,z:a=i.z,dx:o=i.dx,dy:h=i.dy,dz:l=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:f=i.beta,angle:g=i.angle,anchor3d:v=e.attribute.anchor,anchor:m}=e.attribute,y=[0,0,0];if(v){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;y[0]=i.x1+(i.x2-i.x1)*t}else y[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;y[1]=i.x1+(i.x2-i.x1)*t}else y[1]=v[1];y[2]=null!==(n=v[2])&&void 0!==n?n:0}if(yh(t),Sh(t,t,[r+o,s+h,a+l]),Sh(t,t,[y[0],y[1],y[2]]),bh(t,t,f),xh(t,t,p),Sh(t,t,[-y[0],-y[1],y[2]]),Th(t,t,[c,u,d]),g){const i=Lh.allocate(),n=[0,0];if(m){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=v[1]}Sh(i,i,[n[0],n[1],0]),wh(i,i,g),Sh(i,i,[-n[0],-n[1],0]),Ch(t,t,i)}}function Nh(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new j(["graphic"]),onSetStage:new j(["graphic","stage"]),onRemove:new j(["graphic"]),onRelease:new j(["graphic"]),onAddIncremental:new j(["graphic","group","stage"]),onClearIncremental:new j(["graphic","group","stage"]),beforeUpdateAABBBounds:new j(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new j(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new j(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new le,this.tempAABBBounds2=new le}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}clearAABBBounds(t,e,i){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,i)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new Be(t);return Je(i.commandList,n,0,0),!0}updateHTMLTextAABBBounds(t,e,i,n){const{textAlign:r,textBaseline:s}=t;if(null!=t.forceBoundsHeight){const e=ht(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=vh(s,e,e);i.set(i.x1,n,i.x2,n+e)}if(null!=t.forceBoundsWidth){const e=ht(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=gh(r,e);i.set(n,i.y1,n+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,r){if(!e.empty()){const{scaleX:r=i.scaleX,scaleY:s=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:h=i.lineWidth,pickStrokeBuffer:l=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&h){qa(u,(h+l)/Math.abs(r+s),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(o){const{shadowOffsetX:n=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;qa(u,o/Math.abs(r+s)*2,!1,c+1),u.translate(n,a),e.union(u)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let s=!0;const a=r.transMatrix;r&&r.isContainer&&(s=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),s&&oe(e,e,a)}validCheck(t,e,i,n){if(!n)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(n.shadowRoot||n.isContainer)return!0;const{visible:r=e.visible}=t;return!(!n.valid||!r)||(i.empty()||(n.parent&&i.transformWithMatrix(n.parent.globalTransMatrix),mn.graphicService.clearAABBBounds(n,n.stage,i),i.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}},t.DefaultGraphicService=Dh([g(),Uh(0,p(So)),jh("design:paramtypes",[Object])],t.DefaultGraphicService);const Gh={x:0,y:0,z:0,lastModelMatrix:null};class Fh{init(e){e&&(this._renderContribitions=e.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((e=>e.time===t.BaseRenderContributionTime.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((e=>e.time===t.BaseRenderContributionTime.afterFillStroke)))}beforeRenderStep(t,e,i,n,r,s,a,o,h,l,c,u,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d)}))}afterRenderStep(t,e,i,n,r,s,a,o,h,l,c,u,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d)}))}valid(t,e,i,n){const{fill:r=e.fill,background:s,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:h=e.fillOpacity,lineWidth:l=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=zo(o,h,r),p=Vo(o,c),f=Go(r,s),g=Fo(a,l);return!(!t.valid||!u)&&!(!f&&!g)&&!!(d||p||i||n||s)&&{fVisible:d,sVisible:p,doFill:f,doStroke:g}}transform(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:r=e.x,y:s=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:h=e.scaleY,angle:l=e.angle,postMatrix:c}=t.attribute,u=i.modelMatrix,d=i.camera;Gh.x=r,Gh.y=s,Gh.z=a,Gh.lastModelMatrix=u;const p=d&&(n||Nh(t)),f=p?t.transMatrix.onlyTranslate()&&!c:1===o&&1===h&&0===l&&!c;if(p){const n=Lh.allocate(),r=Lh.allocate();Wh(r,t,e),Ch(n,u||n,r),Gh.x=0,Gh.y=0,Gh.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),Lh.free(r)}if(f&&!u){const n=t.getOffsetXY(e);Gh.x+=n.x,Gh.y+=n.y,Gh.z=a,i.setTransformForCurrent()}else if(p)Gh.x=0,Gh.y=0,Gh.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(d&&i.project){const n=t.getOffsetXY(e);Gh.x+=n.x,Gh.y+=n.y,this.transformWithoutTranslate(i,Gh.x,Gh.y,Gh.z,o,h,l)}else i.transformFromMatrix(t.transMatrix,!0),Gh.x=0,Gh.y=0,Gh.z=0;return Gh}transformUseContext2d(t,e,i,n){const r=n.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,a=n.project(0,0,i),o=n.project(r,0,i),h=n.project(r,s,i),l={x:0,y:0},c={x:r,y:0},u={x:r,y:s};n.camera=null;const d=1/(l.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*l.y),p=-(l.y*(h.x-o.x)-c.y*h.x+u.y*o.x+(c.y-u.y)*a.x)*d,f=(c.y*h.y+l.y*(o.y-h.y)-u.y*o.y+(u.y-c.y)*a.y)*d,g=(l.x*(h.x-o.x)-c.x*h.x+u.x*o.x+(c.x-u.x)*a.x)*d,v=-(c.x*h.y+l.x*(o.y-h.y)-u.x*o.y+(u.x-c.x)*a.y)*d,m=(l.x*(u.y*o.x-c.y*h.x)+l.y*(c.x*h.x-u.x*o.x)+(u.x*c.y-c.x*u.y)*a.x)*d,y=(l.x*(u.y*o.y-c.y*h.y)+l.y*(c.x*h.y-u.x*o.y)+(u.x*c.y-c.x*u.y)*a.y)*d;n.setTransform(p,f,g,v,m,y,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,r,s,a){const o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(r,s,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,r){const{context:s}=n;if(!s)return;const{renderable:a}=t.attribute;if(!1===a)return;s.highPerformanceSave();const o=this.transform(t,e,s,i),{x:h,y:l,z:c,lastModelMatrix:u}=o;this.z=c,Xo(t,s,h,l,0,r)||(this.drawShape(t,s,h,l,n,r),this.z=0,s.modelMatrix!==u&&Lh.free(s.modelMatrix),s.modelMatrix=u),s.highPerformanceRestore()}}var zh=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Hh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vh=function(t,e){return function(i,n){e(i,n,t)}};class Yh{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){var p;const{background:f,backgroundOpacity:g=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:h.backgroundOpacity),opacity:v=h.opacity,backgroundMode:m=h.backgroundMode,backgroundFit:y=h.backgroundFit}=t.attribute;if(f)if(t.backgroundImg&&t.resources){const r=t.resources.get(f);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Or(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,h),e.globalAlpha=g*v,this.doDrawImage(e,r.data,s,m,y),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.globalAlpha=g*v,e.fillStyle=f,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n,r){if("no-repeat"===n)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const s=i.width(),a=i.height();let o=s,h=a;if(r&&"repeat"!==n&&(e.width||e.height)){const i=e.width,r=e.height;"repeat-x"===n?(o=i*(a/r),h=a):"repeat-y"===n&&(h=r*(s/i),o=s);const l=t.dpr,c=vr.allocate({width:o,height:h,dpr:l}),u=c.getContext("2d");u&&(u.inuse=!0,u.clearMatrix(),u.setTransformForCurrent(!0),u.clearRect(0,0,o,h),u.drawImage(e,0,0,o,h),e=c.nativeCanvas),vr.free(c)}const l=t.dpr,c=t.createPattern(e,n);c.setTransform&&c.setTransform(new DOMMatrix([1/l,0,0,1/l,0,0])),t.fillStyle=c,t.translate(i.x1,i.y1),t.fillRect(0,0,s,a),t.translate(-i.x1,-i.y1)}}}const Xh=new Yh;t.DefaultBaseInteractiveRenderContribution=class{constructor(e){this.subRenderContribitions=e,this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,a,o,h,l,c,u,d)}))}},t.DefaultBaseInteractiveRenderContribution=zh([g(),Vh(0,p(k)),Vh(0,v(fh)),Hh("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution);class $h{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,n,r){const s=(t-2*e)/2,a=n.dpr,o=vr.allocate({width:t,height:t,dpr:a}),h=o.getContext("2d");if(!h)return null;h.inuse=!0,h.clearMatrix(),h.setTransformForCurrent(!0),h.clearRect(0,0,t,t),r(s,h);const l=n.createPattern(o.nativeCanvas,"repeat");return l.setTransform&&l.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),vr.free(o),l}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,Mt),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const r=t/2,s=r;n.fillStyle=i,n.moveTo(r,s-e),n.lineTo(e+r,s),n.lineTo(r,s+e),n.lineTo(r-e,s),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(s,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(0,s,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const r=t/2,s=-r;n.moveTo(r,s),n.lineTo(r+t,s+t),n.moveTo(-r,-s),n.lineTo(-r+t,-s+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const r=t/2,s=r;n.moveTo(t+r,s),n.lineTo(r,s+t),n.moveTo(t-r,-s),n.lineTo(-r,-s+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,t,t),n.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:f=h.textureColor,textureSize:g=h.textureSize,texturePadding:v=h.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,h,f,g,v)}drawTexture(t,e,i,n,r,s,a,o,h){let l=this.textureMap.get(t);if(!l)switch(t){case"circle":l=this.createCirclePattern(o,h,a,i);break;case"diamond":l=this.createDiamondPattern(o,h,a,i);break;case"rect":l=this.createRectPattern(o,h,a,i);break;case"vertical-line":l=this.createVerticalLinePattern(o,h,a,i);break;case"horizontal-line":l=this.createHorizontalLinePattern(o,h,a,i);break;case"bias-lr":l=this.createBiasLRLinePattern(o,h,a,i);break;case"bias-rl":l=this.createBiasRLLinePattern(o,h,a,i);break;case"grid":l=this.createGridPattern(o,h,a,i)}l&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,r,s),i.fillStyle=l,i.fill(),i.highPerformanceRestore())}}const qh=new $h;class Kh{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{innerPadding:v=h.innerPadding,outerPadding:m=h.outerPadding,startAngle:y=h.startAngle,endAngle:b=h.endAngle,opacity:x=h.opacity,x:w=h.x,y:S=h.y,scaleX:A=h.scaleX,scaleY:T=h.scaleY,keepStrokeScale:C=h.keepStrokeScale}=t.attribute;let{innerRadius:_=h.innerRadius,outerRadius:B=h.outerRadius}=t.attribute;B+=m,_-=v;const P=(r,s)=>{const a=!(!r||!r.stroke),{distance:o=h[s].distance}=r,l=C?o:xn(e,o,e.dpr),c=o/B,d="outerBorder"===s?1:-1;if(t.setAttributes({outerRadius:B+d*l,innerRadius:_-d*l,startAngle:y-d*c,endAngle:b+d*c}),e.beginPath(),Zo(t,e,i,n,B+d*l,_-d*l),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,r,h[s]);else if(a){const a=h[s].opacity;h[s].opacity=x,e.setStrokeStyle(t,r,(w-i)/A,(S-n)/T,h[s]),h[s].opacity=a,e.stroke()}};f&&P(d,"outerBorder"),g&&P(p,"innerBorder"),t.setAttributes({outerRadius:B,innerRadius:_,startAngle:y,endAngle:b})}}const Zh=new Kh,Jh=qh,Qh=Xh;class tl{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{radius:v=h.radius,startAngle:m=h.startAngle,endAngle:y=h.endAngle,opacity:b=h.opacity,x:x=h.x,y:w=h.y,scaleX:S=h.scaleX,scaleY:A=h.scaleY,keepStrokeScale:T=h.keepStrokeScale}=t.attribute,C=(r,s)=>{const a=!(!r||!r.stroke),{distance:o=h[s].distance}=r,l=T?o:xn(e,o,e.dpr),c="outerBorder"===s?1:-1;if(e.beginPath(),e.arc(i,n,v+c*l,m,y),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,r,h[s]);else if(a){const a=h[s].opacity;h[s].opacity=b,e.setStrokeStyle(t,r,(x-i)/S,(w-n)/A,h[s]),h[s].opacity=a,e.stroke()}};f&&C(d,"outerBorder"),g&&C(p,"innerBorder")}}const el=new tl,il=qh,nl=Xh;class rl extends Yh{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{background:d,backgroundMode:p=h.backgroundMode,backgroundFit:f=h.backgroundFit}=t.attribute;if(d)if(t.backgroundImg&&t.resources){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const n=t.AABBBounds;this.doDrawImage(e,i.data,n,p,f),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}}const sl=new rl,al=Bt/2;function ol(t,e,i,n,r,s,a){let o;if(n<0&&(e+=n,n=-n),r<0&&(i+=r,r=-r),ht(s,!0))o=[s=Et(s),s,s,s];else if(Array.isArray(s)){const t=s;let e,i;switch(t.length){case 0:o=[0,0,0,0];break;case 1:e=Et(t[0]),o=[e,e,e,e];break;case 2:case 3:e=Et(t[0]),i=Et(t[1]),o=[e,i,e,i];break;default:o=t,o[0]=Et(o[0]),o[1]=Et(o[1]),o[2]=Et(o[2]),o[3]=Et(o[3])}}else o=[0,0,0,0];if(n<0||o[0]+o[1]+o[2]+o[3]<1e-12)return t.rect(e,i,n,r);const[h,l,c,u]=[[e,i],[e+n,i],[e+n,i+r],[e,i+r]],d=Math.min(n/2,r/2),p=[Math.min(d,o[0]),Math.min(d,o[1]),Math.min(d,o[2]),Math.min(d,o[3])],f=[h[0]+p[0],h[1]],g=[h[0],h[1]+p[0]],v=[l[0]-p[1],l[1]],m=[l[0],l[1]+p[1]],y=[c[0]-p[2],c[1]],b=[c[0],c[1]-p[2]],x=[u[0]+p[3],u[1]],w=[u[0],u[1]-p[3]];if(t.moveTo(f[0],f[1]),a&&a[0]?a[0](f[0],f[1],v[0],v[1]):t.lineTo(v[0],v[1]),!mt(v,m)){a&&a[0]&&t.moveTo(v[0],v[1]);const e=v[0],i=v[1]+p[1];t.arc(e,i,p[1],-al,0,!1)}if(a&&a[1]?a[1](m[0],m[1],b[0],b[1]):t.lineTo(b[0],b[1]),!mt(y,b)){const e=b[0]-p[2],i=b[1];a&&a[1]&&t.moveTo(b[0],b[1]),t.arc(e,i,p[2],0,al,!1)}if(a&&a[2]?a[2](y[0],y[1],x[0],x[1]):t.lineTo(x[0],x[1]),!mt(x,w)){const e=x[0],i=x[1]-p[3];a&&a[2]&&t.moveTo(x[0],x[1]),t.arc(e,i,p[3],al,Bt,!1)}if(a&&a[3]?a[3](w[0],w[1],g[0],g[1]):t.lineTo(g[0],g[1]),!mt(f,g)){const e=f[0],i=f[1]+p[0];a&&a[3]&&t.moveTo(g[0],g[1]),t.arc(e,i,p[0],Bt,Bt+al,!1)}return!a&&t.closePath(),t}var hl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};class ll{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{cornerRadius:v=h.cornerRadius,opacity:m=h.opacity,x:y=h.x,y:b=h.y,scaleX:x=h.scaleX,scaleY:w=h.scaleY,x1:S,y1:A,keepStrokeScale:T=h.keepStrokeScale}=t.attribute;let{width:C,height:_}=t.attribute;C=(null!=C?C:S-i)||0,_=(null!=_?_:A-n)||0;const B=(r,s)=>{const a=!(!r||!r.stroke),o="outerBorder"===s?-1:1,{distance:l=h[s].distance}=r,c=T?l:xn(e,l,e.dpr),d=i+o*c,p=n+o*c,f=2*c;if(0===v||at(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(d,p,C-o*f,_-o*f)):(e.beginPath(),ol(e,d,p,C-o*f,_-o*f,v)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,r,h[s]);else if(a){const a=h[s].opacity;h[s].opacity=m,e.setStrokeStyle(t,r,(y-i)/x,(b-n)/w,h[s]),h[s].opacity=a,e.stroke()}};f&&B(d,"outerBorder"),g&&B(p,"innerBorder")}}t.SplitRectBeforeRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){const{stroke:p=h.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}},t.SplitRectBeforeRenderContribution=hl([g()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{x1:d,y1:p,x:f=h.x,y:g=h.y,stroke:v=h.stroke,cornerRadius:m=h.cornerRadius}=t.attribute;let{width:y,height:b}=t.attribute;if(y=(null!=y?y:d-f)||0,b=(null!=b?b:p-g)||0,Array.isArray(v)&&v.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,h),!(0===m||at(m)&&m.every((t=>0===t)))){let r,s=0;return ol(e,i,n,y,b,m,new Array(4).fill(0).map(((a,o)=>(a,l,c,u)=>{v[o]&&(s===o-1&&v[o]===r||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:v[o]}),i,n,h),e.beginPath(),e.moveTo(a,l),r=v[o]),s=o,e.lineTo(c,u),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,n),v[0]?e.lineTo(i+y,n):e.moveTo(i+y,n),v[1]?e.lineTo(i+y,n+b):e.moveTo(i+y,n+b),v[2]?e.lineTo(i,n+b):e.moveTo(i,n+b),v[3]){const t=v[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}},t.SplitRectAfterRenderContribution=hl([g()],t.SplitRectAfterRenderContribution);const cl=new ll,ul=qh,dl=Xh;class pl extends ll{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){return super.drawShape(t,e,i,n,r,s,a,o,h,l,c,u)}}const fl=new pl,gl=Xh;class vl{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:f}=t.attribute,g=p&&!1!==p.visible,v=f&&!1!==f.visible;if(!g&&!v)return;const{size:m=h.size,opacity:y=h.opacity,x:b=h.x,y:x=h.y,scaleX:w=h.scaleX,scaleY:S=h.scaleY,keepStrokeScale:A=h.keepStrokeScale}=t.attribute,T=(r,s)=>{const a=!(!r||!r.stroke),{distance:o=h[s].distance}=r,l=A?o:xn(e,o,e.dpr),c="outerBorder"===s?1:-1;if(e.beginPath(),!1===d.drawOffset(e,m,i,n,c*l)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,r,h[s]);else if(a){const a=h[s].opacity;h[s].opacity=y,e.setStrokeStyle(t,r,(b-i)/w,(x-n)/S,h[s]),h[s].opacity=a,e.stroke()}};g&&T(p,"outerBorder"),v&&T(f,"innerBorder")}}const ml=new vl,yl=qh,bl=Xh;class xl extends $h{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){var p,f,g,v;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:m=t.attribute}=d||{},{texture:y=(null!==(p=t.attribute.texture)&&void 0!==p?p:Ss(h,"texture")),textureColor:b=(null!==(f=t.attribute.textureColor)&&void 0!==f?f:Ss(h,"textureColor")),textureSize:x=(null!==(g=t.attribute.textureSize)&&void 0!==g?g:Ss(h,"textureSize")),texturePadding:w=(null!==(v=t.attribute.texturePadding)&&void 0!==v?v:Ss(h,"texturePadding"))}=m;y&&this.drawTexture(y,t,e,i,n,h,b,x,w)}}var wl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Sl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Al=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasArcRender=class extends Fh{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=ro,this.builtinContributions=[Zh,Qh,Jh],this.init(t)}drawArcTailCapPath(t,e,i,n,r,s,a,o){const h=o-a,l=t.getParsedAngle(),c=l.startAngle;let u=l.endAngle;u=o;const d=u>c;let p=!1;if(r<s){const t=r;r=s,s=t}const{outerDeltaAngle:f,xors:g,yors:v,xirs:m,yirs:y,limitedOcr:b,outerCornerRadiusStart:x,outerCornerRadiusEnd:w,maxOuterCornerRadius:S,xore:A,yore:T,xire:C,yire:_,limitedIcr:B,innerDeltaAngle:P,innerStartAngle:R,innerCornerRadiusStart:M,innerCornerRadiusEnd:E,maxInnerCornerRadius:k}=Ko(t,c,u,s,r);if(b>_t){const t=Lt(x,b),s=Lt(w,b),a=qo(m,y,g,v,r,t,Number(d)),o=qo(A,T,C,_,r,s,Number(d));if(b<S&&t===s)e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),e.arc(i+a.cx,n+a.cy,b,kt(a.y01,a.x01),kt(o.y01,o.x01),!d);else{const t=u-h-.03,a=kt(o.y11,o.x11);e.arc(i,n,r,t,a,!d),s>0&&e.arc(i+o.cx,n+o.cy,s,kt(o.y11,o.x11),kt(o.y01,o.x01),!d)}}else e.moveTo(i+g,n+v);if(!(s>_t)||P<.001)e.lineTo(i+C,n+_),p=!0;else if(B>_t){const t=Lt(M,B),r=Lt(E,B),a=qo(C,_,A,T,s,-r,Number(d)),o=qo(g,v,m,y,s,-t,Number(d));if(e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01),B<k&&t===r){const t=kt(o.y01,o.x01);e.arc(i+a.cx,n+a.cy,B,kt(a.y01,a.x01),t,!d)}else{r>0&&e.arc(i+a.cx,n+a.cy,r,kt(a.y01,a.x01),kt(a.y11,a.x11),!d);const t=kt(a.cy+a.y11,a.cx+a.x11),o=u-h-.03;e.arc(i,n,s,t,o,d)}}else e.lineTo(i+s*Ot(R),n+s*Dt(R));return p}drawShape(t,e,i,n,r,s,a,o){const h=Or(t,null==s?void 0:s.theme).arc,{fill:l=h.fill,stroke:c=h.stroke,x:u=h.x,y:d=h.y,fillStrokeOrder:p=h.fillStrokeOrder}=t.attribute,f=this.valid(t,h,a,o);if(!f)return;const{fVisible:g,sVisible:v,doFill:m,doStroke:y}=f,{outerPadding:b=h.outerPadding,innerPadding:x=h.innerPadding,cap:w=h.cap,forceShowCap:S=h.forceShowCap}=t.attribute;let{outerRadius:A=h.outerRadius,innerRadius:T=h.innerRadius}=t.attribute;A+=b,T-=x;let C=0;const _=(K(w)&&w||w[0])&&"conical"===l.gradient;if(_){const{sc:e,startAngle:i,endAngle:n}=t.getParsedAngle();Et(n-i)<Mt-_t&&(C=e||0,l.startAngle-=C,l.endAngle-=C)}let B=!1;const{isFullStroke:P,stroke:R}=us(c);if(m||P){e.beginPath(),Zo(t,e,i,n,A,T),B=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,m,y,g,v,h,r,a,o);const s=()=>{m&&(a?a(e,t.attribute,h):g&&(e.setCommonStyle(t,t.attribute,u-i,d-n,h),e.fill()))},l=()=>{y&&P&&(o?o(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,h),e.stroke()))};p?(l(),s()):(s(),l())}if(!P&&y&&(e.beginPath(),Zo(t,e,i,n,A,T,R),B||this.beforeRenderStep(t,e,i,n,m,y,g,v,h,r,a,o),o?o(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),(K(w)&&w||w[1])&&S){const{startAngle:s,endAngle:l}=t.getParsedAngle();if(Et(l-s)>=Mt-_t){e.beginPath();const s=Math.abs(A-T)/2/A,{endAngle:l=h.endAngle,fill:c=h.fill}=t.attribute,u=l;this.drawArcTailCapPath(t,e,i,n,A,T,u,u+s),B||this.beforeRenderStep(t,e,i,n,m,y,g,v,h,r,a,o);const d=()=>{y&&(o||v&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke()))};(()=>{if(m){const r=c;if("conical"===r.gradient){const s=eh(0,0,l,r);a||zo&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=s,e.fill())}}})(),d()}}this.afterRenderStep(t,e,i,n,m,y,g,v,h,r,a,o),_&&(l.startAngle+=C,l.endAngle+=C)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}},t.DefaultCanvasArcRender=wl([g(),Al(0,p(k)),Al(0,v(nh)),Sl("design:paramtypes",[Object])],t.DefaultCanvasArcRender);var Tl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Cl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_l=function(t,e){return function(i,n){e(i,n,t)}};function Bl(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,s+e.p1.y,r+e.p2.x,s+e.p2.y,r+e.p3.x,s+e.p3.y,a):t.lineTo(r+e.p1.x,s+e.p1.y,a);else if(e.p2&&e.p3){const[n]=ri(e,i);t.bezierCurveTo(r+n.p1.x,s+n.p1.y,r+n.p2.x,s+n.p2.y,r+n.p3.x,s+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,a)}}function Pl(t,e,i,n,r,s,a){var o;let h=e.p0,l=n;if(i&&i.originP1===i.originP2&&(h=i.p0),e.defined)n||(t.lineTo(h.x+r,h.y+s,a),l=!n);else{const{originP1:c,originP2:u}=e;let d;if(c&&!1!==c.defined&&!i?d=h:c&&!1!==u.defined&&(d=null!==(o=e.p3)&&void 0!==o?o:e.p1),n){l=!n;const i=d?d.x:e.p0.x,o=d?d.y:e.p0.y;t.moveTo(i+r,o+s,a)}else d&&(l=!n,t.lineTo(d.x+r,d.y+s,a))}return l}function Rl(e,i,n,r,s){const{offsetX:a=0,offsetY:o=0,offsetZ:h=0,mode:l="none",drawConnect:c=!1}=s||{};if(c&&"none"===l)return;if(!i)return;let u=!0;const{curves:d}=i;if(n>=1){if(c){let t,i=!0;d.forEach(((n,r)=>{n.originP1!==n.originP2?(i=Pl(e,n,t,i,a,o,h),t=n):t=n}))}else d.forEach((t=>{t.defined?(u&&e.moveTo(t.p0.x+a,t.p0.y+o,h),Bl(e,t,1,s),u=!1):u=!0}));return}if(n<=0)return;let p;"x"===r?p=t.Direction.ROW:"y"===r?p=t.Direction.COLUMN:"auto"===r&&(p=i.direction);const f=n*i.tryUpdateLength(p);let g=0,v=!0,m=null;for(let t=0,i=d.length;t<i;t++){const i=d[t],n=i.getLength(p),r=(f-g)/n;if(g+=n,r<0)break;if(c){if(i.originP1===i.originP2){m=i;continue}v=Pl(e,i,m,v,a,o,h),m=i}else{if(!i.defined){u=!0;continue}u&&e.moveTo(i.p0.x+a,i.p0.y+o,h),Bl(e,i,Lt(r,1),s),u=!1}}}function Ml(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+r,a.y+s),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}))}function El(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},{points:a}=i,o=[];for(let t=0;t<a.length;t++)a[t].defined;o.push(a),o.forEach(((i,n)=>{var a,o,h,l;const c=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(c.x+r,c.y+s),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}));for(let e=i.length-1;e>=0;e--){const n=i[e];t.lineTo(null!==(a=n.x1)&&void 0!==a?a:n.x,null!==(o=n.y1)&&void 0!==o?o:n.y)}t.lineTo(null!==(h=c.x1)&&void 0!==h?h:c.x,null!==(l=c.y1)&&void 0!==l?l:c.y),t.closePath()}))}t.DefaultCanvasCircleRender=class extends Fh{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=oo,this.builtinContributions=[el,nl,il],this.init(t)}drawShape(t,e,i,n,r,s,a,o){const h=Or(t,null==s?void 0:s.theme).circle,{radius:l=h.radius,startAngle:c=h.startAngle,endAngle:u=h.endAngle,x:d=h.x,y:p=h.y,fillStrokeOrder:f=h.fillStrokeOrder}=t.attribute,g=this.valid(t,h,a,o);if(!g)return;const{fVisible:v,sVisible:m,doFill:y,doStroke:b}=g;e.beginPath(),e.arc(i,n,l,c,u),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,y,b,v,m,h,r,a,o);const x=()=>{y&&(a?a(e,t.attribute,h):v&&(e.setCommonStyle(t,t.attribute,d-i,p-n,h),e.fill()))},w=()=>{b&&(o?o(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,d-i,p-n,h),e.stroke()))};f?(w(),x()):(x(),w()),this.afterRenderStep(t,e,i,n,y,b,v,m,h,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).circle;this._draw(t,r,!1,i,n)}},t.DefaultCanvasCircleRender=Tl([g(),_l(0,p(k)),_l(0,v(sh)),Cl("design:paramtypes",[Object])],t.DefaultCanvasCircleRender);var kl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};function Ol(e,i,n,r){var s;const{top:a,bottom:o}=i;if(a.curves.length!==o.curves.length)return;if(n>=1){const t=[],i=[];let n=!0;for(let s=0,h=a.curves.length;s<h;s++){const l=a.curves[s];n!==l.defined?(n?(Il(e,t,i,r),t.length=0,i.length=0):(t.push(l),i.push(o.curves[h-s-1])),n=!n):n&&(t.push(l),i.push(o.curves[h-s-1]))}return void Il(e,t,i,r)}if(n<=0)return;let{direction:h}=r||{};const{curves:l}=a,c=null!==(s=l[l.length-1].p3)&&void 0!==s?s:l[l.length-1].p1,u=Et(c.x-l[0].p0.x),d=Et(c.y-l[0].p0.y);h=null!=h?h:u>d?t.Direction.ROW:t.Direction.COLUMN,Number.isFinite(u)||(h=t.Direction.COLUMN),Number.isFinite(d)||(h=t.Direction.ROW);const p=n*(h===t.Direction.ROW?u:d);let f=0,g=!0;const v=[],m=[];for(let t=0,i=a.curves.length;t<i;t++){const n=a.curves[t],s=n.getLength(h),l=(p-f)/s;if(l<0)break;f+=s;let c=null,u=null;g!==n.defined?(g?(Il(e,v,m,r),v.length=0,m.length=0):(c=n,u=o.curves[i-t-1]),g=!g):g&&(c=n,u=o.curves[i-t-1]),c&&u&&(l<1&&(c=c.p2&&c.p3?ri(c,l)[0]:ai(c,l)[0],u=u.p2&&u.p3?ri(u,1-l)[1]:ai(u,1-l)[1]),c.defined=g,u.defined=g,v.push(c),m.push(u)),c=null,u=null}Il(e,v,m,r)}function Il(t,e,i,n){const{offsetX:r=0,offsetY:s=0,offsetZ:a=0}=n||{};let o=!0;e.forEach((e=>{e.defined?(o&&t.moveTo(e.p0.x+r,e.p0.y+s,a),Bl(t,e,1,n),o=!1):o=!0})),o=!0;for(let e=i.length-1;e>=0;e--){const h=i[e];h.defined?(o&&t.lineTo(h.p0.x+r,h.p0.y+s,a),Bl(t,h,1,n),o=!1):o=!0}t.closePath()}t.DefaultCanvasLineRender=class extends Fh{constructor(){super(...arguments),this.numberType=uo}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).line;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f){var g;if(!e)return;t.beginPath();const v=null!==(g=this.z)&&void 0!==g?g:0;Rl(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:v}),d.cache&&!at(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,a,o);const{x:m=0,x:y=0}=a;return!1!==i&&(p?p(t,a,o):r&&(t.setCommonStyle(d,a,m-c,y-u,o),t.fill())),!1!==n&&(f?f(t,a,o):s&&(t.setStrokeStyle(d,a,m-c,y-u,o),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,n,r,s,a,o,h,l,c,u,d){var p;e.beginPath();const f=null!==(p=this.z)&&void 0!==p?p:0,{points:g}=t.attribute,v=g[0];e.moveTo(v.x+a,v.y+o,f);for(let t=1;t<g.length;t++){const i=g[t];e.lineTo(i.x+a,i.y+o,f)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h);const{x:m=0,x:y=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,h):r&&(e.setCommonStyle(t,t.attribute,m-a,y-o,h),e.fill())),!1!==n&&(d?d(e,t.attribute,h):s&&(e.setStrokeStyle(t,t.attribute,m-a,y-o,h),e.stroke()))}drawShape(t,e,i,n,r,s,a,o){const h=Or(t,null==s?void 0:s.theme).line,{fill:l=h.fill,stroke:c=h.stroke,fillOpacity:u=h.fillOpacity,strokeOpacity:d=h.strokeOpacity,segments:p,points:f,closePath:g,curveTension:v=h.curveTension,connectedType:m=h.connectedType}=t.attribute;if(!this.valid(t,h,a,o))return;let{curveType:y=h.curveType}=t.attribute;g&&"linear"===y&&(y="linearClosed");const{clipRange:b=h.clipRange,clipRangeByDimension:x=h.clipRangeByDimension}=t.attribute;if(1===b&&!p&&!f.some((t=>!1===t.defined))&&"linear"===y)return this.drawLinearLineHighPerformance(t,e,!!l,!!c,u,d,i,n,h,r,s,a,o);function w(t,e){return"none"===e?t:t.filter((t=>!1!==t.defined))}if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,n=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const r=Wi(w(t.points,m),y,{startPoint:e,curveTension:v});return n=r,r})).filter((t=>!!t)),"linearClosed"===y){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Wi(w(n,m),y,{curveTension:v})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===b){let s=!1;t.cache.forEach(((p,f)=>{s||(s=this.drawSegmentItem(e,p,!!l,!!c,u,d,r[f],[h,t.attribute],b,x,i,n,t,a,o))}))}else{const s=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=b*s;let f=0,g=!1;t.cache.forEach(((s,v)=>{if(g)return;const m=s.getLength(),y=(p-f)/m;f+=m,y>0&&(g=this.drawSegmentItem(e,s,!!l,!!c,u,d,r[v],[h,t.attribute],Lt(y,1),x,i,n,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!l,!!c,u,d,t.attribute,h,b,x,i,n,t,a,o)}},t.DefaultCanvasLineRender=kl([g()],t.DefaultCanvasLineRender);const Ll=new xl,Dl=Xh;var jl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Ul=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wl=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasAreaRender=class extends Fh{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=ao,this.builtinContributions=[Ll,Dl],this.init(t)}drawLinearAreaHighPerformance(t,e,i,n,r,s,a,o,h,l,c,u,d){var p,f,g;const{points:v}=t.attribute;if(v.length<2)return;e.beginPath();const m=null!==(p=this.z)&&void 0!==p?p:0,y=v[0];e.moveTo(y.x+a,y.y+o,m);for(let t=1;t<v.length;t++){const i=v[t];e.lineTo(i.x+a,i.y+o,m)}for(let t=v.length-1;t>=0;t--){const i=v[t];e.lineTo((null!==(f=i.x1)&&void 0!==f?f:i.x)+a,(null!==(g=i.y1)&&void 0!==g?g:i.y)+o,m)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,a,o,!!r,!1,i,!1,h,l,u,null,{attribute:t.attribute});const{x:b=0,x:x=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,h):r&&(e.setCommonStyle(t,t.attribute,b-a,x-o,h),e.fill())),this.afterRenderStep(t,e,a,o,!!r,!1,i,!1,h,l,u,null,{attribute:t.attribute}),(()=>{var i,r;if(n){const{stroke:n=h&&h.stroke}=t.attribute;if(at(n)&&(n[0]||n[2])&&!1===n[1])if(e.beginPath(),n[0]){e.moveTo(y.x+a,y.y+o,m);for(let t=1;t<v.length;t++){const i=v[t];e.lineTo(i.x+a,i.y+o,m)}}else if(n[2]){const t=v[v.length-1];e.moveTo(t.x+a,t.y+o,m);for(let t=v.length-2;t>=0;t--){const n=v[t];e.lineTo((null!==(i=n.x1)&&void 0!==i?i:n.x)+a,(null!==(r=n.y1)&&void 0!==r?r:n.y)+o,m)}}d?d(e,t.attribute,h):(e.setStrokeStyle(t,t.attribute,b-a,x-o,h),e.stroke())}})()}drawShape(t,e,i,n,r,s,a,o){var h,l,c,u,d,p;const f=Or(t,null==s?void 0:s.theme).area,{fill:g=f.fill,stroke:v=f.stroke,fillOpacity:m=f.fillOpacity,z:y=f.z,strokeOpacity:b=f.strokeOpacity,curveTension:x=f.curveTension,connectedType:w=f.connectedType}=t.attribute,S=this.valid(t,f,a,o);if(!S)return;const{doFill:A}=S,T=S.doStroke&&S.sVisible,{clipRange:C=f.clipRange,closePath:_,points:B,segments:P}=t.attribute;let{curveType:R=f.curveType}=t.attribute;function M(t,e){return"connect"!==e?t:t.filter((t=>!1!==t.defined))}if(_&&"linear"===R&&(R="linearClosed"),1===C&&!P&&!B.some((t=>!1===t.defined))&&"linear"===R)return this.drawLinearAreaHighPerformance(t,e,!!g,T,m,b,i,n,f,r,s,a,o);if(t.shouldUpdateShape()){if(P&&P.length){let e,i;const n=P.map(((t,n)=>{if(t.points.length<=1&&0===n)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===n?e={x:i.endX,y:i.endY}:n>1&&(e.x=i.endX,e.y=i.endY);const r=Wi(M(t.points,w),R,{startPoint:e,curveTension:x});return i=r,r})).filter((t=>!!t));let r;const s=[];for(let t=P.length-1;t>=0;t--){const e=P[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(h=e[t].x1)&&void 0!==h?h:e[t].x,y:null!==(l=e[t].y1)&&void 0!==l?l:e[t].y});if(0!==t){const e=P[t-1].points,n=e[e.length-1];n&&i.push({x:null!==(c=n.x1)&&void 0!==c?c:n.x,y:null!==(u=n.y1)&&void 0!==u?u:n.y})}i.length>1&&(r=Wi(M(i,w),"stepBefore"===R?"stepAfter":"stepAfter"===R?"stepBefore":R,{curveTension:x}),s.unshift(r))}t.cacheArea=s.map(((t,e)=>({top:n[e],bottom:t})))}else{if(!B||!B.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=M(B,w),i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(d=e[t].x1)&&void 0!==d?d:e[t].x,y:null!==(p=e[t].y1)&&void 0!==p?p:e[t].y});const n=Wi(e,R,{curveTension:x}),r=Wi(i,"stepBefore"===R?"stepAfter":"stepAfter"===R?"stepBefore":R,{curveTension:x});t.cacheArea={top:n,bottom:r}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===C){let h=!1;t.cacheArea.forEach(((l,c)=>{h||(h=this.drawSegmentItem(e,l,A,m,T,b,s[c],[f,t.attribute],C,i,n,y,t,r,a,o))}))}else{const h=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),l=C*h;let c=0,u=!1;t.cacheArea.forEach(((h,d)=>{if(u)return;const p=h.top.getLength(),g=(l-c)/p;c+=p,g>0&&(u=this.drawSegmentItem(e,h,A,m,T,b,s[d],[f,t.attribute],Lt(g,1),i,n,y,t,r,a,o))}))}}else this.drawSegmentItem(e,t.cacheArea,A,m,T,b,t.attribute,f,C,i,n,y,t,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).area;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f,g){return this._drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f,g)}_drawSegmentItem(e,i,n,r,s,a,o,h,l,c,u,d,p,f,g,v){if(!(i&&i.top&&i.bottom&&i.top.curves&&i.top.curves.length&&i.bottom.curves&&i.bottom.curves.length))return;e.beginPath();const{points:m,segments:y}=p.attribute;let b,x,w=t.Direction.ROW;if(y){const t=y[y.length-1];x=y[0].points[0],b=t.points[t.points.length-1]}else x=m[0],b=m[m.length-1];const S=Et(b.x-x.x),A=Et(b.y-x.y);w=null==b.x1?t.Direction.ROW:null==b.y1?t.Direction.COLUMN:Number.isFinite(S+A)?S>A?t.Direction.ROW:t.Direction.COLUMN:t.Direction.ROW,Ol(e.camera?e:e.nativeContext,i,l,{offsetX:c,offsetY:u,offsetZ:d,direction:w}),this.beforeRenderStep(p,e,c,u,!!r,!1,n,!1,h,f,g,null,{attribute:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(p,o,h);const{x:T=0,x:C=0}=o;return!1!==n&&(g?g(e,o,h):r&&(e.setCommonStyle(p,o,T-c,C-u,h),e.fill())),this.afterRenderStep(p,e,c,u,!!r,!1,n,!1,h,f,g,null,{attribute:o}),(()=>{if(!1!==s)if(v)v(e,o,h);else{const{stroke:n=h&&h[1]&&h[1].stroke}=o;at(n)&&(n[0]||n[2])&&!1===n[1]&&(e.beginPath(),Rl(e.camera?e:e.nativeContext,n[0]?i.top:i.bottom,l,w===t.Direction.ROW?"x":"y",{offsetX:c,offsetY:u,offsetZ:d})),e.setStrokeStyle(p,o,T-c,C-u,h),e.stroke()}})(),!1}},t.DefaultCanvasAreaRender=jl([g(),Wl(0,p(k)),Wl(0,v(rh)),Ul("design:paramtypes",[Object])],t.DefaultCanvasAreaRender);const Nl=qh,Gl=Xh;var Fl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},zl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hl=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasPathRender=class extends Fh{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=po,this.builtinContributions=[Gl,Nl],this.init(t)}drawShape(t,e,i,n,r,s,a,o){var h,l,c;const u=null!==(h=this.tempTheme)&&void 0!==h?h:Or(t,null==s?void 0:s.theme).path,{x:d=u.x,y:p=u.y,fillStrokeOrder:f=u.fillStrokeOrder}=t.attribute,g=null!==(l=this.z)&&void 0!==l?l:0,v=this.valid(t,u,a,o);if(!v)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:x}=v;if(e.beginPath(),t.pathShape)Je(t.pathShape.commandList,e,i,n,1,1,g);else{Je((null!==(c=t.attribute.path)&&void 0!==c?c:u.path).commandList,e,i,n,1,1,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,b,x,m,y,u,r,a,o);const w=()=>{x&&(o?o(e,t.attribute,u):y&&(e.setStrokeStyle(t,t.attribute,d-i,p-n,u),e.stroke()))},S=()=>{b&&(a?a(e,t.attribute,u):m&&(e.setCommonStyle(t,t.attribute,d-i,p-n,u),e.fill()))};f?(w(),S()):(S(),w()),this.afterRenderStep(t,e,i,n,b,x,m,y,u,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).path;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}},t.DefaultCanvasPathRender=Fl([g(),Hl(0,p(k)),Hl(0,v(hh)),zl("design:paramtypes",[Object])],t.DefaultCanvasPathRender);var Vl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Yl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xl=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasRectRender=class extends Fh{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=vo,this.builtinContributions=[cl,dl,ul],this.init(t)}drawShape(t,e,i,n,r,s,a,o){var h;const l=null!==(h=this.tempTheme)&&void 0!==h?h:Or(t,null==s?void 0:s.theme).rect,{fill:c=l.fill,background:u,stroke:d=l.stroke,cornerRadius:p=l.cornerRadius,opacity:f=l.opacity,fillOpacity:g=l.fillOpacity,lineWidth:v=l.lineWidth,strokeOpacity:m=l.strokeOpacity,visible:y=l.visible,x1:b,y1:x,x:w=l.x,y:S=l.y,fillStrokeOrder:A=l.fillStrokeOrder}=t.attribute;let{width:T,height:C}=t.attribute;T=(null!=T?T:b-w)||0,C=(null!=C?C:x-S)||0;const _=Ho(f,g,T,C,c),B=Yo(f,m,T,C),P=Go(c,u),R=Fo(d,v);if(!t.valid||!y)return;if(!P&&!R)return;if(!(_||B||a||o||u))return;0===p||at(p)&&p.every((t=>0===t))?(e.beginPath(),e.rect(i,n,T,C)):(e.beginPath(),ol(e,i,n,T,C,p));const M={doFill:P,doStroke:R};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,P,R,_,B,l,r,a,o,M);const E=()=>{M.doFill&&(a?a(e,t.attribute,l):_&&(e.setCommonStyle(t,t.attribute,w-i,S-n,l),e.fill()))},k=()=>{M.doStroke&&(o?o(e,t.attribute,l):B&&(e.setStrokeStyle(t,t.attribute,w-i,S-n,l),e.stroke()))};A?(k(),E()):(E(),k()),this.afterRenderStep(t,e,i,n,P,R,_,B,l,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).rect;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}},t.DefaultCanvasRectRender=Vl([g(),Xl(0,p(k)),Xl(0,v(ch)),Yl("design:paramtypes",[Object])],t.DefaultCanvasRectRender);var $l=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},ql=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kl=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasSymbolRender=class extends Fh{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=bo,this.builtinContributions=[ml,bl,yl],this.init(t)}drawShape(t,e,i,n,r,s,a,o){var h;const l=Or(t,null==s?void 0:s.theme).symbol,{size:c=l.size,x:u=l.x,y:d=l.y,scaleX:p=l.scaleX,scaleY:f=l.scaleY,fillStrokeOrder:g=l.fillStrokeOrder}=t.attribute,v=this.valid(t,l,a,o);if(!v)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:x}=v,w=t.getParsedPath();if(!w)return;const{keepDirIn3d:S=l.keepDirIn3d}=t.attribute,A=null!==(h=this.z)&&void 0!==h?h:0;e.beginPath();const T=(r,s)=>{var h,c,v;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(h=s.fill)&&void 0!==h?h:t.attribute.fill,e.opacity=null!==(c=s.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(v=s.stroke)&&void 0!==v?v:t.attribute.stroke,s=e}const m=()=>{s.fill&&(a?a(e,t.attribute,l):(e.setCommonStyle(t,s,u-i,d-n,l),e.fill()))},y=()=>{s.stroke&&(o?o(e,t.attribute,l):(e.setStrokeStyle(t,s,(u-i)/p,(d-n)/f,l),e.stroke()))};g?(y(),m()):(m(),y())};if(S&&e.camera&&e.project){const t=e.project(i,n,A),r=e.camera;e.camera=null,!1===w.draw(e,at(c)?[c[0]*p,c[1]*f]:c*p,t.x,t.y,void 0,T)&&e.closePath(),e.camera=r}else!1===w.draw(e,c,i,n,A,T)&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,b,x,m,y,l,r,a,o);const C=()=>{b&&!w.isSvg&&(a?a(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,u-i,d-n,l),e.fill()))},_=()=>{x&&!w.isSvg&&(o?o(e,t.attribute,l):y&&(e.setStrokeStyle(t,t.attribute,(u-i)/p,(d-n)/f,l),e.stroke()))};g?(_(),C()):(C(),_()),this.afterRenderStep(t,e,i,n,b,x,m,y,l,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).symbol;this._draw(t,r,!1,i,n)}},t.DefaultCanvasSymbolRender=$l([g(),Kl(0,p(k)),Kl(0,v(uh)),ql("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender);const Zl=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new le)}allocate(t,e,i,n){if(!this.pools.length)return(new le).setValue(t,e,i,n);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=i,r.y2=n,r}allocateByObj(t){if(!this.pools.length)return new le(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}};const Jl=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let Ql,tc;function ec(t){return Ql||(Ql=Jl.CreateGraphic("text",{})),Ql.initAttributes(t),Ql.AABBBounds}const ic=new class extends Yh{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){var d,p,f,g,v,m,y,b,x,w;const{backgroundMode:S=h.backgroundMode,backgroundFit:A=h.backgroundFit}=t.attribute;let T,{background:C}=t.attribute;if(!C)return;const _=()=>{"richtext"===t.type&&(e.restore(),e.save(),T&&e.setTransformFromMatrix(T,!0,1))};let B;"richtext"===t.type&&(T=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const P=et(C)&&C.background,R=t.transMatrix.onlyTranslate();if(P){const e=t.AABBBounds,i=(null!==(d=C.x)&&void 0!==d?d:e.x1)+(null!==(p=C.dx)&&void 0!==p?p:0),n=(null!==(f=C.y)&&void 0!==f?f:e.y1)+(null!==(g=C.dy)&&void 0!==g?g:0),r=null!==(v=C.width)&&void 0!==v?v:e.width(),s=null!==(m=C.height)&&void 0!==m?m:e.height();if(B=Zl.allocate(i,n,i+r,n+s),C=C.background,!R){const t=B.width(),e=B.height();B.set((null!==(y=C.x)&&void 0!==y?y:0)+(null!==(b=C.dx)&&void 0!==b?b:0),(null!==(x=C.y)&&void 0!==x?x:0)+(null!==(w=C.dy)&&void 0!==w?w:0),t,e)}}else B=t.AABBBounds,R||(B=ec(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const r=t.resources.get(C);if("success"!==r.state||!r.data)return void _();e.highPerformanceSave(),R&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,n,h),this.doDrawImage(e,r.data,B,S,A),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:r}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=C,r?(ol(e,B.x1,B.y1,B.width(),B.height(),r),e.fill()):e.fillRect(B.x1,B.y1,B.width(),B.height()),e.highPerformanceRestore()}P&&Zl.free(B),_()}};var nc=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},rc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sc=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasTextRender=class extends Fh{constructor(t){super(),this.textRenderContribitions=t,this.numberType=xo,this.builtinContributions=[ic],this.init(t)}drawShape(t,e,i,n,r,s,a,o){var h,l,c;const u=Or(t,null==s?void 0:s.theme).text,{text:d,underline:p=u.underline,lineThrough:f=u.lineThrough,keepDirIn3d:g=u.keepDirIn3d,direction:v=u.direction,fontSize:m=u.fontSize,verticalMode:y=u.verticalMode,x:b=u.x,y:x=u.y}=t.attribute,w=null!==(h=_s(t.attribute.lineHeight,m))&&void 0!==h?h:m,S=this.valid(t,u,a,o);if(!S)return;const{fVisible:A,sVisible:T,doFill:C,doStroke:_}=S,B=!g,P=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,C,_,A,T,u,r,a,o),B&&this.transformUseContext2d(t,u,P,e);const R=(r,s,h,l)=>{let c=i+s;const d=n+h;if(l){e.highPerformanceSave(),c+=m;const t=Ih.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,d),e.transformFromMatrix(t,!0),Ih.free(t)}_&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,b-i,x-n,u),e.strokeText(r,c,d,P))),C&&(a?a(e,t.attribute,u):A&&(e.setCommonStyle(t,t.attribute,b-i,x-n,u),e.fillText(r,c,d,P))),l&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,u,P),"horizontal"===v){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:h}=r.bbox;_&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,b-i,x-n,u),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+i,(t.topOffset||0)+h+n,P)})))),C&&(a?a(e,t.attribute,u):A&&(e.setCommonStyle(t,t.attribute,b-i,x-n,u),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+i,(r.topOffset||0)+h+n,P),this.drawUnderLine(p,f,t,(r.leftOffset||0)+s+i,(r.topOffset||0)+h+n,r.descent,(r.descent-r.ascent)/2,P,u,e,{width:r.width})}))))}else{let{textAlign:i=u.textAlign,textBaseline:n=u.textBaseline}=t.attribute;if(!y){const e=i;i=null!==(l=t.getBaselineMapAlign()[n])&&void 0!==l?l:"left",n=null!==(c=t.getAlignMapBaseline()[e])&&void 0!==c?c:"top"}t.tryUpdateAABBBounds();const r=t.cache,{verticalList:s}=r;e.textAlign="left",e.textBaseline="top";const a=w*s.length;let o=0;s.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);o=It(e,o)}));let h=0,d=0;"bottom"===n?d=-a:"middle"===n&&(d=-a/2),"center"===i?h-=o/2:"right"===i&&(h-=o),s.forEach(((t,e)=>{const n=t.reduce(((t,e)=>t+(e.width||0)),0),r=o-n;let s=h;"center"===i?s+=r/2:"right"===i&&(s+=r),t.forEach((t=>{const{text:i,width:n,direction:r}=t;R(i,a-(e+1)*w+d,s,r),s+=n}))}))}B&&this.restoreTransformUseContext2d(t,u,P,e),this.afterRenderStep(t,e,i,n,C,_,A,T,u,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).text,{keepDirIn3d:s=r.keepDirIn3d}=t.attribute,a=!s;this._draw(t,r,a,i,n)}drawUnderLine(t,e,i,n,r,s,a,o,h,l,c){if(e+t<=0)return;const{textAlign:u=h.textAlign,fill:d=h.fill,opacity:p=h.opacity,underlineOffset:f=h.underlineOffset,underlineDash:g=h.underlineDash,fillOpacity:v=h.fillOpacity}=i.attribute,m=!J(c),y=m?c.width:i.clipedWidth,b=m?0:gh(u,y),x={lineWidth:0,stroke:d,opacity:p,strokeOpacity:v};if(t){x.lineWidth=t,l.setStrokeStyle(i,x,n,r,h),g&&l.setLineDash(g),l.beginPath();const e=r+s+f;l.moveTo(n+b,e,o),l.lineTo(n+b+y,e,o),l.stroke()}if(e){x.lineWidth=e,l.setStrokeStyle(i,x,n,r,h),l.beginPath();const t=r+a;l.moveTo(n+b,t,o),l.lineTo(n+b+y,t,o),l.stroke()}}},t.DefaultCanvasTextRender=nc([g(),sc(0,p(k)),sc(0,v(dh)),rc("design:paramtypes",[Object])],t.DefaultCanvasTextRender);var ac=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};function oc(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(let r=1;r<e.length;r++)t.lineTo(e[r].x+i,e[r].y+n)}function hc(t,e){return Math.sqrt(t*t+e*e)}function lc(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.AbstractGraphicRender=class{},t.AbstractGraphicRender=ac([g()],t.AbstractGraphicRender);const cc=qh,uc=Xh;var dc=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},pc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fc=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasPolygonRender=class extends Fh{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=fo,this.builtinContributions=[uc,cc],this.init(t)}drawShape(t,e,i,n,r,s,a,o){const h=Or(t,null==s?void 0:s.theme).polygon,{points:l=h.points,cornerRadius:c=h.cornerRadius,x:u=h.x,y:d=h.y,closePath:p=h.closePath,fillStrokeOrder:f=h.fillStrokeOrder}=t.attribute,g=this.valid(t,h,a,o);if(!g)return;const{fVisible:v,sVisible:m,doFill:y,doStroke:b}=g;e.beginPath(),c<=0||at(c)&&c.every((t=>0===t))?oc(e.camera?e:e.nativeContext,l,i,n):function(t,e,i,n,r){let s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var a;if(e.length<3)return void oc(t,e,i,n);let o=0,h=e.length-1;s||(o+=1,h-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let s=o;s<=h;s++){const o=e[0===s?h:(s-1)%e.length],l=e[s%e.length],c=e[(s+1)%e.length],u=l.x-o.x,d=l.y-o.y,p=l.x-c.x,f=l.y-c.y,g=(Math.atan2(d,u)-Math.atan2(f,p))/2,v=Math.abs(Math.tan(g));let m=Array.isArray(r)?null!==(a=r[s%e.length])&&void 0!==a?a:0:r,y=m/v;const b=hc(u,d),x=hc(p,f),w=Math.min(b,x);y>w&&(y=w,m=w*v);const S=lc(l,y,b,u,d),A=lc(l,y,x,p,f),T=2*l.x-S.x-A.x,C=2*l.y-S.y-A.y,_=hc(T,C),B=lc(l,hc(y,m),_,T,C);let P=Math.atan2(S.y-B.y,S.x-B.x);const R=Math.atan2(A.y-B.y,A.x-B.x);let M=R-P;M<0&&(P=R,M=-M),M>Math.PI&&(M-=Math.PI),0===s?t.moveTo(S.x+i,S.y+n):t.lineTo(S.x+i,S.y+n),M&&t.arcTo(l.x+i,l.y+n,A.x+i,A.y+n,m),t.lineTo(A.x+i,A.y+n)}s||t.lineTo(e[h+1].x+i,e[h+1].y+n)}(e.camera?e:e.nativeContext,l,i,n,c,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,y,b,v,m,h,r,a,o);const x=()=>{y&&(a?a(e,t.attribute,h):v&&(e.setCommonStyle(t,t.attribute,u-i,d-n,h),e.fill()))},w=()=>{b&&(o?o(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,h),e.stroke()))};f?(w(),x()):(x(),w()),this.afterRenderStep(t,e,i,n,y,b,v,m,h,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).polygon;this._draw(t,r,!1,i,n)}},t.DefaultCanvasPolygonRender=dc([g(),fc(0,p(k)),fc(0,v(lh)),pc("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);var gc=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},vc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mc=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasGroupRender=class{constructor(t){this.groupRenderContribitions=t,this.numberType=lo}drawShape(e,i,n,r,s,a,o,h){const l=Or(e,null==a?void 0:a.theme).group,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,width:f=l.width,height:g=l.height,clip:v=l.clip,fillOpacity:m=l.fillOpacity,strokeOpacity:y=l.strokeOpacity,cornerRadius:b=l.cornerRadius,path:x=l.path,lineWidth:w=l.lineWidth,visible:S=l.visible,fillStrokeOrder:A=l.fillStrokeOrder,x:T=l.x,y:C=l.y}=e.attribute,_=Ho(p,m,f,g,c),B=Yo(p,y,f,g),P=Go(c,u),R=Fo(d,w);if(!e.valid||!S)return;if(!v){if(!P&&!R)return;if(!(_||B||o||h||u))return}if(x&&x.length&&s.drawContribution){const t=i.disableFill,e=i.disableStroke,n=i.disableBeginPath;i.disableFill=!0,i.disableStroke=!0,i.disableBeginPath=!0,x.forEach((t=>{s.drawContribution.getRenderContribution(t).draw(t,s.renderService,s,a)})),i.disableFill=t,i.disableStroke=e,i.disableBeginPath=n}else 0===b||at(b)&&b.every((t=>0===t))?(i.beginPath(),i.rect(n,r,f,g)):(i.beginPath(),ol(i,n,r,f,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(sl));const M={doFill:P,doStroke:R};this._groupRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,P,R,_,B,l,s,o,h,M)})),v&&i.clip(),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,l);const E=()=>{M.doFill&&(o?o(i,e.attribute,l):_&&(i.setCommonStyle(e,e.attribute,T-n,C-r,l),i.fill()))},k=()=>{M.doStroke&&(h?h(i,e.attribute,l):B&&(i.setStrokeStyle(e,e.attribute,T-n,C-r,l),i.stroke()))};A?(k(),E()):(E(),k()),this._groupRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,P,R,_,B,l,s,o,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s,baseOpacity:a=1}=t.attribute;s?r.save():r.highPerformanceSave();const o=r.baseGlobalAlpha;r.baseGlobalAlpha*=a;const h=Or(t,null==n?void 0:n.theme).group,l=r.modelMatrix;if(r.camera){const e=Lh.allocate(),i=Lh.allocate();Wh(i,t,h),Ch(e,l||e,i),r.modelMatrix=e,Lh.free(i),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),n.skipDraw?this.drawShape(t,r,0,0,i,n,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,i);const{scrollX:c=h.scrollX,scrollY:u=h.scrollY}=t.attribute;let d;(c||u)&&r.translate(c,u),n&&n.drawingCb&&(d=n.drawingCb()),r.modelMatrix!==l&&Lh.free(r.modelMatrix),r.modelMatrix=l,r.baseGlobalAlpha=o,d&&d.then?d.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}},t.DefaultCanvasGroupRender=gc([g(),mc(0,p(k)),mc(0,v(ah)),vc("design:paramtypes",[Object])],t.DefaultCanvasGroupRender);var yc=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},bc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xc=function(t,e){return function(i,n){e(i,n,t)}};const wc=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class extends Fh{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=co,this.builtinContributions=[fl,gl],this.init(t)}drawShape(t,e,i,n,r,s,a,o){const h=Or(t).image,{width:l=h.width,height:c=h.height,repeatX:u=h.repeatX,repeatY:d=h.repeatY,x:p=h.x,y:f=h.y,cornerRadius:g=h.cornerRadius,fillStrokeOrder:v=h.fillStrokeOrder,image:m}=t.attribute,y=this.valid(t,h,a);if(!y)return;const{fVisible:b,sVisible:x,doFill:w,doStroke:S}=y;if(!m||!t.resources)return;const A=t.resources.get(m);if("success"!==A.state)return;let T=!1;0===g||at(g)&&g.every((t=>0===t))||(e.beginPath(),ol(e,i,n,l,c,g),T=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h);const C=()=>{if(w)if(a)a(e,t.attribute,h);else if(b){e.setCommonStyle(t,t.attribute,i,n,h);let r=0;if("repeat"===u&&(r|=1),"repeat"===d&&(r|=2),r){const t=e.createPattern(A.data,wc[r]);e.fillStyle=t,e.translate(i,n,!0),e.fillRect(0,0,l,c),e.translate(-i,-n,!0)}else e.drawImage(A.data,i,n,l,c)}},_=()=>{S&&(o?o(e,t.attribute,h):x&&(e.setStrokeStyle(t,t.attribute,p-i,f-n,h),e.stroke()))};v?(_(),T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,n,w,!1,b,!1,h,r,a),C(),T&&e.restore()):(T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,n,w,!1,b,!1,h,r,a),C(),T&&e.restore(),_()),this.afterRenderStep(t,e,i,n,w,!1,b,!1,h,r,a)}draw(t,e,i){const{image:n}=t.attribute;if(!n||!t.resources)return;const r=t.resources.get(n);if("loading"===r.state&&st(n))return void Ca.improveImageLoading(n);if("success"!==r.state)return;const{context:s}=e.drawParams;if(!s)return;const a=Or(t).image;this._draw(t,a,!1,i)}},t.DefaultCanvasImageRender=yc([g(),xc(0,p(k)),xc(0,v(oh)),bc("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const Sc=Symbol.for("IncrementalDrawContribution"),Ac=Symbol.for("ArcRender"),Tc=Symbol.for("Arc3dRender"),Cc=Symbol.for("AreaRender"),_c=Symbol.for("CircleRender"),Bc=Symbol.for("GraphicRender"),Pc=Symbol.for("GroupRender"),Rc=Symbol.for("LineRender"),Mc=Symbol.for("PathRender"),Ec=Symbol.for("PolygonRender"),kc=Symbol.for("RectRender"),Oc=Symbol.for("Rect3DRender"),Ic=Symbol.for("SymbolRender"),Lc=Symbol.for("TextRender"),Dc=Symbol.for("RichTextRender"),jc=Symbol.for("Pyramid3dRender"),Uc=Symbol.for("GlyphRender"),Wc=Symbol.for("ImageRender"),Nc=Symbol.for("RenderSelector"),Gc=Symbol.for("DrawContribution"),Fc=(t,e,i,n)=>{let r,s=!1,a=!1;if(e.forEachChildren((t=>(s=t.numberType===so,!s))),e.forEachChildren((t=>(a=!!t.findFace,!a))),s){const t=e.getChildren(),o=[...t];o.sort(((t,e)=>{var i,n,r,s;let a=(null!==(n=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==n?n:0)/2,o=(null!==(s=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==s?s:0)/2;for(;a<0;)a+=Mt;for(;o<0;)o+=Mt;return o-a})),o.forEach((t=>{t._next=null,t._prev=null})),e.removeAllChild(),e.update(),o.forEach((t=>{e.appendChild(t)})),n.hack_pieFace="outside",r=i(s,a),r&&r.graphic||(n.hack_pieFace="inside",r=i(s,a)),r&&r.graphic||(n.hack_pieFace="top",r=i(s,a)),e.removeAllChild(),t.forEach((t=>{t._next=null,t._prev=null})),t.forEach((t=>{e.appendChild(t)}))}else if(a){const n=e.getChildren(),o=n.map((e=>({ave_z:e.findFace().vertices.map((i=>{var n;return t.view(i[0],i[1],null!==(n=i[2]+e.attribute.z)&&void 0!==n?n:0)[2]})).reduce(((t,e)=>t+e),0),g:e})));o.sort(((t,e)=>e.ave_z-t.ave_z)),e.removeAllChild(),o.forEach((t=>{t.g._next=null,t.g._prev=null})),e.update(),o.forEach((t=>{e.add(t.g)})),r=i(s,a),e.removeAllChild(),n.forEach((t=>{t._next=null,t._prev=null})),e.update(),n.forEach((t=>{e.add(t)}))}else r=i(s,a);return r};var zc=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Hc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Vc=Symbol.for("DrawItemInterceptor"),Yc=new le,Xc=new le;class $c{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0||(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0||(t.attribute.shadowRootIdx<0||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0)&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.shadowRoot)return!1;const{context:s}=i;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){Yc.copy(n.dirtyBounds),Xc.copy(n.backupDirtyBounds);const e=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(e),n.backupDirtyBounds.copy(n.dirtyBounds)}return n.renderGroup(t.shadowRoot,i,Ih.allocate(1,0,0,1,0,0)),s.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&(n.dirtyBounds.copy(Yc),n.backupDirtyBounds.copy(Xc)),!0}}class qc{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return t.attribute._debug_bounds&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.attribute._debug_bounds)return!1;const{context:s}=i;s.highPerformanceSave(),t.parent&&s.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&s.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const a=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(s,t),s.strokeRect(a.x1,a.y1,a.width(),a.height()),s.highPerformanceRestore(),!0}}t.CommonDrawItemInterceptorContribution=class{constructor(){this.order=1,this.interceptors=[new $c,new Zc,new Kc,new qc]}afterDrawItem(t,e,i,n,r){for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].afterDrawItem&&this.interceptors[s].afterDrawItem(t,e,i,n,r))return!0;return!1}beforeDrawItem(t,e,i,n,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].beforeDrawItem&&this.interceptors[s].beforeDrawItem(t,e,i,n,r))return!0;return!1}},t.CommonDrawItemInterceptorContribution=zc([g(),Hc("design:paramtypes",[])],t.CommonDrawItemInterceptorContribution);class Kc{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,n,r):this.beforeSetInteractive(t,e,i,n,r))}beforeSetInteractive(t,e,i,n,r){let s=t.interactiveGraphic;if(t.attribute.globalZIndex){s||(s=t.clone(),t.interactiveGraphic=s,s.baseGraphic=t),s.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).add(s),!0}if(s){i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(s),t.interactiveGraphic=null,s.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,n,r){const s=t.baseGraphic;let a=!!s.stage,o=s.parent;for(;a&&o&&o.stage!==o;)a=!!o.stage,o=o.parent;if(!a){const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).removeChild(t),!0}if(s){this.processing=!0;const{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(s.parent.globalTransMatrix,!0),s.isContainer?n.renderGroup(s,i,s.parent.globalTransMatrix):n.renderItem(s,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=Jl.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class Zc{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:s,stage:a}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=a.camera;const o=s.currentMatrix;o.a/=s.dpr,o.b/=s.dpr,o.c/=s.dpr,o.d/=s.dpr,o.e/=s.dpr,o.f/=s.dpr;const h=Lh.allocate();Ah(h,o);const l=s.modelMatrix;if(l){if(h){const t=Lh.allocate();s.modelMatrix=Ch(t,l,h)}}else s.modelMatrix=h;return s.setTransform(1,0,0,1,0,0,!0),t.isContainer?Fc(s,t,((e,r)=>n.renderGroup(t,i,t.parent.globalTransMatrix,!e&&r)),i):n.renderItem(t,i),s.camera=null,s.restore(),s.modelMatrix!==l&&Lh.free(s.modelMatrix),s.modelMatrix=l,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var Jc=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Qc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tu=function(t,e){return function(i,n){e(i,n,t)}};const eu=Symbol.for("RenderService"),iu=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{constructor(t){this.drawContribution=t}prepare(t){t&&this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}},t.DefaultRenderService=Jc([g(),tu(0,p(Gc)),Qc("design:paramtypes",[Object])],t.DefaultRenderService);var nu=new i((e=>{e(eu).to(t.DefaultRenderService)}));const ru=Symbol.for("GraphicPicker"),su=Symbol.for("PickerService"),au=Symbol.for("BoundsPicker"),ou=Symbol.for("GlobalPickerService"),hu=(t,e,i)=>{const{outerBorder:n,shadowBlur:r=e.shadowBlur}=t;if(n){const t=e.outerBorder,{distance:s=t.distance,lineWidth:a=t.lineWidth}=n;i.expand(s+(r+a)/2)}return i},lu=["radius","startAngle","endAngle",...Ra];class cu extends La{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1}),this.type="circle",this.numberType=oo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}getGraphicTheme(){return Or(this).circle}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateCircleAABBBoundsImprecise(t,e,i):this.updateCircleAABBBoundsAccurate(t,e,i));const{tb1:r,tb2:s}=mn.graphicService.updateTempAABBBounds(i);return hu(t,e,r),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2),mn.graphicService.transformAABBBounds(t,i,e,!1,this),i}updateCircleAABBBoundsImprecise(t,e,i){const{radius:n=e.radius}=t;return i.set(-n,-n,n,n),i}updateCircleAABBBoundsAccurate(t,e,i){const{startAngle:n=e.startAngle,endAngle:r=e.endAngle,radius:s=e.radius}=t;return r-n>Mt-_t?i.set(-s,-s,s,s):vs(n,r,s,i),i}needUpdateTags(t){return super.needUpdateTags(t,lu)}needUpdateTag(t){return super.needUpdateTag(t,lu)}toCustomPath(){var t,e,i;const n=this.attribute,r=null!==(t=n.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),s=null!==(e=n.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),a=null!==(i=n.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),o=new Ni;return o.arc(0,0,r,s,a),o}clone(){return new cu(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return cu.NOWORK_ANIMATE_ATTR}}function uu(t){return new cu(t)}cu.NOWORK_ANIMATE_ATTR=Ia;class du{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,n){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===i)t.yOffset=0;else if("middle"===i)t.yOffset=t.height/-2;else if("alphabetic"===i){let e=.79;if(1===n.length){const t=n[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(e,i,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0;const{lineWidth:h,suffixPosition:l="end",measureMode:c=t.MeasureModeEnum.actualBounding,keepCenterInLine:u=!1}=null!=o?o:{};e=e.map((t=>t.toString()));const d=[],p=[0,0];if("number"==typeof h&&h!==1/0){let t;for(let i=0,n=e.length;i<n;i++){const n=this.textMeasure.measureTextPixelADscentAndWidth(e[i],this.textOptions,c);let r=e[i].toString();if(n.width>h){const n=this.textMeasure.clipTextWithSuffix(e[i],this.textOptions,h,s,a,l);r=n.str,t=n.width}else t=n.width;d.push({str:r,width:t,ascent:n.ascent,descent:n.descent,keepCenterInLine:u})}p[0]=h}else{let t,i,n=0;for(let r=0,s=e.length;r<s;r++){i=e[r];const s=this.textMeasure.measureTextPixelADscentAndWidth(e[r],this.textOptions,c);t=s.width,n=Math.max(n,t),d.push({str:i,width:t,ascent:s.ascent,descent:s.descent,keepCenterInLine:u})}p[0]=n}p[1]=d.length*r,p[0]=d.reduce(((t,e)=>Math.max(t,e.width)),0);const f={xOffset:0,yOffset:0,width:p[0],height:p[1]};return this.LayoutBBox(f,i,n,d),this.layoutWithBBox(f,d,i,n,r)}layoutWithBBox(t,e,i,n,r){const s=[0,0],a=e.length*r;"top"===n||("middle"===n?s[1]=(t.height-a)/2:"bottom"===n&&(s[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,n,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,r,s){if("left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=r/2+(e.ascent-e.descent)/2+s[1],!e.keepCenterInLine){const t=0,i=e.ascent+e.descent+t;if(i<r-t&&("bottom"===n?e.topOffset+=(r-i)/2:"top"===n&&(e.topOffset-=(r-i)/2)),"alphabetic"===n){const t=r/(e.ascent+e.descent);e.topOffset=r/2+(e.ascent-e.descent)/2*t+s[1]}}return s[1]+=r,e}}const pu=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...Ra];class fu extends La{get font(){const t=this.getGraphicTheme();return this._font||(this._font=se(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme(),n=this.getMaxWidth(i);return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const i=this.getGraphicTheme(),n=this.attribute,r=this.getMaxWidth(i);if(!Number.isFinite(r))return!1;const{text:s}=this.attribute;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(s)?s.join(""):s)!==t}return"vertical"===n.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==n.text.toString():null!=this.clipedText&&this.clipedText!==n.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=xo,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return at(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Or(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new fu({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const n=this.obbText.AABBBounds,{x:r,y:s}=e,a={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2},o=te(a,i,{x:r,y:s});return this._OBBBounds.copy(n),this._OBBBounds.translate(o.x-a.x,o.y-a.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:n=e.text}=this.attribute;Array.isArray(n)?this.updateMultilineAABBBounds(n):this.updateSingallineAABBBounds(n);const{tb1:r}=mn.graphicService.updateTempAABBBounds(i),{scaleX:s=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:h=e.strokeBoundsBuffer}=t;if(o){qa(r,o/Math.abs(s+a),!0,h),i.union(r)}return mn.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||mn.graphicService.updateHTMLTextAABBBounds(t,e,i),oe(i,i,this.transMatrix),i}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,r="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),r}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const i=this.getGraphicTheme(),n=this.attribute,{fontFamily:r=i.fontFamily,textAlign:s=i.textAlign,textBaseline:a=i.textBaseline,fontSize:o=i.fontSize,fontWeight:h=i.fontWeight,ellipsis:l=i.ellipsis,maxLineWidth:c,stroke:u=i.stroke,wrap:d=i.wrap,measureMode:p=i.measureMode,lineWidth:f=i.lineWidth,whiteSpace:g=i.whiteSpace,suffixPosition:v=i.suffixPosition,ignoreBuf:m=i.ignoreBuf,keepCenterInLine:y=i.keepCenterInLine}=n,b=m?0:this.guessLineHeightBuf(o),x=this.getLineHeight(n,i,b);if("normal"===g||d)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(f/2),this._AABBBounds}const w=mn.graphicUtil.textMeasure,S=new du(r,{fontSize:o,fontWeight:h,fontFamily:r,lineHeight:x},w).GetLayoutByLines(t,s,a,x,!0===l?i.ellipsis:l||void 0,!1,{lineWidth:c,suffixPosition:v,measureMode:p,keepCenterInLine:y}),{bbox:A}=S;return this.cache.layoutData=S,this.clearUpdateShapeTag(),this._AABBBounds.set(A.xOffset,A.yOffset,A.xOffset+A.width,A.yOffset+A.height),u&&this._AABBBounds.expand(f/2),this._AABBBounds}updateWrapAABBBounds(t){var e,i,n;const r=this.getGraphicTheme(),{fontFamily:s=r.fontFamily,textAlign:a=r.textAlign,textBaseline:o=r.textBaseline,fontSize:h=r.fontSize,ellipsis:l=r.ellipsis,maxLineWidth:c,stroke:u=r.stroke,lineWidth:d=r.lineWidth,wordBreak:p=r.wordBreak,fontWeight:f=r.fontWeight,ignoreBuf:g=r.ignoreBuf,measureMode:v=r.measureMode,suffixPosition:m=r.suffixPosition,heightLimit:y=0,lineClamp:b,keepCenterInLine:x=r.keepCenterInLine}=this.attribute,w=g?0:this.guessLineHeightBuf(h),S=this.getLineHeight(this.attribute,r,w);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}const A=mn.graphicUtil.textMeasure,T={fontSize:h,fontWeight:f,fontFamily:s,lineHeight:S},C=new du(s,T,A),_=at(t)?t.map((t=>t.toString())):[t.toString()],B=[],P=[0,0];let R=1/0;if(y>0&&(R=Math.max(Math.floor(y/S),1)),b&&(R=Math.min(R,b)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<_.length;t++){const e=_[t];let r=!0;if(t===R-1){const i=A.clipTextWithSuffix(e,T,c,l,!1,m,t!==_.length-1),n=A.measureTextPixelADscentAndWidth(i.str,T,v);B.push({str:i.str,width:i.width,ascent:n.ascent,descent:n.descent,keepCenterInLine:x});break}const s=A.clipText(e,T,c,"break-all"!==p,"keep-all"===p);if(""!==e&&""===s.str||s.wordBreaked){if(l){const t=A.clipTextWithSuffix(e,T,c,l,!1,m);s.str=null!==(i=t.str)&&void 0!==i?i:"",s.width=null!==(n=t.width)&&void 0!==n?n:0}else s.str="",s.width=0;r=!1}const a=A.measureTextPixelADscentAndWidth(s.str,T,v);B.push({str:s.str,width:s.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:x});let o=s.str.length;if(!s.wordBreaked||""!==e&&""===s.str||(r=!0,o=s.wordBreaked),s.str.length===e.length);else if(r){let i=e.substring(o);"keep-all"===p&&(i=i.replace(/^\s+/g,"")),_.splice(t+1,0,i)}}let t=0;B.forEach((e=>{t=Math.max(t,e.width)})),P[0]=t}else{let t,e,i=0;for(let n=0,r=_.length;n<r;n++){if(n===R-1){const t=A.clipTextWithSuffix(_[n],T,c,l,!1,m),e=A.measureTextPixelADscentAndWidth(t.str,T,v);B.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:x}),i=Math.max(i,t.width);break}e=_[n],t=A.measureTextWidth(e,T),i=Math.max(i,t);const r=A.measureTextPixelADscentAndWidth(e,T,v);B.push({str:e,width:t,ascent:r.ascent,descent:r.descent,keepCenterInLine:x})}P[0]=i}P[1]=B.length*S;const M={xOffset:0,yOffset:0,width:P[0],height:P[1]};C.LayoutBBox(M,a,o,B);const E=C.layoutWithBBox(M,B,a,o,S);return this.cache.layoutData=E,this.clearUpdateShapeTag(),this._AABBBounds.set(M.xOffset,M.yOffset,M.xOffset+M.width,M.yOffset+M.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var i,n;const r=this.getGraphicTheme(),s=mn.graphicUtil.textMeasure;let a;const o=this.attribute,{maxLineWidth:h=r.maxLineWidth,ellipsis:l=r.ellipsis,fontFamily:c=r.fontFamily,fontSize:u=r.fontSize,fontWeight:d=r.fontWeight,stroke:p=r.stroke,lineWidth:f=r.lineWidth,verticalMode:g=r.verticalMode,suffixPosition:v=r.suffixPosition}=o,m=this.getLineHeight(o,r,0);let{textAlign:y=r.textAlign,textBaseline:b=r.textBaseline}=o;if(!g){const t=y;y=null!==(i=fu.baselineMapAlign[b])&&void 0!==i?i:"left",b=null!==(n=fu.alignMapBaseline[t])&&void 0!==n?n:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=It(e,a)}));const t=gh(y,a),e=this.cache.verticalList.length*m,i=vh(b,e,u);return this._AABBBounds.set(i,t,i+e,t+a),p&&this._AABBBounds.expand(f/2),this._AABBBounds}const x=e.map((t=>Qa(t.toString())));x.forEach(((e,i)=>{if(Number.isFinite(h))if(l){const t=!0===l?r.ellipsis:l,n=s.clipTextWithSuffixVertical(e,{fontSize:u,fontWeight:d,fontFamily:c},h,t,!1,v);x[i]=n.verticalList,a=n.width}else{const t=s.clipTextVertical(e,{fontSize:u,fontWeight:d,fontFamily:c},h,!1);x[i]=t.verticalList,a=t.width}else a=0,e.forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?u:s.measureTextWidth(e.text,{fontSize:u,fontWeight:d,fontFamily:c});a+=i,e.width=i}))})),this.cache.verticalList=x,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=It(e,a)}));const w=gh(y,a),S=this.cache.verticalList.length*m,A=vh(b,S,u);return this._AABBBounds.set(A,w,A+S,w+a),p&&this._AABBBounds.expand(f/2),this._AABBBounds}getMaxWidth(t){var e,i;const n=this.attribute;return null!==(i=null!==(e=n.maxLineWidth)&&void 0!==e?e:n.maxWidth)&&void 0!==i?i:t.maxWidth}getLineHeight(t,e,i){var n;return null!==(n=_s(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==n?n:(t.fontSize||e.fontSize)+i}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pu;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pu;return super.needUpdateTag(t,e)}clone(){return new fu(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return fu.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return fu.baselineMapAlign}getAlignMapBaseline(){return fu.alignMapBaseline}}function gu(t){return new fu(t)}fu.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Ia),fu.baselineMapAlign={top:"left",bottom:"right",middle:"center"},fu.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const vu=["heightLimit","lineClamp"];class mu extends fu{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return at(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,n,r;const s=this.getGraphicTheme(),{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:h=s.textBaseline,fontSize:l=s.fontSize,ellipsis:c=s.ellipsis,maxLineWidth:u,stroke:d=s.stroke,lineWidth:p=s.lineWidth,wordBreak:f=s.wordBreak,fontWeight:g=s.fontWeight,ignoreBuf:v=s.ignoreBuf,heightLimit:m=0,suffixPosition:y=s.suffixPosition,lineClamp:b}=this.attribute,x=null!==(e=_s(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==e?e:this.attribute.fontSize||s.fontSize,w=v?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const S=mn.graphicUtil.textMeasure,A=new du(a,{fontSize:l,fontWeight:g,fontFamily:a},S),T=t.map((t=>t.toString())),C=[],_=[0,0];let B=1/0;if(m>0&&(B=Math.max(Math.floor(m/x),1)),b&&(B=Math.min(B,b)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<T.length;t++){const e=T[t];let i=!0;if(t===B-1){const t=A.textMeasure.clipTextWithSuffix(e,A.textOptions,u,c,!1,y);C.push({str:t.str,width:t.width,ascent:0,descent:0,keepCenterInLine:!1});break}const s=A.textMeasure.clipText(e,A.textOptions,u,"break-word"===f);if(""!==e&&""===s.str){if(c){const t=A.textMeasure.clipTextWithSuffix(e,A.textOptions,u,c,!1,y);s.str=null!==(n=t.str)&&void 0!==n?n:"",s.width=null!==(r=t.width)&&void 0!==r?r:0}else s.str="",s.width=0;i=!1}if(C.push({str:s.str,width:s.width,ascent:0,descent:0,keepCenterInLine:!1}),s.str.length===e.length);else if(i){const i=e.substring(s.str.length);T.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),_[0]=t}else{let t,e,i=0;for(let n=0,r=T.length;n<r;n++){if(n===B-1){const t=A.textMeasure.clipTextWithSuffix(T[n],A.textOptions,u,c,!1,y);C.push({str:t.str,width:t.width,ascent:0,descent:0,keepCenterInLine:!1}),i=Math.max(i,t.width);break}e=T[n],t=A.textMeasure.measureTextWidth(e,A.textOptions,"break-word"===f),i=Math.max(i,t),C.push({str:e,width:t,ascent:0,descent:0,keepCenterInLine:!1})}_[0]=i}_[1]=C.length*(x+w);const P={xOffset:0,yOffset:0,width:_[0],height:_[1]};A.LayoutBBox(P,o,h);const R=A.layoutWithBBox(P,C,o,h,x);return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<vu.length;e++){const i=vu[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<vu.length;e++)if(t===vu[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return mu.NOWORK_ANIMATE_ATTR}}function yu(t){return new mu(t)}class bu{bounds(t,e){if(ht(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return ht(t)?t:Math.min(t[0],t[1])}}function xu(t,e,i,n,r){return r?t.arc(i,n,e,0,Rt,!1,r):t.arc(i,n,e,0,Rt),!1}var wu=new class extends bu{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,r){return xu(t,this.parseSize(e)/2,i,n,r)}drawOffset(t,e,i,n,r,s){return xu(t,this.parseSize(e)/2+r,i,n,s)}drawToSvgPath(t,e,i,n){const r=this.parseSize(t)/2;return`M ${e-r}, ${i} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}};var Su=new class extends bu{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-3*e+i,-e+n,r),t.lineTo(-e+i,-e+n,r),t.lineTo(-e+i,-3*e+n,r),t.lineTo(e+i,-3*e+n,r),t.lineTo(e+i,-e+n,r),t.lineTo(3*e+i,-e+n,r),t.lineTo(3*e+i,e+n,r),t.lineTo(e+i,e+n,r),t.lineTo(e+i,3*e+n,r),t.lineTo(-e+i,3*e+n,r),t.lineTo(-e+i,e+n,r),t.lineTo(-3*e+i,e+n,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,r)}drawOffset(t,e,i,n,r,s){return function(t,e,i,n,r,s){return t.moveTo(-3*e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-3*e+n-r,s),t.lineTo(e+i+r,-3*e+n-r,s),t.lineTo(e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,e+n+r,s),t.lineTo(e+i+r,e+n+r,s),t.lineTo(e+i+r,3*e+n+r,s),t.lineTo(-e+i-r,3*e+n+r,s),t.lineTo(-e+i-r,e+n+r,s),t.lineTo(-3*e+i-r,e+n+r,s),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,r,s)}};function Au(t,e,i,n,r){return t.moveTo(i,n-e,r),t.lineTo(e+i,n,r),t.lineTo(i,n+e,r),t.lineTo(i-e,n,r),t.closePath(),!0}var Tu=new class extends bu{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,r){return Au(t,this.parseSize(e)/2,i,n,r)}drawFitDir(t,e,i,n,r){return Au(t,this.parseSize(e)/2,i,n,r)}drawOffset(t,e,i,n,r,s){return Au(t,this.parseSize(e)/2+r,i,n,s)}};function Cu(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var _u=new class extends bu{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Cu(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Cu(t,this.parseSize(e)/2+r,i,n)}};function Bu(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i+e+2*r,e+n+r),t.lineTo(i-e-2*r,e+n+r),t.lineTo(i,n-e-2*r),t.closePath(),!0}class Pu extends bu{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return Bu(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Bu(t,this.parseSize(e)/2,i,n,r)}}var Ru=new Pu;var Mu=new class extends Pu{constructor(){super(...arguments),this.type="triangle"}};const Eu=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ku=Math.sin(Rt/10)*Eu,Ou=-Math.cos(Rt/10)*Eu;function Iu(t,e,i,n){const r=ku*e,s=Ou*e;t.moveTo(i,-e+n),t.lineTo(r+i,s+n);for(let a=1;a<5;++a){const o=Rt*a/5,h=Math.cos(o),l=Math.sin(o);t.lineTo(l*e+i,-h*e+n),t.lineTo(h*r-l*s+i,l*r+h*s+n)}return t.closePath(),!0}var Lu=new class extends bu{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,n){return Iu(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Iu(t,this.parseSize(e)/2+r,i,n)}};const Du=jt(3);function ju(t,e,i,n){const r=e,s=r/Du,a=s/5,o=e;return t.moveTo(0+i,-r+n),t.lineTo(s/2+i,n),t.lineTo(a/2+i,n),t.lineTo(a/2+i,o+n),t.lineTo(-a/2+i,o+n),t.lineTo(-a/2+i,n),t.lineTo(-s/2+i,n),t.closePath(),!0}var Uu=new class extends bu{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return ju(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return ju(t,this.parseSize(e)/2+r,i,n)}};function Wu(t,e,i,n){const r=2*e;return t.moveTo(i,-e+n),t.lineTo(r/3/2+i,e+n),t.lineTo(-r/3/2+i,e+n),t.closePath(),!0}var Nu=new class extends bu{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return Wu(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Wu(t,this.parseSize(e)/2+r,i,n)}};function Gu(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Fu=new class extends bu{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return Gu(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Gu(t,this.parseSize(e)/2+r,i,n)}};const zu=-.5,Hu=jt(3)/2,Vu=1/jt(12);function Yu(t,e,i,n){const r=e/2,s=e*Vu,a=r,o=e*Vu+e,h=-a,l=o;return t.moveTo(r+i,s+n),t.lineTo(a+i,o+n),t.lineTo(h+i,l+n),t.lineTo(zu*r-Hu*s+i,Hu*r+zu*s+n),t.lineTo(zu*a-Hu*o+i,Hu*a+zu*o+n),t.lineTo(zu*h-Hu*l+i,Hu*h+zu*l+n),t.lineTo(zu*r+Hu*s+i,zu*s-Hu*r+n),t.lineTo(zu*a+Hu*o+i,zu*o-Hu*a+n),t.lineTo(zu*h+Hu*l+i,zu*l-Hu*h+n),t.closePath(),!1}var Xu=new class extends bu{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,n){return Yu(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Yu(t,this.parseSize(e)/2+r,i,n)}};function $u(t,e,i,n,r){return t.moveTo(-e+i-2*r,n),t.lineTo(e+i+r,e+n+2*r),t.lineTo(e+i+r,n-e-2*r),t.closePath(),!0}var qu=new class extends bu{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return $u(t,this.parseSize(e)/2,i,n,0)}drawOffset(t,e,i,n,r){return $u(t,this.parseSize(e)/2,i,n,r)}};function Ku(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-r,e+n+2*r),t.lineTo(e+i+2*r,n),t.lineTo(i-e-r,n-e-2*r),t.closePath(),!0}var Zu=new class extends bu{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return Ku(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Ku(t,this.parseSize(e)/2,i,n,r)}};function Ju(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-2*r,n-e-r),t.lineTo(i+e+2*r,n-e-r),t.lineTo(i,n+e+2*r),t.closePath(),!0}var Qu=new class extends bu{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return Ju(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Ju(t,this.parseSize(e)/2,i,n,r)}};const td=jt(3);function ed(t,e,i,n){const r=e*td;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var id=new class extends bu{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return ed(t,this.parseSize(e)/2/td,i,n)}drawOffset(t,e,i,n,r){return ed(t,this.parseSize(e)/2/td+r,i,n)}};function nd(t,e,i,n){const r=2*e;return t.moveTo(e+i,n-r),t.lineTo(i-e,n),t.lineTo(e+i,r+n),!0}var rd=new class extends bu{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return nd(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,r){return nd(t,this.parseSize(e)/4+r,i,n)}};function sd(t,e,i,n){const r=2*e;return t.moveTo(i-e,n-r),t.lineTo(i+e,n),t.lineTo(i-e,r+n),!0}var ad=new class extends bu{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return sd(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,r){return sd(t,this.parseSize(e)/4+r,i,n)}};function od(t,e,i,n){const r=2*e;return t.moveTo(i-r,n+e),t.lineTo(i,n-e),t.lineTo(i+r,n+e),!0}var hd=new class extends bu{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return od(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,r){return od(t,this.parseSize(e)/4+r,i,n)}};function ld(t,e,i,n){const r=2*e;return t.moveTo(i-r,n-e),t.lineTo(i,n+e),t.lineTo(i+r,n-e),!0}var cd=new class extends bu{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return ld(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,r){return ld(t,this.parseSize(e)/4+r,i,n)}};function ud(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var dd=new class extends bu{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,r){return ud(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r,s){return ud(t,this.parseSize(e)/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=this.parseSize(t)/2;return`M ${e}, ${i-r} L ${e},${i+r}`}};function pd(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var fd=new class extends bu{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,r){return pd(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r,s){return pd(t,this.parseSize(e)/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=this.parseSize(t)/2;return`M ${e-r}, ${i} L ${e+r},${i}`}};function gd(t,e,i,n,r){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var vd=new class extends bu{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,r){return gd(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r,s){return gd(t,this.parseSize(e)/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=this.parseSize(t)/2;return`M ${e-r}, ${i-r} L ${e+r},${i+r} M ${e+r}, ${i-r} L ${e-r},${i+r}`}};function md(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function yd(t,e,i,n){const r=e,s=e/2;return t.rect(i-r/2,n-s/2,r,s),!1}var bd=new class extends bu{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,n){return ht(e)?yd(t,e,i,n):md(t,e,i,n)}drawOffset(t,e,i,n,r){return ht(e)?yd(t,e+2*r,i,n):md(t,[e[0]+2*r,e[1]+2*r],i,n)}};const xd=new le;class wd{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,at(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,r,s,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),Je(r.path.commandList,t,i,n,e,e),a&&a(r.path,r.attribute)})),!1):(Je(this.path.commandList,t,i,n,e+r,e+r),!1)}draw(t,e,i,n,r,s){return e=this.parseSize(e),this.drawOffset(t,e,i,n,0,r,s)}parseSize(t){return ht(t)?t:Math.min(t[0],t[1])}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:n}=i;xd.x1=n.bounds.x1*t,xd.y1=n.bounds.y1*t,xd.x2=n.bounds.x2*t,xd.y2=n.bounds.y2*t,e.union(xd)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const Sd=[wu,Su,Tu,_u,id,Mu,Lu,Uu,Nu,Fu,Xu,qu,Zu,Ru,Qu,rd,ad,hd,cd,bd,dd,fd,vd],Ad={};Sd.forEach((t=>{Ad[t.type]=t}));const Td={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},Cd=new le,_d=["symbolType","size",...Ra];let Bd=class t extends La{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=bo}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return at(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=this.getGraphicTheme();let{symbolType:i=e.symbolType}=this.attribute,n=Ad[i];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[i],n)return this._parsedPath=n,n;if(i=Td[i]||i,!0===Ya(i)){const e=new Va,{svg:n}=e.parse(i);if(!n)return null;const r=at(n.path)?n.path:[n.path];Cd.clear();const s=[];r.forEach((t=>{const e=(new Ni).fromString(t.d),i={};_o.forEach((e=>{t[e]&&(i[Co[e]]=t[e])})),s.push({path:e,attribute:i}),Cd.union(e.bounds)}));const a=Cd.width(),o=Cd.height(),h=1/It(a,o);return s.forEach((t=>t.path.transform(0,0,h,h))),this._parsedPath=new wd(i,s,!0),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}const r=(new Ni).fromString(i),s=r.bounds.width(),a=r.bounds.height(),o=1/It(s,a);return r.transform(0,0,o,o),this._parsedPath=new wd(i,r),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}getGraphicTheme(){return Or(this).symbol}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:r,tb2:s}=mn.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:r=e.shadowBlur,strokeBoundsBuffer:s=e.strokeBoundsBuffer}=t;if(n){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=n;qa(i,a+(r+o)/2,!0,s)}})(t,e,r),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2);const{lineJoin:a=e.lineJoin}=t;return mn.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:n=e.size}=t;if(at(n))i.set(-n[0]/2,-n[1]/2,n[0]/2,n[1]/2);else{const t=n/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:n=e.size}=t;return this.getParsedPath().bounds(n,i),i}needUpdateTags(t){return super.needUpdateTags(t,_d)}needUpdateTag(t){return super.needUpdateTag(t,_d)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=at(e)?e:[e,e];return t.path?(new Ni).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Ni).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Pd(t){return new Bd(t)}Bd.userSymbolMap={},Bd.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Ia);const Rd=["segments","points","curveType","curveTension",...Ra];let Md=class t extends La{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=uo}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,n,r){"points"===t&&(r.points=bs(i,n,e))}getGraphicTheme(){return Or(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),mn.graphicService.updateTempAABBBounds(i);const{lineJoin:n=e.lineJoin}=t;return mn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:r=e.points,connectedType:s}=t,a=i;return r.forEach((t=>{!1===t.defined&&"connect"!==s||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments,connectedType:s}=t,a=i;return r.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"connect"!==s||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,Rd)}needUpdateTag(t){return super.needUpdateTag(t,Rd)}toCustomPath(){const t=this.attribute,e=new Ni,i=t.segments,n=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):t.points&&n(t.points),e}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Ed(t){return new Md(t)}Md.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Ia);const kd=["width","x1","y1","height","cornerRadius",...Ra];class Od extends La{constructor(t){super(t),this.type="rect",this.numberType=vo}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Or(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:n}=t;const{x1:r,y1:s,x:a,y:o}=t;e=null!=e?e:r-a,n=null!=n?n:s-o,(isFinite(e)||isFinite(n)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,n||0)}const{tb1:n,tb2:r}=mn.graphicService.updateTempAABBBounds(i);return hu(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),mn.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,kd)}needUpdateTag(t){return super.needUpdateTag(t,kd)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:n,height:r}=Gs(t),s=new Ni;return s.moveTo(e,i),s.rect(e,i,n,r),s}clone(){return new Od(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Od.NOWORK_ANIMATE_ATTR}}function Id(t){return new Od(t)}Od.NOWORK_ANIMATE_ATTR=Ia;const Ld=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class Dd extends Od{constructor(t){super(t),this.type="rect3d",this.numberType=mo}findFace(){const t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),{x1:i,y1:n,x:r,y:s,length:a=Lt(e.width,e.height)}=this.attribute;let{width:o,height:h}=this.attribute;o=null!=o?o:i-r,h=null!=h?h:n-s;for(let e=0;e<Ld.length;e++){const i=Ld[e];t.vertices.push([i[0]*o,i[1]*h,i[2]*a])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return Dd.NOWORK_ANIMATE_ATTR}}function jd(t){return new Dd(t)}Dd.NOWORK_ANIMATE_ATTR=Ia;class Ud extends La{constructor(t){super(t),this.type="glyph",this.numberType=ho,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,n){super.setAttribute(t,e,i,n),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}getGraphicTheme(){return Or(this).glyph}updateAABBBounds(t,e,i){return this.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i}doUpdateAABBBounds(){this.updateAABBBoundsStamp++,this._AABBBounds.clear();const t=this.updateAABBBounds(this.attribute,this.getGraphicTheme(),this._AABBBounds);return this.clearUpdateBoundTag(),t}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;this.stopStateAnimates();const n={},r=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const s=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];s&&(Object.assign(n,s.attributes),(null===(i=s.subAttributes)||void 0===i?void 0:i.length)&&r.forEach(((t,e)=>{Object.assign(t,s.subAttributes[e])})))})),this.subGraphic.forEach(((i,n)=>{i.updateNormalAttrs(r[n]),i.applyStateAttrs(r[n],t,e)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}clearStates(t){this.stopStateAnimates(),this.hasState()&&this.normalAttrs?(this.currentStates=[],this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}clone(){const t=new Ud(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return Ud.NOWORK_ANIMATE_ATTR}}function Wd(t){return new Ud(t)}Ud.NOWORK_ANIMATE_ATTR=Ia;class Nd{constructor(t,e,i,n,r,s,a,o,h,l,c,u,d,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=h,this.layoutDirection=l,this.directionKey=Sn[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let s=this.isHeightMax?Math.min(this.height,n):this.height||n||0;s=Math.min(s,n);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-s/2;break;case"bottom":a=-s}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-r:"center"===this.globalAlign&&(o=-r/2);let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let l=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=h&&0!==h)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(s=!0,l=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else{const i=Math.floor((h-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],s=h-this.lines[i].top-this.lines[i].height;if(0===h)this.lines[i].draw(t,!1,o,s+a,this.ellipsis,e);else{if(s+r>this[this.directionKey.top]+h||s<this[this.directionKey.top])return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,l=!0),this.lines[i].draw(t,n,o,s+a,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[i].height+this.lines[i].top);const{top:n,height:r}=this.lines[i];if(0===h)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(n=!0,l=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}}}}return l}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],a=r-this.lines[i].top-this.lines[i].height;if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+s>this[this.directionKey.top]+r||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class Gd{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";const n=_s(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof n?n>this.fontSize?n:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:r,height:s,descent:a,width:o}=kn(t,i);let h=0,l=0,c=0;this.height>s&&(h=(this.height-s)/2,l=Math.ceil(h),c=Math.floor(h)),"top"===this.textBaseline?(this.ascent=h,this.descent=s-h):"bottom"===this.textBaseline?(this.ascent=s-h,this.descent=h):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=r+l,this.descent=a+c),this.length=t.length,this.width=o||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=kn(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,n,r){let s=this.text,a=this.left+i;e+=this.top;let o=this.direction;if(this.verticalEllipsis)s=this.ellipsisStr,o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+=this.ellipsisStr,"right"!==r&&"end"!==r||(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Rn(s,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+=this.ellipsisStr,"right"===r||"end"===r){const{width:e}=kn(this.text.slice(t),this.character);"vertical"===o||(a-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0);const{lineWidth:h=1}=this.character;this.character.stroke&&h&&t.strokeText(s,a,e),this.character.fill&&t.fillText(s,a,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Rn(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:n}=kn(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const Fd=["width","height","image",...Ra];class zd extends La{constructor(t){super(t),this.type="image",this.numberType=co,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,n){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,n)}getGraphicTheme(){return Or(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const{tb1:n,tb2:r}=mn.graphicService.updateTempAABBBounds(i);return hu(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),mn.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return fn[t]}needUpdateTags(t){return super.needUpdateTags(t,Fd)}needUpdateTag(t){return super.needUpdateTag(t,Fd)}clone(){return new zd(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return zd.NOWORK_ANIMATE_ATTR}}function Hd(t){return new zd(t)}zd.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Ia);class Vd extends zd{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=ps(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(at(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=ps(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=fn.width,height:e=fn.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,r=(i-t)/2,s=(n-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class Yd{constructor(t,e,i,n,r,s,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=r,this.top=i-n,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof Vd?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Sn[this.direction],this.actualWidth=0;let h=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof Gd){const e=Bn.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],h=Math.max(t[this.directionKey.height],h)})),this.height=h,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const i=this.directionKey,n=this.height;let r=this.left,s=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?r=t-this.actualWidth:"center"===this.textAlign?r=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:s=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof Vd?(t["_"+i.x]=r,r+=t[i.width]+s,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=r,r+=t[i.width]+s)}))}draw(t,e,i,n,r,s){if(r&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const n=this.paragraphs[e];if(n.overflow)t=t&&""===n.text;else if(t){i=!0;break}}let n=0;if(!i)for(let t=this.paragraphs.length-1;t>=0;t--){const i=this.paragraphs[t];if(i.overflow){if(""===i.text)break;continue}if(i instanceof Vd)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const s=!0===r?"...":r||"";i.ellipsisStr=s;const{width:a}=kn(s,i.character),o=a||0;if(o<=this.blankWidth+n){e&&(i.ellipsis="add");break}if(o<=this.blankWidth+n+i.width){i.ellipsis="replace",i.ellipsisWidth=o,i.ellipsisOtherParagraphWidth=this.blankWidth+n;break}i.ellipsis="hide",n+=i.width}}this.paragraphs.forEach(((e,r)=>{if(e instanceof Vd)return e.setAttributes({x:i+e._x,y:n+e._y}),void s(e,t,i+e._x,n+e._y,this.ascent);const a={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){const i=e&&e.stroke||Tn;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:n=1,opacity:r=1}=e;t.globalAlpha=n*r,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,Pn(t,e)})(t,e.character),function(t,e,i){const n=e&&e.fill||An;if(!n)return void(t.globalAlpha=0);const{fillOpacity:r=1,opacity:s=1}=e;t.globalAlpha=r*s,t.fillStyle=i?wn(t,n,{AABBBounds:i}):n,Pn(t,e)}(t,e.character,a),e.draw(t,n+this.ascent,i,0===r,this.textAlign)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n instanceof Vd)break;const{width:r}=kn(t,n.character),s=r||0;if(s<=this.blankWidth+e){n.ellipsis="add",n.ellipsisWidth=s;break}if(s<=this.blankWidth+e+n.width){n.ellipsis="replace",n.ellipsisWidth=s,n.ellipsisOtherParagraphWidth=this.blankWidth+e;break}n.ellipsis="hide",e+=n.width}let i=0;return this.paragraphs.forEach(((t,e)=>{i+=t instanceof Vd?t.width:t.getWidthWithEllips(this.direction)})),i}}class Xd{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=Sn[this.direction]}store(t){if(t instanceof Vd){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new Yd(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t instanceof Vd?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const i=this[this.directionKey.width]-this.lineWidth||0,n=Math.ceil(i/t[this.directionKey.width]*t.length)||0,r=Rn(t.text,i,t.character,n,"break-word"===this.frame.wordBreak);if(0!==r){const[i,n]=function(t,e){const i=t.text.slice(0,e),n=t.text.slice(e);return[new Gd(i,t.newLine,t.character),new Gd(n,!0,t.character)]}(t,r);this.store(i),e?this.send():this.deal(n)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const $d=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...Ra];class qd extends La{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=yo,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const n=this._frameCache.icons.get(t[i]);this.updateHoverIconState(n)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:pn.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:pn.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:pn.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:pn.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:pn.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:pn.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:pn.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:pn.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Or(this).richtext}updateAABBBounds(t,e,i){const{width:n=e.width,height:r=e.height,maxWidth:s=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:o=e.textAlign,textBaseline:h=e.textBaseline}=t;if(n>0&&r>0)i.set(0,0,n,r);else{const t=this.getFrameCache(),{width:e,height:o}=t.getActualSize();let h=n||e||0,l=r||o||0;l="number"==typeof a&&l>a?a:l||0,h="number"==typeof s&&h>s?s:h||0,i.set(0,0,h,l)}let l=0;switch(h){case"top":l=0;break;case"middle":l=-i.height()/2;break;case"bottom":l=-i.height()}let c=0;switch(o){case"left":c=0;break;case"center":c=-i.width()/2;break;case"right":c=-i.width()}return i.translate(c,l),mn.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||mn.graphicService.updateHTMLTextAABBBounds(t,e,i),mn.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,$d)}needUpdateTag(t){return super.needUpdateTag(t,$d)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e<t.lines.length;e++){const i=t.lines[e];for(let t=0;t<i.paragraphs.length;t++){const e=i.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:n,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:h,fillOpacity:l,strokeOpacity:c}=this.attribute;return Object.assign({fill:e,stroke:i,fontSize:n,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:h,fillOpacity:l,strokeOpacity:c},t)}doUpdateFrameCache(t){var e;const{textConfig:i=[],maxWidth:n,maxHeight:r,width:s,height:a,ellipsis:o,wordBreak:h,verticalDirection:l,textAlign:c,textBaseline:u,layoutDirection:d,singleLine:p,disableAutoWrapLine:f}=this.attribute,g=[],v=null!=t?t:i;for(let t=0;t<v.length;t++)if("image"in v[t]){const e=this.combinedStyleToCharacter(v[t]);e.lineWidth=void 0;const i=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(i)g.push(i);else{const t=new Vd(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,g.push(t)}}else{const e=this.combinedStyleToCharacter(v[t]);if(ht(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const t=e.text.split("\n");for(let i=0;i<t.length;i++)g.push(new Gd(t[i],0!==i,e))}else e.text&&g.push(new Gd(e.text,!1,e))}const m="number"==typeof n&&Number.isFinite(n)&&n>0,y="number"==typeof r&&Number.isFinite(r)&&r>0,b="number"==typeof s&&Number.isFinite(s)&&s>0&&(!m||s<=n),x="number"==typeof a&&Number.isFinite(a)&&a>0&&(!y||a<=r),w=new Nd(0,0,(b?s:m?n:0)||0,(x?a:y?r:0)||0,o,h,l,c,u,d||"horizontal",!b&&m,!x&&y,p||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),S=new Xd(w);if(f){let t=0,e=!1;for(let i=0;i<g.length;i++){const n=g[i];e?(n.overflow=!0,n.left=1/0,n.top=1/0,!n.newLine&&w.lines[w.lines.length-1].paragraphs.push(n)):S.deal(n,!0),w.lines.length!==t&&(t=w.lines.length,S.lineBuffer.length=0,n.overflow=!0,n.left=1e3,n.top=1e3,w.lines[w.lines.length-1].paragraphs.push(n),e=!0),n.newLine&&(e=!1,S.lineWidth=0),S.send()}}else for(let t=0;t<g.length;t++)S.deal(g[t]);if(S.send(),!("horizontal"===w.layoutDirection?b:x)){const t=w.getActualSizeWidthEllipsis();let e="horizontal"===w.layoutDirection?t.width:t.height;("horizontal"===w.layoutDirection?m:y)&&(e=Math.min(e,"horizontal"===w.layoutDirection?n:r)),w.lines.forEach((function(t){t.calcOffset(e,!1)}))}this._frameCache=w}clone(){return new qd(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?this.setAttribute("hoverIconId",e.richtextId):!e&&this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0)}))}updateHoverIconState(t){var e,i,n,r,s;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(t.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let r;return e.icons.forEach(((e,s)=>{var a,o;const h=e.AABBBounds.clone();h.translate(e._marginArray[3],e._marginArray[0]),h.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(null!==(a=r.attribute.x)&&void 0!==a?a:0)+i+e._marginArray[3],r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+n+e._marginArray[0])})),r}getNoWorkAnimateAttr(){return qd.NOWORK_ANIMATE_ATTR}}function Kd(t){return new qd(t)}qd.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Ia);const Zd=["path","customPath",...Ra];class Jd extends La{constructor(t){super(t),this.type="path",this.numberType=po}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof Ni?e.path:(J(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Ni?this.cache:t.path)}getGraphicTheme(){return Or(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:n,tb2:r}=mn.graphicService.updateTempAABBBounds(i);hu(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:s=e.lineJoin}=t;return mn.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;st(t.path,!0)?this.cache=(new Ni).fromString(t.path):t.customPath&&(this.cache=new Ni,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,Zd)}needUpdateTag(t){return super.needUpdateTag(t,Zd)}toCustomPath(){return(new Ni).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Jd(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Jd.NOWORK_ANIMATE_ATTR}}function Qd(t){return new Jd(t)}Jd.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Ia);const tp=["segments","points","curveType","curveTension",...Ra];class ep extends La{constructor(t){super(t),this.type="area",this.numberType=ao}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return Or(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),mn.graphicService.updateTempAABBBounds(i);const{lineJoin:n=e.lineJoin}=t;return mn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),s}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),s}_interpolate(t,e,i,n,r){"points"===t&&(r.points=bs(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,tp)}needUpdateTag(t){return super.needUpdateTag(t,tp)}toCustomPath(){const t=new Ni,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var r,s;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(s=e.y1)&&void 0!==s?s:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new ep(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ep.NOWORK_ANIMATE_ATTR}}function ip(t){return new ep(t)}ep.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Ia);const np=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...Ra];class rp extends La{constructor(t){super(t),this.type="arc",this.numberType=ro}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:n=t.outerPadding}=this.attribute;let{outerRadius:r=t.outerRadius,innerRadius:s=t.innerRadius}=this.attribute;if(r+=n,s-=i,0===e||"0%"===e)return 0;const a=Math.abs(r-s),o=t=>Math.min(ht(t,!0)?t:a*parseFloat(t)/100,a/2);if(at(e)){const t=e.map((t=>o(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:n=t.cap}=this.attribute,r=i-e>=0?1:-1,s=i-e;if(e=Yt(e),i=e+s,n&&Et(s)<Mt-_t){let s=1,a=1;n.length&&(s=Number(n[0]),a=Number(n[1]));let{outerRadius:o=t.outerRadius,innerRadius:h=t.innerRadius}=this.attribute;const{outerPadding:l=t.outerPadding,innerPadding:c=t.innerPadding}=this.attribute;o+=l,h-=c;const u=Math.abs(o-h)/2,d=u/o;if(u>_t&&o>_t)return{startAngle:e-r*d*s,endAngle:i+r*d*a,sc:r*d*s,ec:r*d*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:n=i.innerPadding,outerPadding:r=i.outerPadding,padAngle:s=i.padAngle}=this.attribute;let{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=this.attribute;a+=r,o-=n;const{padRadius:h=jt(a*a+o*o)}=this.attribute,l=Et(e-t);let c=t,u=e,d=t,p=e;const f=s/2;let g=l,v=l;if(f>_t&&h>_t){const i=e>t?1:-1;let n=Wt(Number(h)/o*Dt(f)),r=Wt(Number(h)/a*Dt(f));return(g-=2*n)>_t?(n*=i,d+=n,p-=n):(g=0,d=p=(t+e)/2),(v-=2*r)>_t?(r*=i,c+=r,u-=r):(v=0,c=u=(t+e)/2),{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:g,outerDeltaAngle:v}}return{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:g,outerDeltaAngle:v}}getGraphicTheme(){return Or(this).arc}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:r,tb2:s}=mn.graphicService.updateTempAABBBounds(i);hu(t,e,r),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2);const{lineJoin:a=e.lineJoin}=t;return mn.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:n=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:a=e.innerPadding}=t;return n+=s,r-=a,n<r&&(n=r),i.set(-n,-n,n,n),i}updateArcAABBBoundsAccurate(t,e,i){let{outerRadius:n=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(n+=s,r-=a,n<r){const t=n;n=r,r=t}let{endAngle:o=e.endAngle,startAngle:h=e.startAngle}=t;if(h>o){const t=h;h=o,o=t}return n<=_t?i.set(0,0,0,0):Math.abs(o-h)>Mt-_t?i.set(-n,-n,n,n):(vs(h,o,n,i),vs(h,o,r,i)),i}needUpdateTags(t){return super.needUpdateTags(t,np)}needUpdateTag(t){return super.needUpdateTag(t,np)}toCustomPath(){var t,e,i,n;const r=this.attribute,{startAngle:s,endAngle:a}=this.getParsedAngle();let o=(null!==(t=r.innerRadius)&&void 0!==t?t:0)-(null!==(e=r.innerPadding)&&void 0!==e?e:0),h=(null!==(i=r.outerRadius)&&void 0!==i?i:0)-(null!==(n=r.outerPadding)&&void 0!==n?n:0);const l=Et(a-s),c=a>s;if(h<o){const t=h;h=o,o=t}const u=new Ni;if(h<=_t)u.moveTo(0,0);else if(l>=Mt-_t)u.moveTo(0+h*Ot(s),0+h*Dt(s)),u.arc(0,0,h,s,a,!c),o>_t&&(u.moveTo(0+o*Ot(a),0+o*Dt(a)),u.arc(0,0,o,a,s,c));else{const t=h*Ot(s),e=h*Dt(s),i=o*Ot(a),n=o*Dt(a);u.moveTo(0+t,0+e),u.arc(0,0,h,s,a,!c),u.lineTo(0+i,0+n),u.arc(0,0,o,a,s,c),u.closePath()}return u}clone(){return new rp(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return rp.NOWORK_ANIMATE_ATTR}}function sp(t){return new rp(t)}rp.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Ia);class ap extends rp{constructor(t){super(t),this.type="arc3d",this.numberType=so}updateAABBBounds(t,e,i){const n=this.stage;if(!n||!n.camera)return i;const{outerRadius:r=e.outerRadius,height:s=0}=t,a=r+s;return i.setValue(-a,-a,a,a),mn.graphicService.updateTempAABBBounds(i),mn.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return ap.NOWORK_ANIMATE_ATTR}}function op(t){return new ap(t)}ap.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Ia);const hp=["points","cornerRadius",...Ra];class lp extends La{constructor(t){super(t),this.type="polygon",this.numberType=fo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Or(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),mn.graphicService.updateTempAABBBounds(i);const{lineJoin:n=e.lineJoin}=t;return mn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:n=e.points}=t;return n.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,n,r){"points"===t&&(r.points=bs(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,hp)}needUpdateTag(t){return super.needUpdateTag(t,hp)}toCustomPath(){const t=this.attribute.points,e=new Ni;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new lp(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return lp.NOWORK_ANIMATE_ATTR}}function cp(t){return new lp(t)}lp.NOWORK_ANIMATE_ATTR=Ia;class up extends lp{constructor(t){super(t),this.type="pyramid3d",this.numberType=go}updateAABBBounds(t,e,i){const n=this.stage;return n&&n.camera?(this.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)})),mn.graphicService.updateTempAABBBounds(i),mn.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const n=3===i?t[0]:t[i+1],r=e.x-n.x;return 0===r?0:(e.y-n.y)/r})),i=t.map((t=>({p:t,d:0})));let n=!1,r=0;for(let t=0;t<e.length-1;t++){for(let s=t+1;s<e.length;s++){if(e[t]===e[s]){n=!0;const e=Ht.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,r=It(r,e);const a=Ht.distancePP(i[s].p,i[s+1].p);i[s].d=a,i[s+1].d=a,r=It(r,a)}if(n)break}if(n)break}for(let e=t.length-1;e>=0;e--){const n=t[e];i.unshift({p:n,d:0})}for(let e=0;e<t.length;e++){const n=(r-i[e+t.length].d)/2;i[e].d+=n,i[e+t.length].d+=n}const s={polygons:[],vertices:[],edges:[]};return i.forEach((t=>{s.vertices.push([t.p.x,t.p.y,t.d])})),s.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),s.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),s.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),s.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),s.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),s.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),s.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],s}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return up.NOWORK_ANIMATE_ATTR}}function dp(t){return new up(t)}up.NOWORK_ANIMATE_ATTR=Ia;class pp extends Po{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}clearUpdateBoundTag(){super.clearUpdateBoundTag(),this.shadowHost&&this.shadowHost.clearUpdateBoundTag()}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function fp(t){return new pp(t)}var gp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};const vp=Symbol.for("PickItemInterceptor");t.ShadowRootPickItemInterceptorContribution=class{constructor(){this.order=1}afterPickItem(t,e,i,n,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,r):null}beforePickItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,r):null}_pickItem(t,e,i,n,r){var s;if(!t.shadowRoot)return null;const{parentMatrix:a}=r||{};if(!a)return null;const o=e.pickContext;o.highPerformanceSave();const h=null===(s=Or(t))||void 0===s?void 0:s[t.type],{shadowPickMode:l=(null==h?void 0:h.shadowPickMode)}=t.attribute,c=t.shadowRoot,u=Ih.allocateByObj(a),d=new zt(u.a*i.x+u.c*i.y+u.e,u.b*i.x+u.d*i.y+u.f),p=e.pickGroup(c,d,u,n);return o.highPerformanceRestore(),!p.graphic&&p.group&&"full"===l&&(p.graphic=p.group),p}},t.ShadowRootPickItemInterceptorContribution=gp([g()],t.ShadowRootPickItemInterceptorContribution),t.InteractivePickItemInterceptorContribution=class{constructor(){this.order=1}beforePickItem(t,e,i,n,r){const s=t.baseGraphic;if(s&&s.parent){const t=new zt(i.x,i.y),r=e.pickContext;r.highPerformanceSave();const a=s.parent.globalTransMatrix;a.transformPoint(t,t);const o=s.isContainer?e.pickGroup(s,t.clone(),a,n):e.pickItem(s,t.clone(),a,n);return r.highPerformanceRestore(),o}return null}},t.InteractivePickItemInterceptorContribution=gp([g()],t.InteractivePickItemInterceptorContribution),t.Canvas3DPickItemInterceptor=class{constructor(){this.order=1}beforePickItem(t,e,i,n,r){if(!t.in3dMode||n.in3dInterceptor)return null;const s=e.pickContext,a=t.stage;if(!s||!a)return null;if(n.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=a.camera,t.isContainer){const a=Fc(s,t,(()=>e.pickGroup(t,i,r.parentMatrix,n)),n);return s.camera=null,n.in3dInterceptor=!1,s.restore(),a}return s.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}},t.Canvas3DPickItemInterceptor=gp([g()],t.Canvas3DPickItemInterceptor);var mp=new i(((e,i,n)=>{n(su)||(e(ou).toSelf(),e(su).toService(ou)),e(t.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(),e(vp).toService(t.Canvas3DPickItemInterceptor),e(t.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(),e(vp).toService(t.ShadowRootPickItemInterceptorContribution),e(t.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(),e(vp).toService(t.InteractivePickItemInterceptorContribution),I(e,vp)})),yp=new i((e=>{e(wo).to(t.DefaultGraphicService).inSingletonScope(),e(So).toConstantValue(Jl)}));const bp=Symbol.for("AutoEnablePlugins"),xp=Symbol.for("PluginService");var wp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Sp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ap=function(t,e){return function(i,n){e(i,n,t)}};let Tp=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&jn.isBound(bp)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}unRegister(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}release(){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};Tp=wp([g(),Ap(0,p(k)),Ap(0,v(bp)),Sp("design:paramtypes",[Object])],Tp);var Cp=new i((t=>{t(xp).to(Tp),L(t,bp)})),_p=new i((t=>{I(t,U)})),Bp=new i((e=>{e(Dn).to(t.DefaultTextMeasureContribution).inSingletonScope(),I(e,Dn)})),Pp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Rp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Mp=class{constructor(){this.type="static",this.offscreen=!1,this.global=mn.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,i.canvasId&&(t=this.global.getElementById(i.canvasId)),t||(t=this.global.createCanvas({width:e.width,height:e.height})),t.style&&(t.style["pointer-events"]="none");const n=e.getContext().getCanvas().nativeCanvas,r=Nn({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:n.offsetLeft,y:n.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var n;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"},e),i))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){var n;const r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};Mp=Pp([g(),Rp("design:paramtypes",[])],Mp);var Ep=new i((t=>{t(Mp).toSelf(),t(Io).toService(Mp)}));var kp=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};function Op(t,e,i){const n={},r=[];return t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;n[i]?n[i].push(t):(n[i]=[t],r.push(i))}),i),r.sort(((t,e)=>i?e-t:t-e)),{childMap:n,zIdxArray:r}}function Ip(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=!1;if(r)s=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:r=e}=t.attribute;if(0===n)i=r;else if(i!==r)return s=!0,!0;return!1}),n)}if(s){const{childMap:s,zIdxArray:a}=Op(t,e,n);let o=!1;for(let t=0;t<a.length&&!o;t++){const e=s[a[t]];r&&e.sort(((t,e)=>{var i,r;return(n?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(r=t.attribute.z)&&void 0!==r?r:0))}));for(let t=0;t<e.length;t++)if(i(e[t],t)){o=!0;break}}}else t.forEachChildren(i,n)}function Lp(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return kp(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,n)}))}function Dp(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(void 0!==n)return r=!0,!0;return!1}),n);let s=null,a=!1;if(r){const{childMap:r,zIdxArray:o}=Op(t,i,n);let h=!1;for(let t=0;t<o.length&&!h;t++){const i=r[o[t]];for(let t=0;t<i.length;t++){if(a){h=!0,s=i[t];break}i[t]._uid!==e||(a=!0)}}}else t.forEachChildren((t=>a?(s=t,!0):(t._uid===e&&(a=!0),!1)),n);return s}var jp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Up=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wp=function(t,e){return function(i,n){e(i,n,t)}};let Np=class{constructor(t,e){this.contributions=t,this.drawItemInterceptorContributions=e,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new he,this.backupDirtyBounds=new he,this.global=mn.global,this.layerService=mn.layerService,at(this.contributions)||(this.contributions=[this.contributions]),this.init()}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}prepareForDraw(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(t,e){this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:n,viewBox:r,transMatrix:s}=e;if(!i)return;const a=this.dirtyBounds.setValue(0,0,r.width(),r.height());if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=function(t,e,i){if(null===t)return e;if(null===e)return t;const{x11:n,x12:r,y11:s,y12:a,x21:o,x22:h,y21:l,y22:c}=Zt(t,e,i);return n>=h||r<=o||s>=c||a<=l?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(n,o),y1:Math.max(s,l),x2:Math.min(r,h),y2:Math.min(a,c)}}(a,n.dirtyBounds,!1);a.x1=Math.floor(t.x1),a.y1=Math.floor(t.y1),a.x2=Math.ceil(t.x2),a.y2=Math.ceil(t.y2)}const o=i.dpr%1;(o||.5!==o)&&(a.x1=Math.floor(a.x1*i.dpr)/i.dpr,a.y1=Math.floor(a.y1*i.dpr)/i.dpr,a.x2=Math.ceil(a.x2*i.dpr)/i.dpr,a.y2=Math.ceil(a.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(a),i.inuse=!0,i.setClearMatrix(s.a,s.b,s.c,s.d,s.e,s.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(r.x1,r.y1,!0),i.beginPath(),i.rect(a.x1,a.y1,a.width(),a.height()),i.clip(),n.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Qi.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Qi.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,e,Ih.allocate(1,0,0,1,0,0)):this.renderItem(t,e)})),i.restore(),i.setClearMatrix(1,0,0,1,0,0),i.inuse=!1,i.draw()}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=Dp(e,i,Qi.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i,n){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(this.useDirtyBounds&&!Jt(t.AABBBounds,this.dirtyBounds,!1))return;let r,s=i;if(this.useDirtyBounds){r=Zl.allocateByObj(this.dirtyBounds);const e=t.transMatrix;s=Ih.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(s.getInverse())}this.renderItem(t,e,{drawingCb:()=>{var i;n?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e,s):this.renderItem(t,e))})):Ip(t,Qi.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e,s):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(r),Zl.free(r),Ih.free(s))}_increaseRender(t,e){const{layer:i,stage:n}=e,{subLayers:r}=i;let s=r.get(t._uid);s||(s={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,s));const a=s.layer.getNativeHandler().getContext(),o=s.drawContribution||jn.get(Sc);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:s.layer,context:a,startAtId:t._uid,break:!1})),s.drawContribution=o;const h=this._findNextGraphic(t);if(h)if(h.isContainer&&h.incremental)this._increaseRender(h,e);else{let t=r.get(h._uid);t||(t={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(h._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:t.layer,context:i,startAtId:h._uid,break:!1}))}}getRenderContribution(t){let e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,i))return}const n=this.getRenderContribution(t);if(!n)return;let r,s=this.scrollMatrix&&(0!==this.scrollMatrix.e||0!==this.scrollMatrix.f);if(t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;(e||i)&&(s=!0,this.scrollMatrix||(this.scrollMatrix=Ih.allocate(1,0,0,1,0,0)),this.scrollMatrix.translate(-e,-i))}if(s&&(r=this.dirtyBounds.clone().transformWithMatrix(this.scrollMatrix)),this.useDirtyBounds&&!t.isContainer&&!Jt(t.AABBBounds,null!=r?r:this.dirtyBounds,!1)){if(s&&t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;this.scrollMatrix&&this.scrollMatrix.translate(e,i)}return}const a=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=a),a?t.isContainer&&n.draw(t,this.currentRenderService,e,i):n.draw(t,this.currentRenderService,e,i),s&&t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;this.scrollMatrix&&this.scrollMatrix.translate(e,i)}if(this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const n=this.InterceptorContributions[i];if(n.afterDrawItem&&n.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return wt.getInstance().warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t,e){let i;if(e.attribute.renderStyle){const n=this.styleRenderMap.get(e.attribute.renderStyle);i=n&&n.get(t)}return i||this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){var n,r;const{clear:s,viewBox:a}=i,o=a.width(),h=a.height();if(s){e.clearRect(0,0,o,h);const i=null===(n=t.drawParams)||void 0===n?void 0:n.stage;if(i&&(e.globalAlpha=null!==(r=i.attribute.opacity)&&void 0!==r?r:1),i&&i.backgroundImg&&i.resources){const t=i.resources.get(s);t&&"success"===t.state&&t.data&&e.drawImage(t.data,0,0,o,h)}else e.fillStyle=wn(e,s,{AABBBounds:{x1:0,y1:0,x2:0+o,y2:0+h}},0,0),e.fillRect(0,0,o,h)}}afterDraw(t,e){}};Np=jp([g(),Wp(0,f(Bc)),Wp(1,p(k)),Wp(1,v(Vc)),Up("design:paramtypes",[Array,Object])],Np);var Gp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Fp=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.numberType=uo}drawShape(t,e,i,n,r,s,a,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(e>h.length)return;const l=Or(t).line,{fill:c=l.fill,stroke:u=l.stroke,opacity:d=l.opacity,fillOpacity:p=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,lineWidth:g=l.lineWidth,visible:v=l.visible}=t.attribute,m=zo(d,p,c),y=Vo(d,f),b=Go(c),x=Fo(u,g);if(!t.valid||!v)return;if(!b&&!x)return;if(!(m||y||a||o))return;const{context:w}=r;for(let r=e;r<e+s;r++)this.drawIncreaseSegment(t,w,h[r-1],h[r],t.attribute.segments[r],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,a,o)}drawIncreaseSegment(t,e,i,n,r,s,a,o){n&&(e.beginPath(),Ml(e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,s),e.setStrokeStyle(t,r,a,o,s),e.stroke())}};Fp=Gp([g()],Fp);var zp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Hp=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.numberType=ao}drawShape(t,e,i,n,r,s,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:o}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(s>h.length)return;const l=Or(t).area,{fill:c=l.fill,fillOpacity:u=l.fillOpacity,opacity:d=l.opacity,visible:p=l.visible}=t.attribute,f=zo(d,u,c),g=Go(c);if(!t.valid||!p)return;if(!g)return;if(!f&&!a)return;for(let r=s;r<s+o;r++)this.drawIncreaseSegment(t,e,h[r-1],h[r],t.attribute.segments[r],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,a)}drawIncreaseSegment(t,e,i,n,r,s,a,o){n&&(e.beginPath(),El(e.camera?e:e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,s),e.setCommonStyle(t,r,a,o,s),e.fill())}};Hp=zp([g()],Hp);var Vp,Yp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Xp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$p=function(t,e){return function(i,n){e(i,n,t)}},qp=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(Vp||(Vp={}));let Kp=class extends Np{constructor(t,e,i,n){super(t,n),this.contributions=t,this.lineRender=e,this.areaRender=i,this.drawItemInterceptorContributions=n,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=Vp.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new j([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return qp(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:n,viewBox:r}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(r.x1,r.y1,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Qi.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Qi.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{n.restore(),n.restore(),n.draw(),n.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return qp(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return qp(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>qp(this,void 0,void 0,(function*(){if(2!==t.count)yield Lp(t,Qi.zIndex,((i,n)=>{if(this.status===Vp.STOP)return!0;if(i.isContainer)return!1;if(n<this.currentIdx)return!1;const r=this.currFrameStartAt+t.incremental;return n<r&&(this.currentIdx=n+1,this.renderItem(i,e)),n===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),i(!1);else{const n=t.getChildAt(0);if(n.incremental&&n.attribute.segments)for(n.incrementalAt||(n.incrementalAt=0);n.incrementalAt<n.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:n.incrementalAt,length:n.incremental},this.renderItem(n,e),n.incrementalAt+=n.incremental,yield this.waitToNextFrame();else this.renderItem(n,e);i(!1)}}))})})),this.hooks.completeDraw.call()}))}waitToNextFrame(){return qp(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return qp(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return qp(this,void 0,void 0,(function*(){this.rendering&&(this.status=Vp.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=Vp.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return qp(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>qp(this,void 0,void 0,(function*(){yield Lp(t,Qi.zIndex,(t=>qp(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};Kp=Yp([g(),$p(0,f(Bc)),$p(1,p(Fp)),$p(2,p(Hp)),$p(3,p(k)),$p(3,v(Vc)),Xp("design:paramtypes",[Array,Object,Object,Object])],Kp);var Zp=new i((e=>{e(Yh).toSelf().inSingletonScope(),e($h).toSelf().inSingletonScope(),e(Gc).to(Np),e(Sc).to(Kp),e(Pc).to(t.DefaultCanvasGroupRender).inSingletonScope(),e(Bc).toService(Pc),I(e,ah),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),I(e,fh),I(e,Bc),e(t.CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(),e(Vc).toService(t.CommonDrawItemInterceptorContribution),I(e,Vc)}));function Jp(){Jp.__loaded||(Jp.__loaded=!0,jn.load(No),jn.load(yp),jn.load(nu),jn.load(mp),jn.load(Cp),function(t){t.load(_p),t.load(Bp),t.load(Ep)}(jn),function(t){t.load(Zp)}(jn))}Jp.__loaded=!1,Jp();const Qp=jn.get(W);mn.global=Qp;const tf=jn.get(ko);mn.graphicUtil=tf;const ef=jn.get(Eo);mn.transformUtil=ef;const nf=jn.get(wo);mn.graphicService=nf;const rf=jn.get(Oo);mn.layerService=rf;class sf{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.handleChange=t=>{t.glyphHost&&(t=t.glyphHost),t.stage===this.pluginService.stage&&null!=t.stage&&t.stage.renderNextFrame()}}activate(t){this.pluginService=t,mn.graphicService.hooks.onAttributeUpdate.tap(this.key,this.handleChange),mn.graphicService.hooks.onSetStage.tap(this.key,this.handleChange),mn.graphicService.hooks.onRemove.tap(this.key,this.handleChange)}deactivate(t){const e=t=>t.filter((t=>t.name!==this.key));mn.graphicService.hooks.onAttributeUpdate.taps=e(mn.graphicService.hooks.onAttributeUpdate.taps),mn.graphicService.hooks.onSetStage.taps=e(mn.graphicService.hooks.onSetStage.taps),mn.graphicService.hooks.onRemove.taps=e(mn.graphicService.hooks.onRemove.taps)}}class af{constructor(){this.name="AutoRefreshPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.handleChange=t=>{t.glyphHost&&(t=t.glyphHost),t.stage===this.pluginService.stage&&null!=t.stage&&t.stage.renderNextFrame()}}activate(t){this.pluginService=t,this.dpr=mn.global.devicePixelRatio,this.refresh()}refresh(){this._refreshByMediaQuery()||this._refreshByRaf()}_refreshByRaf(){const t=mn.global.getRequestAnimationFrame();this.rafId=t((()=>{mn.global.devicePixelRatio!==this.dpr&&(this.dpr=mn.global.devicePixelRatio,this.pluginService.stage.setDpr(this.dpr,!0)),this.refresh()}))}_refreshByMediaQuery(){try{const t=`(resolution: ${window.devicePixelRatio}dppx)`,e=()=>{window.devicePixelRatio!==this.dpr&&(this.dpr=window.devicePixelRatio,this.pluginService.stage.setDpr(this.dpr,!0))};matchMedia(t).addEventListener("change",e)}catch(t){return!1}return!0}deactivate(t){const e=mn.global.getCancelAnimationFrame();e&&this.rafId&&e(this.rafId)}}class of{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,mn.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,n)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),mn.graphicService.hooks.onClearIncremental.tap(this.key,((e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))}))}deactivate(t){mn.graphicService.hooks.onAddIncremental.taps=mn.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.onClearIncremental.taps=mn.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,mn.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const n=e.layer.subLayers.get(e._uid);n&&n.drawContribution&&n.drawContribution.draw(t.renderService,Object.assign({stage:t,layer:i,viewBox:t.window.getViewBox(),transMatrix:t.window.getViewBoxTransform(),clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:n.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}const hf=new le;class lf{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),mn.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(hf.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(hf,t.parent&&t.parent.globalTransMatrix)))})),mn.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!r||e.dirty(n.globalAABBBounds))})),mn.graphicService.hooks.clearAABBBounds.tap(this.key,((t,e,i)=>{e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(i)})),mn.graphicService.hooks.onRemove.tap(this.key,(t=>{const e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){mn.graphicService.hooks.beforeUpdateAABBBounds.taps=mn.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.afterUpdateAABBBounds.taps=mn.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.clearAABBBounds.taps=mn.graphicService.hooks.clearAABBBounds.taps.filter((t=>t.name!==this.key)),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.onRemove.taps=mn.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}const cf=new Zr;let uf;function df(){if(null==uf)try{const t=document.createElement("canvas"),e=t.getContext("2d");uf=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),uf&&(uf=!!document.createElement)}catch(t){uf=!1}}function pf(){df();const t=mn.global&&mn.global.env;return t?"browser"===t:uf}function ff(){df();const t=mn.global&&mn.global.env;return t?"node"===t:!uf}cf.addTimeline(es),cf.setFPS(60);class gf{static registerPlugin(t,e){gf._pluginClasses[t]=e}static getPlugin(t){return gf._pluginClasses[t]}}gf._pluginClasses={};const vf="white";class mf extends Po{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){const e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){const e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this.window.getViewBox().width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this.window.getViewBox().height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return null!==(t=this._background)&&void 0!==t?t:vf}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super({}),this.tickedBeforeRender=!0,this._onVisibleChange=t=>{if(!(this._skipRender<0))if(t){if(this.dirtyBounds){const t=this.window.getViewBox();this.dirtyBounds.setValue(t.x1,t.y1,t.width(),t.height())}this._skipRender>1&&this.renderNextFrame(),this._skipRender=0}else this._skipRender=1},this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null,this.tickedBeforeRender=!1},this.afterTickCb=()=>{var t;this.tickedBeforeRender=!0,"performance"===(null===(t=this.params.optimize)||void 0===t?void 0:t.tickRenderMode)||"rendering"!==this.state&&this.render()},this.params=t,this.theme=new Er,this.hooks={beforeRender:new j(["stage"]),afterRender:new j(["stage"])},this.global=mn.global,!this.global.env&&pf()&&this.global.setEnv("browser"),this.window=jn.get(br),this.renderService=jn.get(eu),this.pluginService=jn.get(xp),this.layerService=jn.get(Oo),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,viewBox:t.viewBox,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._background=null!==(e=t.background)&&void 0!==e?e:vf,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),t.autoRefresh&&this.enableAutoRefresh(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.ReactDOM&&this.enableReactAttribute(t.ReactDOM),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||cf,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new ts,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&st(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background}),this.ticker.on("afterTick",this.afterTickCb)}pauseRender(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this._skipRender=t}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new Xr(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}preventRender(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:n=0,beta:r=0,camera:s,fieldRatio:a=1,fieldDepth:o}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:n,beta:r,camera:s,fieldRatio:a,fieldDepth:o})}set3dOptions(t){var e,i,n,r,s,a;this.option3d=t;const o=this.get3dOptions(t),{light:h,center:l,camera:c,alpha:u,beta:d,fieldRatio:p,fieldDepth:f}=o,{dir:g=[1,1,-1],color:v="white",ambient:m}=h,y=(null!==(e=l.x)&&void 0!==e?e:this.width/2)+(null!==(i=l.dx)&&void 0!==i?i:0),b=(null!==(n=l.y)&&void 0!==n?n:this.height/2)+(null!==(r=l.dy)&&void 0!==r?r:0),x=[y,b,(null!==(s=l.z)&&void 0!==s?s:0)+(null!==(a=l.dz)&&void 0!==a?a:0)];let w=0,S=0,A=0;c||(w=Math.sin(u)+y,S=Math.sin(d)+b,A=Math.cos(u)*Math.cos(d)*1);const T=gf.getPlugin("DirectionalLight");T&&(this.light=new T(g,v,m));const C={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:f,viewParams:{pos:[w,S,A],center:x,up:[0,1,0]}};if(this.camera)this.camera.params=C;else{const t=gf.getPlugin("OrthoCamera");t&&(this.camera=new t(C))}t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){if(this.view3dTranform)return;this.view3dTranform=!0;const t=gf.getPlugin("ViewTransform3dPlugin");t&&this.pluginService.register(new t)}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new sf))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRefresh(){this.autoRefresh||(this.autoRefresh=!0,this.pluginService.register(new af))}disableAutoRefresh(){this.autoRefresh&&(this.autoRefresh=!1,this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new of))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new he;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new lf,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableLayout(){if(this._enableLayout)return;this._enableLayout=!0;const t=gf.getPlugin("FlexLayoutPlugin");t&&this.pluginService.register(new t)}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableHtmlAttribute(t){if(this.htmlAttribute)return;const e=gf.getPlugin("HtmlAttributePlugin");e&&(this.htmlAttribute=t,this.pluginService.register(new e))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableReactAttribute(t){if(this.reactAttribute)return;const e=gf.getPlugin("ReactAttributePlugin");e&&(this.reactAttribute=t,this.pluginService.register(new e))}disableReactAttribute(){this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}getPluginsByName(t){return this.pluginService.findPluginsByName(t)}tryUpdateAABBBounds(){const t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){if("released"===this.releaseStatus)return;const i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){"released"!==this.releaseStatus&&this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(t)}render(t,e){if("released"===this.releaseStatus)return;this.ticker.start(),this.timeline.resume();const i=this.state;this.state="rendering",this.tickedBeforeRender||this.ticker.trySyncTickStatus(),this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){if("harmony"===this.global.env){const t=this.window.getContext().nativeContext;this.forEachChildren(((e,i)=>{if(i>0){const i=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(i)}}))}}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){if("released"===this.releaseStatus)return;this.timeline.resume(),this.ticker.start();const t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let e=0;e<t.length;e++){let n=t[e];"virtual"===n.layerMode&&(n=n.getNativeHandler().mainHandler.layer),i.includes(n)||i.push(n)}i.forEach((t=>{t.renderCount>this.renderCount||(t.renderCount=this.renderCount+1,t===this.interactiveLayer&&this.dirtyBounds&&this.dirtyBounds.clear(),t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&(this.dirtyBounds&&this.dirtyBounds.clear(),this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))}resizeWindow(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),i&&this.render()}resize(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render())}resizeView(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render())}setViewBox(t,e,i,n,r){let s=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(s=!1)):(this.viewBox.setValue(t,e,t+i,e+n),!1===r&&(s=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),s&&this.render()}setDpr(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){if("released"===this.releaseStatus)return;const i=this.getPickerService().pick(this.children,new zt(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&(this.interactiveLayer.forEachChildren((t=>{t.setStage&&t.setStage(null,null),this.interactiveLayer.removeChild(t)})),this.interactiveLayer.release()),this.window.release(),this.ticker.remTimeline(this.timeline),this.ticker.removeListener("afterTick",this.afterTickCb),this.renderService.renderTreeRoots=[]}setStage(t){}dirty(t,e){"released"!==this.releaseStatus&&(e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t))}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t){"released"!==this.releaseStatus&&this.forEachChildren(((e,i)=>{e.drawTo(t,{renderService:this.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:e===this.defaultLayer?this.background:void 0,clear:0===i,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())})}))}renderToNewWindow(){let t=arguments.length>1?arguments[1]:void 0;if("released"===this.releaseStatus)return;const e=jn.get(br),i=t?-t.x1:0,n=t?-t.y1:0,r=t?t.x2:this.viewWidth,s=t?t.y2:this.viewHeight,a=t?t.width():this.viewWidth,o=t?t.height():this.viewHeight;return e.create({viewBox:{x1:i,y1:n,x2:r,y2:s},width:a,height:o,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e),e}toCanvas(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;if("released"===this.releaseStatus)return;const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}eventPointTransform(t){const e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}pauseTriggerEvent(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}resumeTriggerEvent(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}getPickerService(){return this.pickerService||(this.pickerService=jn.get(su)),this.pickerService}}var yf=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},bf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const xf=new ue(1,0,0,1,0,0),wf={x:0,y:0};t.EmptyContext2d=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new ue(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new ue(1,0,0,1,0,0),this.path=new Ni,this._clearMatrix=new ue(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Ih.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(Ih.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(Ih.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(o*t,o*e,o*i,o*n,o*r,o*s),a&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,r,s),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,r,s){this.path.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.path.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s){this.path.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.path.closePath()}ellipse(t,e,i,n,r,s,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},wf),function(t,e,i){return fr(t,0,!1,e,i)}(this.path.commandList,wf.x,wf.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},wf);const i=xn(this,this.lineWidth,this.dpr);return function(t,e,i,n){return fr(t,e,!0,i,n)}(this.path.commandList,i,wf.x,wf.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,r){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,r){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(xf,t,e)}setClearMatrix(t,e,i,n,r,s){this._clearMatrix.setValue(t,e,i,n,r,s)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>Ih.free(t))),this.stack.length=0}},t.EmptyContext2d=yf([g(),bf("design:paramtypes",[Object,Number])],t.EmptyContext2d);const Sf={WIDTH:500,HEIGHT:500,DPR:1};class Af{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){var e;const{nativeCanvas:i,width:n=Sf.WIDTH,height:r=Sf.HEIGHT,dpr:s=Sf.DPR,x:a,y:o,id:h,canvasControled:l=!0}=t;this._x=null!=a?a:0,this._y=null!=o?o:0,this._pixelWidth=n*s,this._pixelHeight=r*s,this._visiable=!1!==t.visiable,this.controled=l,this._displayWidth=n,this._displayHeight=r,this._dpr=s,this._nativeCanvas=i,this._id=null!==(e=i.id)&&void 0!==e?e:h,h&&(i.id=h),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}Af.env="browser";var Tf=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Cf=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};t.BaseEnvContribution=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new le}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}loadFont(t,e,i){return Cf(this,void 0,void 0,(function*(){return{loadState:"fail"}}))}},t.BaseEnvContribution=Tf([g()],t.BaseEnvContribution);var _f=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Bf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.BaseWindowHandlerContribution=class{constructor(){this._uid=e.GenAutoIncrementId(),this.viewBox=new le,this.modelMatrix=new ue(1,0,0,1,0,0)}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}setViewBox(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}getViewBox(){return this.viewBox}setViewBoxTransform(t,e,i,n,r,s){this.modelMatrix.setValue(t,e,i,n,r,s)}getViewBoxTransform(){return this.modelMatrix}},t.BaseWindowHandlerContribution=_f([g(),Bf("design:paramtypes",[])],t.BaseWindowHandlerContribution);class Pf{constructor(e,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.dir=e,this.color=i,this.colorRgb=ia.Get(i,t.ColorType.Color1),this.ambient=n;const r=jt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);this.formatedDir=[e[0]/r,e[1]/r,e[2]/r]}computeColor(e,i){const n=this.formatedDir,r=Lt(It((e[0]*n[0]+e[1]*n[1]+e[2]*n[2])*(1-this.ambient/2),0)+this.ambient,1);let s;s=st(i)?ia.Get(i,t.ColorType.Color1):i;const a=this.colorRgb;return`rgb(${a[0]*s[0]*r}, ${a[1]*s[1]*r}, ${a[2]*s[2]*r})`}}const Rf=()=>{gf.registerPlugin("DirectionalLight",Pf)};class Mf{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=Lh.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Lh.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return _h(this._viewMatrixCached,t,e,i),this._vp||(this._vp=Lh.allocate()),this._vp=Ch(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=Lh.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=Lh.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return Bh(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=Lh.allocate()),this._vp=Ch(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return Ph(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;Ph(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const s=this.getProjectionScale(i);return{x:t*s+r[0],y:e*s+r[1]}}}const Ef=()=>{gf.registerPlugin("OrthoCamera",Mf)};var kf=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Of=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},If=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultPickService=class{constructor(t){this.pickItemInterceptorContributions=t,this.type="default",this.global=mn.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let n={graphic:null,group:null};i.pickerService=this;const r=i.bounds.width(),s=i.bounds.height();if(!(new le).setValue(0,0,r,s).containsPoint(e))return n;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const a=new ue(1,0,0,1,0,0);let o;for(let r=t.length-1;r>=0&&(n=t[r].isContainer?this.pickGroup(t[r],e,a,i):this.pickItem(t[r],e,a,i),!n.graphic);r--)o||(o=n.group);if(n.graphic||(n.group=o),this.pickContext&&(this.pickContext.inuse=!1),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){var n;return!!(null===(n=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===n?void 0:n.graphic)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=n.pickContext,a=s.modelMatrix;if(s.camera){const e=t.transMatrix,i=Lh.allocate();if(Ah(i,e),a){if(i){const t=Lh.allocate();s.modelMatrix=Ch(t,a,i),Lh.free(i)}}else Ah(i,t.globalTransMatrix),s.modelMatrix=i}if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const o=this.InterceptorContributions[r];if(o.beforePickItem){const r=o.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return s.modelMatrix!==a&&Lh.free(s.modelMatrix),s.modelMatrix=a,r}}const o=t.transMatrix,h=Ih.allocateByObj(i),l=new zt(e.x,e.y);h.transformPoint(l,l);const c=t.AABBBounds.containsPoint(l);if(!c&&!t.stage.camera)return r;const u=this.pickItem(t,l.clone(),i,n);u&&u.graphic&&(r.graphic=u.graphic,r.params=u.params);const d=!1!==t.attribute.pickable&&c;return h.multiply(o.a,o.b,o.c,o.d,o.e,o.f),!1===t.attribute.childrenPickable||u&&u.graphic||Ip(t,Qi.zIndex,(s=>{if(s.isContainer){const i=new zt(e.x,e.y),a=Or(t).group,{scrollX:o=a.scrollX,scrollY:l=a.scrollY}=t.attribute;i.x-=o,i.y-=l,r=this.pickGroup(s,i,h,n)}else{const a=new zt(e.x,e.y);h.transformPoint(a,a);const o=Or(t).group,{scrollX:l=o.scrollX,scrollY:c=o.scrollY}=t.attribute;a.x-=l,a.y-=c;const u=this.pickItem(s,a,i,n);u&&u.graphic&&(r.graphic=u.graphic,r.params=u.params)}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==a&&Lh.free(s.modelMatrix),s.modelMatrix=a,r.graphic||r.group||!d||t.stage.camera||(r.group=t),Ih.free(h),r}selectPicker(t){return this.pickerMap.get(t.numberType)||null}},t.DefaultPickService=kf([g(),If(0,p(k)),If(0,v(vp)),Of("design:paramtypes",[Object])],t.DefaultPickService);var Lf=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Df=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};function jf(t,e){let i=0;for(i=0;i<t.length;i++){const n=t[i];if(n.text&&"\n"===n.text||e--,e<0)break}return i}t.DefaultGlobalPickerService=class{constructor(){this.global=mn.global,this.global.hooks.onSetEnv.tap("global-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env)}configure(t,e){}pick(t,e,i){let n={graphic:null,group:null};const r=new ue(1,0,0,1,0,0);let s;for(let a=0;a<t.length;a++){if(t[a].isContainer)n=this.pickGroup(t[a],e,r,i);else{const s=this.pickItem(t[a],e,r,i);s&&(n.graphic=s.graphic,n.params=s.params)}if(n.graphic)break;s||(s=n.group)}if(n.graphic||(n.group=s),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){return!!this.pickItem(t,e,null,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=t.transMatrix,a=new zt(e.x,e.y);i.transformPoint(a,a);const o=t.AABBBounds.containsPoint(a);if(!o)return r;const h=!1!==t.attribute.pickable&&o;return i.multiply(s.a,s.b,s.c,s.d,s.e,s.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((t=>{if(t.isContainer)r=this.pickGroup(t,e,i,n);else{const s=new zt(e.x,e.y);i.transformPoint(s,s);const a=this.pickItem(t,s,i,n);a&&(r.graphic=a.graphic,r.params=a.params)}return!!r.graphic||!!r.group})),r.graphic||r.group||!h||(r.group=t),r}pickItem(t,e,i,n){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?{graphic:t}:null}},t.DefaultGlobalPickerService=Lf([g(),Df("design:paramtypes",[])],t.DefaultGlobalPickerService);class Uf{constructor(t){this.handleKeyDown=t=>{"Delete"!==t.key&&"Backspace"!==t.key||this.handleInput({data:null,type:"Backspace"})},this.handleCompositionStart=()=>{const{textConfig:t=[]}=this.currRt.attribute,e=jf(t,this.cursorIndex),i=t[e];t.splice(e+1,0,Object.assign(Object.assign({},i),{text:""})),this.isComposing=!0},this.handleCompositionEnd=()=>{this.isComposing=!1;const{textConfig:t=[]}=this.currRt.attribute,e=jf(t,this.cursorIndex+1),i=t[e];t.splice(e,1);const n=i.text,r=Array.from(n.toString());for(let n=0;n<r.length;n++)t.splice(n+e,0,Object.assign(Object.assign({},i),{text:r[n]}));this.currRt.setAttributes({textConfig:t}),this.onChangeCbList.forEach((t=>{t(n,this.isComposing,this.cursorIndex+r.length,this.currRt,"right")}))},this.handleInput=t=>{if(!this.currRt)return;let e=t.data;"Backspace"===t.type||e||(e="\n");const{textConfig:i=[]}=this.currRt.attribute;let n=this.selectionStartCursorIdx,r=this.cursorIndex;n>r&&([n,r]=[r,n]),this.selectionStartCursorIdx=n,this.cursorIndex=n,n=jf(i,n);const s=this.selectionStartCursorIdx-n;r=jf(i,r);const a=i[n+(this.isComposing?1:0)];let o=a;"Backspace"!==t.type||this.isComposing?(n!==r&&i.splice(n+1,r-n),this.isComposing||(o=Object.assign(Object.assign({},a),{text:""}),n+=1,i.splice(n,0,o)),o.text=e):n!==r?i.splice(n+1,r-n):(i.splice(n,1),n-=1),this.currRt.setAttributes({textConfig:i}),this.isComposing?this.onInputCbList.forEach((t=>{t(e,this.isComposing,n+s,this.currRt,"\n"===e?"left":"right")})):this.onChangeCbList.forEach((t=>{t(e,this.isComposing,n+s,this.currRt,"\n"===e?"left":"right")}))},this.container=null!=t?t:document.body;const e=document.createElement("textarea");e.autocomplete="off",e.innerText="",this.applyStyle(e),this.container.append(e),this.textAreaDom=e,this.isComposing=!1,this.onInputCbList=[],this.onChangeCbList=[]}onInput(t){this.onInputCbList.push(t)}onChange(t){this.onChangeCbList.push(t)}applyStyle(t){t.setAttribute("style","width: 100px; height: 30px; left: 0; top: 0; position: absolute; z-index: -1; outline: none; resize: none; border: none; overflow: hidden; color: transparent; user-select: none; caret-color: transparent;background-color: transparent;"),t.addEventListener("input",this.handleInput),t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd),window.addEventListener("keydown",this.handleKeyDown)}moveTo(t,e,i,n,r){this.textAreaDom.style.left=`${t}px`,this.textAreaDom.style.top=`${e}px`,setTimeout((()=>{this.textAreaDom.focus(),this.textAreaDom.setSelectionRange(0,0)})),this.currRt=i,this.cursorIndex=n,this.selectionStartCursorIdx=r}release(){this.textAreaDom.removeEventListener("input",this.handleInput),this.textAreaDom.removeEventListener("compositionstart",this.handleCompositionStart),this.textAreaDom.removeEventListener("compositionend",this.handleCompositionEnd),window.removeEventListener("keydown",this.handleKeyDown)}}class Wf{constructor(t,e,i,n,r){this.curCursorIdx=n,this.selectionStartCursorIdx=i,this.cacheCurCursorIdx=e,this.cacheSelectionStartCursorIdx=t,this.rt=r}hasFormat(t){return null!=this.getFormat(t)}getFormat(t){if(!this.rt)return null;const e=this.rt.attribute.textConfig,i=e[this.selectionStartCursorIdx+1][t];if(null==i)return null;for(let n=this.selectionStartCursorIdx+2;n<=this.curCursorIdx;n++)if(i!==e[n][t])return null;return i}getAllFormat(t){if(!this.rt)return[];const e=this.rt.attribute.textConfig,i=e[this.selectionStartCursorIdx+1][t],n=new Set;n.add(i);for(let i=this.selectionStartCursorIdx+2;i<=this.curCursorIdx;i++){const r=e[i];n.add(r[t])}return Array.from(n.values())}}const Nf="FORMAT_TEXT_COMMAND";class Gf{constructor(){this.pools=[]}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}class Ff extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.rect(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.rect(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const zf=new Ff;class Hf extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.arc(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.arc(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Vf=new Hf;class Yf extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.area(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.area(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Xf=new Yf;class $f extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.circle(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.circle(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const qf=new $f;class Kf extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.line(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.line(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Zf=new Kf;class Jf extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.path(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.path(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Qf=new Jf;class tg extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.symbol(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.symbol(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const eg=new tg;class ig extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.text(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.text(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const ng=new ig;class rg{constructor(){this.map={text:ng,symbol:eg}}gc(t){t.isContainer?t.forEachChildren((t=>this.gc(t))):this.gcItem(t)}gcItem(t){const e=this.map[t.type];e&&e.free(t)}}const sg=new rg;let ag=!1;const og=new i((e=>{ag||(ag=!0,e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(Ac).to(t.DefaultCanvasArcRender).inSingletonScope(),e(Bc).toService(Ac),e(nh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,nh))}));let hg=!1;const lg=new i((e=>{hg||(hg=!0,e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(kc).to(t.DefaultCanvasRectRender).inSingletonScope(),e(Bc).toService(kc),e(t.SplitRectAfterRenderContribution).toSelf(),e(t.SplitRectBeforeRenderContribution).toSelf(),e(ch).toService(t.SplitRectAfterRenderContribution),e(ch).toService(t.SplitRectBeforeRenderContribution),e(ch).toService(t.DefaultBaseInteractiveRenderContribution),I(e,ch))}));let cg=!1;const ug=new i((e=>{cg||(cg=!0,e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(Fp).toSelf().inSingletonScope(),e(Rc).to(t.DefaultCanvasLineRender).inSingletonScope(),e(Bc).toService(Rc))}));let dg=!1;const pg=new i((e=>{dg||(dg=!0,e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(Cc).to(t.DefaultCanvasAreaRender).inSingletonScope(),e(Bc).toService(Cc),e(rh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,rh),e(Hp).toSelf().inSingletonScope())}));let fg=!1;const gg=new i((e=>{fg||(fg=!0,e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(Ic).to(t.DefaultCanvasSymbolRender).inSingletonScope(),e(Bc).toService(Ic),e(uh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,uh))}));let vg=!1;const mg=new i((e=>{vg||(vg=!0,e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(_c).to(t.DefaultCanvasCircleRender).inSingletonScope(),e(Bc).toService(_c),e(sh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,sh))}));let yg=!1;const bg=new i((e=>{yg||(yg=!0,e(Lc).to(t.DefaultCanvasTextRender).inSingletonScope(),e(Bc).toService(Lc),e(dh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,dh))}));let xg=!1;const wg=new i((e=>{xg||(xg=!0,e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(Mc).to(t.DefaultCanvasPathRender).inSingletonScope(),e(Bc).toService(Mc),e(hh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,hh))}));let Sg=!1;const Ag=new i((e=>{Sg||(Sg=!0,e(Ec).to(t.DefaultCanvasPolygonRender).inSingletonScope(),e(Bc).toService(Ec),e(lh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,lh))}));var Tg=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Cg=class{constructor(){this.numberType=ho}drawShape(t,e,i,n,r,s,a,o){r.drawContribution&&t.getSubGraphic().forEach((t=>{const h=r.drawContribution.getRenderContribution(t);h&&h.drawShape&&h.drawShape(t,e,i,n,r,s,a,o)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;if(r.highPerformanceSave(),!i.drawContribution)return;const s=Or(t),a=t.getSubGraphic();a.length&&a.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:s})})),r.highPerformanceRestore()}};Cg=Tg([g()],Cg);let _g=!1;const Bg=new i((t=>{_g||(_g=!0,t(Uc).to(Cg).inSingletonScope(),t(Bc).toService(Uc))}));var Pg=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Rg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Mg=class extends Fh{constructor(){super(),this.numberType=yo,this.builtinContributions=[ic],this.init()}drawShape(t,e,i,n,r){const s=Or(t).richtext,{strokeOpacity:a=s.strokeOpacity,opacity:o=s.opacity,fillOpacity:h=s.fillOpacity,visible:l=s.visible}=t.attribute;if(!t.valid||!l)return;const c=zo(o,h,!0),u=zo(o,a,!0);c&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,s),e.translate(i,n),this.beforeRenderStep(t,e,i,n,c,u,c,u,s,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,c,u,c,u,s,r))}drawIcon(t,e,i,n,r){var s;const a=Or(t).richtextIcon,{width:o=a.width,height:h=a.height,opacity:l=a.opacity,image:c,backgroundFill:u=a.backgroundFill,backgroundFillOpacity:d=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:f=a.backgroundStrokeOpacity,backgroundRadius:g=a.backgroundRadius,margin:v}=t.attribute,{backgroundWidth:m=o,backgroundHeight:y=h}=t.attribute;if(v&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(m-o)/2,r=(y-h)/2;0===g?(e.beginPath(),e.rect(i-t,n-r,m,y)):(e.beginPath(),ol(e,i-t,n-r,m,y,g)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=f,e.strokeStyle=p,e.stroke())}const b=c&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(c));b&&"success"===b.state&&(e.globalAlpha=l,e.drawImage(b.data,i,n,o,h))}draw(t,e,i){const n=Or(t).richtext;this._draw(t,n,!1,i)}};Mg=Pg([g(),Rg("design:paramtypes",[])],Mg);let Eg=!1;const kg=new i((t=>{Eg||(Eg=!0,t(Dc).to(Mg).inSingletonScope(),t(Bc).toService(Dc))}));let Og=!1;const Ig=new i((e=>{Og||(Og=!0,e(Wc).to(t.DefaultCanvasImageRender).inSingletonScope(),e(Bc).toService(Wc),e(oh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,oh))}));class Lg extends Fh{stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const a=s[n[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},h=s[n[1]],l={x:t+h[0],y:e+h[1],z:i+h[2]};r.beginPath(),r.moveTo(o.x,o.y,o.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(e,i,n,r,s,a,o,h,l,c,u){const d=ia.Get(a,t.ColorType.Color255),p=r.vertices,f=p.map((t=>o.view(t[0],t[1],t[2])[2])),g=[];r.polygons.forEach(((t,e)=>{if(s&&!s[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i}=t,n=f[i[0]],r=f[i[1]],a=f[i[2]],o=f[i[3]];t.ave_z=n+r+a+o})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((t=>{const{polygon:r,normal:s}=t.polygon,f=p[r[0]],g=p[r[1]],v=p[r[2]],m=p[r[3]],y={x:e+f[0],y:i+f[1],z:n+f[2]},b={x:e+g[0],y:i+g[1],z:n+g[2]},x={x:e+v[0],y:i+v[1],z:n+v[2]},w={x:e+m[0],y:i+m[1],z:n+m[2]};o.beginPath(),o.moveTo(y.x,y.y,y.z),o.lineTo(b.x,b.y,b.z),o.lineTo(x.x,x.y,x.z),o.lineTo(w.x,w.y,w.z),o.closePath(),u?u(o,l&&l.attribute,c):(o.fillStyle=h?h.computeColor(s,d):a,o.fill())}))}}var Dg=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let jg=class extends Lg{constructor(){super(...arguments),this.type="rect3d",this.numberType=mo}drawShape(t,e,i,n,r,s,a,o){var h;const l=Or(t,null==s?void 0:s.theme).rect,{fill:c=l.fill,stroke:u=l.stroke,x1:d,y1:p,x:f,y:g,opacity:v=l.opacity,fillOpacity:m=l.fillOpacity,lineWidth:y=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:x=l.visible}=t.attribute;let{width:w,height:S}=t.attribute;w=(null!=w?w:d-f)||0,S=(null!=S?S:p-g)||0;const A=null!==(h=this.z)&&void 0!==h?h:0,T=Ho(v,m,w,S,c),C=Yo(v,b,w,S),_=Go(c),B=Fo(u,y);if(!t.valid||!x)return;if(!_&&!B)return;if(!(T||C||a||o))return;const{light:P}=r.stage||{},R=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,A,R,null,r,e,P,null,null,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,A,R,e))}draw(t,e,i){const n=Or(t).rect;this._draw(t,n,!1,i)}};jg=Dg([g()],jg);let Ug=!1;const Wg=new i((t=>{Ug||(Ug=!0,t(Oc).to(jg).inSingletonScope(),t(Bc).toService(Oc))}));var Ng=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Gg=class extends Fh{constructor(){super(...arguments),this.numberType=so}drawShape(e,i,n,r,s,a,o,h){var l;const c=Or(e,null==a?void 0:a.theme).arc,{fill:u=c.fill}=e.attribute,d=this.valid(e,c,o,h);if(!d)return;const{fVisible:p,sVisible:f,doFill:g,doStroke:v}=d,m=null!==(l=this.z)&&void 0!==l?l:0,{outerPadding:y=c.outerPadding,innerPadding:b=c.innerPadding,height:x=10}=e.attribute;let{outerRadius:w=c.outerRadius,innerRadius:S=c.innerRadius}=e.attribute;w+=y,S-=b;const A=ia.Get(u,t.ColorType.Color255),{light:T}=s.stage||{},C=s.hack_pieFace,_={top:m,bottom:m+x},B={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===C||"top"===C?(i.beginPath(),function(t,e,i,n,r,s,a){const{startAngle:o,endAngle:h}=t.getParsedAngle(),l=Et(h-o),c=h>o;let u=!1;if(s<a){const t=s;s=a,a=t}if(s<=_t)e.moveTo(i,n,r);else if(l>=Mt-_t)e.moveTo(i+s*Ot(o),n+s*Dt(o),r),e.arc(i,n,s,o,h,!c,r),a>_t&&(e.moveTo(i+a*Ot(h),n+a*Dt(h),r),e.arc(i,n,a,h,o,c,r));else{const{outerDeltaAngle:l,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:f,innerEndAngle:g,innerStartAngle:v}=t.getParsePadAngle(o,h),m=s*Ot(p),y=s*Dt(p),b=a*Ot(g),x=a*Dt(g);l<.001?u=!0:(e.moveTo(i+m,n+y,r),e.arc(i,n,s,p,f,!c,r)),!(a>_t)||d<.001?(e.lineTo(i+b,n+x,r),u=!0):(e.lineTo(i+b,n+x,r),e.arc(i,n,a,g,v,c,r))}e.closePath()}(e,i,n,r,_[C],w,S),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,c),g&&(o?o(i,e.attribute,c):p&&(i.setCommonStyle(e,e.attribute,n,r,c),i.fillStyle=T?T.computeColor(B[C],A):u,i.fill())),v&&(h?h(i,e.attribute,c):f&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke()))):"outside"!==C&&"inside"!==C||("inside"===C&&(i.save(),i.beginPath(),i.arc(n,r,S,0,Mt,!0,_.top),i.clip()),i.beginPath(),function(t,e,i,n,r,s,a,o){const{startAngle:h,endAngle:l}=t.getParsedAngle(),c=Et(l-h),u=l>h;let d=!1;if(a<=_t)e.moveTo(i,n,r);else if(c>=Mt-_t)e.moveTo(i+a*Ot(h),n+a*Dt(h),r),e.arc(i,n,a,h,l,!u,r),e.lineTo(i+a*Ot(l),n+a*Dt(l),s),e.arc(i,n,a,l,h,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=o(h,l),f=a*Ot(c),g=a*Dt(c),v=a*Ot(p),m=a*Dt(p);t<.001?d=!0:(e.moveTo(i+f,n+g,r),e.arc(i,n,a,c,p,!u,r),e.lineTo(i+v,n+m,s),e.arc(i,n,a,p,c,u,s))}e.closePath()}(e,i,n,r,_.top,_.bottom,"outside"===C?w:S,((t,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:a,innerEndAngle:o,innerStartAngle:h}=e.getParsePadAngle(t,i);return"outside"===C?{innerouterDeltaAngle:n,innerouterEndAngle:a,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:o,innerouterStartAngle:h}})),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,c),g&&(o?o(i,e.attribute,c):p&&(i.setCommonStyle(e,e.attribute,n,r,c),i.fillStyle=T?T.computeColor(B[C],A):u,i.fill())),v&&(h?h(i,e.attribute,c):f&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke())),"inside"===C&&i.restore())}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}};Gg=Ng([g()],Gg);let Fg=!1;const zg=new i((t=>{Fg||(Fg=!0,t(Tc).to(Gg).inSingletonScope(),t(Bc).toService(Tc))}));var Hg=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Vg=class extends Lg{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=go}drawShape(t,e,i,n,r,s,a,o){var h;const l=Or(t,null==s?void 0:s.theme).polygon,{fill:c=l.fill,stroke:u=l.stroke,face:d=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(h=this.z)&&void 0!==h?h:0;if(!this.valid(t,l,a,o))return;const{light:f}=r.stage||{},g=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,p,g,d,r,e,f,t,l,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,p,g,e))}draw(t,e,i){const n=Or(t).polygon;this._draw(t,n,!1,i)}};Vg=Hg([g()],Vg);let Yg=!1;const Xg=new i((t=>{Yg||(Yg=!0,t(jc).to(Vg).inSingletonScope(),t(Bc).toService(jc))}));function $g(){Jl.RegisterGraphicCreator("arc",sp)}function qg(){Jl.RegisterGraphicCreator("arc3d",op)}function Kg(){Jl.RegisterGraphicCreator("area",ip)}function Zg(){Jl.RegisterGraphicCreator("circle",uu)}function Jg(){Jl.RegisterGraphicCreator("glyph",Wd)}function Qg(){Jl.RegisterGraphicCreator("group",Ro)}function tv(){Jl.RegisterGraphicCreator("image",Hd)}function ev(){Jl.RegisterGraphicCreator("line",Ed)}function iv(){Jl.RegisterGraphicCreator("path",Qd)}function nv(){Jl.RegisterGraphicCreator("polygon",cp)}function rv(){Jl.RegisterGraphicCreator("pyramid3d",dp)}function sv(){Jl.RegisterGraphicCreator("rect",Id)}function av(){Jl.RegisterGraphicCreator("rect3d",jd)}function ov(){Jl.RegisterGraphicCreator("richtext",Kd)}function hv(){Jl.RegisterGraphicCreator("symbol",Pd)}function lv(){Jl.RegisterGraphicCreator("text",gu)}function cv(){Jl.RegisterGraphicCreator("shadowRoot",fp)}function uv(){Jl.RegisterGraphicCreator("wrapText",yu)}class dv{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0,this.onWheel=t=>{try{const e=new t.constructor(t.type,t);this.pluginService.stage.window.getContext().getCanvas().nativeCanvas.dispatchEvent(e)}catch(t){return}}}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML([...t.stage.getChildren()])}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.onRemove.unTap(this.key),mn.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,i){let n;return n=e?"string"==typeof e?mn.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:mn.global.createDom(Object.assign({tagName:"div",parent:n},i)),nativeContainer:n}}parseDefaultStyleFromGraphic(t){return mh("text"===t.type&&t.attribute?t.attribute:Or(t).text)}getTransformOfText(t){const e=Or(t).text,{textAlign:i=e.textAlign,textBaseline:n=e.textBaseline}=t.attribute,r=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:s,scaleX:a,scaleY:o}=r,h={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},l={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:i,transform:`translate(${h[i]},${h[n]}) rotate(${s}deg) scaleX(${a}) scaleY(${o})`,transformOrigin:`${l[i]} ${l[n]}`}}updateStyleOfWrapContainer(t,e,i,n,r){const{pointerEvents:s,penetrateEventList:a=[]}=r;let o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===s?"all":s||"none","none"!==o.pointerEvents&&(this.removeWrapContainerEventListener(i),a.forEach((t=>{"wheel"===t&&i.addEventListener("wheel",this.onWheel)}))),i.style.position||(i.style.position="absolute",n.style.position="relative");let h=0,l=0;const c=t.globalAABBBounds;let u=r.anchorType;if(J(u)&&(u="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===u&&(u="top-left"),"position"===u||c.empty()){const e=t.globalTransMatrix;h=e.e,l=e.f}else{const t=((t,e)=>{const{x1:i,x2:n,y1:r,y2:s}=t,a=Math.abs(n-i),o=Math.abs(s-r);let h=(i+n)/2,l=(r+s)/2,c=0,u=0;switch(e){case"top":case"inside-top":u=-.5;break;case"bottom":case"inside-bottom":u=.5;break;case"left":case"inside-left":c=-.5;break;case"right":case"inside-right":c=.5;break;case"top-right":c=.5,u=-.5;break;case"top-left":c=-.5,u=-.5;break;case"bottom-right":c=.5,u=.5;break;case"bottom-left":c=-.5,u=.5}return h+=c*a,l+=u*o,{x:h,y:l}})(c,u);h=t.x,l=t.y}const d=mn.global.getElementTopLeft(n,!1),p=e.window.getTopLeft(!1),f=e.viewBox,g=h+p.left-d.left+f.x1,v=l+p.top-d.top+f.y1;if(o.left=`${g}px`,o.top=`${v}px`,"text"===t.type&&"position"===u&&(o=Object.assign(Object.assign({},o),this.getTransformOfText(t))),Z(r.style)){const e=r.style({top:v,left:g,width:c.width(),height:c.height()},t,i);e&&(o=Object.assign(Object.assign({},o),e))}else et(r.style)?o=Object.assign(Object.assign({},o),r.style):st(r.style)&&r.style&&(o=Object.assign(Object.assign({},o),function(){const t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").forEach((e=>{if(e){const i=e.split(":");if(2===i.length){const e=i[0].trim(),n=i[1].trim();e&&n&&(t[e]=n)}}})),t}(r.style)));mn.global.updateDom(i,{width:r.width,height:r.height,style:o})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===mn.global.env&&(t.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Qi.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Qi.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&mn.global.removeDom(e),this.htmlMap[t]=null}removeWrapContainerEventListener(t){t.removeEventListener("wheel",this.onWheel)}renderGraphicHTML(t){var e;const{html:i}=t.attribute;if(!i)return;const n=t.stage;if(!n)return;const{dom:r,container:s}=i;if(!r)return;const a=J(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[a]&&s&&s!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])"string"==typeof r?this.htmlMap[a].wrapContainer.innerHTML=r:r!==this.htmlMap[a].wrapContainer.firstChild&&(this.htmlMap[a].wrapContainer.removeChild(this.htmlMap[a].wrapContainer.firstChild),this.htmlMap[a].wrapContainer.appendChild(r));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(n,s);t&&("string"==typeof r?t.innerHTML=r:t.appendChild(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[a]={wrapContainer:t,nativeContainer:e,container:s,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:o,nativeContainer:h}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,n,o,h,i),this.htmlMap[a].renderId=this.renderId}release(){"browser"===mn.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}const pv=()=>{gf.registerPlugin("HtmlAttributePlugin",dv)};class fv extends dv{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:i,unmount:n}=this.htmlMap[t];e?mn.global.getRequestAnimationFrame()((()=>{e.unmount()})):n&&n(),i&&mn.global.removeDom(i),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{react:i}=t.attribute;if(!i)return;const n=t.stage;if(!n)return;const r=n.params.ReactDOM,{element:s,container:a}=i;if(!s||!r||!r.createRoot&&!r.render)return;const o=J(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])r.createRoot?this.htmlMap[o].root.render(s):r.render(s,this.htmlMap[o].wrapContainer);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(n,a);if(t)if(this.htmlMap||(this.htmlMap={}),r.createRoot){const i=r.createRoot(t);i.render(s),this.htmlMap[o]={root:i,wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId}}else r.render(s,t),this.htmlMap[o]={wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId,unmount:()=>{r.unmountComponentAtNode(t)}}}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:h,nativeContainer:l}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,n,h,l,i),this.htmlMap[o].renderId=this.renderId}}const gv=()=>{gf.registerPlugin("ReactAttributePlugin",fv)};class vv{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const r=t.page.x-this.pageX,s=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=r/100,o=s/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+a,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+o,n.set3dOptions(this.option3d),n.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}const mv=()=>{gf.registerPlugin("ViewTransform3dPlugin",vv)},yv=new le;class bv{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=e.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new le}pauseLayout(t){this.pause=t}tryLayoutChildren(t){t.firstChild&&this.tryLayout(t.firstChild)}tryLayout(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.pause)return;const i=t.parent;if(!(e||i&&t.needUpdateLayout()))return;const n=Or(i).group,{display:r=n.display}=i.attribute;if("flex"!==r)return;const{flexDirection:s=n.flexDirection,flexWrap:a=n.flexWrap,alignItems:o=n.alignItems,clip:h=n.clip}=i.attribute,{alignContent:l=(null!=o?o:n.alignContent)}=i.attribute;let{width:c,height:u,justifyContent:d=n.justifyContent}=i.attribute;const p=i.getChildren();if(null==c||null==u){let t=0,e=0,i=0;if(p.forEach((n=>{const r=this.getAABBBounds(n);r.empty()||("column"===s||"column-reverse"===s?(e+=r.height(),t=Math.max(t,r.width())):(t+=r.width(),e=Math.max(e,r.height())),i+=r.x1,i+=r.y1,i+=r.x2,i+=r.y2)})),!isFinite(i))return;c=t,u=e}null==i.attribute.width?i.attribute.width=c:c=i.attribute.width,null==i.attribute.height?i.attribute.height=u:u=i.attribute.height,this.tempBounds.copy(i._AABBBounds);const f={main:{len:c,field:"x"},cross:{len:u,field:"y"}},g=f.main,v=f.cross;"column"!==s&&"column-reverse"!==s||(g.len=u,v.len=c,g.field="y",v.field="x"),"row-reverse"!==s&&"column-reverse"!==s||("flex-start"===d?d="flex-end":"flex-end"===d?d="flex-start":p.reverse());let m=0,y=0;const b=[];p.forEach((t=>{const e=this.getAABBBounds(t);if(e.empty())return;const i="x"===g.field?e.width():e.height(),n="x"===v.field?e.width():e.height();b.push({mainLen:i,crossLen:n}),m+=i,y=Math.max(y,n)}));const x=[];if(m>g.len&&"wrap"===a){let t=0,e=0;b.forEach(((i,n)=>{let{mainLen:r,crossLen:s}=i;t+r>g.len?0===t?(x.push({idx:n,mainLen:t+r,crossLen:s}),t=0,e=0):(x.push({idx:n-1,mainLen:t,crossLen:e}),t=r,e=s):(t+=r,e=Math.max(e,s))})),x.push({idx:b.length-1,mainLen:t,crossLen:e})}else x.push({idx:b.length-1,mainLen:m,crossLen:y});let w=0;if(x.forEach((t=>{this.layoutMain(i,p,d,g,b,w,t),w=t.idx+1})),y=x.reduce(((t,e)=>t+e.crossLen),0),1===x.length){const t={"flex-start":0,"flex-end":v.len,center:v.len/2};this.layoutCross(p,o,v,t,b,x[0],0)}else if("flex-start"===l){w=0;let t=0;x.forEach(((e,i)=>{const n={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(p,"flex-start",v,n,b,x[i],w),w=e.idx+1,t+=e.crossLen}))}else if("center"===l){w=0;let t=Math.max(0,(v.len-y)/2);x.forEach(((e,i)=>{const n={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(p,"center",v,n,b,x[i],w),w=e.idx+1,t+=e.crossLen}))}else if("space-around"===l){w=0;const t=Math.max(0,(v.len-y)/x.length/2);let e=t;x.forEach(((i,n)=>{const r={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(p,"flex-start",v,r,b,x[n],w),w=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===l){w=0;const t=Math.max(0,(v.len-y)/(2*x.length-2));let e=0;x.forEach(((i,n)=>{const r={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(p,"flex-start",v,r,b,x[n],w),w=i.idx+1,e+=i.crossLen+2*t}))}p.forEach(((t,e)=>{t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),i.addUpdateLayoutTag();const S=this.getAABBBounds(i);h||this.tempBounds.equals(S)||this.tryLayout(i,!1)}getAABBBounds(t){this.skipBoundsTrigger=!0;const e=t.AABBBounds;return this.skipBoundsTrigger=!1,e}updateChildPos(t,e,i){return t+(null!=e?e:0)-i}layoutMain(t,e,i,n,r,s,a){if("flex-start"===i){let t=0;for(let i=s;i<=a.idx;i++){const s=t+(e[i],n.field,0),a=this.getAABBBounds(e[i]);!a.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],a[`${n.field}1`])),t+=r[i].mainLen}}else if("flex-end"===i){let t=n.len;for(let i=a.idx;i>=s;i--){t-=r[i].mainLen;const s=t+(e[i],n.field,0),a=this.getAABBBounds(e[i]);!a.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],a[`${n.field}1`]))}}else if("space-around"===i)if(a.mainLen>=n.len){let t=0;for(let i=s;i<=a.idx;i++){const s=t+(e[i],n.field,0),a=this.getAABBBounds(e[i]);!a.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],a[`${n.field}1`])),t+=r[i].mainLen}}else{const t=a.idx-s+1,i=(n.len-a.mainLen)/t/2;let o=i;for(let t=s;t<=a.idx;t++){const s=o+(e[t],n.field,0),a=this.getAABBBounds(e[t]);!a.empty()&&(e[t].attribute[n.field]=this.updateChildPos(s,e[t].attribute[n.field],a[`${n.field}1`])),o+=r[t].mainLen+2*i}}else if("space-between"===i)if(a.mainLen>=n.len){let t=0;for(let i=s;i<=a.idx;i++){const s=t+(e[i],n.field,0),a=this.getAABBBounds(e[i]);!a.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],a[`${n.field}1`])),t+=r[i].mainLen}}else{const t=a.idx-s+1,i=(n.len-a.mainLen)/(2*t-2);let o=0;for(let t=s;t<=a.idx;t++){const s=o+(e[t],n.field,0),a=this.getAABBBounds(e[t]);!a.empty()&&(e[t].attribute[n.field]=this.updateChildPos(s,e[t].attribute[n.field],a[`${n.field}1`])),o+=r[t].mainLen+2*i}}else if("center"===i){let t=(n.len-a.mainLen)/2;for(let i=s;i<=a.idx;i++){const s=t+(e[i],n.field,0),a=this.getAABBBounds(e[i]);!a.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],a[`${n.field}1`])),t+=r[i].mainLen}}}layoutCross(t,e,i,n,r,s,a){var o;for(let h=a;h<=s.idx;h++){const s=t[h];let{alignSelf:a}=s.attribute;a&&"auto"!==a||(a=e);const l=this.getAABBBounds(s),c=null!==(o=n[a])&&void 0!==o?o:n["flex-start"];"flex-end"===a?!l.empty()&&(s.attribute[i.field]=this.updateChildPos(c-r[h].crossLen+(i.field,0),s.attribute[i.field],l[`${i.field}1`])):"center"===a?!l.empty()&&(s.attribute[i.field]=this.updateChildPos(c-r[h].crossLen/2+(i.field,0),s.attribute[i.field],l[`${i.field}1`])):!l.empty()&&(s.attribute[i.field]=this.updateChildPos(c+(i.field,0),s.attribute[i.field],l[`${i.field}1`]))}}activate(t){this.pluginService=t,mn.graphicService.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),t.stage&&t.stage===this.pluginService.stage&&this.tryLayout(t,!1)})),mn.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&yv.copy(n)})),mn.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&(yv.equals(i)||this.tryLayout(t,!1))})),mn.graphicService.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t,!1)}))}deactivate(t){mn.graphicService.hooks.onAttributeUpdate.taps=mn.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.beforeUpdateAABBBounds.taps=mn.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.afterUpdateAABBBounds.taps=mn.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.onSetStage.taps=mn.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}const xv=()=>{gf.registerPlugin("FlexLayoutPlugin",bv)};function wv(t,e,i){if(t&&t.length){const[n,r]=e,s=Math.PI/180*i,a=Math.cos(s),o=Math.sin(s);t.forEach((t=>{const[e,i]=t;t[0]=(e-n)*a-(i-r)*o+n,t[1]=(e-n)*o+(i-r)*a+r}))}}function Sv(t){const e=t[0],i=t[1];return Math.sqrt(Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2))}function Av(t,e){const i=e.hachureAngle+90;let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);const r=[0,0];if(i)for(const e of t)wv(e,r,i);const s=function(t,e){const i=[];for(const e of t){const t=[...e];t[0].join(",")!==t[t.length-1].join(",")&&t.push([t[0][0],t[0][1]]),t.length>2&&i.push(t)}const n=[];e=Math.max(e,.1);const r=[];for(const t of i)for(let e=0;e<t.length-1;e++){const i=t[e],n=t[e+1];if(i[1]!==n[1]){const t=Math.min(i[1],n[1]);r.push({ymin:t,ymax:Math.max(i[1],n[1]),x:t===i[1]?i[0]:n[0],islope:(n[0]-i[0])/(n[1]-i[1])})}}if(r.sort(((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!r.length)return n;let s=[],a=r[0].ymin;for(;s.length||r.length;){if(r.length){let t=-1;for(let e=0;e<r.length&&!(r[e].ymin>a);e++)t=e;r.splice(0,t+1).forEach((t=>{s.push({s:a,edge:t})}))}if(s=s.filter((t=>!(t.edge.ymax<=a))),s.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),s.length>1)for(let t=0;t<s.length;t+=2){const e=t+1;if(e>=s.length)break;const i=s[t].edge,r=s[e].edge;n.push([[Math.round(i.x),a],[Math.round(r.x),a]])}a+=e,s.forEach((t=>{t.edge.x=t.edge.x+e*t.edge.islope}))}return n}(t,n);if(i){for(const e of t)wv(e,r,-i);!function(t,e,i){const n=[];t.forEach((t=>n.push(...t))),wv(n,e,i)}(s,r,-i)}return s}class Tv{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const i=Av(t,e);return{type:"fillSketch",ops:this.renderLines(i,e)}}renderLines(t,e){const i=[];for(const n of t)i.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return i}}class Cv extends Tv{fillPolygons(t,e){let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.max(i,.1);const n=Av(t,Object.assign({},e,{hachureGap:i})),r=Math.PI/180*e.hachureAngle,s=[],a=.5*i*Math.cos(r),o=.5*i*Math.sin(r);for(const[t,e]of n)Sv([t,e])&&s.push([[t[0]-a,t[1]+o],[...e]],[[t[0]+a,t[1]-o],[...e]]);return{type:"fillSketch",ops:this.renderLines(s,e)}}}class _v extends Tv{fillPolygons(t,e){const i=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),r=this._fillPolygons(t,n);return i.ops=i.ops.concat(r.ops),i}}class Bv{constructor(t){this.helper=t}fillPolygons(t,e){const i=Av(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(i,e)}dotsOnLines(t,e){const i=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let r=e.fillWeight;r<0&&(r=e.strokeWidth/2);const s=n/4;for(const a of t){const t=Sv(a),o=t/n,h=Math.ceil(o)-1,l=t-h*n,c=(a[0][0]+a[1][0])/2-n/4,u=Math.min(a[0][1],a[1][1]);for(let t=0;t<h;t++){const a=u+l+t*n,o=c-s+2*Math.random()*s,h=a-s+2*Math.random()*s,d=this.helper.ellipse(o,h,r,r,e);i.push(...d.ops)}}return{type:"fillSketch",ops:i}}}class Pv{constructor(t){this.helper=t}fillPolygons(t,e){const i=Av(t,e);return{type:"fillSketch",ops:this.dashedLine(i,e)}}dashedLine(t,e){const i=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,n=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,r=[];return t.forEach((t=>{const s=Sv(t),a=Math.floor(s/(i+n)),o=(s+n-a*(i+n))/2;let h=t[0],l=t[1];h[0]>l[0]&&(h=t[1],l=t[0]);const c=Math.atan((l[1]-h[1])/(l[0]-h[0]));for(let t=0;t<a;t++){const s=t*(i+n),a=s+i,l=[h[0]+s*Math.cos(c)+o*Math.cos(c),h[1]+s*Math.sin(c)+o*Math.sin(c)],u=[h[0]+a*Math.cos(c)+o*Math.cos(c),h[1]+a*Math.sin(c)+o*Math.sin(c)];r.push(...this.helper.doubleLineOps(l[0],l[1],u[0],u[1],e))}})),r}}class Rv{constructor(t){this.helper=t}fillPolygons(t,e){const i=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,n=e.zigzagOffset<0?i:e.zigzagOffset,r=Av(t,e=Object.assign({},e,{hachureGap:i+n}));return{type:"fillSketch",ops:this.zigzagLines(r,n,e)}}zigzagLines(t,e,i){const n=[];return t.forEach((t=>{const r=Sv(t),s=Math.round(r/(2*e));let a=t[0],o=t[1];a[0]>o[0]&&(a=t[1],o=t[0]);const h=Math.atan((o[1]-a[1])/(o[0]-a[0]));for(let t=0;t<s;t++){const r=2*t*e,s=2*(t+1)*e,o=Math.sqrt(2*Math.pow(e,2)),l=[a[0]+r*Math.cos(h),a[1]+r*Math.sin(h)],c=[a[0]+s*Math.cos(h),a[1]+s*Math.sin(h)],u=[l[0]+o*Math.cos(h+Math.PI/4),l[1]+o*Math.sin(h+Math.PI/4)];n.push(...this.helper.doubleLineOps(l[0],l[1],u[0],u[1],i),...this.helper.doubleLineOps(u[0],u[1],c[0],c[1],i))}})),n}}const Mv={};class Ev{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const kv={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Ov(t,e){return t.type===e}function Iv(t){const e=[],i=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t);let n="BOD",r=0,s=i[r];for(;!Ov(s,2);){let a=0;const o=[];if("BOD"===n){if("M"!==s.text&&"m"!==s.text)return Iv("M0,0"+t);r++,a=kv[s.text],n=s.text}else Ov(s,1)?a=kv[n]:(r++,a=kv[s.text],n=s.text);if(!(r+a<i.length))throw new Error("Path data ended short");for(let t=r;t<r+a;t++){const e=i[t];if(!Ov(e,1))throw new Error("Param not a number: "+n+","+e.text);o[o.length]=+e.text}if("number"!=typeof kv[n])throw new Error("Bad segment: "+n);{const t={key:n,data:o};e.push(t),r+=a,s=i[r],"M"===n&&(n="L"),"m"===n&&(n="l")}}return e}function Lv(t){let e=0,i=0,n=0,r=0;const s=[];for(const{key:a,data:o}of t)switch(a){case"M":s.push({key:"M",data:[...o]}),[e,i]=o,[n,r]=o;break;case"m":e+=o[0],i+=o[1],s.push({key:"M",data:[e,i]}),n=e,r=i;break;case"L":s.push({key:"L",data:[...o]}),[e,i]=o;break;case"l":e+=o[0],i+=o[1],s.push({key:"L",data:[e,i]});break;case"C":s.push({key:"C",data:[...o]}),e=o[4],i=o[5];break;case"c":{const t=o.map(((t,n)=>n%2?t+i:t+e));s.push({key:"C",data:t}),e=t[4],i=t[5];break}case"Q":s.push({key:"Q",data:[...o]}),e=o[2],i=o[3];break;case"q":{const t=o.map(((t,n)=>n%2?t+i:t+e));s.push({key:"Q",data:t}),e=t[2],i=t[3];break}case"A":s.push({key:"A",data:[...o]}),e=o[5],i=o[6];break;case"a":e+=o[5],i+=o[6],s.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,i]});break;case"H":s.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],s.push({key:"H",data:[e]});break;case"V":s.push({key:"V",data:[...o]}),i=o[0];break;case"v":i+=o[0],s.push({key:"V",data:[i]});break;case"S":s.push({key:"S",data:[...o]}),e=o[2],i=o[3];break;case"s":{const t=o.map(((t,n)=>n%2?t+i:t+e));s.push({key:"S",data:t}),e=t[2],i=t[3];break}case"T":s.push({key:"T",data:[...o]}),e=o[0],i=o[1];break;case"t":e+=o[0],i+=o[1],s.push({key:"T",data:[e,i]});break;case"Z":case"z":s.push({key:"Z",data:[]}),e=n,i=r}return s}function Dv(t){const e=[];let i="",n=0,r=0,s=0,a=0,o=0,h=0;for(const{key:l,data:c}of t){switch(l){case"M":e.push({key:"M",data:[...c]}),[n,r]=c,[s,a]=c;break;case"C":e.push({key:"C",data:[...c]}),n=c[4],r=c[5],o=c[2],h=c[3];break;case"L":e.push({key:"L",data:[...c]}),[n,r]=c;break;case"H":n=c[0],e.push({key:"L",data:[n,r]});break;case"V":r=c[0],e.push({key:"L",data:[n,r]});break;case"S":{let t=0,s=0;"C"===i||"S"===i?(t=n+(n-o),s=r+(r-h)):(t=n,s=r),e.push({key:"C",data:[t,s,...c]}),o=c[0],h=c[1],n=c[2],r=c[3];break}case"T":{const[t,s]=c;let a=0,l=0;"Q"===i||"T"===i?(a=n+(n-o),l=r+(r-h)):(a=n,l=r);const u=n+2*(a-n)/3,d=r+2*(l-r)/3,p=t+2*(a-t)/3,f=s+2*(l-s)/3;e.push({key:"C",data:[u,d,p,f,t,s]}),o=a,h=l,n=t,r=s;break}case"Q":{const[t,i,s,a]=c,l=n+2*(t-n)/3,u=r+2*(i-r)/3,d=s+2*(t-s)/3,p=a+2*(i-a)/3;e.push({key:"C",data:[l,u,d,p,s,a]}),o=t,h=i,n=s,r=a;break}case"A":{const t=Math.abs(c[0]),i=Math.abs(c[1]),s=c[2],a=c[3],o=c[4],h=c[5],l=c[6];0===t||0===i?(e.push({key:"C",data:[n,r,h,l,h,l]}),n=h,r=l):n===h&&r===l||(Uv(n,r,h,l,t,i,s,a,o).forEach((function(t){e.push({key:"C",data:t})})),n=h,r=l);break}case"Z":e.push({key:"Z",data:[]}),n=s,r=a}i=l}return e}function jv(t,e,i){return[t*Math.cos(i)-e*Math.sin(i),t*Math.sin(i)+e*Math.cos(i)]}function Uv(t,e,i,n,r,s,a,o,h,l){const c=(u=a,Math.PI*u/180);var u;let d=[],p=0,f=0,g=0,v=0;if(l)[p,f,g,v]=l;else{[t,e]=jv(t,e,-c),[i,n]=jv(i,n,-c);const a=(t-i)/2,l=(e-n)/2;let u=a*a/(r*r)+l*l/(s*s);u>1&&(u=Math.sqrt(u),r*=u,s*=u);const d=r*r,m=s*s,y=d*m-d*l*l-m*a*a,b=d*l*l+m*a*a,x=(o===h?-1:1)*Math.sqrt(Math.abs(y/b));g=x*r*l/s+(t+i)/2,v=x*-s*a/r+(e+n)/2,p=Math.asin(parseFloat(((e-v)/s).toFixed(9))),f=Math.asin(parseFloat(((n-v)/s).toFixed(9))),t<g&&(p=Math.PI-p),i<g&&(f=Math.PI-f),p<0&&(p=2*Math.PI+p),f<0&&(f=2*Math.PI+f),h&&p>f&&(p-=2*Math.PI),!h&&f>p&&(f-=2*Math.PI)}let m=f-p;if(Math.abs(m)>120*Math.PI/180){const t=f,e=i,o=n;f=h&&f>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,d=Uv(i=g+r*Math.cos(f),n=v+s*Math.sin(f),e,o,r,s,a,0,h,[f,t,g,v])}m=f-p;const y=Math.cos(p),b=Math.sin(p),x=Math.cos(f),w=Math.sin(f),S=Math.tan(m/4),A=4/3*r*S,T=4/3*s*S,C=[t,e],_=[t+A*b,e-T*y],B=[i+A*w,n-T*x],P=[i,n];if(_[0]=2*C[0]-_[0],_[1]=2*C[1]-_[1],l)return[_,B,P].concat(d);{d=[_,B,P].concat(d);const t=[];for(let e=0;e<d.length;e+=3){const i=jv(d[e][0],d[e][1],c),n=jv(d[e+1][0],d[e+1][1],c),r=jv(d[e+2][0],d[e+2][1],c);t.push([i[0],i[1],n[0],n[1],r[0],r[1]])}return t}}const Wv={randOffset:function(t,e){return qv(t,e)},randOffsetWithRange:function(t,e,i){return $v(t,e,i)},ellipse:function(t,e,i,n,r){return zv(t,e,r,Fv(i,n,r)).opset},doubleLineOps:function(t,e,i,n,r){return Kv(t,e,i,n,r,!0)}};function Nv(t,e,i,n,r){return{type:"path",ops:Kv(t,e,i,n,r)}}function Gv(t,e,i){const n=(t||[]).length;if(n>2){const r=[];for(let e=0;e<n-1;e++)r.push(...Kv(t[e][0],t[e][1],t[e+1][0],t[e+1][1],i));return e&&r.push(...Kv(t[n-1][0],t[n-1][1],t[0][0],t[0][1],i)),{type:"path",ops:r}}return 2===n?Nv(t[0][0],t[0][1],t[1][0],t[1][1],i):{type:"path",ops:[]}}function Fv(t,e,i){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),r=Math.ceil(Math.max(i.curveStepCount,i.curveStepCount/Math.sqrt(200)*n)),s=2*Math.PI/r;let a=Math.abs(t/2),o=Math.abs(e/2);const h=1-i.curveFitting;return a+=qv(a*h,i),o+=qv(o*h,i),{increment:s,rx:a,ry:o}}function zv(t,e,i,n){const[r,s]=tm(n.increment,t,e,n.rx,n.ry,1,n.increment*$v(.1,$v(.4,1,i),i),i);let a=Qv(r,null,i);if(!i.disableMultiStroke&&0!==i.roughness){const[r]=tm(n.increment,t,e,n.rx,n.ry,1.5,0,i),s=Qv(r,null,i);a=a.concat(s)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function Hv(t,e,i,n,r,s,a,o,h){const l=t,c=e;let u=Math.abs(i/2),d=Math.abs(n/2);u+=qv(.01*u,h),d+=qv(.01*d,h);let p=r,f=s;for(;p<0;)p+=2*Math.PI,f+=2*Math.PI;f-p>2*Math.PI&&(p=0,f=2*Math.PI);const g=2*Math.PI/h.curveStepCount,v=Math.min(g/2,(f-p)/2),m=em(v,l,c,u,d,p,f,1,h);if(!h.disableMultiStroke){const t=em(v,l,c,u,d,p,f,1.5,h);m.push(...t)}return a&&(o?m.push(...Kv(l,c,l+u*Math.cos(p),c+d*Math.sin(p),h),...Kv(l,c,l+u*Math.cos(f),c+d*Math.sin(f),h)):m.push({op:"lineTo",data:[l,c]},{op:"lineTo",data:[l+u*Math.cos(p),c+d*Math.sin(p)]})),{type:"path",ops:m}}function Vv(t,e){const i=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,r=n.length;if(r>2){i.push({op:"move",data:[n[0][0]+qv(t,e),n[0][1]+qv(t,e)]});for(let s=1;s<r;s++)i.push({op:"lineTo",data:[n[s][0]+qv(t,e),n[s][1]+qv(t,e)]})}}return{type:"fillPath",ops:i}}function Yv(t,e){return function(t,e){let i=t.fillStyle||"hachure";if(!Mv[i])switch(i){case"zigzag":Mv[i]||(Mv[i]=new Cv(e));break;case"cross-hatch":Mv[i]||(Mv[i]=new _v(e));break;case"dots":Mv[i]||(Mv[i]=new Bv(e));break;case"dashed":Mv[i]||(Mv[i]=new Pv(e));break;case"zigzag-line":Mv[i]||(Mv[i]=new Rv(e));break;default:i="hachure",Mv[i]||(Mv[i]=new Tv(e))}return Mv[i]}(e,Wv).fillPolygons(t,e)}function Xv(t){return t.randomizer||(t.randomizer=new Ev(t.seed||0)),t.randomizer.next()}function $v(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return i.roughness*n*(Xv(i)*(e-t)+t)}function qv(t,e){return $v(-t,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function Kv(t,e,i,n,r){const s=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?r.disableMultiStrokeFill:r.disableMultiStroke,a=Zv(t,e,i,n,r,!0,!1);if(s)return a;const o=Zv(t,e,i,n,r,!0,!0);return a.concat(o)}function Zv(t,e,i,n,r,s,a){const o=Math.pow(t-i,2)+Math.pow(e-n,2),h=Math.sqrt(o);let l=1;l=h<200?1:h>500?.4:-.0016668*h+1.233334;let c=r.maxRandomnessOffset||0;c*c*100>o&&(c=h/10);const u=c/2,d=.2+.2*Xv(r);let p=r.bowing*r.maxRandomnessOffset*(n-e)/200,f=r.bowing*r.maxRandomnessOffset*(t-i)/200;p=qv(p,r,l),f=qv(f,r,l);const g=[],v=()=>qv(u,r,l),m=()=>qv(c,r,l),y=r.preserveVertices;return s&&(a?g.push({op:"move",data:[t+(y?0:v()),e+(y?0:v())]}):g.push({op:"move",data:[t+(y?0:qv(c,r,l)),e+(y?0:qv(c,r,l))]})),a?g.push({op:"bcurveTo",data:[p+t+(i-t)*d+v(),f+e+(n-e)*d+v(),p+t+2*(i-t)*d+v(),f+e+2*(n-e)*d+v(),i+(y?0:v()),n+(y?0:v())]}):g.push({op:"bcurveTo",data:[p+t+(i-t)*d+m(),f+e+(n-e)*d+m(),p+t+2*(i-t)*d+m(),f+e+2*(n-e)*d+m(),i+(y?0:m()),n+(y?0:m())]}),g}function Jv(t,e,i){const n=[];n.push([t[0][0]+qv(e,i),t[0][1]+qv(e,i)]),n.push([t[0][0]+qv(e,i),t[0][1]+qv(e,i)]);for(let r=1;r<t.length;r++)n.push([t[r][0]+qv(e,i),t[r][1]+qv(e,i)]),r===t.length-1&&n.push([t[r][0]+qv(e,i),t[r][1]+qv(e,i)]);return Qv(n,null,i)}function Qv(t,e,i){const n=t.length,r=[];if(n>3){const s=[],a=1-i.curveTightness;r.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<n;e++){const i=t[e];s[0]=[i[0],i[1]],s[1]=[i[0]+(a*t[e+1][0]-a*t[e-1][0])/6,i[1]+(a*t[e+1][1]-a*t[e-1][1])/6],s[2]=[t[e+1][0]+(a*t[e][0]-a*t[e+2][0])/6,t[e+1][1]+(a*t[e][1]-a*t[e+2][1])/6],s[3]=[t[e+1][0],t[e+1][1]],r.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}if(e&&2===e.length){const t=i.maxRandomnessOffset;r.push({op:"lineTo",data:[e[0]+qv(t,i),e[1]+qv(t,i)]})}}else 3===n?(r.push({op:"move",data:[t[1][0],t[1][1]]}),r.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===n&&r.push(...Kv(t[0][0],t[0][1],t[1][0],t[1][1],i));return r}function tm(t,e,i,n,r,s,a,o){const h=[],l=[];if(0===o.roughness){t/=4,l.push([e+n*Math.cos(-t),i+r*Math.sin(-t)]);for(let s=0;s<=2*Math.PI;s+=t){const t=[e+n*Math.cos(s),i+r*Math.sin(s)];h.push(t),l.push(t)}l.push([e+n*Math.cos(0),i+r*Math.sin(0)]),l.push([e+n*Math.cos(t),i+r*Math.sin(t)])}else{const c=qv(.5,o)-Math.PI/2;l.push([qv(s,o)+e+.9*n*Math.cos(c-t),qv(s,o)+i+.9*r*Math.sin(c-t)]);const u=2*Math.PI+c-.01;for(let a=c;a<u;a+=t){const t=[qv(s,o)+e+n*Math.cos(a),qv(s,o)+i+r*Math.sin(a)];h.push(t),l.push(t)}l.push([qv(s,o)+e+n*Math.cos(c+2*Math.PI+.5*a),qv(s,o)+i+r*Math.sin(c+2*Math.PI+.5*a)]),l.push([qv(s,o)+e+.98*n*Math.cos(c+a),qv(s,o)+i+.98*r*Math.sin(c+a)]),l.push([qv(s,o)+e+.9*n*Math.cos(c+.5*a),qv(s,o)+i+.9*r*Math.sin(c+.5*a)])}return[l,h]}function em(t,e,i,n,r,s,a,o,h){const l=s+qv(.1,h),c=[];c.push([qv(o,h)+e+.9*n*Math.cos(l-t),qv(o,h)+i+.9*r*Math.sin(l-t)]);for(let s=l;s<=a;s+=t)c.push([qv(o,h)+e+n*Math.cos(s),qv(o,h)+i+r*Math.sin(s)]);return c.push([e+n*Math.cos(a),i+r*Math.sin(a)]),c.push([e+n*Math.cos(a),i+r*Math.sin(a)]),Qv(c,null,h)}function im(t,e,i,n,r,s,a,o){const h=[],l=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3];let c=[0,0];const u=o.disableMultiStroke?1:2,d=o.preserveVertices;for(let p=0;p<u;p++)0===p?h.push({op:"move",data:[a[0],a[1]]}):h.push({op:"move",data:[a[0]+(d?0:qv(l[0],o)),a[1]+(d?0:qv(l[0],o))]}),c=d?[r,s]:[r+qv(l[p],o),s+qv(l[p],o)],h.push({op:"bcurveTo",data:[t+qv(l[p],o),e+qv(l[p],o),i+qv(l[p],o),n+qv(l[p],o),c[0],c[1]]});return h}function nm(t){return[...t]}function rm(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function sm(t,e,i){const n=rm(e,i);if(0===n)return rm(t,e);let r=((t[0]-e[0])*(i[0]-e[0])+(t[1]-e[1])*(i[1]-e[1]))/n;return r=Math.max(0,Math.min(1,r)),rm(t,am(e,i,r))}function am(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]}function om(t,e,i,n){const r=n||[];if(function(t,e){const i=t[e+0],n=t[e+1],r=t[e+2],s=t[e+3];let a=3*n[0]-2*i[0]-s[0];a*=a;let o=3*n[1]-2*i[1]-s[1];o*=o;let h=3*r[0]-2*s[0]-i[0];h*=h;let l=3*r[1]-2*s[1]-i[1];return l*=l,a<h&&(a=h),o<l&&(o=l),a+o}(t,e)<i){const i=t[e+0];r.length?(s=r[r.length-1],a=i,Math.sqrt(rm(s,a))>1&&r.push(i)):r.push(i),r.push(t[e+3])}else{const n=.5,s=t[e+0],a=t[e+1],o=t[e+2],h=t[e+3],l=am(s,a,n),c=am(a,o,n),u=am(o,h,n),d=am(l,c,n),p=am(c,u,n),f=am(d,p,n);om([s,l,d,f],0,i,r),om([f,p,u,h],0,i,r)}var s,a;return r}function hm(t,e){return lm(t,0,t.length,e)}function lm(t,e,i,n,r){const s=r||[],a=t[e],o=t[i-1];let h=0,l=1;for(let n=e+1;n<i-1;++n){const e=sm(t[n],a,o);e>h&&(h=e,l=n)}return Math.sqrt(h)>n?(lm(t,e,l+1,n,s),lm(t,l,i,n,s)):(s.length||s.push(a),s.push(o)),s}function cm(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,i=arguments.length>2?arguments[2]:void 0;const n=[],r=(t.length-1)/3;for(let i=0;i<r;i++)om(t,3*i,e,n);return i&&i>0?lm(n,0,n.length,i):n}const um="none";class dm{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,i){return{shape:t,sets:e||[],options:i||this.defaultOptions}}line(t,e,i,n,r){const s=this._o(r);return this._d("line",[Nv(t,e,i,n,s)],s)}rectangle(t,e,i,n,r){const s=this._o(r),a=[],o=function(t,e,i,n,r){return function(t,e){return Gv(t,!0,e)}([[t,e],[t+i,e],[t+i,e+n],[t,e+n]],r)}(t,e,i,n,s);if(s.fill){const r=[[t,e],[t+i,e],[t+i,e+n],[t,e+n]];"solid"===s.fillStyle?a.push(Vv([r],s)):a.push(Yv([r],s))}return s.stroke!==um&&a.push(o),this._d("rectangle",a,s)}ellipse(t,e,i,n,r){const s=this._o(r),a=[],o=Fv(i,n,s),h=zv(t,e,s,o);if(s.fill)if("solid"===s.fillStyle){const i=zv(t,e,s,o).opset;i.type="fillPath",a.push(i)}else a.push(Yv([h.estimatedPoints],s));return s.stroke!==um&&a.push(h.opset),this._d("ellipse",a,s)}circle(t,e,i,n){const r=this.ellipse(t,e,i,i,n);return r.shape="circle",r}linearPath(t,e){const i=this._o(e);return this._d("linearPath",[Gv(t,!1,i)],i)}arc(t,e,i,n,r,s){let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0;const h=this._o(o),l=[],c=Hv(t,e,i,n,r,s,a,!0,h);if(a&&h.fill)if("solid"===h.fillStyle){const a=Object.assign({},h);a.disableMultiStroke=!0;const o=Hv(t,e,i,n,r,s,!0,!1,a);o.type="fillPath",l.push(o)}else l.push(function(t,e,i,n,r,s,a){const o=t,h=e;let l=Math.abs(i/2),c=Math.abs(n/2);l+=qv(.01*l,a),c+=qv(.01*c,a);let u=r,d=s;for(;u<0;)u+=2*Math.PI,d+=2*Math.PI;d-u>2*Math.PI&&(u=0,d=2*Math.PI);const p=(d-u)/a.curveStepCount,f=[];for(let t=u;t<=d;t+=p)f.push([o+l*Math.cos(t),h+c*Math.sin(t)]);return f.push([o+l*Math.cos(d),h+c*Math.sin(d)]),f.push([o,h]),Yv([f],a)}(t,e,i,n,r,s,h));return h.stroke!==um&&l.push(c),this._d("arc",l,h)}curve(t,e){const i=this._o(e),n=[],r=function(t,e){let i=Jv(t,1*(1+.2*e.roughness),e);if(!e.disableMultiStroke){const n=Jv(t,1.5*(1+.22*e.roughness),function(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}(e));i=i.concat(n)}return{type:"path",ops:i}}(t,i);if(i.fill&&i.fill!==um&&t.length>=3){const e=cm(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=t.length;if(i<3)throw new Error("A curve must have at least three points.");const n=[];if(3===i)n.push(nm(t[0]),nm(t[1]),nm(t[2]),nm(t[2]));else{const i=[];i.push(t[0],t[0]);for(let e=1;e<t.length;e++)i.push(t[e]),e===t.length-1&&i.push(t[e]);const r=[],s=1-e;n.push(nm(i[0]));for(let t=1;t+2<i.length;t++){const e=i[t];r[0]=[e[0],e[1]],r[1]=[e[0]+(s*i[t+1][0]-s*i[t-1][0])/6,e[1]+(s*i[t+1][1]-s*i[t-1][1])/6],r[2]=[i[t+1][0]+(s*i[t][0]-s*i[t+2][0])/6,i[t+1][1]+(s*i[t][1]-s*i[t+2][1])/6],r[3]=[i[t+1][0],i[t+1][1]],n.push(r[1],r[2],r[3])}}return n}(t),10,(1+i.roughness)/2);"solid"===i.fillStyle?n.push(Vv([e],i)):n.push(Yv([e],i))}return i.stroke!==um&&n.push(r),this._d("curve",n,i)}polygon(t,e){const i=this._o(e),n=[],r=Gv(t,!0,i);return i.fill&&("solid"===i.fillStyle?n.push(Vv([t],i)):n.push(Yv([t],i))),i.stroke!==um&&n.push(r),this._d("polygon",n,i)}path(t,e){const i=this._o(e),n=[];if(!t)return this._d("path",n,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const r=i.fill&&"transparent"!==i.fill&&i.fill!==um,s=i.stroke!==um,a=!!(i.simplification&&i.simplification<1),o=function(t,e,i){const n=Dv(Lv(Iv(t))),r=[];let s=[],a=[0,0],o=[];const h=()=>{o.length>=4&&s.push(...cm(o,1)),o=[]},l=()=>{h(),s.length&&(r.push(s),s=[])};for(const{key:t,data:e}of n)switch(t){case"M":l(),a=[e[0],e[1]],s.push(a);break;case"L":h(),s.push([e[0],e[1]]);break;case"C":if(!o.length){const t=s.length?s[s.length-1]:a;o.push([t[0],t[1]])}o.push([e[0],e[1]]),o.push([e[2],e[3]]),o.push([e[4],e[5]]);break;case"Z":h(),s.push([a[0],a[1]])}if(l(),!i)return r;const c=[];for(const t of r){const e=hm(t,i);e.length&&c.push(e)}return c}(t,0,a?4-4*i.simplification:(1+i.roughness)/2);return r&&("solid"===i.fillStyle?n.push(Vv(o,i)):n.push(Yv(o,i))),s&&(a?o.forEach((t=>{n.push(Gv(t,!1,i))})):n.push(function(t,e){const i=Dv(Lv(Iv(t))),n=[];let r=[0,0],s=[0,0];for(const{key:t,data:a}of i)switch(t){case"M":{const t=1*(e.maxRandomnessOffset||0),i=e.preserveVertices;n.push({op:"move",data:a.map((n=>n+(i?0:qv(t,e))))}),s=[a[0],a[1]],r=[a[0],a[1]];break}case"L":n.push(...Kv(s[0],s[1],a[0],a[1],e)),s=[a[0],a[1]];break;case"C":{const[t,i,r,o,h,l]=a;n.push(...im(t,i,r,o,h,l,s,e)),s=[h,l];break}case"Z":n.push(...Kv(s[0],s[1],r[0],r[1],e)),s=[r[0],r[1]]}return{type:"path",ops:n}}(t,i))),this._d("path",n,i)}opsToPath(t,e){let i="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":i+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":i+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":i+=`L${t[0]} ${t[1]} `}}return i.trim()}toPaths(t){const e=t.sets||[],i=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:um};break;case"fillPath":e={d:this.opsToPath(t),stroke:um,strokeWidth:0,fill:i.fill||um};break;case"fillSketch":e=this.fillSketch(t,i)}e&&n.push(e)}return n}fillSketch(t,e){let i=e.fillWeight;return i<0&&(i=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||um,strokeWidth:i,fill:um}}}class pm{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new dm(e)}draw(t){const e=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.ctx,r=t.options.fixedDecimalPlaceDigits;for(const s of e)switch(s.type){case"path":n.save(),n.strokeStyle="none"===i.stroke?"transparent":i.stroke,n.lineWidth=i.strokeWidth,i.strokeLineDash&&n.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(n.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(n,s,r),n.restore();break;case"fillPath":{n.save(),n.fillStyle=i.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,s,r,e),n.restore();break}case"fillSketch":this.fillSketch(n,s,i)}}fillSketch(t,e,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=n,this._drawToContext(t,e,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";t.beginPath();for(const n of e.ops){const e="number"==typeof i&&i>=0?n.data.map((t=>+t.toFixed(i))):n.data;switch(n.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,i,n,r){const s=this.gen.line(t,e,i,n,r);return this.draw(s),s}rectangle(t,e,i,n,r){const s=this.gen.rectangle(t,e,i,n,r);return this.draw(s),s}ellipse(t,e,i,n,r){const s=this.gen.ellipse(t,e,i,n,r);return this.draw(s),s}circle(t,e,i,n){const r=this.gen.circle(t,e,i,n);return this.draw(r),r}linearPath(t,e){const i=this.gen.linearPath(t,e);return this.draw(i),i}polygon(t,e){const i=this.gen.polygon(t,e);return this.draw(i),i}arc(t,e,i,n,r,s){let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0;const h=this.gen.arc(t,e,i,n,r,s,a,o);return this.draw(h),h}curve(t,e){const i=this.gen.curve(t,e);return this.draw(i),i}path(t,e){const i=this.gen.path(t,e);return this.draw(i),i}}var fm=(t,e)=>new pm(t,e);const gm={maxRandomnessOffset:3,roughness:1,bowing:1,curveFitting:.95,curveTightness:void 0,curveStepCount:9,fillStyle:"hachure",fillWeight:void 0,hachureAngle:60,hachureGap:6,simplification:0,dashOffset:void 0,dashGap:void 0,zigzagOffset:void 0,seed:1,fillLineDash:void 0,fillLineDashOffset:void 0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!0,fixedDecimalPlaceDigits:void 0};class vm{drawShape(t,e,i,n,r,s,a,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,a,o)}}var mm=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},ym=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bm=function(t,e){return function(i,n){e(i,n,t)}};let xm=class extends vm{constructor(t){super(),this.canvasRenderer=t,this.style="rough",this.type="arc",this.numberType=ro}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,a=fm(s);r.highPerformanceSave();const o=t.getGraphicTheme();let{x:h=o.x,y:l=o.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const{dx:e=o.dx,dy:i=o.dy}=t.attribute;h+=e,l+=i,r.setTransformForCurrent()}else h=0,l=0,r.transformFromMatrix(t.transMatrix,!0);const c=new Ni,{fill:u=o.fill,stroke:d=o.stroke,lineWidth:p=o.lineWidth,outerRadius:f=o.outerRadius,innerRadius:g=o.innerRadius,maxRandomnessOffset:v=gm.maxRandomnessOffset,roughness:m=gm.roughness,bowing:y=gm.bowing,curveFitting:b=gm.curveFitting,curveTightness:x=gm.curveTightness,curveStepCount:w=gm.curveStepCount,fillStyle:S=gm.fillStyle,fillWeight:A=gm.fillWeight,hachureAngle:T=gm.hachureAngle,hachureGap:C=gm.hachureGap,simplification:_=gm.simplification,dashOffset:B=gm.dashOffset,dashGap:P=gm.dashGap,zigzagOffset:R=gm.zigzagOffset,seed:M=gm.seed,fillLineDash:E=gm.fillLineDash,fillLineDashOffset:k=gm.fillLineDashOffset,disableMultiStroke:O=gm.disableMultiStroke,disableMultiStrokeFill:I=gm.disableMultiStrokeFill,preserveVertices:L=gm.preserveVertices,fixedDecimalPlaceDigits:D=gm.fixedDecimalPlaceDigits}=t.attribute;Zo(t,c,h,l,f,g),a.path(c.toString(),{fill:u||void 0,stroke:d||void 0,strokeWidth:p,maxRandomnessOffset:v,roughness:m,bowing:y,curveFitting:b,curveTightness:x,curveStepCount:w,fillStyle:S,fillWeight:A,hachureAngle:T,hachureGap:C,simplification:_,dashOffset:B,dashGap:P,zigzagOffset:R,seed:M,fillLineDash:E,fillLineDashOffset:k,disableMultiStroke:O,disableMultiStrokeFill:I,preserveVertices:L,fixedDecimalPlaceDigits:D}),r.highPerformanceRestore()}};xm=mm([g(),bm(0,p(t.DefaultCanvasArcRender)),ym("design:paramtypes",[Object])],xm);var wm=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Sm=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.style="rough"}drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f){if(f)return super.drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f);t.highPerformanceSave();const g=t.canvas.nativeCanvas,v=fm(g,{}),m=new Ni;Ol(m,e,h,{offsetX:l,offsetY:c});const{maxRandomnessOffset:y=gm.maxRandomnessOffset,roughness:b=gm.roughness,bowing:x=gm.bowing,curveFitting:w=gm.curveFitting,curveTightness:S=gm.curveTightness,curveStepCount:A=gm.curveStepCount,fillStyle:T=gm.fillStyle,fillWeight:C=gm.fillWeight,hachureAngle:_=gm.hachureAngle,hachureGap:B=gm.hachureGap,simplification:P=gm.simplification,dashOffset:R=gm.dashOffset,dashGap:M=gm.dashGap,zigzagOffset:E=gm.zigzagOffset,seed:k=gm.seed,fillLineDash:O=gm.fillLineDash,fillLineDashOffset:I=gm.fillLineDashOffset,disableMultiStroke:L=gm.disableMultiStroke,disableMultiStrokeFill:D=gm.disableMultiStrokeFill,preserveVertices:j=gm.preserveVertices,fixedDecimalPlaceDigits:U=gm.fixedDecimalPlaceDigits}=a;let{fill:W,stroke:N,lineWidth:G}=a;return Array.isArray(o)?o.forEach((t=>{W=null!=W?W:t.fill,N=null!=N?N:t.stroke,G=null!=G?G:t.lineWidth})):(W=null!=W?W:o.fill,N=null!=N?N:o.stroke,G=null!=G?G:o.lineWidth),v.path(m.toString(),{fill:i?W:void 0,strokeWidth:G,maxRandomnessOffset:y,roughness:b,bowing:x,curveFitting:w,curveTightness:S,curveStepCount:A,fillStyle:T,fillWeight:C,hachureAngle:_,hachureGap:B,simplification:P,dashOffset:R,dashGap:M,zigzagOffset:E,seed:k,fillLineDash:O,fillLineDashOffset:I,disableMultiStroke:L,disableMultiStrokeFill:D,preserveVertices:j,fixedDecimalPlaceDigits:U}),t.highPerformanceRestore(),!1}};Sm=wm([g()],Sm);var Am=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Tm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cm=function(t,e){return function(i,n){e(i,n,t)}};let _m=class extends vm{constructor(t){super(),this.canvasRenderer=t,this.style="rough",this.type="circle",this.numberType=oo}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,a=fm(s,{}),o=t.getGraphicTheme();let{x:h=o.x,y:l=o.y}=t.attribute;t.transMatrix.onlyTranslate()?r.onlyTranslate()||r.clearMatrix():(h=0,l=0,r.transformFromMatrix(t.transMatrix,!0));const{radius:c=o.radius,fill:u=o.fill,stroke:d=o.stroke,lineWidth:p=o.lineWidth}=t.attribute;a.circle(h,l,c,{fill:u||void 0,stroke:d||void 0,strokeWidth:p,fillStyle:"zigzag",roughness:.5})}};_m=Am([g(),Cm(0,p(t.DefaultCanvasCircleRender)),Tm("design:paramtypes",[Object])],_m);var Bm=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Pm=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.style="rough"}drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f){if(p||f)return super.drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f);t.highPerformanceSave();const g=t.canvas.nativeCanvas,v=fm(g,{}),m=new Ni;Rl(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u});const{maxRandomnessOffset:y=gm.maxRandomnessOffset,roughness:b=gm.roughness,bowing:x=gm.bowing,curveFitting:w=gm.curveFitting,curveTightness:S=gm.curveTightness,curveStepCount:A=gm.curveStepCount,fillStyle:T=gm.fillStyle,fillWeight:C=gm.fillWeight,hachureAngle:_=gm.hachureAngle,hachureGap:B=gm.hachureGap,simplification:P=gm.simplification,dashOffset:R=gm.dashOffset,dashGap:M=gm.dashGap,zigzagOffset:E=gm.zigzagOffset,seed:k=gm.seed,fillLineDash:O=gm.fillLineDash,fillLineDashOffset:I=gm.fillLineDashOffset,disableMultiStroke:L=gm.disableMultiStroke,disableMultiStrokeFill:D=gm.disableMultiStrokeFill,preserveVertices:j=gm.preserveVertices,fixedDecimalPlaceDigits:U=gm.fixedDecimalPlaceDigits}=a;let{fill:W,stroke:N,lineWidth:G}=a;return Array.isArray(o)?o.forEach((t=>{W=null!=W?W:t.fill,N=null!=N?N:t.stroke,G=null!=G?G:t.lineWidth})):(W=null!=W?W:o.fill,N=null!=N?N:o.stroke,G=null!=G?G:o.lineWidth),v.path(m.toString(),{fill:i?W:void 0,stroke:n?N:void 0,strokeWidth:G,maxRandomnessOffset:y,roughness:b,bowing:x,curveFitting:w,curveTightness:S,curveStepCount:A,fillStyle:T,fillWeight:C,hachureAngle:_,hachureGap:B,simplification:P,dashOffset:R,dashGap:M,zigzagOffset:E,seed:k,fillLineDash:O,fillLineDashOffset:I,disableMultiStroke:L,disableMultiStrokeFill:D,preserveVertices:j,fixedDecimalPlaceDigits:U}),t.highPerformanceRestore(),!1}};Pm=Bm([g()],Pm);var Rm=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Mm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Em=function(t,e){return function(i,n){e(i,n,t)}};let km=class extends vm{constructor(t){super(),this.canvasRenderer=t,this.style="rough",this.type="path",this.numberType=po}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,a=fm(s,{});r.highPerformanceSave();const o=t.getGraphicTheme();r.transformFromMatrix(t.transMatrix,!0);const{fill:h=o.fill,stroke:l=o.stroke,lineWidth:c=o.lineWidth,path:u=o.path,maxRandomnessOffset:d=gm.maxRandomnessOffset,roughness:p=gm.roughness,bowing:f=gm.bowing,curveFitting:g=gm.curveFitting,curveTightness:v=gm.curveTightness,curveStepCount:m=gm.curveStepCount,fillStyle:y=gm.fillStyle,fillWeight:b=gm.fillWeight,hachureAngle:x=gm.hachureAngle,hachureGap:w=gm.hachureGap,simplification:S=gm.simplification,dashOffset:A=gm.dashOffset,dashGap:T=gm.dashGap,zigzagOffset:C=gm.zigzagOffset,seed:_=gm.seed,fillLineDash:B=gm.fillLineDash,fillLineDashOffset:P=gm.fillLineDashOffset,disableMultiStroke:R=gm.disableMultiStroke,disableMultiStrokeFill:M=gm.disableMultiStrokeFill,preserveVertices:E=gm.preserveVertices,fixedDecimalPlaceDigits:k=gm.fixedDecimalPlaceDigits}=t.attribute;"string"==typeof u&&a.path(u,{fill:h||void 0,stroke:l||void 0,strokeWidth:c,maxRandomnessOffset:d,roughness:p,bowing:f,curveFitting:g,curveTightness:v,curveStepCount:m,fillStyle:y,fillWeight:b,hachureAngle:x,hachureGap:w,simplification:S,dashOffset:A,dashGap:T,zigzagOffset:C,seed:_,fillLineDash:B,fillLineDashOffset:P,disableMultiStroke:R,disableMultiStrokeFill:M,preserveVertices:E,fixedDecimalPlaceDigits:k}),r.highPerformanceRestore()}};km=Rm([g(),Em(0,p(t.DefaultCanvasPathRender)),Mm("design:paramtypes",[Object])],km);var Om=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Im=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Lm=function(t,e){return function(i,n){e(i,n,t)}};let Dm=class extends vm{constructor(t){super(),this.canvasRenderer=t,this.style="rough",this.type="rect",this.numberType=vo}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,a=fm(s);r.highPerformanceSave();const o=t.getGraphicTheme();let{x:h=o.x,y:l=o.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const{dx:e=o.dx,dy:i=o.dy}=t.attribute;h+=e,l+=i,r.setTransformForCurrent()}else h=0,l=0,r.transformFromMatrix(t.transMatrix,!0);const{fill:c=o.fill,stroke:u=o.stroke,fillColor:d=o.fill,strokeColor:p=o.stroke,x1:f,y1:g,lineWidth:v=o.lineWidth,maxRandomnessOffset:m=gm.maxRandomnessOffset,roughness:y=gm.roughness,bowing:b=gm.bowing,curveFitting:x=gm.curveFitting,curveTightness:w=gm.curveTightness,curveStepCount:S=gm.curveStepCount,fillStyle:A=gm.fillStyle,fillWeight:T=gm.fillWeight,hachureAngle:C=gm.hachureAngle,hachureGap:_=gm.hachureGap,simplification:B=gm.simplification,dashOffset:P=gm.dashOffset,dashGap:R=gm.dashGap,zigzagOffset:M=gm.zigzagOffset,seed:E=gm.seed,fillLineDash:k=gm.fillLineDash,fillLineDashOffset:O=gm.fillLineDashOffset,disableMultiStroke:I=gm.disableMultiStroke,disableMultiStrokeFill:L=gm.disableMultiStrokeFill,preserveVertices:D=gm.preserveVertices,fixedDecimalPlaceDigits:j=gm.fixedDecimalPlaceDigits}=t.attribute;let{width:U=o.width,height:W=o.height}=t.attribute;U=(null!=U?U:f-h)||0,W=(null!=W?W:g-l)||0,a.rectangle(h,l,U,W,{fill:c?d:void 0,stroke:u?p:void 0,strokeWidth:v,maxRandomnessOffset:m,roughness:y,bowing:b,curveFitting:x,curveTightness:w,curveStepCount:S,fillStyle:A,fillWeight:T,hachureAngle:C,hachureGap:_,simplification:B,dashOffset:P,dashGap:R,zigzagOffset:M,seed:E,fillLineDash:k,fillLineDashOffset:O,disableMultiStroke:I,disableMultiStrokeFill:L,preserveVertices:D,fixedDecimalPlaceDigits:j}),r.highPerformanceRestore()}};Dm=Om([g(),Lm(0,p(t.DefaultCanvasRectRender)),Im("design:paramtypes",[Object])],Dm);var jm=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Um=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wm=function(t,e){return function(i,n){e(i,n,t)}};let Nm=class extends Fh{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=bo,this.style="rough"}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,a=fm(s);r.highPerformanceSave();const o=t.getGraphicTheme(),h=this.transform(t,o,r),{x:l,y:c,z:u,lastModelMatrix:d}=h,p=t.getParsedPath();if(!p)return;const{fill:f=o.fill,stroke:g=o.stroke,fillColor:v=o.fill,strokeColor:m=o.stroke,size:y=o.size,lineWidth:b=o.lineWidth,maxRandomnessOffset:x=gm.maxRandomnessOffset,roughness:w=gm.roughness,bowing:S=gm.bowing,curveFitting:A=gm.curveFitting,curveTightness:T=gm.curveTightness,curveStepCount:C=gm.curveStepCount,fillStyle:_=gm.fillStyle,fillWeight:B=gm.fillWeight,hachureAngle:P=gm.hachureAngle,hachureGap:R=gm.hachureGap,simplification:M=gm.simplification,dashOffset:E=gm.dashOffset,dashGap:k=gm.dashGap,zigzagOffset:O=gm.zigzagOffset,seed:I=gm.seed,fillLineDash:L=gm.fillLineDash,fillLineDashOffset:D=gm.fillLineDashOffset,disableMultiStroke:j=gm.disableMultiStroke,disableMultiStrokeFill:U=gm.disableMultiStrokeFill,preserveVertices:W=gm.preserveVertices,fixedDecimalPlaceDigits:N=gm.fixedDecimalPlaceDigits}=t.attribute;let G="";if(p.drawToSvgPath)G=p.drawToSvgPath(y,l,c);else{const t=new Ni;p.draw(t,y,l,c)&&t.closePath(),G=t.toString()}a.path(G,{fill:f?v:void 0,stroke:g?m:void 0,strokeWidth:b,maxRandomnessOffset:x,roughness:w,bowing:S,curveFitting:A,curveTightness:T,curveStepCount:C,fillStyle:_,fillWeight:B,hachureAngle:P,hachureGap:R,simplification:M,dashOffset:E,dashGap:k,zigzagOffset:O,seed:I,fillLineDash:L,fillLineDashOffset:D,disableMultiStroke:j,disableMultiStrokeFill:U,preserveVertices:W,fixedDecimalPlaceDigits:N}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,a,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,a,o)}};Nm=jm([g(),Wm(0,p(t.DefaultCanvasSymbolRender)),Um("design:paramtypes",[Object])],Nm);var Gm=new i((t=>{t(_m).toSelf().inSingletonScope(),t(Bc).to(_m),t(Dm).toSelf().inSingletonScope(),t(Bc).to(Dm),t(km).toSelf().inSingletonScope(),t(Bc).to(km),t(Nm).toSelf().inSingletonScope(),t(Bc).to(Nm),t(Pm).toSelf().inSingletonScope(),t(Bc).to(Pm),t(Sm).toSelf().inSingletonScope(),t(Bc).to(Sm),t(xm).toSelf().inSingletonScope(),t(Bc).to(xm)}));const Fm=Symbol.for("MathPickerContribution"),zm=Symbol.for("MathArcPicker"),Hm=Symbol.for("MathAreaPicker"),Vm=Symbol.for("MathCirclePicker"),Ym=Symbol.for("MathImagePicker"),Xm=Symbol.for("MathLinePicker"),$m=Symbol.for("MathPathPicker"),qm=Symbol.for("MathRectPicker"),Km=Symbol.for("MathSymbolPicker"),Zm=Symbol.for("MathTextPicker"),Jm=Symbol.for("MathPolygonPicker"),Qm=Symbol.for("MathGlyphPicker"),ty=Symbol.for("CanvasArcPicker"),ey=Symbol.for("CanvasArc3dPicker"),iy=Symbol.for("CanvasAreaPicker"),ny=Symbol.for("CanvasCirclePicker"),ry=Symbol.for("CanvasImagePicker"),sy=Symbol.for("CanvasGifImagePicker"),ay=Symbol.for("CanvasLinePicker"),oy=Symbol.for("CanvasPathPicker"),hy=Symbol.for("CanvasRectPicker"),ly=Symbol.for("CanvasRect3dPicker"),cy=Symbol.for("CanvasSymbolPicker"),uy=Symbol.for("CanvasTextPicker"),dy=Symbol.for("CanvasPolygonPicker"),py=Symbol.for("CanvasPyramid3dPicker"),fy=Symbol.for("CanvasRichTextPicker"),gy=Symbol.for("CanvasGlyphPicker"),vy=Symbol.for("CanvasGroupPicker"),my=Symbol.for("CanvasPickerContribution"),yy={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},by=Object.keys(yy);function xy(t){return Jl.richtext(t?t.attribute:{})}xy.Text=function(t){return Object.assign({type:"rich/text"},t)},xy.Image=function(t){return Object.assign({type:"rich/image"},t)};var wy=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i};function Sy(t,e){if(at(t))return t.forEach((t=>Sy(t,e)));e.push(t)}const Ay=Po;function Ty(t){if(!t||!t.$$typeof)return t;const e=t.type,{attribute:i,children:n,stateProxy:r,id:s,name:a}=t.props,o=e({attribute:i}),h=function(t,e,i){let n,r=!1;switch(t.type){case"richtext":break;case"rich/text":n=t.attribute||{},i&&(n.text=i),t.attribute=n;break;case"rich/image":n=t.attribute||{};break;default:r=!0}return r?Object.keys(e).forEach((i=>{const n=yy[i];n&&t.on(n,e[i])})):"richtext"===t.type&&(t.attribute.textConfig=i.map((t=>Ty(t))).filter((t=>t))),n}(o,t.props,n);return h||(r&&(o.stateProxy=r),o.id=s,o.name=a,Cy(n,o),o)}function Cy(t,e){at(t)?t.forEach((t=>{if(at(t))Cy(t,e);else{const i=Ty(t);i&&i.type&&e.add(i)}})):t&&e.add(Ty(t))}const _y=(t,e)=>{const i=e.x-t.x,n=e.y-t.y;return Math.abs(i)>Math.abs(n)?i>0?"right":"left":n>0?"down":"up"},By=(t,e)=>{const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return Math.sqrt(i*i+n*n)};var Py=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Ry=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const My=[0,0,0];let Ey=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},Vi),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},Xi),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},$i),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new ue(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new ue(1,0,0,1,0,0),this._clearMatrix=new ue(1,0,0,1,0,0),this.baseGlobalAlpha=1}reset(){this.stack.length&&wt.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new ue(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Ih.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(Ih.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(Ih.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(o*t,o*e,o*i,o*n,o*r,o*s),a&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,r,s),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,n,r,s,a){if(a=a||0,this.camera){const o=[];((t,e,i,n,r,s,a,o)=>{if(o)for(;i>e;)i-=Mt;else for(;i<e;)i+=Mt;const h=Bt/3*(i>e?1:-1);let l=e,c=l;for(;c!==i;){c=h>0?Math.min(c+h,i):Math.max(c+h,i);const e=Math.abs(c-l),o=4*Math.tan(e/4)/3,u=c<l?-1:1,d=Math.cos(l),p=Math.sin(l),f=Math.cos(c),g=Math.sin(c),v=d*s+n,m=p*a+r,y=f*s+n,b=g*a+r,x=s*o*u,w=a*o*u;t.push([v-x*p,m+w*d,y+x*g,b-w*f,y,b]),l=c}})(o,n,r,t,e,i,i,s);for(let t=0;t<o.length;++t){const e=o[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],a)}}else this.nativeContext.arc(t,e,Math.max(0,i),n,r,s)}arcTo(t,e,i,n,r){this.nativeContext.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s,a){if(a=a||0,this.camera){let o=a,h=a;this.modelMatrix&&(Ph(My,[t,e,a],this.modelMatrix),t=My[0],e=My[1],o=My[2],Ph(My,[i,n,a],this.modelMatrix),i=My[0],n=My[1],h=My[2],Ph(My,[r,s,a],this.modelMatrix),r=My[0],s=My[1],a=My[2]);let l=this.camera.vp(r,s,a);r=l.x,s=l.y,l=this.camera.vp(t,e,o),t=l.x,e=l.y,l=this.camera.vp(i,n,h),i=l.x,n=l.y}this.nativeContext.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.nativeContext.closePath()}ellipse(t,e,i,n,r,s,a,o){null==o?this.nativeContext.ellipse(t,e,i,n,r,s,a):this.nativeContext.ellipse(t,e,i,n,r,s,a,o)}lineTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Ph(My,[t,e,i],this.modelMatrix),t=My[0],e=My[1],i=My[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Ph(My,[t,e,i],this.modelMatrix),t=My[0],e=My[1],i=My[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,i,n,r){if(r=r||0,this.camera){let s=r;this.modelMatrix&&(Ph(My,[t,e,r],this.modelMatrix),t=My[0],e=My[1],s=My[2],Ph(My,[i,n,r],this.modelMatrix),i=My[0],n=My[1],r=My[2]);let a=this.camera.vp(i,n,r);i=a.x,n=a.y,a=this.camera.vp(t,e,s),t=a.x,e=a.y}this.nativeContext.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+i,e,r),this.lineTo(t+i,e+n,r),this.lineTo(t,e+n,r),this.closePath()):this.nativeContext.rect(t,e,i,n)}createImageData(){const t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}createLinearGradient(t,e,i,n){return isFinite(t+e+i+n)||(t=0,e=0,i=0,n=0),this.nativeContext.createLinearGradient(t,e,i,n)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,i,n,r,s){return this.nativeContext.createRadialGradient(t,e,i,n,r,s)}createConicGradient(t,e,i,n){let r,s=!1;const a=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),s=!0},GetPattern(o,h,l){return s&&(l||(l=n-i),r=ih(a,this.stops,t,e,l,i,n,o,h),s=!1),r}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,n){this.nativeContext.fillRect(t,e,i,n)}clearRect(t,e,i,n){this.nativeContext.clearRect(t,e,i,n)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Ph(My,[t,e,i],this.modelMatrix),t=My[0],e=My[1],i=My[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(Ph(My,[t,e,i],this.modelMatrix),t=My[0],e=My[1],i=My[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(Ph(My,[e,i,n],this.modelMatrix),e=My[0],i=My[1],n=My[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,n){return this.nativeContext.getImageData(t,e,i,n)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mn.global.measureTextMethod;var i,n;if(!e||"native"===e)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=mn.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas.nativeCanvas)));const r=null!==(i=this.fontFamily)&&void 0!==i?i:$i.fontFamily,s=null!==(n=this.fontSize)&&void 0!==n?n:$i.fontSize;return this.mathTextMeasure.textSpec.fontFamily===r&&this.mathTextMeasure.textSpec.fontSize===s||(this.mathTextMeasure.textSpec.fontFamily=r,this.mathTextMeasure.textSpec.fontSize=s,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,e)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?e[0]&&i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,n){this.nativeContext.strokeRect(t,e,i,n)}strokeText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(Ph(My,[e,i,n],this.modelMatrix),e=My[0],i=My[1],n=My[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}setCommonStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,i,n,r[0]);const s=Object.create(r[0]);return r.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setCommonStyle(t,e,i,n,s)}return this._setCommonStyle(t,e,i,n,r)}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:a=r.fillOpacity,opacity:o=r.opacity,fill:h=r.fill}=e;s.globalAlpha=a*o*this.baseGlobalAlpha,a>1e-12&&o>1e-12&&(s.fillStyle=wn(this,h,t,i,n))}setShadowBlendStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);const n=Object.create(i[0]);return i.forEach(((t,e)=>{0!==e&&Object.assign(n,t)})),this._setShadowBlendStyle(t,e,n)}return this._setShadowBlendStyle(t,e,i)}_setShadowBlendStyle(t,e,i){const n=this.nativeContext;i||(i=this.fillAttributes);const{opacity:r=i.opacity,shadowBlur:s=i.shadowBlur,shadowColor:a=i.shadowColor,shadowOffsetX:o=i.shadowOffsetX,shadowOffsetY:h=i.shadowOffsetY,blur:l=i.blur,globalCompositeOperation:c=i.globalCompositeOperation}=e;r<=1e-12||(s||o||h?(n.shadowBlur=s*this.dpr,n.shadowColor=a,n.shadowOffsetX=o*this.dpr,n.shadowOffsetY=h*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0),l?(n.filter=`blur(${l}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(n.filter="blur(0px)",this._clearFilterStyle=!1),c?(n.globalCompositeOperation=c,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(n.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,i,n,r[0]);const s=Object.create(r[0]);return r.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setStrokeStyle(t,e,i,n,s)}return this._setStrokeStyle(t,e,i,n,r)}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(s.globalAlpha=a*o*this.baseGlobalAlpha,a>1e-12&&o>1e-12){const{lineWidth:a=r.lineWidth,stroke:o=r.stroke,lineJoin:h=r.lineJoin,lineDash:l=r.lineDash,lineCap:c=r.lineCap,miterLimit:u=r.miterLimit,keepStrokeScale:d=r.keepStrokeScale}=e;s.lineWidth=d?a:xn(this,a,this.dpr),s.strokeStyle=wn(this,o,t,i,n),s.lineJoin=h,l&&s.setLineDash(l),s.lineCap=c,s.miterLimit=u}}setTextStyleWithoutAlignBaseline(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;t.font?n.font=t.font:n.font=se(t,e,r&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:s=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=s,this.fontSize=a,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){var n,r;const s=this.nativeContext;e||(e=this.textAttributes),t.font?s.font=t.font:s.font=se(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:a=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=a,this.fontSize=o,s.textAlign=null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(this._clearMatrix,t,e)}setClearMatrix(t,e,i,n,r,s){this._clearMatrix.setValue(t,e,i,n,r,s)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>Ih.free(t))),this.stack.length=0}};Ey.env="browser",Ey=Py([g(),Ry("design:paramtypes",[Object,Number])],Ey);var ky=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Oy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Iy=class extends Af{constructor(t){super(t)}init(t){const{container:e}=t;if("string"==typeof e){const t=mn.global.getElementById(e);t&&(this._container=t)}else this._container=e;this._context=new Ey(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:i=this._displayHeight,dpr:n=this._dpr,x:r=this._x,y:s=this._y}=t,{nativeCanvas:a}=this;a.width=e*n,a.height=i*n,!a.style||this.setCanvasStyle(a,r,s,e,i),t.id&&(a.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,n,r){this.controled&&(t.style.width=`${n}px`,t.style.height=`${r}px`)}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}resize(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}};function Ly(t,e){return new i((i=>{i(Un).toDynamicValue((()=>e=>new t(e))).whenTargetNamed(t.env),i(Wn).toDynamicValue((()=>(t,i)=>new e(t,i))).whenTargetNamed(e.env)}))}Iy.env="browser",Iy=ky([g(),Oy("design:paramtypes",[Object])],Iy);const Dy=Ly(Iy,Ey);var jy=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Uy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wy=function(t,e){return function(i,n){e(i,n,t)}};let Ny=class extends t.DefaultPickService{constructor(t,e,i){super(i),this.contributions=t,this.drawContribution=e,this.pickItemInterceptorContributions=i,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(t,e){this.pickCanvas=vr.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i,n){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.beforePickItem){const r=s.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n),a=s?t:null,o={graphic:a,params:s};if(a)return o;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.afterPickItem){const r=s.afterPickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}return o}};Ny=jy([g(),Wy(0,p(k)),Wy(0,v(my)),Wy(1,p(Gc)),Wy(2,p(k)),Wy(2,v(vp)),Uy("design:paramtypes",[Object,Object,Object])],Ny);var Gy=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Fy=class{constructor(){this.type="group",this.numberType=lo}contains(t,e,i){return!1}};Fy=Gy([g()],Fy);const zy=new i(((t,e,i,n)=>{zy.__vloaded||(zy.__vloaded=!0,t(vy).to(Fy).inSingletonScope(),t(my).toService(vy),I(t,my))}));zy.__vloaded=!1;var Hy=zy;const Vy=new i(((t,e,i,n)=>{i(Ny)||t(Ny).toSelf().inSingletonScope(),i(su)?n(su).toService(Ny):t(su).toService(Ny)}));function Yy(t){t.load(Hy),t.load(Vy)}var Xy,$y=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},qy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ky=Xy=class extends t.BaseWindowHandlerContribution{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${Xy.idprefix}_${Xy.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=mn.global,this.viewBox=new le,this.modelMatrix=new ue(1,0,0,1,0,0)}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>n)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let i;if(i="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!i)throw new Error("发生错误,containerId可能传入有误");t.offscreen?i=null:i.appendChild(e);const n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:i,id:Xy.GenerateCanvasId(),canvasControled:!0};this.canvas=new Iy(n)}createWindowByCanvas(t){var e;let i;if("string"==typeof t.canvas){if(i=this.global.getElementById(t.canvas),!i)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=t.canvas;if(!i)throw new Error("发生错误,传入的canvas不正确");let n=t.width,r=t.height;if(null==n||null==r||!t.canvasControled){const t=i.getBoundingClientRect();n=t.width,r=t.height}let s=t.dpr;null==s&&(s=null!==(e=i.getContext("2d").pixelRatio)&&void 0!==e?e:i.width/n),this.canvas=new Iy({width:n,height:r,dpr:s,nativeCanvas:i,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){var t;return null!==(t=this.canvas.nativeCanvas.style)&&void 0!==t?t:{}}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};Ky.env="browser",Ky.idprefix="visactor_window",Ky.prefix_count=0,Ky=Xy=$y([g(),qy("design:paramtypes",[])],Ky);const Zy=new i((t=>{t(Ky).toSelf(),t(xr).toDynamicValue((t=>t.container.get(Ky))).whenTargetNamed(Ky.env)}));var Jy=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Qy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tb=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};class eb{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function ib(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.createElement("img");if(mn.global.isImageAnonymous&&(i.crossOrigin="anonymous"),e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return i.src=t,i.complete?Promise.resolve(i):new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}))}t.BrowserEnvContribution=class extends t.BaseEnvContribution{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var i,n;let r=0,s=0,a=0,o=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};r=e.clientX||0,s=e.clientY||0,a=r,o=s}else r=t.clientX||0,s=t.clientY||0,a=t.offsetX||0,o=t.offsetY||0;if(e){const t=r,i=s,a=e.getBoundingClientRect(),o=null===(n=e.getNativeHandler)||void 0===n?void 0:n.call(e).nativeCanvas;let h,l;return o&&(h=a.width/o.offsetWidth,l=a.height/o.offsetHeight),{x:(t-a.left)/(lt(h)?h:1),y:(i-a.top)/(lt(l)?l:1)}}return{x:a,y:o}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new eb(t)}return new le}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:i,height:n,style:r}=e;return r&&(st(r)?t.setAttribute("style",r):Object.keys(r).forEach((e=>{t.style[e]=r[e]}))),null!=i&&(t.style.width=`${i}px`),null!=n&&(t.style.height=`${n}px`),!0}createDom(t){const{tagName:e="div",parent:i}=t,n=document.createElement(e);if(this.updateDom(n,t),i){const t=st(i)?this.getElementById(i):i;t&&t.appendChild&&t.appendChild(n)}return n}loadImage(t){return ib(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return ib(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var i,n;const r=document.createElement("canvas");t.id&&(r.id=null!==(i=t.id)&&void 0!==i?i:e.GenAutoIncrementId().toString());const s=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r.width=t.width*s,r.height=t.height*s),r}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(){}getElementTop(t,e){let i=t.offsetTop,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,n=n.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetLeft,n=n.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,n=t.offsetLeft,r=t.offsetParent;for(;null!==r;)i+=r.offsetTop,n+=r.offsetLeft,r=r.offsetParent;return{top:i,left:n}}loadFont(t,e,i){return tb(this,void 0,void 0,(function*(){return new FontFace(t,st(e)?`url(${e})`:e,i).load().then((function(t){return document.fonts.add(t),{loadState:"success"}})).catch((function(t){return console.error("Failed to load font:",t),{loadState:"fail"}}))}))}},t.BrowserEnvContribution=Jy([g(),Qy("design:paramtypes",[])],t.BrowserEnvContribution);const nb=new i((e=>{nb.isBrowserBound||(nb.isBrowserBound=!0,e(t.BrowserEnvContribution).toSelf().inSingletonScope(),e(U).toService(t.BrowserEnvContribution))}));function rb(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];rb.__loaded||(rb.__loaded=!0,t.load(nb),t.load(Dy),t.load(Zy),e&&Yy(t))}nb.isBrowserBound=!1,rb.__loaded=!1;var sb=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let ab=class extends Ey{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}getImageData(t,e,i,n){return new Promise(((r,s)=>{var a;try{tt.canvasGetImageData({canvasId:null!==(a=this.canvas.nativeCanvas.id)&&void 0!==a?a:this.canvas.id,x:t,y:e,width:i,height:n,success(t){r(t)}})}catch(t){s(t)}}))}draw(){const t=this.nativeContext;t.draw&&(this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))})))}createPattern(t,e){return null}};ab.env="feishu",ab=sb([g()],ab);var ob=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},hb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let lb=class extends Af{constructor(t){super(t)}init(){this._context=new ab(this,this._dpr)}release(){}};lb.env="feishu",lb=ob([g(),hb("design:paramtypes",[Object])],lb);const cb=Ly(lb,ab);var ub=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},db=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pb=function(t,e){return function(i,n){e(i,n,t)}};let fb=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="feishu",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new lb(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new lb({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};fb.env="feishu",fb=ub([g(),pb(0,p(W)),db("design:paramtypes",[Object])],fb);const gb=new i((t=>{t(fb).toSelf(),t(xr).toDynamicValue((t=>t.container.get(fb))).whenTargetNamed(fb.env)}));var vb=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},mb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yb=function(t,e){return function(i,n){e(i,n,t)}};let bb=class extends t.DefaultPickService{constructor(t,e){super(e),this.contributions=t,this.pickItemInterceptorContributions=e,this.global.hooks.onSetEnv.tap("math-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(e,i){this.pickContext=new t.EmptyContext2d(null,1)}pickItem(t,e,i,n){if(!1===t.attribute.pickable)return null;const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n),a=s?t:null;return a?{graphic:a,params:s}:null}};bb=vb([g(),yb(0,p(k)),yb(0,v(Fm)),yb(1,p(k)),yb(1,v(vp)),mb("design:paramtypes",[Object,Object])],bb);const xb=new i((t=>{xb.__vloaded||(xb.__vloaded=!0,I(t,Fm))}));xb.__vloaded=!1;var wb=xb;class Sb{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.getGraphicTheme();n.highPerformanceSave();let{x:s=r.x,y:a=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth,a=i.pickStrokeBuffer||r.pickStrokeBuffer,h=i.keepStrokeScale||r.keepStrokeScale;return n.lineWidth=h?s+a:xn(n,s+a,n.dpr),o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}}var Ab=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Tb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cb=function(t,e){return function(i,n){e(i,n,t)}};let _b=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=ro}};_b=Ab([g(),Cb(0,p(Ac)),Tb("design:paramtypes",[Object])],_b);let Bb=!1;const Pb=new i(((t,e,i,n)=>{Bb||(Bb=!0,t(zm).to(_b).inSingletonScope(),t(Fm).toService(zm))}));var Rb=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Mb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Eb=function(t,e){return function(i,n){e(i,n,t)}};let kb=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=ao}};kb=Rb([g(),Eb(0,p(Cc)),Mb("design:paramtypes",[Object])],kb);let Ob=!1;const Ib=new i(((t,e,i,n)=>{Ob||(Ob=!0,t(Hm).to(kb).inSingletonScope(),t(Fm).toService(Hm))}));var Lb=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Db=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jb=function(t,e){return function(i,n){e(i,n,t)}};let Ub=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=oo}};Ub=Lb([g(),jb(0,p(_c)),Db("design:paramtypes",[Object])],Ub);let Wb=!1;const Nb=new i(((t,e,i,n)=>{Wb||(Wb=!0,t(Vm).to(Ub).inSingletonScope(),t(Fm).toService(Vm))}));class Gb{constructor(){this.type="glyph",this.numberType=ho}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{if(n)return;const s=r.pickItem(t,e,null,i);n=!(!s||!s.graphic)})),n}return!1}}var Fb=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},zb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hb=function(t,e){return function(i,n){e(i,n,t)}};let Vb=class extends Gb{constructor(t){super(),this.canvasRenderer=t}};Vb=Fb([g(),Hb(0,p(Uc)),zb("design:paramtypes",[Object])],Vb);let Yb=!1;const Xb=new i(((t,e,i,n)=>{Yb||(Yb=!0,t(Qm).to(Vb).inSingletonScope(),t(Vb).toService(Qm))}));var $b=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let qb=class{constructor(){this.type="image",this.numberType=co}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};qb=$b([g()],qb);let Kb=!1;const Zb=new i(((t,e,i,n)=>{Kb||(Kb=!0,t(Ym).to(qb).inSingletonScope(),t(qb).toService(Ym))}));var Jb=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Qb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tx=function(t,e){return function(i,n){e(i,n,t)}};let ex=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=uo}};ex=Jb([g(),tx(0,p(Rc)),Qb("design:paramtypes",[Object])],ex);let ix=!1;const nx=new i(((t,e,i,n)=>{ix||(ix=!0,t(Xm).to(ex).inSingletonScope(),t(Fm).toService(Xm))}));var rx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},sx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ax=function(t,e){return function(i,n){e(i,n,t)}};let ox=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=fo}};ox=rx([g(),ax(0,p(Ec)),sx("design:paramtypes",[Object])],ox);let hx=!1;const lx=new i(((t,e,i,n)=>{hx||(hx=!0,t(Jm).to(ox).inSingletonScope(),t(Fm).toService(Jm))}));var cx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},ux=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dx=function(t,e){return function(i,n){e(i,n,t)}};let px=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=po}};px=cx([g(),dx(0,p(Mc)),ux("design:paramtypes",[Object])],px);let fx=!1;const gx=new i(((t,e,i,n)=>{fx||(fx=!0,t($m).to(px).inSingletonScope(),t(Fm).toService($m))})),vx=new le;class mx{constructor(){this.type="rect",this.numberType=vo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.getGraphicTheme(),{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:a=r.x,y:o=r.y}=t.attribute;n.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);a+=e.x,o+=e.y,n.setTransformForCurrent()}else a=0,o=0,h=!1,n.transformFromMatrix(t.transMatrix,!0);let l=!0;if(!h||t.shadowRoot||ht(s,!0)&&0!==s||at(s)&&s.some((t=>0!==t)))l=!1,this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,i,n)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,r)=>{if(l)return!0;const s=i.lineWidth||r.lineWidth,a=i.pickStrokeBuffer||r.pickStrokeBuffer,o=i.keepStrokeScale||r.keepStrokeScale;return n.lineWidth=o?s+a:xn(n,s+a,n.dpr),l=t.isPointInStroke(e.x,e.y),l}));else{const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)l=!0;else if(n){const i=t.AABBBounds;vx.setValue(i.x1,i.y1,i.x2,i.y2),vx.expand(-s/2),l=!vx.containsPoint(e)}}return n.highPerformanceRestore(),l}}var yx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},bx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xx=function(t,e){return function(i,n){e(i,n,t)}};let Sx=class extends mx{constructor(t){super(),this.canvasRenderer=t}};Sx=yx([g(),xx(0,p(kc)),bx("design:paramtypes",[Object])],Sx);let Ax=!1;const Tx=new i(((t,e,i,n)=>{Ax||(Ax=!0,t(qm).to(Sx).inSingletonScope(),t(Fm).toService(qm))}));let Cx=!1;const _x=new i(((t,e,i,n)=>{Cx||(Cx=!0,t(Ym).to(qb).inSingletonScope(),t(qb).toService(Ym))}));var Bx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Px=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rx=function(t,e){return function(i,n){e(i,n,t)}};let Mx=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=bo}};Mx=Bx([g(),Rx(0,p(Ic)),Px("design:paramtypes",[Object])],Mx);let Ex=!1;const kx=new i(((t,e,i,n)=>{Ex||(Ex=!0,t(Km).to(Mx).inSingletonScope(),t(Fm).toService(Km))}));var Ox=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Ix=class{constructor(){this.type="text",this.numberType=xo}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};Ix=Ox([g()],Ix);let Lx=!1;const Dx=new i(((t,e,i,n)=>{Lx||(Lx=!0,t(Zm).to(Ix).inSingletonScope(),t(Fm).toService(Zm))})),jx=new i(((t,e,i,n)=>{i(bb)||t(bb).toSelf().inSingletonScope(),i(su)?n(su).toService(bb):t(su).toService(bb)}));function Ux(t){t.load(wb),t.load(jx),t.load(Pb),t.load(Ib),t.load(Nb),t.load(Xb),t.load(Zb),t.load(nx),t.load(lx),t.load(gx),t.load(Tx),t.load(_x),t.load(kx),t.load(Dx)}class Wx{get width(){return this._w*this.dpr}set width(t){}get height(){return this._h*this.dpr}set height(t){}get offsetWidth(){return this._w}set offsetWidth(t){}get offsetHeight(){return this._h}set offsetHeight(t){}constructor(t,e,i,n,r,s){this.nativeCanvas=t,this.ctx=e,this._w=n,this._h=r,this.id=s,t.id=s,this.dpr=i}getContext(){return this.ctx}getBoundingClientRect(){return{width:this._w,height:this._h}}}class Nx{get width(){return this._w*this.dpr}set width(t){this._w=t/this.dpr,this.nativeCanvas.width=t}get height(){return this._h*this.dpr}set height(t){this._h=t/this.dpr,this.nativeCanvas.height=t}get offsetWidth(){return this._w}set offsetWidth(t){this._w=t,this.nativeCanvas.width=t*this.dpr}get offsetHeight(){return this._h}set offsetHeight(t){this._h=t,this.nativeCanvas.height=t*this.dpr}constructor(t,e,i,n,r,s){this.nativeCanvas=t,this.ctx=e,this._w=n,this._h=r,this.id=s,t.id=s,this.dpr=i}getContext(){return this.ctx}getBoundingClientRect(){return{width:this._w,height:this._h}}}var Gx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Fx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let zx=class extends t.BaseEnvContribution{constructor(){super(),this.type="feishu",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r,s){const a=null!=s?s:tt.getSystemInfoSync().pixelRatio;e.forEach(((e,s)=>{if(i.has(e))return;const o=tt.createCanvasContext(e),h=new Wx(o.canvas||{},o,a,t.width,t.height,e);o.canvas=h,i.set(e,h),s>=n&&r.push(h)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.pixelRatio))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return tt.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return Ts.call(t)}}getCancelAnimationFrame(){return t=>{Ts.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}};zx=Gx([g(),Fx("design:paramtypes",[])],zx);const Hx=new i((t=>{Hx.isFeishuBound||(Hx.isFeishuBound=!0,t(zx).toSelf().inSingletonScope(),t(U).toService(zx))}));function Vx(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Vx.__loaded||(Vx.__loaded=!0,t.load(Hx),t.load(cb),t.load(gb),e&&Ux(t))}Hx.isFeishuBound=!1,Vx.__loaded=!1;var Yx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Xx=class extends Ey{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;t&&i.setLineDash(t)}}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(a>1e-12&&o>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit,keepStrokeScale:f=r.keepStrokeScale}=e;s.globalAlpha=a*o*this.baseGlobalAlpha,s.lineWidth=f?h:xn(this,h,this.dpr),s.strokeStyle=wn(this,l,t,i,n),s.lineJoin=c,0===u[0]&&0===u[1]||u&&s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mn.global.measureTextMethod;return this.setTransform(1,0,0,1,0,0,!0,mn.global.devicePixelRatio),{width:super.measureText(t,e).width,fontBoundingBoxDescent:void 0,fontBoundingBoxAscent:void 0,actualBoundingBoxAscent:void 0,actualBoundingBoxDescent:void 0}}createPattern(t,e){return null}draw(){const t=this.nativeContext;t.draw&&(this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))})))}};Xx.env="lynx",Xx=Yx([g()],Xx);var $x=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},qx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Kx=class extends Af{constructor(t){super(t)}init(){this._context=new Xx(this,this._dpr)}resize(t,e){this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._nativeCanvas.nativeCanvas&&(this._nativeCanvas.nativeCanvas.width=this._pixelWidth,this._nativeCanvas.nativeCanvas.height=this._pixelHeight),this._context.dpr=this._dpr}release(){}};Kx.env="lynx",Kx=$x([g(),qx("design:paramtypes",[Object])],Kx);var Zx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Jx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qx=function(t,e){return function(i,n){e(i,n,t)}};let tw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="lynx",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Kx(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Kx({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};tw.env="lynx",tw=Zx([g(),Qx(0,p(W)),Jx("design:paramtypes",[Object])],tw);const ew=new i((t=>{t(tw).toSelf(),t(xr).toDynamicValue((t=>t.container.get(tw))).whenTargetNamed(tw.env)})),iw=Ly(Kx,Xx);var nw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},rw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let sw=!1;try{sw=!!lynx.createCanvasNG}catch(t){}let aw=class extends t.BaseEnvContribution{constructor(){super(),this.type="lynx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r,s,a){const o=null!=a?a:SystemInfo.pixelRatio;if(e.forEach(((e,a)=>{let h;s?h=lynx.createOffscreenCanvas():(h=sw?lynx.createCanvasNG(e):lynx.createCanvas(e),sw&&h.attachToCanvasView(e)),h.width=t.width*o,h.height=t.height*o;const l=h.getContext("2d"),c=new Nx(h,l,o,t.width,t.height,e);i.set(e,c),a>n&&r.push(c)})),!r.length&&lynx.createOffscreenCanvas){const e=lynx.createOffscreenCanvas();e.width=t.width*o,e.height=t.height*o;const n=e.getContext("2d"),s=Math.random().toString(),a=new Nx(e,n,o,t.width,t.height,s);i.set(s,a),r.push(a)}}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,!!e.offscreen,e.pixelRatio))}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}loadImage(t){return function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return Promise.reject();const e=lynx.createImage(t);return new Promise(((t,i)=>{e.onload=()=>{t(e)},e.onerror=()=>{i(new Error("加载失败"))}}))}(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return SystemInfo.pixelRatio}getRequestAnimationFrame(){return function(t){return Ts.call(t)}}getCancelAnimationFrame(){return t=>{Ts.clear(t)}}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};aw=nw([g(),rw("design:paramtypes",[])],aw);const ow=new i((t=>{ow.isLynxBound||(ow.isLynxBound=!0,t(aw).toSelf().inSingletonScope(),t(U).toService(aw))}));function hw(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];hw.__loaded||(hw.__loaded=!0,t.load(ow),t.load(iw),t.load(ew),e&&Ux(t))}ow.isLynxBound=!1,hw.__loaded=!1;var lw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},cw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let uw=class extends Ey{constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new ue(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(){}};uw.env="node",uw=lw([g(),cw("design:paramtypes",[Object,Number])],uw);var dw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},pw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let fw=class extends Af{constructor(t){super(t)}init(){this._context=new uw(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(){this._nativeCanvas.release&&Z(this._nativeCanvas.release)&&this._nativeCanvas.release()}};fw.env="node",fw=dw([g(),pw("design:paramtypes",[Object])],fw);const gw=Ly(fw,uw);var vw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},mw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yw=function(t,e){return function(i,n){e(i,n,t)}};let bw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new fw(n)}createWindowByCanvas(t){const e=t.canvas;let i=t.width,n=t.height;null!=i&&null!=n&&t.canvasControled||(i=e.width,n=e.height),this.canvas=new fw({width:i,height:n,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t){}};bw.env="node",bw=vw([g(),yw(0,p(W)),mw("design:paramtypes",[Object])],bw);const xw=new i((t=>{t(bw).toSelf(),t(xr).toDynamicValue((t=>t.container.get(bw))).whenTargetNamed(bw.env)}));var ww=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Sw=class extends t.BaseEnvContribution{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return Ts.call(t)}}getCancelAnimationFrame(){return t=>{Ts.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(){}createOffscreenCanvas(t){}};Sw=ww([g()],Sw);const Aw=new i((t=>{Aw.isNodeBound||(Aw.isNodeBound=!0,t(Sw).toSelf().inSingletonScope(),t(U).toService(Sw))}));function Tw(t){Tw.__loaded||(Tw.__loaded=!0,t.load(Aw),t.load(gw),t.load(xw))}Aw.isNodeBound=!1,Tw.__loaded=!1;var Cw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let _w=class extends Ey{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}draw(){this.nativeContext.draw()}strokeText(t,e,i){}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:a=r.fillOpacity,opacity:o=r.opacity,fill:h=r.fill}=e;a>1e-12&&o>1e-12&&(s.setGlobalAlpha(a*o),s.setFillStyle(wn(this,h,t,i,n)))}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(a>1e-12&&o>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit,keepStrokeScale:f=r.keepStrokeScale}=e;s.setGlobalAlpha(a*o),s.setLineWidth(f?h:xn(this,h,this.dpr)),s.setStrokeStyle(wn(this,l,t,i,n)),s.setLineJoin(c),u&&s.setLineDash(u),s.setLineCap(d),s.setMiterLimit(p)}}setTextStyleWithoutAlignBaseline(t,e){var i;const n=this.nativeContext;e||(e=this.textAttributes),t.font?n.font=t.font:n.font=se(t,e),n.setFontSize(null!==(i=t.fontSize)&&void 0!==i?i:e.fontSize)}setTextStyle(t,e){var i,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=se(t,e),r.setTextAlign(null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign),r.setTextBaseline(null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline)}createConicGradient(t,e,i,n){return null}createPattern(t,e){return null}getImageData(t,e,i,n){const r=this.nativeContext,s=r.taro;if(r&&s)return!r.getImageData&&s.canvasGetImageData?new Promise(((r,a)=>{try{s.canvasGetImageData({canvasId:this.canvas.nativeCanvas.id,sx:t,sy:e,sw:i,sh:n,success(t){r(t)}})}catch(t){a(t)}})):void 0}createRadialGradient(t,e,i,n,r,s){return this.nativeContext.createCircularGradient&&this.nativeContext.createCircularGradient(t,e,i,n,r,s)}};_w.env="taro",_w=Cw([g()],_w);var Bw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Pw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Rw=class extends Af{constructor(t){super(t)}init(){this._context=new _w(this,this._dpr)}release(){}};Rw.env="taro",Rw=Bw([g(),Pw("design:paramtypes",[Object])],Rw);const Mw=Ly(Rw,_w);var Ew=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},kw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ow=function(t,e){return function(i,n){e(i,n,t)}};let Iw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="taro",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Rw(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Rw({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches.length>0&&(t.changedTouches.forEach(((e,i)=>{t.changedTouches[i]=Object.assign(Object.assign({},t.changedTouches[i]),{offsetX:e.x,offsetY:e.y})})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach(((e,i)=>{t.touches[i]=Object.assign(Object.assign({},t.touches[i]),{offsetX:e.x,offsetY:e.y})})),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};Iw.env="taro",Iw=Ew([g(),Ow(0,p(W)),kw("design:paramtypes",[Object])],Iw);const Lw=new i((t=>{t(Iw).toSelf(),t(xr).toDynamicValue((t=>t.container.get(Iw))).whenTargetNamed(Iw.env)}));var Dw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},jw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Uw=class extends t.BaseEnvContribution{constructor(){super(),this.type="taro",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}configure(t,e){var i,n,r,s,a,o,h;t.env===this.type&&(t.setActiveEnvContribution(this),i=e.domref,n=e.canvasIdLists,r=this.canvasMap,s=e.freeCanvasIdx,a=this.freeCanvasList,o=e.taro,h=e.pixelRatio,n.forEach(((t,e)=>{const n=o.createCanvasContext(t),l=new Wx(n.canvas||{},n,h,i.width,i.height,t);return n.canvas=l,r.set(t,l),e>=s&&a.push(l),l})),this.taro=e.taro,this.pixelRatio=e.pixelRatio)}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){const e=window||globalThis;if(e.DOMParser){const i=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],n=(new XMLSerializer).serializeToString(i),r=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`;return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){const i=new e.Blob([t],{type:"image/svg+xml"}),n=e.URL.createObjectURL(i);return Promise.resolve({data:n,loadState:"success"})}return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return this.pixelRatio}getRequestAnimationFrame(){return requestAnimationFrame}getCancelAnimationFrame(){return cancelAnimationFrame}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};Uw=Dw([g(),jw("design:paramtypes",[])],Uw);const Ww=new i((t=>{Ww.isTaroBound||(Ww.isTaroBound=!0,t(Uw).toSelf().inSingletonScope(),t(U).toService(Uw))}));function Nw(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Nw.__loaded||(Nw.__loaded=!0,t.load(Ww),t.load(Mw),t.load(Lw),e&&Ux(t))}Ww.isTaroBound=!1,Nw.__loaded=!1;var Gw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Fw=class extends Ey{draw(){}createPattern(t,e){return null}};Fw.env="wx",Fw=Gw([g()],Fw);var zw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Hw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Vw=class extends Af{constructor(t){super(t)}init(){this._context=new Fw(this,this._dpr)}release(){}};Vw.env="wx",Vw=zw([g(),Hw("design:paramtypes",[Object])],Vw);const Yw=Ly(Vw,Fw);var Xw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},$w=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qw=function(t,e){return function(i,n){e(i,n,t)}};let Kw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="wx",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Vw(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Vw({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){var e,i,n,r;const{type:s}=t;return!!this.eventManager.cache[s]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=null!==(e=t.changedTouches[0].x)&&void 0!==e?e:t.changedTouches[0].pageX,t.changedTouches[0].clientX=null!==(i=t.changedTouches[0].x)&&void 0!==i?i:t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=null!==(n=t.changedTouches[0].y)&&void 0!==n?n:t.changedTouches[0].pageY,t.changedTouches[0].clientY=null!==(r=t.changedTouches[0].y)&&void 0!==r?r:t.changedTouches[0].pageY),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[s].listener&&this.eventManager.cache[s].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};Kw.env="wx",Kw=Xw([g(),qw(0,p(W)),$w("design:paramtypes",[Object])],Kw);const Zw=new i((t=>{t(Kw).toSelf(),t(xr).toDynamicValue((t=>t.container.get(Kw))).whenTargetNamed(Kw.env)}));var Jw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Qw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tS=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};let eS=class extends t.BaseEnvContribution{constructor(){super(),this.type="wx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,i,n,r,s){return tS(this,void 0,void 0,(function*(){const t=wx.getSystemInfoSync().pixelRatio;for(let a=0;a<e.length;a++){const o=e[a];i.has(o)||(yield new Promise((e=>{let h=wx.createSelectorQuery();s&&(h=h.in(s)),h.select(`#${o}`).fields({node:!0,size:!0}).exec((s=>{if(!s[0])return;const h=s[0].node,l=s[0].width,c=s[0].height;h.width=l*t,h.height=c*t,i.set(o,h),a>=n&&r.push(h),e(null)}))})))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((()=>{}))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return wx.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return Ts.call(t)}}getCancelAnimationFrame(){return t=>{Ts.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}};eS=Jw([g(),Qw("design:paramtypes",[])],eS);const iS=new i((t=>{iS._isWxBound||(iS._isWxBound=!0,t(eS).toSelf().inSingletonScope(),t(U).toService(eS))}));function nS(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];nS.__loaded||(nS.__loaded=!0,t.load(iS),t.load(Yw),t.load(Zw),e&&Ux(t))}function rS(t){sS(t)}function sS(t){sS.__loaded||(sS.__loaded=!0,rb(t,!1),Vx(t,!1),hw(t,!1),Tw(t),Nw(t,!1),nS(t,!1),Yy(t),Qp.hooks.onSetEnv.tap("loadMathPicker",((e,i)=>{"browser"!==i&&Ux(t)})))}iS._isWxBound=!1,nS.__loaded=!1,sS.__loaded=!1;var aS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let oS=class extends ab{};oS.env="tt",oS=aS([g()],oS);var hS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},lS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let cS=class extends Af{constructor(t){super(t)}init(){this._context=new oS(this,this._dpr)}release(){}};cS.env="tt",cS=hS([g(),lS("design:paramtypes",[Object])],cS);const uS=Ly(cS,oS);var dS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},pS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fS=function(t,e){return function(i,n){e(i,n,t)}};let gS=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="tt",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new cS(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new cS({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};gS.env="tt",gS=dS([g(),fS(0,p(W)),pS("design:paramtypes",[Object])],gS);const vS=new i((t=>{t(gS).toSelf(),t(xr).toDynamicValue((t=>t.container.get(gS))).whenTargetNamed(gS.env)}));var mS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},yS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bS=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};let xS=class extends t.BaseEnvContribution{constructor(){super(),this.type="tt",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,i,n,r,s){return bS(this,void 0,void 0,(function*(){const t=tt.getSystemInfoSync().pixelRatio;for(let a=0;a<e.length;a++){const o=e[a];i.has(o)||(yield new Promise((e=>{let h=tt.createSelectorQuery();s&&(h=h.in(s)),h.select(`#${o}`).node().exec((s=>{const h=s[0].node,l=h.width,c=h.height;h.width=l*t,h.height=c*t,i.set(o,h),a>=n&&r.push(h),e(null)}))})))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((()=>{}))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return tt.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return Ts.call(t)}}getCancelAnimationFrame(){return t=>{Ts.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}};xS=mS([g(),yS("design:paramtypes",[])],xS);const wS=new i((t=>{wS.isTTBound||(wS.isTTBound=!0,t(xS).toSelf().inSingletonScope(),t(U).toService(xS))}));function SS(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];SS.__loaded||(SS.__loaded=!0,t.load(wS),t.load(uS),t.load(vS),e&&Ux(t))}wS.isTTBound=!1,SS.__loaded=!1;var AS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let TS=class extends Ey{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;t&&i.setLineDash(t)}}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(a>1e-12&&o>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit,keepStrokeScale:f=r.keepStrokeScale}=e;s.globalAlpha=a*o*this.baseGlobalAlpha,s.lineWidth=f?h:xn(this,h,this.dpr),s.strokeStyle=wn(this,l,t,i,n),s.lineJoin=c,0===u[0]&&0===u[1]||u&&s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mn.global.measureTextMethod;return this.setTransform(1,0,0,1,0,0,!0,mn.global.devicePixelRatio),super.measureText(t,e)}setTextStyleWithoutAlignBaseline(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;let s="";s=t.font?t.font:se(t,e,r&&this.camera&&this.camera.getProjectionScale(i)),n.font=(s||"").replace("px","vp");const{fontFamily:a=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=a,this.fontSize=o,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){var n,r;const s=this.nativeContext;e||(e=this.textAttributes);let a="";a=t.font?t.font:se(t,e,this.camera&&this.camera.getProjectionScale(i)),s.font=(a||"").replace("px","vp");const{fontFamily:o=e.fontFamily,fontSize:h=e.fontSize}=t;this.fontFamily=o,this.fontSize=h,s.textAlign=null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}createPattern(t,e){return null}drawImage(){const t=this.nativeContext,e=arguments;e[0].drawImage&&(e[0]=e[0].transferToImageBitmap()),3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}draw(){}};TS.env="harmony",TS=AS([g()],TS);var CS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},_S=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let BS=class extends Af{constructor(t){super(t)}init(){this._context=new TS(this,this._dpr)}resize(t,e){}release(){}};BS.env="harmony",BS=CS([g(),_S("design:paramtypes",[Object])],BS);var PS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},RS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},MS=function(t,e){return function(i,n){e(i,n,t)}};class ES{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}let kS=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="harmony",this.eventManager=new ES}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new BS(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}this.canvas=new BS({width:i,height:n,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};kS.env="harmony",kS=PS([g(),MS(0,p(W)),RS("design:paramtypes",[Object])],kS);const OS=new i((t=>{t(kS).toSelf(),t(xr).toDynamicValue((t=>t.container.get(kS))).whenTargetNamed(kS.env)})),IS=Ly(BS,TS);var LS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},DS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let jS=class extends t.BaseEnvContribution{constructor(){super(),this.type="harmony",this.supportEvent=!0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0,this.rafSTO=new As(0)}configure(t,e){t.env===this.type&&t.setActiveEnvContribution(this)}getDynamicCanvasCount(){return 9999}getStaticCanvasCount(){return 9999}loadImage(t){}loadSvg(t){return Promise.reject()}createCanvas(t){return function(t,e,i){const n=new OffscreenCanvas(t,e),r=n.getContext("2d");return new Wx({width:t,height:e,context:r,_c:n,getBoundingClientRect:()=>({width:t,height:e}),getContext:()=>r},r,1,t,e,i)}(t.width,t.height,t.id)}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return t=>this.rafSTO.call(t)}getCancelAnimationFrame(){return t=>{this.rafSTO.clear(t)}}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return null}getRootElement(){return null}getDocument(){return null}release(){}};jS=LS([g(),DS("design:paramtypes",[])],jS);const US=new i((t=>{US.isHarmonyBound||(US.isHarmonyBound=!0,t(jS).toSelf().inSingletonScope(),t(U).toService(jS))}));function WS(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];WS.__loaded||(WS.__loaded=!0,t.load(US),t.load(IS),t.load(OS),e&&Ux(t))}US.isHarmonyBound=!1,WS.__loaded=!1;var NS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},GS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},FS=function(t,e){return function(i,n){e(i,n,t)}};let zS=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=ro}};zS=NS([g(),FS(0,p(Ac)),GS("design:paramtypes",[Object])],zS);let HS=!1;const VS=new i(((t,e,i,n)=>{HS||(HS=!0,t(ty).to(zS).inSingletonScope(),t(my).toService(ty))}));var YS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},XS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$S=function(t,e){return function(i,n){e(i,n,t)}};let qS=class extends mx{constructor(t){super(),this.canvasRenderer=t}};qS=YS([g(),$S(0,p(kc)),XS("design:paramtypes",[Object])],qS);let KS=!1;const ZS=new i(((t,e,i,n)=>{KS||(KS=!0,t(hy).to(qS).inSingletonScope(),t(my).toService(hy))}));class JS extends Fh{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const r=t.getGraphicTheme(),s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?r+s:xn(n,r+s,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==l&&Lh.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}}var QS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},tA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},eA=function(t,e){return function(i,n){e(i,n,t)}};let iA=class extends JS{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=uo}};iA=QS([g(),eA(0,p(Rc)),tA("design:paramtypes",[Object])],iA);let nA=!1;const rA=new i(((t,e,i,n)=>{nA||(nA=!0,t(ay).to(iA).inSingletonScope(),t(my).toService(ay))}));var sA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},aA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},oA=function(t,e){return function(i,n){e(i,n,t)}};let hA=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=ao}};hA=sA([g(),oA(0,p(Cc)),aA("design:paramtypes",[Object])],hA);let lA=!1;const cA=new i(((t,e,i,n)=>{lA||(lA=!0,t(iy).to(hA).inSingletonScope(),t(my).toService(iy))}));class uA extends Fh{contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.getGraphicTheme();n.highPerformanceSave();const s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==l&&Lh.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}}var dA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},pA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fA=function(t,e){return function(i,n){e(i,n,t)}};let gA=class extends uA{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=bo}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const s=t.getGraphicTheme(),a=this.transform(t,s,n),{x:o,y:h,z:l,lastModelMatrix:c}=a;let u=e;if(n.camera){u=e.clone();const i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let d=!1;return this.canvasRenderer.drawShape(t,n,o,h,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,i)=>{if(d)return!0;const r=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?r+s:xn(n,r+s,n.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==c&&Lh.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),d}};gA=dA([g(),fA(0,p(Ic)),pA("design:paramtypes",[Object])],gA);let vA=!1;const mA=new i(((t,e,i,n)=>{vA||(vA=!0,t(cy).to(gA).inSingletonScope(),t(my).toService(cy))}));var yA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},bA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xA=function(t,e){return function(i,n){e(i,n,t)}};let wA=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=oo}};wA=yA([g(),xA(0,p(_c)),bA("design:paramtypes",[Object])],wA);let SA=!1;const AA=new i(((t,e,i,n)=>{SA||(SA=!0,t(ny).to(wA).inSingletonScope(),t(my).toService(ny))}));var TA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},CA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_A=function(t,e){return function(i,n){e(i,n,t)}};let BA=class extends uA{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=xo}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();const s=t.getGraphicTheme(),{keepDirIn3d:a=s.keepDirIn3d}=t.attribute,o=!a,h=this.transform(t,s,n,o),{x:l,y:c,z:u,lastModelMatrix:d}=h;this.canvasRenderer.z=u;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let f=!1;return this.canvasRenderer.drawShape(t,n,l,c,{},null,((e,i,n)=>{if(f)return!0;const{fontSize:r=s.fontSize,textBaseline:a=s.textBaseline,textAlign:o=s.textAlign}=t.attribute,h=t.AABBBounds,d=h.height(),g=h.width(),v=vh(a,d,r),m=gh(o,g);return e.rect(m+l,v+c,g,d,u),f=e.isPointInPath(p.x,p.y),f}),((t,e,i)=>f)),this.canvasRenderer.z=0,n.modelMatrix!==d&&Lh.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),f}};BA=TA([g(),_A(0,p(Lc)),CA("design:paramtypes",[Object])],BA);let PA=!1;const RA=new i(((t,e,i,n)=>{PA||(PA=!0,t(uy).to(BA).inSingletonScope(),t(my).toService(uy))}));var MA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},EA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kA=function(t,e){return function(i,n){e(i,n,t)}};let OA=class extends JS{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=po}};OA=MA([g(),kA(0,p(Mc)),EA("design:paramtypes",[Object])],OA);let IA=!1;const LA=new i(((t,e,i,n)=>{IA||(IA=!0,t(oy).to(OA).inSingletonScope(),t(my).toService(oy))}));var DA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},jA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},UA=function(t,e){return function(i,n){e(i,n,t)}};let WA=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=fo}};WA=DA([g(),UA(0,p(Ec)),jA("design:paramtypes",[Object])],WA);let NA=!1;const GA=new i(((t,e,i,n)=>{NA||(NA=!0,t(dy).to(WA).inSingletonScope(),t(my).toService(dy))}));var FA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},zA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},HA=function(t,e){return function(i,n){e(i,n,t)}};let VA=class extends Gb{constructor(t){super(),this.canvasRenderer=t}};VA=FA([g(),HA(0,p(Uc)),zA("design:paramtypes",[Object])],VA);let YA=!1;const XA=new i(((t,e,i,n)=>{YA||(YA=!0,t(gy).to(VA).inSingletonScope(),t(my).toService(gy))}));var $A=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},qA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},KA=function(t,e){return function(i,n){e(i,n,t)}};let ZA=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=yo}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};ZA=$A([g(),KA(0,p(Dc)),qA("design:paramtypes",[Object])],ZA);let JA=!1;const QA=new i(((t,e,i,n)=>{JA||(JA=!0,t(fy).to(ZA).inSingletonScope(),t(my).toService(fy))}));var tT=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let eT=class{constructor(){this.type="image",this.numberType=co}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};eT=tT([g()],eT);let iT=!1;const nT=new i(((t,e,i,n)=>{iT||(iT=!0,t(ry).to(eT).inSingletonScope(),t(my).toService(ry))}));var rT=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},sT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},aT=function(t,e){return function(i,n){e(i,n,t)}};let oT=class extends uA{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=mo,this.themeType="rect"}};oT=rT([g(),aT(0,p(Oc)),sT("design:paramtypes",[Object])],oT);let hT=!1;const lT=new i(((t,e,i,n)=>{hT||(hT=!0,t(ly).to(oT).inSingletonScope(),t(my).toService(ly))}));var cT=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},uT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dT=function(t,e){return function(i,n){e(i,n,t)}};let pT=class extends uA{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=so,this.themeType="arc"}};pT=cT([g(),dT(0,p(Tc)),uT("design:paramtypes",[Object])],pT);let fT=!1;const gT=new i(((t,e,i,n)=>{fT||(fT=!0,t(ey).to(pT).inSingletonScope(),t(my).toService(ey))}));var vT=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},mT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yT=function(t,e){return function(i,n){e(i,n,t)}};let bT=class extends uA{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=go,this.themeType="polygon"}};bT=vT([g(),yT(0,p(jc)),mT("design:paramtypes",[Object])],bT);let xT=!1;const wT=new i(((t,e,i,n)=>{xT||(xT=!0,t(py).to(bT).inSingletonScope(),t(my).toService(py))}));var ST={},AT={},TT={};Object.defineProperty(TT,"__esModule",{value:!0}),TT.loop=TT.conditional=TT.parse=void 0;TT.parse=function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(i))i.forEach((function(i){return t(e,i,n,r)}));else if("function"==typeof i)i(e,n,r,t);else{var s=Object.keys(i)[0];Array.isArray(i[s])?(r[s]={},t(e,i[s],n,r[s])):r[s]=i[s](e,n,r,t)}return n};TT.conditional=function(t,e){return function(i,n,r,s){e(i,n,r)&&s(i,t,n,r)}};TT.loop=function(t,e){return function(i,n,r,s){for(var a=[],o=i.pos;e(i,n,r);){var h={};if(s(i,t,n,h),i.pos===o)break;o=i.pos,a.push(h)}return a}};var CT={};Object.defineProperty(CT,"__esModule",{value:!0}),CT.readBits=CT.readArray=CT.readUnsigned=CT.readString=CT.peekBytes=CT.readBytes=CT.peekByte=CT.readByte=CT.buildStream=void 0;CT.buildStream=function(t){return{data:t,pos:0}};var _T=function(){return function(t){return t.data[t.pos++]}};CT.readByte=_T;CT.peekByte=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(e){return e.data[e.pos+t]}};var BT=function(t){return function(e){return e.data.subarray(e.pos,e.pos+=t)}};CT.readBytes=BT;CT.peekBytes=function(t){return function(e){return e.data.subarray(e.pos,e.pos+t)}};CT.readString=function(t){return function(e){return Array.from(BT(t)(e)).map((function(t){return String.fromCharCode(t)})).join("")}};CT.readUnsigned=function(t){return function(e){var i=BT(2)(e);return t?(i[1]<<8)+i[0]:(i[0]<<8)+i[1]}};CT.readArray=function(t,e){return function(i,n,r){for(var s="function"==typeof e?e(i,n,r):e,a=BT(t),o=new Array(s),h=0;h<s;h++)o[h]=a(i);return o}};CT.readBits=function(t){return function(e){for(var i=function(t){return t.data[t.pos++]}(e),n=new Array(8),r=0;r<8;r++)n[7-r]=!!(i&1<<r);return Object.keys(t).reduce((function(e,i){var r=t[i];return r.length?e[i]=function(t,e,i){for(var n=0,r=0;r<i;r++)n+=t[e+r]&&Math.pow(2,i-r-1);return n}(n,r.index,r.length):e[i]=n[r.index],e}),{})}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=TT,i=CT,n={blocks:function(t){for(var e=[],n=t.data.length,r=0,s=(0,i.readByte)()(t);0!==s&&s;s=(0,i.readByte)()(t)){if(t.pos+s>=n){var a=n-t.pos;e.push((0,i.readBytes)(a)(t)),r+=a;break}e.push((0,i.readBytes)(s)(t)),r+=s}for(var o=new Uint8Array(r),h=0,l=0;l<e.length;l++)o.set(e[l],h),h+=e[l].length;return o}},r=(0,e.conditional)({gce:[{codes:(0,i.readBytes)(2)},{byteSize:(0,i.readByte)()},{extras:(0,i.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,i.readUnsigned)(!0)},{transparentColorIndex:(0,i.readByte)()},{terminator:(0,i.readByte)()}]},(function(t){var e=(0,i.peekBytes)(2)(t);return 33===e[0]&&249===e[1]})),s=(0,e.conditional)({image:[{code:(0,i.readByte)()},{descriptor:[{left:(0,i.readUnsigned)(!0)},{top:(0,i.readUnsigned)(!0)},{width:(0,i.readUnsigned)(!0)},{height:(0,i.readUnsigned)(!0)},{lct:(0,i.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,i.readArray)(3,(function(t,e,i){return Math.pow(2,i.descriptor.lct.size+1)}))},(function(t,e,i){return i.descriptor.lct.exists})),{data:[{minCodeSize:(0,i.readByte)()},n]}]},(function(t){return 44===(0,i.peekByte)()(t)})),a=(0,e.conditional)({text:[{codes:(0,i.readBytes)(2)},{blockSize:(0,i.readByte)()},{preData:function(t,e,n){return(0,i.readBytes)(n.text.blockSize)(t)}},n]},(function(t){var e=(0,i.peekBytes)(2)(t);return 33===e[0]&&1===e[1]})),o=(0,e.conditional)({application:[{codes:(0,i.readBytes)(2)},{blockSize:(0,i.readByte)()},{id:function(t,e,n){return(0,i.readString)(n.blockSize)(t)}},n]},(function(t){var e=(0,i.peekBytes)(2)(t);return 33===e[0]&&255===e[1]})),h=(0,e.conditional)({comment:[{codes:(0,i.readBytes)(2)},n]},(function(t){var e=(0,i.peekBytes)(2)(t);return 33===e[0]&&254===e[1]})),l=[{header:[{signature:(0,i.readString)(3)},{version:(0,i.readString)(3)}]},{lsd:[{width:(0,i.readUnsigned)(!0)},{height:(0,i.readUnsigned)(!0)},{gct:(0,i.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,i.readByte)()},{pixelAspectRatio:(0,i.readByte)()}]},(0,e.conditional)({gct:(0,i.readArray)(3,(function(t,e){return Math.pow(2,e.lsd.gct.size+1)}))},(function(t,e){return e.lsd.gct.exists})),{frames:(0,e.loop)([r,o,h,s,a],(function(t){var e=(0,i.peekByte)()(t);return 33===e||44===e}))}],c=l;t.default=c}(AT);var PT={};Object.defineProperty(PT,"__esModule",{value:!0}),PT.deinterlace=void 0;PT.deinterlace=function(t,e){for(var i=new Array(t.length),n=t.length/e,r=function(n,r){var s=t.slice(r*e,(r+1)*e);i.splice.apply(i,[n*e,e].concat(s))},s=[0,4,2,1],a=[8,8,4,2],o=0,h=0;h<4;h++)for(var l=s[h];l<n;l+=a[h])r(l,o),o++;return i};var RT={};Object.defineProperty(RT,"__esModule",{value:!0}),RT.lzw=void 0;RT.lzw=function(t,e,i){var n,r,s,a,o,h,l,c,u,d,p,f,g,v,m,y,b=4096,x=i,w=new Array(i),S=new Array(b),A=new Array(b),T=new Array(4097);for(o=(r=1<<(d=t))+1,n=r+2,l=-1,s=(1<<(a=d+1))-1,c=0;c<r;c++)S[c]=0,A[c]=c;for(p=f=g=v=m=y=0,u=0;u<x;){if(0===v){if(f<a){p+=e[y]<<f,f+=8,y++;continue}if(c=p&s,p>>=a,f-=a,c>n||c==o)break;if(c==r){s=(1<<(a=d+1))-1,n=r+2,l=-1;continue}if(-1==l){T[v++]=A[c],l=c,g=c;continue}for(h=c,c==n&&(T[v++]=g,c=l);c>r;)T[v++]=A[c],c=S[c];g=255&A[c],T[v++]=g,n<b&&(S[n]=l,A[n]=g,0==(++n&s)&&n<b&&(a++,s+=n)),l=h}v--,w[m++]=T[v],u++}for(u=m;u<x;u++)w[u]=0;return w},Object.defineProperty(ST,"__esModule",{value:!0});var MT,ET=ST.decompressFrames=ST.decompressFrame=jT=ST.parseGIF=void 0,kT=(MT=AT)&&MT.__esModule?MT:{default:MT},OT=TT,IT=CT,LT=PT,DT=RT;var jT=ST.parseGIF=function(t){var e=new Uint8Array(t);return(0,OT.parse)((0,IT.buildStream)(e),kT.default)},UT=function(t,e,i){if(t.image){var n=t.image,r=n.descriptor.width*n.descriptor.height,s=(0,DT.lzw)(n.data.minCodeSize,n.data.blocks,r);n.descriptor.lct.interlaced&&(s=(0,LT.deinterlace)(s,n.descriptor.width));var a={pixels:s,dims:{top:t.image.descriptor.top,left:t.image.descriptor.left,width:t.image.descriptor.width,height:t.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?a.colorTable=n.lct:a.colorTable=e,t.gce&&(a.delay=10*(t.gce.delay||10),a.disposalType=t.gce.extras.disposal,t.gce.extras.transparentColorGiven&&(a.transparentIndex=t.gce.transparentColorIndex)),i&&(a.patch=function(t){for(var e=t.pixels.length,i=new Uint8ClampedArray(4*e),n=0;n<e;n++){var r=4*n,s=t.pixels[n],a=t.colorTable[s]||[0,0,0];i[r]=a[0],i[r+1]=a[1],i[r+2]=a[2],i[r+3]=s!==t.transparentIndex?255:0}return i}(a)),a}console.warn("gif frame does not have associated image.")};ST.decompressFrame=UT;ET=ST.decompressFrames=function(t,e){return t.frames.filter((function(t){return t.image})).map((function(i){return UT(i,t.gct,e)}))};const WT=e.GenAutoIncrementId();class NT extends zd{constructor(t){super(t),this.type="gif-image",this.numberType=WT,this.loadGif()}loadGif(){if(st(this.attribute.gifImage))Ca.GetFile(this.attribute.gifImage,"arrayBuffer").then((t=>{const e=jT(t),i=ET(e,!0);this.renderGIF(i)})).catch((t=>{console.error("Gif load error: ",t)}));else if(this.attribute.gifImage instanceof ArrayBuffer){const t=jT(this.attribute.gifImage),e=ET(t,!0);this.renderGIF(e)}}renderGIF(t){this.loadedFrames=t,this.frameIndex=0,this.tempCanvas||(this.tempCanvas=mn.global.createCanvas({}),this.tempCtx=this.tempCanvas.getContext("2d")),this.gifCanvas||(this.gifCanvas=mn.global.createCanvas({}),this.gifCtx=this.gifCanvas.getContext("2d")),this.gifCanvas.width=t[0].dims.width,this.gifCanvas.height=t[0].dims.height,this.playing=!0,this.lastTime=(new Date).getTime();const e=this.animate();this.attribute.timeline&&e.setTimeline(this.attribute.timeline),e.to({},1e3,"linear").loop(1/0)}renderFrame(t,e,i){const n=this.loadedFrames[this.frameIndex||0];2===n.disposalType&&this.gifCtx.clearRect(0,0,this.gifCanvas.width,this.gifCanvas.height),this.drawPatch(n),this.manipulate(t,e,i);const r=(new Date).getTime()-this.lastTime;n.delay<r&&(this.frameIndex++,this.lastTime=(new Date).getTime()),this.frameIndex>=this.loadedFrames.length&&(this.frameIndex=0)}drawPatch(t){const e=t.dims;this.frameImageData&&e.width===this.frameImageData.width&&e.height===this.frameImageData.height||(this.tempCanvas.width=e.width,this.tempCanvas.height=e.height,this.frameImageData=this.tempCtx.createImageData(e.width,e.height)),this.frameImageData.data.set(t.patch),this.tempCtx.putImageData(this.frameImageData,0,0),this.gifCtx.drawImage(this.tempCanvas,e.left,e.top)}manipulate(t,e,i){t.drawImage(this.gifCanvas,0,0,this.gifCanvas.width,this.gifCanvas.height,e,i,this.attribute.width,this.attribute.height)}setAttribute(t,e,i,n){super.setAttribute(t,e,i,n),"gifImage"===t&&this.loadGif()}setAttributes(t,e,i){super.setAttributes(t,e,i),t.gifImage&&this.loadGif()}}var GT=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let FT=class{constructor(){this.type="gif-image",this.numberType=WT}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};FT=GT([g()],FT);let zT=!1;const HT=new i(((t,e,i,n)=>{zT||(zT=!0,t(sy).to(FT).inSingletonScope(),t(my).toService(sy))}));var VT=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},YT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},XT=function(t,e){return function(i,n){e(i,n,t)}};let $T=class extends t.DefaultCanvasImageRender{constructor(t){super(t),this.imageRenderContribitions=t,this.numberType=WT,this._renderContribitions=void 0,this.builtinContributions=[qT],this.init(t)}drawShape(t,e,i,n,r,s,a,o){const h=Or(t).image,{x:l=h.x,y:c=h.y,fillStrokeOrder:u=h.fillStrokeOrder}=t.attribute,d=this.valid(t,h,a);if(!d)return;const{fVisible:p,sVisible:f,doFill:g,doStroke:v}=d,m=()=>{g&&a&&a(e,t.attribute,h)},y=()=>{v&&(o?o(e,t.attribute,h):f&&(e.setStrokeStyle(t,t.attribute,l-i,c-n,h),e.stroke()))};u?(y(),e.save(),e.clip(),this.beforeRenderStep(t,e,i,n,g,!1,p,!1,h,r,a),m(),e.restore()):(e.save(),e.clip(),this.beforeRenderStep(t,e,i,n,g,!1,p,!1,h,r,a),m(),e.restore(),y()),this.afterRenderStep(t,e,i,n,g,!1,p,!1,h,r,a)}draw(t,e,i){const{context:n}=e.drawParams;if(!n)return;const r=Or(t).image;this._draw(t,r,!1,i)}};$T=VT([g(),XT(0,p(k)),XT(0,v(oh)),YT("design:paramtypes",[Object])],$T);const qT=new class extends ll{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){t.renderFrame&&t.playing&&t.renderFrame(e,i,n)}};let KT=!1;const ZT=new i((t=>{KT||(KT=!0,t($T).toSelf().inSingletonScope(),t(Bc).toService($T))})),JT=pf();function QT(){QT.__loaded||(QT.__loaded=!0,$g(),jn.load(og),jn.load(JT?VS:Pb))}QT.__loaded=!1;const tC=QT;function eC(){eC.__loaded||(eC.__loaded=!0,qg(),Rf(),Ef(),jn.load(zg),jn.load(gT))}eC.__loaded=!1;const iC=eC;function nC(){nC.__loaded||(nC.__loaded=!0,Kg(),jn.load(pg),jn.load(JT?cA:Ib))}nC.__loaded=!1;const rC=nC;function sC(){sC.__loaded||(sC.__loaded=!0,Zg(),jn.load(mg),jn.load(JT?AA:Nb))}sC.__loaded=!1;const aC=sC;function oC(){oC.__loaded||(oC.__loaded=!0,Jg(),jn.load(Bg),jn.load(JT?XA:Xb))}oC.__loaded=!1;const hC=oC;function lC(){lC.__loaded||(lC.__loaded=!0,Qg())}lC.__loaded=!1;const cC=lC;function uC(){uC.__loaded||(uC.__loaded=!0,tv(),jn.load(Ig),jn.load(JT?nT:Zb))}uC.__loaded=!1;const dC=uC;function pC(){pC.__loaded||(pC.__loaded=!0,ev(),jn.load(ug),jn.load(JT?rA:nx))}pC.__loaded=!1;const fC=pC;function gC(){gC.__loaded||(gC.__loaded=!0,iv(),jn.load(wg),jn.load(JT?LA:gx))}gC.__loaded=!1;const vC=gC;function mC(){mC.__loaded||(mC.__loaded=!0,nv(),jn.load(Ag),jn.load(JT?GA:lx))}mC.__loaded=!1;const yC=mC;function bC(){bC.__loaded||(bC.__loaded=!0,rv(),Rf(),Ef(),jn.load(Xg),jn.load(wT))}bC.__loaded=!1;const xC=bC;function wC(){wC.__loaded||(wC.__loaded=!0,sv(),jn.load(lg),jn.load(JT?ZS:Tx))}wC.__loaded=!1;const SC=wC;function AC(){AC.__loaded||(AC.__loaded=!0,av(),jn.load(Wg),jn.load(lT))}AC.__loaded=!1;const TC=AC;function CC(){CC.__loaded||(CC.__loaded=!0,ov(),jn.load(kg),jn.load(JT?QA:_x))}CC.__loaded=!1;const _C=CC;function BC(){BC.__loaded||(BC.__loaded=!0,cv())}BC.__loaded=!1;const PC=BC;function RC(){RC.__loaded||(RC.__loaded=!0,hv(),jn.load(gg),jn.load(JT?mA:kx))}RC.__loaded=!1;const MC=RC;function EC(){EC.__loaded||(EC.__loaded=!0,lv(),jn.load(bg),jn.load(JT?RA:Dx))}EC.__loaded=!1;const kC=EC;function OC(){OC.__loaded||(OC.__loaded=!0,uv())}OC.__loaded=!1;const IC=OC,LC=Gm;Jp(),pf()?rb(jn):ff()&&Tw(jn),tC(),iC(),rC(),aC(),hC(),cC(),dC(),fC(),vC(),yC(),xC(),SC(),TC(),_C(),PC(),MC(),kC(),IC(),xv(),mv(),pv(),gv(),Rf(),Ef(),t.ACustomAnimate=is,t.ARC3D_NUMBER_TYPE=so,t.ARC_NUMBER_TYPE=ro,t.AREA_NUMBER_TYPE=ao,t.Animate=rs,t.AnimateGroup=class extends is{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onStart(){this.customAnimates.forEach((t=>{t.onStart()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Qr[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends is{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Qr[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Application=vn,t.Arc=rp,t.Arc3d=ap,t.Arc3dRender=Tc,t.ArcRender=Ac,t.ArcRenderContribution=nh,t.Area=ep,t.AreaRender=Cc,t.AreaRenderContribution=rh,t.AttributeAnimate=class extends is{constructor(t,e,i){super({},t,e,i)}getEndProps(){return this.to}onBind(){Object.keys(this.to).forEach((t=>{this.from[t]=this.target.getComputedAttribute(t)}))}onEnd(){}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this.to,this.from)}},t.AutoEnablePlugins=bp,t.BaseCanvas=Af,t.BaseRender=Fh,t.Basis=vi,t.BeforeRenderConstribution=iu,t.BoundsContext=Be,t.BoundsPicker=au,t.CIRCLE_NUMBER_TYPE=oo,t.Canvas3DDrawItemInterceptor=Zc,t.CanvasArc3dPicker=ey,t.CanvasArcPicker=ty,t.CanvasAreaPicker=iy,t.CanvasCirclePicker=ny,t.CanvasFactory=Un,t.CanvasGifImagePicker=sy,t.CanvasGlyphPicker=gy,t.CanvasGroupPicker=vy,t.CanvasImagePicker=ry,t.CanvasLinePicker=ay,t.CanvasPathPicker=oy,t.CanvasPickerContribution=my,t.CanvasPolygonPicker=dy,t.CanvasPyramid3dPicker=py,t.CanvasRect3dPicker=ly,t.CanvasRectPicker=hy,t.CanvasRichTextPicker=fy,t.CanvasSymbolPicker=cy,t.CanvasTextLayout=du,t.CanvasTextPicker=uy,t.CbAnimate=ns,t.Circle=cu,t.CircleRender=_c,t.CircleRenderContribution=sh,t.ClipAngleAnimate=class extends Ps{constructor(t,e,i,n,r){var s,a,o,h,l,c,u,d,p,f,g,v;const m=null!==(a=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==a?a:{},y=null!==(o=m.width)&&void 0!==o?o:0,b=null!==(h=m.height)&&void 0!==h?h:0,x=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",w=null!==(c=null==r?void 0:r.startAngle)&&void 0!==c?c:0,S=null!==(u=null==r?void 0:r.orient)&&void 0!==u?u:"clockwise";let A=0,T=0;"anticlockwise"===S?(T="in"===x?w+2*Math.PI:w,T=w+2*Math.PI):(A=w,T="out"===x?w+2*Math.PI:w);const C=mn.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:y/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:b/2,outerRadius:null!==(v=null==r?void 0:r.radius)&&void 0!==v?v:(y+b)/2,innerRadius:0,startAngle:A,endAngle:T,fill:!0});let _,B;"anticlockwise"===S?(_={startAngle:w+2*Math.PI},B={startAngle:w}):(_={endAngle:w},B={endAngle:w+2*Math.PI}),super("in"===x?_:B,"in"===x?B:_,i,n,{group:null==r?void 0:r.group,clipGraphic:C})}},t.ClipDirectionAnimate=class extends Ps{constructor(t,e,i,n,r){var s,a,o,h,l,c,u,d,p;const f=null!==(a=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==a?a:{},g=null!==(h=null!==(o=null==r?void 0:r.width)&&void 0!==o?o:f.width)&&void 0!==h?h:0,v=null!==(c=null!==(l=null==r?void 0:r.height)&&void 0!==l?l:f.height)&&void 0!==c?c:0,m=null!==(u=null==r?void 0:r.animationType)&&void 0!==u?u:"in",y=null!==(d=null==r?void 0:r.direction)&&void 0!==d?d:"x",b=null!==(p=null==r?void 0:r.orient)&&void 0!==p?p:"positive",x=mn.graphicService.creator.rect({x:0,y:0,width:"in"===m&&"x"===y?0:g,height:"in"===m&&"y"===y?0:v,fill:!0});let w={},S={};"y"===y?"negative"===b?(w={y:v,height:0},S={y:0,height:v}):(w={height:0},S={height:v}):"negative"===b?(w={x:g,width:0},S={x:0,width:g}):(w={width:0},S={width:g}),super("in"===m?w:S,"in"===m?S:w,i,n,{group:null==r?void 0:r.group,clipGraphic:x})}},t.ClipGraphicAnimate=Ps,t.ClipRadiusAnimate=class extends Ps{constructor(t,e,i,n,r){var s,a,o,h,l,c,u,d,p,f,g;const v=null!==(a=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==a?a:{},m=null!==(o=v.width)&&void 0!==o?o:0,y=null!==(h=v.height)&&void 0!==h?h:0,b=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",x=null!==(c=null==r?void 0:r.startRadius)&&void 0!==c?c:0,w=null!==(u=null==r?void 0:r.endRadius)&&void 0!==u?u:Math.sqrt((m/2)**2+(y/2)**2),S=mn.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:m/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:y/2,outerRadius:"out"===b?w:x,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),A={outerRadius:x},T={outerRadius:w};super("in"===b?A:T,"in"===b?T:A,i,n,{group:null==r?void 0:r.group,clipGraphic:S})}},t.ColorInterpolate=Qo,t.ColorStore=ia,t.CommonRenderContribution=ph,t.Container=E,t.ContainerModule=i,t.Context2dFactory=Wn,t.ContributionProvider=k,t.CurveContext=class{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.curves.push(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new oi(new zt(this._lastX,this._lastY),new zt(t,e))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,e,i,n,r,s){const a=new si(new zt(this._lastX,this._lastY),new zt(t,e),new zt(i,n),new zt(r,s));this.path.curves.push(a),this._lastX=r,this._lastY=s}arcTo(t,e,i,n,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,r,s,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,r,s){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}},t.CustomEvent=Gr,t.CustomPath2D=Ni,t.CustomSymbolClass=wd,t.DEFAULT_TEXT_FONT_FAMILY=N,t.DebugDrawItemInterceptorContribution=qc,t.DefaultArcAllocate=Hf,t.DefaultArcAttribute=tn,t.DefaultArcRenderContribution=Kh,t.DefaultAreaAllocate=Yf,t.DefaultAreaAttribute=en,t.DefaultAreaTextureRenderContribution=xl,t.DefaultAttribute=Qi,t.DefaultBaseBackgroundRenderContribution=Yh,t.DefaultBaseTextureRenderContribution=$h,t.DefaultCanvasAllocate=gr,t.DefaultCircleAllocate=$f,t.DefaultCircleAttribute=nn,t.DefaultCircleRenderContribution=tl,t.DefaultConnectAttribute=Zi,t.DefaultDebugAttribute=Ji,t.DefaultFillStyle=Vi,t.DefaultGlyphAttribute=sn,t.DefaultGraphicAllocate=Gf,t.DefaultGraphicMemoryManager=rg,t.DefaultGroupAttribute=rn,t.DefaultGroupBackgroundRenderContribution=rl,t.DefaultImageAttribute=fn,t.DefaultImageRenderContribution=pl,t.DefaultLayout=zi,t.DefaultLineAllocate=Kf,t.DefaultLineAttribute=an,t.DefaultMat4Allocate=Oh,t.DefaultMatrixAllocate=kh,t.DefaultMorphingAnimateConfig=hs,t.DefaultPathAllocate=Jf,t.DefaultPathAttribute=on,t.DefaultPickStyle=qi,t.DefaultPolygonAttribute=hn,t.DefaultRect3dAttribute=cn,t.DefaultRectAllocate=Ff,t.DefaultRectAttribute=ln,t.DefaultRectRenderContribution=ll,t.DefaultRichTextAttribute=pn,t.DefaultRichTextIconAttribute=gn,t.DefaultStateAnimateConfig=os,t.DefaultStrokeStyle=Xi,t.DefaultStyle=Ki,t.DefaultSymbolAllocate=tg,t.DefaultSymbolAttribute=un,t.DefaultSymbolRenderContribution=vl,t.DefaultTextAllocate=ig,t.DefaultTextAttribute=dn,t.DefaultTextStyle=$i,t.DefaultTicker=Zr,t.DefaultTimeline=ts,t.DefaultTransform=Hi,t.DirectionalLight=Pf,t.DragNDrop=class{constructor(t){this.onPointerDown=t=>{const e=t.target,i=this.rootNode,n=e===i;if(e&&!n){let r,s=!1;function a(t){if(s||(t.type="dragstart",null==e||e.dispatchEvent(t),s=!0),t.type="drag",null==e||e.dispatchEvent(t),!n){e.attribute.pickable=!1;const n=(null==i?void 0:i.pick(t.global.x,t.global.y)).graphic;e.attribute.pickable=!0,r!==n&&(r&&(t.type="dragleave",t.target=r,r.dispatchEvent(t)),n&&(t.type="dragenter",t.target=n,n.dispatchEvent(t)),r=n,r&&(t.type="dragover",t.target=r,r.dispatchEvent(t)))}}null==i||i.addEventListener("pointermove",a);const o=function(){s&&(r&&(t.type="drop",t.target=r,r.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),s=!1),null==i||i.removeEventListener("pointermove",a)};e.addEventListener("pointerup",o,{once:!0}),e.addEventListener("pointerupoutside",o,{once:!0})}},this.rootNode=t,this.initEvents()}initEvents(){var t;null===(t=this.rootNode)||void 0===t||t.addEventListener("pointerdown",this.onPointerDown)}removeEvents(){var t;null===(t=this.rootNode)||void 0===t||t.removeEventListener("pointerdown",this.onPointerDown)}release(){this.removeEvents(),this.rootNode=null}},t.DrawContribution=Gc,t.DrawItemInterceptor=Vc,t.DynamicLayerHandlerContribution=Lo,t.EnvContribution=U,t.EventManager=Hr,t.EventSystem=Xr,t.EventTarget=Vr,t.FORMAT_ELEMENT_COMMAND="FORMAT_ELEMENT_COMMAND",t.FORMAT_TEXT_COMMAND=Nf,t.Factory=gf,t.FadeInPlus=class extends is{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=Bs.LEFT_TO_RIGHT,fill:a=!0,stroke:o=!0}=r||{};this.direction=s,this.fill=a,this.stroke=o,this.fillGradient={gradient:"linear",stops:[]},this.strokeGradient={gradient:"linear",stops:[]}}getEndProps(){return{fill:this.toFill,stroke:this.toStroke}}onBind(){this.toFill=this.target.getComputedAttribute("fill"),this.toStroke=this.target.getComputedAttribute("stroke")}onEnd(){}onUpdate(t,e,i){if(this.toFill&&this.toStroke)switch(this.direction){case Bs.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case Bs.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case Bs.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case Bs.STROKE:this.strokePath(t,e,i);break;default:this.leftToRight(t,e,i)}}leftToRight(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=this.toStroke;this.strokeGradient.x0=0,this.strokeGradient.y0=0,this.strokeGradient.x1=1,this.strokeGradient.y1=0,this.strokeGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,6*e),color:"transparent"}],i.stroke=this.strokeGradient}}strokePath(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=300,n=e*t;i.lineDash=[n,t-n]}}rightToLeft(t,e,i){}topToBottom(t,e,i){}bottomToTop(t,e,i){}},t.FederatedEvent=jr,t.FederatedMouseEvent=Ur,t.FederatedPointerEvent=Wr,t.FederatedWheelEvent=Nr,t.FlexLayoutPlugin=bv,t.Fragment=Ay,t.GLYPH_NUMBER_TYPE=ho,t.GRAPHIC_UPDATE_TAG_KEY=Ra,t.GROUP_NUMBER_TYPE=lo,t.Generator=e,t.Gesture=class extends ${constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,n,r,s,a,o,h,l,c,u;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=t=>{this.cachedEvents=[],this.startPoints=[],this.reset(),this.startTime=Fr.now();const{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t<e.length;t++){const{x:n,y:r}=e[t],s={x:n,y:r};i[t]=s}if(1!==i.length)this.startDistance=By(i[0],i[1]),this.center=(t=>{const e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,n=0,r=0;for(;r<e;)i+=t[r].x,n+=t[r].y,r++;return{x:Math.round(i/e),y:Math.round(n/e)}})([i[0],i[1]]);else{const t=e[0];this.pressTimeout=setTimeout((()=>{t.direction="none",t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent("press",t),this.triggerEvent("press",t),this.eventType="press",this.direction="none",this.pressTimeout=null}),this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const n=t.clone(),{x:r,y:s,pointerId:a}=n;for(let t=0,e=i.length;t<e;t++)if(a===i[t].pointerId){i[t]=n;break}const o={x:r,y:s},h=i.map((t=>({x:t.x,y:t.y}))),l=Fr.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=l,this.lastMovePoint=o,1===e.length){const t=e[0],i=r-t.x,a=s-t.y,l=this.direction||_y(t,o);this.direction=l;const c=this.getEventType(o);return n.direction=l,n.deltaX=i,n.deltaY=a,n.points=h,this.triggerStartEvent(c,n),void this.triggerEvent(c,n)}const{startDistance:c}=this,u=By(h[0],h[1]);n.scale=u/c,n.center=this.center,n.points=h,this.triggerStartEvent("pinch",n),this.triggerEvent("pinch",n)},this.onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:n}=this,r=i.map((t=>({x:t.x,y:t.y})));if(e.points=r,this.triggerEndEvent(e),1===i.length){const i=Fr.now(),r=this.lastMoveTime;if(i-r<100){const t=r-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||n[0],r=this.lastMovePoint||n[0],s=By(i,r),a=s/t;if(a>this.config.swipe.velocity&&s>this.config.swipe.threshold)return e.velocity=a,e.direction=_y(i,r),this.triggerEvent("swipe",e),this.cachedEvents=[],this.startPoints=[],void this.reset()}}i-this.startTime<this.config.press.time&&(i-this.lastTapTime<this.config.tap.interval&&t.target===this.lastTapTarget?this.tapCount++:this.tapCount=1,this.lastTapTime=i,this.lastTapTarget=t.target,1===this.tapCount?this.triggerEvent("tap",e):2===this.tapCount&&(this.triggerEvent("doubletap",e),this.tapCount=0))}for(let t=0,r=i.length;t<r;t++)if(i[t].pointerId===e.pointerId){i.splice(t,1),n.splice(t,1);break}this.reset(),i.length>0&&this.onStart()},this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:null!==(n=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==n?n:251,threshold:null!==(s=null===(r=null==e?void 0:e.press)||void 0===r?void 0:r.threshold)&&void 0!==s?s:9},swipe:{threshold:null!==(o=null===(a=null==e?void 0:e.swipe)||void 0===a?void 0:a.threshold)&&void 0!==o?o:10,velocity:null!==(l=null===(h=null==e?void 0:e.swipe)||void 0===h?void 0:h.velocity)&&void 0!==l?l:.3},tap:{interval:null!==(u=null===(c=null==e?void 0:e.tap)||void 0===c?void 0:c.interval)&&void 0!==u?u:300}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){const{eventType:e,startTime:i,startPoints:n}=this;if("press"===e)return e;let r;return r=Fr.now()-i>this.config.press.time&&By(n[0],t)<this.config.press.threshold?"press":"pan",this.eventType=r,r}enable(t){this.processEvent[t]=!0}isProcess(t){return this.processEvent[t]}pushEvent(t,e){const{emitThrottles:i}=this,n={type:t,ev:e};for(let e=0,r=i.length;e<r;e++)if(i[e].type===t)return void i.splice(e,1,n);i.push(n)}clearPressTimeout(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}reset(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}triggerEvent(t,e){this.pushEvent(t,e);const{throttleTimer:i,emitThrottles:n}=this;i||(this.throttleTimer=mn.global.getRequestAnimationFrame()((()=>{mn.global.getCancelAnimationFrame()(this.throttleTimer),this.throttleTimer=null;for(let t=0,e=n.length;t<e;t++){const{type:e,ev:i}=n[t];this.emitEvent(e,i)}this.emitThrottles.length=0})))}triggerStartEvent(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent(`${t}start`,e))}triggerEndEvent(t){const e=this.processEvent;Object.keys(e).forEach((i=>{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]}))}emitEvent(t,e){if(!this.element)return;const i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let n=0,r=i.length;n<r&&!e.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,e,t);this.emit(t,e)}},t.GifImage=NT,t.GlobalPickerService=ou,t.Glyph=Ud,t.GlyphRender=Uc,t.Graphic=La,t.GraphicAnimate=class extends is{constructor(t,e,i,n,r){super(t,e,i,n,r),this.graphic=null==r?void 0:r.graphic}onUpdate(t,e,i){this.graphic&&Object.keys(this.from).forEach((t=>{i[t]=this.from[t]+(this.to[t]-this.from[t])*e}))}},t.GraphicCreator=So,t.GraphicPicker=ru,t.GraphicRender=Bc,t.GraphicService=wo,t.GraphicUtil=ko,t.Group=Po,t.GroupFadeIn=class extends is{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:0}})}onEnd(){this.target.setTheme({common:{opacity:1}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:e}})}},t.GroupFadeOut=class extends is{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:1}})}onEnd(){this.target.setTheme({common:{opacity:0}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:1-e}})}},t.GroupRender=Pc,t.GroupRenderContribution=ah,t.HtmlAttributePlugin=dv,t.IMAGE_NUMBER_TYPE=co,t.Image=zd,t.ImageRender=Wc,t.ImageRenderContribution=oh,t.IncreaseCount=class extends is{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n,r,s,a,o;this.fromNumber=ht(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(i=this.from)||void 0===i?void 0:i.text),this.toNumber=ht(null===(n=this.to)||void 0===n?void 0:n.text)?null===(r=this.to)||void 0===r?void 0:r.text:Number.parseFloat(null===(s=this.to)||void 0===s?void 0:s.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(o=null===(a=this.params)||void 0===a?void 0:a.fixed)&&void 0!==o?o:Math.max(Ft(this.fromNumber),Ft(this.toNumber)))}onEnd(){}onUpdate(t,e,i){var n;!1!==this.valid&&(i.text=t?null===(n=this.to)||void 0===n?void 0:n.text:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}},t.IncrementalDrawContribution=Sc,t.InputText=class extends is{constructor(){super(...arguments),this.fromText="",this.toText=""}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n;if(this.fromText=null!==(e=null===(t=this.from)||void 0===t?void 0:t.text)&&void 0!==e?e:"",this.toText=null!==(n=null===(i=this.to)||void 0===i?void 0:i.text)&&void 0!==n?n:"",!this.toText||at(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=mn.graphicService.creator.line({x:0,y:0,points:[{x:0,y:0},{x:0,y:this.target.getComputedAttribute("fontSize")}],stroke:"black",lineWidth:1});t.add(e)}}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){var n;if(!1===this.valid)return;const r=this.fromText.length,s=this.toText.length,a=Math.ceil(r+(s-r)*e);i.text=this.toText.substr(0,a);const o=null===(n=this.target.shadowRoot)||void 0===n?void 0:n.at(0),h=this.target.clipedWidth+2;o.setAttribute("x",h)}},t.InteractiveDrawItemInterceptorContribution=Kc,t.InteractiveSubRenderContribution=fh,t.LINE_NUMBER_TYPE=uo,t.Layer=Mo,t.LayerService=Oo,t.Line=Md,t.LineRender=Rc,t.Linear=di,t.LinearClosed=ki,t.ManualTickHandler=Jr,t.ManualTicker=class extends Zr{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new Jr;return this._mode="manual",this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}tickAt(t){this.tickerHandler.tick(t-Math.max(this.lastFrameTime,0),(t=>{this.handleTick(t,{once:!0})}))}ifCanStop(){return!1}},t.Mat4Allocate=Mh,t.MathArcPicker=zm,t.MathAreaPicker=Hm,t.MathCirclePicker=Vm,t.MathGlyphPicker=Qm,t.MathImagePicker=Ym,t.MathLinePicker=Xm,t.MathPathPicker=$m,t.MathPickerContribution=Fm,t.MathPolygonPicker=Jm,t.MathRectPicker=qm,t.MathSymbolPicker=Km,t.MathTextPicker=Zm,t.MatrixAllocate=Rh,t.Meteor=class extends is{get lastPos(){return this.posList[this.posList.length-1]}constructor(t,e,i,n){super(null,null,e,i,n),this.size=t,this.posList=[]}onBind(){const e=this.target.attachShadow();this.root=e;for(let i=0;i<this.size;i++){const n=this.target.clone(),r=Math.min((this.size-i)/this.size*3,1),s=Math.min(.2+.7/this.size);n.setAttributes({x:0,y:0,dx:0,dy:0,scaleX:r,scaleY:r,opacity:s},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}),e.add(n)}}onUpdate(t,e,i){if(t)return this.target.detachShadow(),void(this.posList.length=0);const n=this.target.getComputedAttribute("x"),r=this.target.getComputedAttribute("y"),s=new zt(n,r);this.posList.length?(this.target.shadowRoot.forEachChildren(((t,e)=>{const i=this.posList[Math.max(this.posList.length-e-1,0)];t.setAttributes({x:i.x-n,y:i.y-r},!1)})),this.posList.push(s)):this.posList.push(s)}},t.MonotoneX=Ai,t.MonotoneY=Ti,t.MorphingPath=ya,t.MotionPath=class extends is{constructor(t,e,i,n,r){var s;super(t,e,i,n,r),r&&(this.pathLength=r.path.getLength(),this.path=r.path,this.distance=r.distance,this.to=r.distance*this.pathLength,this.initAngle=null!==(s=r.initAngle)&&void 0!==s?s:0,this.changeAngle=!!r.changeAngle,this.cb=r.cb)}onUpdate(t,e,i){const n=this.to*e,{pos:r,angle:s}=this.path.getAttrAt(n);i.x=r.x,i.y=r.y,this.changeAngle&&(i.angle=s+this.initAngle),this.cb&&this.cb(this.from,this.to,e,this.target)}},t.MultiToOneMorphingPath=xa,t.NOWORK_ANIMATE_ATTR=Ia,t.Node=Dr,t.OrthoCamera=Mf,t.PATH_NUMBER_TYPE=po,t.POLYGON_NUMBER_TYPE=fo,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=go,t.Path=Jd,t.PathRender=Mc,t.PathRenderContribution=hh,t.PickItemInterceptor=vp,t.PickerService=su,t.PluginService=xp,t.Polygon=lp,t.PolygonRender=Ec,t.PolygonRenderContribution=lh,t.Pyramid3d=up,t.Pyramid3dRender=jc,t.RAFTickHandler=qr,t.REACT_TO_CANOPUS_EVENTS=yy,t.REACT_TO_CANOPUS_EVENTS_LIST=by,t.RECT3D_NUMBER_TYPE=mo,t.RECT_NUMBER_TYPE=vo,t.RICHTEXT_NUMBER_TYPE=yo,t.RafBasedSTO=As,t.ReactAttributePlugin=fv,t.Rect=Od,t.Rect3DRender=Oc,t.Rect3d=Dd,t.RectRender=kc,t.RectRenderContribution=ch,t.ReflectSegContext=li,t.RenderSelector=Nc,t.RenderService=eu,t.ResourceLoader=Ca,t.RichText=qd,t.RichTextEditPlugin=class{constructor(){this.name="RichTextEditPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.editing=!1,this.pointerDown=!1,this.handleInput=(t,e,i,n,r)=>{const s=this.getPointByColumnIdx(i,n,r);this.hideSelection(),this.setCursor(s.x,s.y1,s.y2),this.updateCbs.forEach((t=>t("input",this)))},this.handleChange=(t,e,i,n,r)=>{const s=this.getPointByColumnIdx(i,n,r);this.curCursorIdx=i,this.selectionStartCursorIdx=i,this.setCursorAndTextArea(s.x,s.y1,s.y2,n),this.hideSelection(),this.updateCbs.forEach((t=>t("change",this)))},this.handleMove=t=>{this.isRichtext(t)&&(this.currRt=t.target,this.handleEnter(t),t.target.once("pointerleave",this.handleLeave),this.showSelection(t))},this.handlePointerDown=t=>{this.editing?this.onFocus(t):this.deFocus(t),this.applyUpdate(),this.pointerDown=!0,this.updateCbs.forEach((t=>t(this.editing?"onfocus":"defocus",this)))},this.handlePointerUp=t=>{this.pointerDown=!1},this.handleEnter=t=>{this.editing=!0,this.pluginService.stage.setCursor("text")},this.handleLeave=t=>{this.editing=!1,this.pluginService.stage.setCursor("default")},this.commandCbs=new Map,this.commandCbs.set(Nf,[this.formatTextCommandCb]),this.updateCbs=[]}getSelection(){return this.selectionStartCursorIdx&&this.curCursorIdx&&this.selectionStartCursorIdx!==this.curCursorIdx&&this.currRt?new Wf(this.selectionStartCursorIdx,this.curCursorIdx,jf(this.currRt.attribute.textConfig,this.selectionStartCursorIdx),jf(this.currRt.attribute.textConfig,this.curCursorIdx),this.currRt):null}formatTextCommandCb(t,e){const i=e.currRt;if(!i)return;const n=e.getSelection();if(!n)return;const{selectionStartCursorIdx:r,curCursorIdx:s}=n,a=i.attribute.textConfig.slice(r+1,s+1);"bold"===t?a.forEach((t=>t.fontWeight="bold")):"italic"===t?a.forEach((t=>t.fontStyle="italic")):"underline"===t?a.forEach((t=>t.underline=!0)):"lineThrough"===t?a.forEach((t=>t.lineThrough=!0)):et(t)&&a.forEach((e=>function(t){let e=-1;const i=arguments.length<=1?0:arguments.length-1;for(;++e<i;)ft(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}(e,t))),i.setAttributes(i.attribute)}dispatchCommand(t,e){const i=this.commandCbs.get(t);i&&i.forEach((t=>t(e,this))),this.updateCbs.forEach((t=>t("dispatch",this)))}registerCommand(t,e){(this.commandCbs.get(t)||[]).push(e)}registerUpdateListener(t){(this.updateCbs||[]).push(t)}activate(t){this.pluginService=t,this.editModule=new Uf,t.stage.on("pointermove",this.handleMove),t.stage.on("pointerdown",this.handlePointerDown),t.stage.on("pointerup",this.handlePointerUp),t.stage.on("pointerleave",this.handlePointerUp),this.editModule.onInput(this.handleInput),this.editModule.onChange(this.handleChange)}showSelection(t){const e=t.target.getFrameCache();if(e&&this.editBg&&this.pointerDown){let i=this.lastPoint,n=this.getEventPosition(t),r=this.getLineByPoint(e,n);const s=this.getColumnByLinePoint(r,n),a=r.top,o=r.top+r.height;let h=s.left+s.width,l=this.getColumnIndex(e,s);n.x<s.left+s.width/2&&(h=s.left,l-=1),n.x=h,n.y=(a+o)/2;let c=this.getLineByPoint(e,i);if((i.y>n.y||i.y===n.y&&i.x>n.x)&&([i,n]=[n,i],[r,c]=[c,r]),this.editBg.removeAllChild(),c===r){const t=this.getColumnByLinePoint(c,i);this.editBg.setAttributes({x:i.x,y:c.top,width:n.x-i.x,height:t.height,fill:"#336df4",fillOpacity:.2})}else{this.editBg.setAttributes({x:0,y:c.top,width:0,height:0});const t=e.lines.findIndex((t=>t===c)),s=e.lines.findIndex((t=>t===r));let a=0;for(let r=t;r<=s;r++){const o=e.lines[r];if(r===t){const t=o.paragraphs[o.paragraphs.length-1];this.editBg.add(Id({x:i.x,y:a,width:t.left+t.width-i.x,height:o.height,fill:"#336df4",fillOpacity:.2}))}else if(r===s){const t=o.paragraphs[0];this.editBg.add(Id({x:t.left,y:a,width:n.x-t.left,height:o.height,fill:"#336df4",fillOpacity:.2}))}else{const t=o.paragraphs[0],e=o.paragraphs[o.paragraphs.length-1];this.editBg.add(Id({x:t.left,y:a,width:e.left+e.width-t.left,height:o.height,fill:"#336df4",fillOpacity:.2}))}a+=o.height}}this.curCursorIdx=l,this.setCursorAndTextArea(h,a+2,o-2,t.target),this.applyUpdate(),this.updateCbs.forEach((t=>t("selection",this)))}}hideSelection(){this.editBg&&(this.editBg.removeAllChild(),this.editBg.setAttributes({fill:"transparent"}))}isRichtext(t){return!(!t.target||"richtext"!==t.target.type||!t.target.attribute.editable)}getEventPosition(t){const e=this.pluginService.stage.eventPointTransform(t),i={x:0,y:0};return t.target.globalTransMatrix.transformPoint(e,i),i}getLineByPoint(t,e){let i=t.lines[0];for(let n=0;n<t.lines.length&&!(i.top<=e.y&&i.top+i.height>=e.y);n++)i=t.lines[n+1];return i}getColumnByLinePoint(t,e){let i=t.paragraphs[0];for(let n=0;n<t.paragraphs.length&&!(i.left<=e.x&&i.left+i.width>=e.x);n++)i=t.paragraphs[n];return i}onFocus(t){this.deFocus(t);const e=t.target;this.tryUpdateRichtext(e);const i=e.attachShadow();i.setAttributes({shadowRootIdx:-1});const n=e.getFrameCache();if(!n)return;if(!this.editLine){const t=Ed({x:0,y:0,lineWidth:1,stroke:"black"});t.animate().to({opacity:1},10,"linear").wait(700).to({opacity:0},10,"linear").wait(700).loop(1/0),this.editLine=t;const e=Ro({x:0,y:0,width:0,height:0});this.editBg=e,i.add(this.editLine),i.add(this.editBg)}const r=this.getEventPosition(t),s=this.getLineByPoint(n,r);if(s){const t=this.getColumnByLinePoint(s,r);if(!t)return;let i=s.top,a=s.top+s.height,o=t.left+t.width;i+=2,a-=2;let h=this.getColumnIndex(n,t);r.x<t.left+t.width/2&&(o=t.left,h-=1),this.lastPoint={x:o,y:(i+a)/2},this.curCursorIdx=h,this.selectionStartCursorIdx=h,this.setCursorAndTextArea(o,i,a,e)}}getPointByColumnIdx(t,e,i){const n=e.getFrameCache(),{lineInfo:r,columnInfo:s}=this.getColumnByIndex(n,t);let a=r.top,o=r.top+r.height;return a+=2,o-=2,{x:s.left+("left"===i?0:s.width),y1:a,y2:o}}getColumnIndex(t,e){let i=-1;for(let n=0;n<t.lines.length;n++){const r=t.lines[n];for(let t=0;t<r.paragraphs.length;t++)if(i++,e===r.paragraphs[t])return i}return-1}getColumnByIndex(t,e){let i=-1;for(let n=0;n<t.lines.length;n++){const r=t.lines[n];for(let t=0;t<r.paragraphs.length;t++){const n=r.paragraphs[t];if(i++,i===e)return{lineInfo:r,columnInfo:n}}}return null}setCursorAndTextArea(t,e,i,n){this.editLine.setAttributes({points:[{x:t,y:e},{x:t,y:i}]});const r={x:0,y:0};n.globalTransMatrix.getInverse().transformPoint({x:t,y:e},r);const{left:s,top:a}=this.pluginService.stage.window.getBoundingClientRect();r.x+=s,r.y+=a,this.editModule.moveTo(r.x,r.y,n,this.curCursorIdx,this.selectionStartCursorIdx)}setCursor(t,e,i){this.editLine.setAttributes({points:[{x:t,y:e},{x:t,y:i}]})}applyUpdate(){this.pluginService.stage.renderNextFrame()}deFocus(t){const e=this.currRt;e&&(e.detachShadow(),this.currRt=null,this.editLine&&(this.editLine.parent.removeChild(this.editLine),this.editLine.release(),this.editLine=null,this.editBg.parent.removeChild(this.editBg),this.editBg.release(),this.editBg=null))}splitText(t){return Array.from(t)}tryUpdateRichtext(t){if(!t.getFrameCache().lines.every((t=>t.paragraphs.every((t=>!(t.text&&st(t.text)&&this.splitText(t.text).length>1)))))){const e=[];t.attribute.textConfig.forEach((t=>{const i=this.splitText(t.text.toString());if(st(t.text)&&i.length>1)for(let n=0;n<i.length;n++){const r=i[n];e.push(Object.assign(Object.assign({},t),{text:r}))}else e.push(t)})),t.setAttributes({textConfig:e}),t.doUpdateFrameCache(e)}}onSelect(){}deactivate(t){t.stage.off("pointermove",this.handleMove),t.stage.off("pointerdown",this.handlePointerDown),t.stage.off("pointerup",this.handlePointerUp),t.stage.off("pointerleave",this.handlePointerUp)}release(){this.editModule.release()}},t.RichTextRender=Dc,t.RotateBySphereAnimate=class extends is{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.getComputedAttribute("x"),n=this.target.getComputedAttribute("y"),r=this.target.getComputedAttribute("z"),s=Math.acos((n-t.y)/e);let a=Math.acos((i-t.x)/e/Math.sin(s));r-t.z<0&&(a=Mt-a),this.theta=a,this.phi=s}onBind(){}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:n,r:r,cb:s}="function"==typeof this.params?this.params():this.params,a=2*Math.PI*e,o=this.theta+a,h=this.phi,l=r*Math.sin(h)*Math.cos(o)+n.x,c=r*Math.cos(h)+n.y,u=r*Math.sin(h)*Math.sin(o)+n.z;for(i.x=l,i.y=c,i.z=u,i.alpha=o+Bt/2;i.alpha>Mt;)i.alpha-=Mt;i.alpha=Mt-i.alpha,i.zIndex=-1e4*i.z,s&&s(i)}},t.SVG_ATTRIBUTE_MAP=Ao,t.SVG_ATTRIBUTE_MAP_KEYS=To,t.SVG_PARSE_ATTRIBUTE_MAP=Co,t.SVG_PARSE_ATTRIBUTE_MAP_KEYS=_o,t.SYMBOL_NUMBER_TYPE=bo,t.SegContext=hi,t.ShadowRoot=pp,t.ShadowRootDrawItemInterceptorContribution=$c,t.Stage=mf,t.StaticLayerHandlerContribution=Io,t.Step=Ri,t.StreamLight=class extends is{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){this.target&&("rect"===this.target.type?this.onStartRect():"line"===this.target.type?this.onStartLineOrArea("line"):"area"===this.target.type&&this.onStartLineOrArea("area"))}onStartLineOrArea(t){var e;const i=this.target.attachShadow(),n=mn.graphicService.creator[t](Object.assign({},null===(e=this.params)||void 0===e?void 0:e.attribute));this[t]=n,n.pathProxy=new Ni,i.add(n)}onStartRect(){var t,e,i;const n=this.target.attachShadow(),r=null===(e=null===(t=this.params)||void 0===t?void 0:t.isHorizontal)||void 0===e||e,s=r?"height":"width",a=r?"width":"height",o=this.target.AABBBounds[s](),h=r?0:this.target.AABBBounds.y1,l=mn.graphicService.creator.rect(Object.assign(Object.assign({[s]:o,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff"},null===(i=this.params)||void 0===i?void 0:i.attribute),{x:0,y:h,[a]:0}));this.rect=l,n.add(l)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){return this.rect?this.onUpdateRect(t,e,i):this.line||this.area?this.onUpdateLineOrArea(t,e,i):void 0}onUpdateRect(e,i,n){var r,s,a,o,h,l,c,u,d,p,f,g,v,m,y,b;const x=null===(s=null===(r=this.params)||void 0===r?void 0:r.isHorizontal)||void 0===s||s,w=this.target.attribute;if(x){const n=null!==(o=null!==(a=w.width)&&void 0!==a?a:Math.abs(w.x1-w.x))&&void 0!==o?o:250,r=null!==(l=null===(h=this.params)||void 0===h?void 0:h.streamLength)&&void 0!==l?l:n,s=null!==(d=null===(u=null===(c=this.params)||void 0===c?void 0:c.attribute)||void 0===u?void 0:u.width)&&void 0!==d?d:60,p=-s,f=p+(r-p)*i,g=Math.max(f,0),v=Math.min(Math.min(f+s,s),r-f),m=v+g>n?Math.max(n-g,0):v;this.rect.setAttributes({x:g,width:m,dx:Math.min(w.x1-w.x,0)},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}else{const n=null!==(f=null!==(p=w.height)&&void 0!==p?p:Math.abs(w.y1-w.y))&&void 0!==f?f:250,r=null!==(v=null===(g=this.params)||void 0===g?void 0:g.streamLength)&&void 0!==v?v:n,s=null!==(b=null===(y=null===(m=this.params)||void 0===m?void 0:m.attribute)||void 0===y?void 0:y.height)&&void 0!==b?b:60,a=n-(r+s)*i;let o=Math.min(a,n);const h=Math.min(n-a,s);let l;o<=0?(l=Math.max(o+h,0),o=0):l=h,this.rect.setAttributes({y:o,height:l,dy:Math.min(w.y1-w.y,0)},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}}onUpdateLineOrArea(t,e,i){const n=this.line||this.area;if(!n)return;const r=n.pathProxy,s=this.target;s.cache||s.cacheArea?this._onUpdateLineOrAreaWithCache(r,s,t,e,i):this._onUpdateLineWithoutCache(r,s,t,e,i);const a=s.attribute;n.setAttributes(Object.assign({stroke:a.stroke},n.attribute)),n.addUpdateBoundTag()}_onUpdateLineOrAreaWithCache(t,e,i,n,r){var s,a;if(t.clear(),"line"===e.type){let i=e.cache;Array.isArray(i)||(i=[i]);const r=i.reduce(((t,e)=>t+e.getLength()),0),s=[];return i.forEach((t=>{t.curves.forEach((t=>s.push(t)))})),this._updateCurves(t,s,r,n)}if("area"===e.type&&(null===(a=null===(s=e.cacheArea)||void 0===s?void 0:s.top)||void 0===a?void 0:a.curves)){const i=e.cacheArea,r=i.top.curves.reduce(((t,e)=>t+e.getLength()),0);return this._updateCurves(t,i.top.curves,r,n)}}_updateCurves(t,e,i,n){var r,s;const a=i*n,o=Math.min(null!==(s=a+(null===(r=this.params)||void 0===r?void 0:r.streamLength))&&void 0!==s?s:10,i);let h=0,l=!1;for(let i=0;i<e.length;i++)if(!1!==e[i].defined){const n=e[i],r=n.getLength(),s=1-(h+r-a)/r;let c,u=1-(h+r-o)/r;if(h<a&&h+r>a)if(l=!0,n.p2&&n.p3){const[e,i]=ri(n,s);t.moveTo(i.p0.x,i.p0.y),c=i}else{const e=n.getPointAt(s);t.moveTo(e.x,e.y)}if(h<o&&h+r>o){if(n.p2&&n.p3){c&&(u=(o-a)/c.getLength());const[e]=ri(c||n,u);t.bezierCurveTo(e.p1.x,e.p1.y,e.p2.x,e.p2.y,e.p3.x,e.p3.y)}else{const e=n.getPointAt(u);t.lineTo(e.x,e.y)}break}if(l)if(n.p2&&n.p3){const e=c||n;t.bezierCurveTo(e.p1.x,e.p1.y,e.p2.x,e.p2.y,e.p3.x,e.p3.y)}else t.lineTo(n.p1.x,n.p1.y);h+=r}}_onUpdateLineWithoutCache(t,e,i,n,r){var s,a;const{points:o,curveType:h}=e.attribute;if(!o||o.length<2||"linear"!==h)return;let l=0;for(let t=1;t<o.length;t++)l+=Ht.distancePP(o[t],o[t-1]);const c=l*n,u=Math.min(null!==(a=c+(null===(s=this.params)||void 0===s?void 0:s.streamLength))&&void 0!==a?a:10,l),d=[];let p=0;for(let t=1;t<o.length;t++){const e=Ht.distancePP(o[t],o[t-1]);if(p<c&&p+e>c&&d.push(Ht.pointAtPP(o[t-1],o[t],1-(p+e-c)/e)),p<u&&p+e>u){d.push(Ht.pointAtPP(o[t-1],o[t],1-(p+e-u)/e));break}d.length&&d.push(o[t]),p+=e}if(d.length&&!(d.length<2)){t.clear(),t.moveTo(d[0].x,d[0].y);for(let e=1;e<d.length;e++)t.lineTo(d[e].x,d[e].y)}}},t.SubAnimate=ss,t.Symbol=Bd,t.SymbolRender=Ic,t.SymbolRenderContribution=uh,t.TEXT_NUMBER_TYPE=xo,t.TagPointsUpdate=class extends is{constructor(t,e,i,n,r){var s,a;super(t,e,i,n,r),this.newPointAnimateType=null!==(s=null==r?void 0:r.newPointAnimateType)&&void 0!==s?s:"grow",this.clipRangeByDimension=null!==(a=null==r?void 0:r.clipRangeByDimension)&&void 0!==a?a:"x"}getPoints(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.points)return t.points;if(t.segments){const i=[];return this.segmentsCache||(this.segmentsCache=[]),t.segments.map((t=>{var n,r;t.points&&i.push(...t.points),e&&this.segmentsCache.push(null!==(r=null===(n=t.points)||void 0===n?void 0:n.length)&&void 0!==r?r:0)})),i}return[]}onBind(){const t=this.getPoints(this.from),e=this.getPoints(this.to,!0);this.fromPoints=t?Array.isArray(t)?t:[t]:[],this.toPoints=e?Array.isArray(e)?e:[e]:[];const i=new Map;this.fromPoints.forEach((t=>{t.context&&i.set(t.context,t)}));let n,r,s=1/0,a=-1/0;for(let t=0;t<this.toPoints.length;t+=1)if(i.has(this.toPoints[t].context)){s=t,n=i.get(this.toPoints[t].context);break}for(let t=this.toPoints.length-1;t>=0;t-=1)if(i.has(this.toPoints[t].context)){a=t,r=i.get(this.toPoints[t].context);break}"clip"===this.newPointAnimateType&&0!==this.toPoints.length&&(Number.isFinite(a)?(this.clipRange=this.toPoints[a][this.clipRangeByDimension]/this.toPoints[this.toPoints.length-1][this.clipRangeByDimension],1===this.clipRange&&(this.shrinkClipRange=this.toPoints[a][this.clipRangeByDimension]/this.fromPoints[this.fromPoints.length-1][this.clipRangeByDimension]),lt(this.clipRange)?this.clipRange=Ct(this.clipRange,0,1):this.clipRange=0):this.clipRange=0);let o=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const h=i.get(t.context);return h?(o=h,[h,t]):"appear"===this.newPointAnimateType||"clip"===this.newPointAnimateType?[t,t]:e<s&&n?[n,t]:e>a&&r?[r,t]:[o,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],n=new zt(e.x,e.y,e.x1,e.y1);return n.defined=i.defined,n.context=i.context,n}))}onFirstRun(){const t=this.target.attribute.clipRange;lt(t*this.clipRange)&&(this.clipRange*=t)}onUpdate(t,e,i){if(this.points=this.points.map(((t,i)=>{const n=ys(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),this.clipRange){if(this.shrinkClipRange)return void(t?(i.points=this.toPoints,i.clipRange=1):(i.points=this.fromPoints,i.clipRange=this.clipRange-(this.clipRange-this.shrinkClipRange)*e));i.clipRange=this.clipRange+(1-this.clipRange)*e}if(this.segmentsCache&&this.to.segments){let t=0;i.segments=this.to.segments.map(((e,i)=>{const n=t+this.segmentsCache[i],r=this.points.slice(t,n);return t=n,Object.assign(Object.assign({},e),{points:r})}))}else i.points=this.points}},t.Text=fu,t.TextMeasureContribution=Dn,t.TextRender=Lc,t.TextRenderContribution=dh,t.Theme=Er,t.TimeOutTickHandler=Kr,t.TransformUtil=Eo,t.VArc=function(t){return Jl.arc(t?t.attribute:{})},t.VArc3d=function(t){return Jl.arc3d(t?t.attribute:{})},t.VArea=function(t){return Jl.area(t?t.attribute:{})},t.VCircle=function(t){return Jl.circle(t?t.attribute:{})},t.VGlobal=W,t.VGlyph=function(t){return Jl.glyph(t?t.attribute:{})},t.VGroup=function(t){return Jl.group(t?t.attribute:{})},t.VImage=function(t){return Jl.image(t?t.attribute:{})},t.VLine=function(t){return Jl.line(t?t.attribute:{})},t.VPath=function(t){return Jl.path(t?t.attribute:{})},t.VPolygon=function(t){return Jl.polygon(t?t.attribute:{})},t.VPyramid3d=function(t){return Jl.pyramid3d(t?t.attribute:{})},t.VRect=function(t){return Jl.rect(t?t.attribute:{})},t.VRect3d=function(t){return Jl.rect3d(t?t.attribute:{})},t.VRichText=xy,t.VSymbol=function(t){return Jl.symbol(t?t.attribute:{})},t.VText=function(t){return Jl.text(t?t.attribute:{})},t.VWindow=br,t.ViewTransform3dPlugin=vv,t.VirtualLayerHandlerContribution=Do,t.WILDCARD="*",t.WindowHandlerContribution=xr,t.WrapText=mu,t.XMLParser=Va,t._calculateLineHeight=Cs,t._interpolateColor=sa,t._registerArc=QT,t.addArcToBezierPath=Ke,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=Ds,t.alignSubpath=Ms,t.application=mn,t.applyTransformOnBezierCurves=Ws,t.arc3dCanvasPickModule=gT,t.arc3dModule=zg,t.arcCanvasPickModule=VS,t.arcMathPickModule=Pb,t.arcModule=og,t.areaCanvasPickModule=cA,t.areaMathPickModule=Ib,t.areaModule=pg,t.bezier=$e,t.bezierCurversToPath=Ns,t.binarySplitPolygon=Zs,t.bindContributionProvider=I,t.bindContributionProviderNoSingletonScope=L,t.boundStroke=qa,t.browserEnvModule=nb,t.builtInSymbolStrMap=Td,t.builtinSymbols=Sd,t.builtinSymbolsMap=Ad,t.calcLineCache=Wi,t.calculateArcCornerRadius=Ko,t.calculateLineHeight=_s,t.canvasAllocate=vr,t.centroidOfSubpath=Os,t.circleBounds=vs,t.circleCanvasPickModule=AA,t.circleMathPickModule=Nb,t.circleModule=mg,t.clock=Fr,t.cloneGraphic=Aa,t.colorEqual=function(t,e){const i=Ae.parseColorString(t),n=Ae.parseColorString(e);return!(!i||!n)&&i.r===n.r&&i.g===n.g&&i.b===n.b&&i.opacity===n.opacity},t.colorStringInterpolationToStr=da,t.container=jn,t.cornerTangents=qo,t.createArc=sp,t.createArc3d=op,t.createArea=ip,t.createCircle=uu,t.createColor=wn,t.createConicalGradient=ih,t.createGifImage=function(t){return new NT(t)},t.createGlyph=Wd,t.createGroup=Ro,t.createImage=Hd,t.createImageElement=ib,t.createLine=Ed,t.createMat4=Eh,t.createPath=Qd,t.createPolygon=cp,t.createPyramid3d=dp,t.createRect=Id,t.createRect3d=jd,t.createRectPath=ol,t.createRichText=Kd,t.createShadowRoot=fp,t.createStage=function(t){return new mf(t)},t.createSymbol=Pd,t.createText=gu,t.createWrapText=yu,t.cubicCalc=ii,t.cubicLength=ei,t.cubicPointAt=ni,t.cubicSubdivide=Rs,t.decodeReactDom=Ty,t.defaultArcAllocate=Vf,t.defaultArcBackgroundRenderContribution=Qh,t.defaultArcRenderContribution=Zh,t.defaultArcTextureRenderContribution=Jh,t.defaultAreaAllocate=Xf,t.defaultBaseBackgroundRenderContribution=Xh,t.defaultBaseTextureRenderContribution=qh,t.defaultCircleAllocate=qf,t.defaultCircleBackgroundRenderContribution=nl,t.defaultCircleRenderContribution=el,t.defaultCircleTextureRenderContribution=il,t.defaultGraphicMemoryManager=sg,t.defaultGroupBackgroundRenderContribution=sl,t.defaultImageBackgroundRenderContribution=gl,t.defaultImageRenderContribution=fl,t.defaultLineAllocate=Zf,t.defaultPathAllocate=Qf,t.defaultRectAllocate=zf,t.defaultRectBackgroundRenderContribution=dl,t.defaultRectRenderContribution=cl,t.defaultRectTextureRenderContribution=ul,t.defaultSymbolAllocate=eg,t.defaultSymbolBackgroundRenderContribution=bl,t.defaultSymbolRenderContribution=ml,t.defaultSymbolTextureRenderContribution=yl,t.defaultTextAllocate=ng,t.defaultTicker=cf,t.defaultTimeline=es,t.drawArc=qe,t.drawArcPath=Zo,t.drawAreaSegments=Ol,t.drawIncrementalAreaSegments=El,t.drawIncrementalSegments=Ml,t.drawPathProxy=Xo,t.drawSegments=Rl,t.enumCommandMap=Ee,t.feishuEnvModule=Hx,t.fillVisible=zo,t.findBestMorphingRotation=Ls,t.findNextGraphic=Dp,t.flatten_simplify=function(t,e,i){return t.length<=10||i?t:function(t,e){let i,n,r=t[0].x,s=t[0].y;const a=[t[0]];for(let o=1,h=t.length;o<h;o++)i=t[o].x-r,n=t[o].y-s,i*i+n*n>e&&(r=t[o].x,s=t[o].y,a.push(t[o]));return t[t.length-1].x===r&&t[t.length-1].y===s||a.push(t[t.length-1]),a}(t,void 0!==e?e*e:1)},t.foreach=Ip,t.foreachAsync=Lp,t.genBasisSegments=yi,t.genBasisTypeSegments=mi,t.genLinearClosedSegments=Oi,t.genLinearClosedTypeSegments=Ii,t.genLinearSegments=pi,t.genLinearTypeSegments=fi,t.genMonotoneXSegments=_i,t.genMonotoneXTypeSegments=Ci,t.genMonotoneYSegments=Pi,t.genMonotoneYTypeSegments=Bi,t.genNumberType=Za,t.genStepSegments=Mi,t.genStepTypeSegments=Ei,t.getAttributeFromDefaultAttrList=Ss,t.getConicGradientAt=eh,t.getCurrentEnv=function(){return pf()?"browser":"node"},t.getExtraModelMatrix=function(t,e,i){const{alpha:n,beta:r}=i.attribute;if(!n&&!r)return null;const{anchor3d:s=i.attribute.anchor}=i.attribute,a=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=i.AABBBounds;a[0]=e.x1+(e.x2-e.x1)*t}else a[0]=s[0];if("string"==typeof s[1]){const t=parseFloat(s[1])/100,e=i.AABBBounds;a[1]=e.x1+(e.x2-e.x1)*t}else a[1]=s[1]}if("text"===i.type){const{textAlign:t}=i.attribute;a[0]+=gh(t,i.clipedWidth)}a[0]+=t,a[1]+=e;const o=Lh.allocate();return Sh(o,o,[a[0],a[1],0]),r&&bh(o,o,r),n&&xh(o,o,n),Sh(o,o,[-a[0],-a[1],0]),o},t.getModelMatrix=Wh,t.getRichTextBounds=function(t){return tc||(tc=Jl.CreateGraphic("richtext",{})),tc.setAttributes(t),tc.AABBBounds},t.getScaledStroke=xn,t.getTextBounds=ec,t.getTheme=Or,t.getThemeFromGroup=Ir,t.gifImageCanvasPickModule=HT,t.gifImageModule=ZT,t.globalTheme=kr,t.glyphCanvasPickModule=XA,t.glyphMathPickModule=Xb,t.glyphModule=Bg,t.graphicCreator=Jl,t.graphicService=nf,t.graphicUtil=tf,t.harmonyEnvModule=US,t.identityMat4=yh,t.imageCanvasPickModule=nT,t.imageMathPickModule=Zb,t.imageModule=Ig,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.initAllEnv=function(){rS(jn)},t.initBrowserEnv=function(){rb(jn)},t.initFeishuEnv=function(){Vx(jn)},t.initHarmonyEnv=function(){WS(jn)},t.initLynxEnv=function(){hw(jn)},t.initNodeEnv=function(){Tw(jn)},t.initTTEnv=function(){SS(jn)},t.initTaroEnv=function(){Nw(jn)},t.initWxEnv=function(){nS(jn)},t.inject=p,t.injectable=g,t.interpolateColor=ra,t.interpolateGradientConicalColor=ha,t.interpolateGradientLinearColor=aa,t.interpolateGradientRadialColor=oa,t.interpolatePureColorArray=la,t.intersect=$o,t.isBrowserEnv=pf,t.isNodeEnv=ff,t.isSvg=Ya,t.isTransformKey=ws,t.isXML=Xa,t.jsx=function(t,e){const i=e||{},{key:n,name:r,id:s,attribute:a,stateProxy:o,animation:h,timeline:l}=i,c=wy(i,["key","name","id","attribute","stateProxy","animation","timeline"]);let u=t;st(t)&&(u=Jl[t]);const d=[];for(var p=arguments.length,f=new Array(p>2?p-2:0),g=2;g<p;g++)f[g-2]=arguments[g];f.length&&Sy(1===f.length?f[0]:f,d);const v="Group"===u.name?new u(a):u(e);if(function(t,e,i){let n,r=!1;switch(t.type){case"richtext":case"rich/image":break;case"rich/text":n=t.attribute||{},e[0]&&(n.text=e[0]);break;default:r=!0}r?(e.forEach((e=>{e&&t.add(e)})),Object.keys(i).forEach((e=>{const n=yy[e];n&&t.on(n,i[e])}))):"richtext"===t.type&&(t.attribute.textConfig=e.map((t=>t.attribute)).filter((t=>t)))}(v,d,c),o&&(v.stateProxy=o),r&&(v.name=r),at(h)){const t=v.animate();l&&t.setTimeline(l),h.forEach((e=>{t[e[0]](...e.slice(1))}))}return v},t.layerService=rf,t.lineCanvasPickModule=rA,t.lineMathPickModule=nx,t.lineModule=ug,t.loadAllEnv=rS,t.loadAllModule=sS,t.loadBrowserEnv=rb,t.loadFeishuEnv=Vx,t.loadHarmonyEnv=WS,t.loadLynxEnv=hw,t.loadNodeEnv=Tw,t.loadTTEnv=SS,t.loadTaroEnv=Nw,t.loadWxEnv=nS,t.lookAt=_h,t.lynxEnvModule=ow,t.mat3Tomat4=Ah,t.mat4Allocate=Lh,t.matrixAllocate=Ih,t.morphPath=ba,t.multiInject=f,t.multiToOneMorph=(e,i,n)=>{var r,s,a;const o=e.filter((t=>t.toCustomPath&&t.valid));o.length||__DEV__&&console.error(e," is not validate"),i.valid&&i.toCustomPath||__DEV__&&console.error(i," is not validate");const h=("clone"===(null==n?void 0:n.splitPath)?Aa:null!==(r=null==n?void 0:n.splitPath)&&void 0!==r?r:Ta)(i,o.length,!0),l=i.attribute;i.setAttribute("visible",!1);const c=o.map(((t,e)=>ga(t.toCustomPath(),h[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:h[e].globalTransMatrix}))),u=o.map(((t,e)=>ma(t.attribute,l)));if(null==n?void 0:n.individualDelay){const r=n.onEnd;let s=o.length;const a=()=>{s--,0===s&&(i.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),r&&r())};h.forEach(((t,i)=>{var r,s,h;const l=(null!==(r=n.delay)&&void 0!==r?r:0)+n.individualDelay(i,o.length,e[i],t),d=t.animate(Object.assign({},n,{onEnd:a}));d.wait(l),d.play(new ya({morphingData:c[i],saveOnEnd:!0,otherAttrs:u[i]},null!==(s=n.duration)&&void 0!==s?s:hs.duration,null!==(h=n.easing)&&void 0!==h?h:hs.easing))}))}else{const e=null==n?void 0:n.onEnd,r=n?Object.assign({},n):{};r.onEnd=()=>{i.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),e&&e()};const o=i.animate(r);(null==n?void 0:n.delay)&&o.wait(n.delay),o.play(new xa({morphingData:c,otherAttrs:u},null!==(s=null==n?void 0:n.duration)&&void 0!==s?s:hs.duration,null!==(a=null==n?void 0:n.easing)&&void 0!==a?a:hs.easing))}},t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i.a,x=i.b,w=0,S=0;return t[0]=b*n+x*o+w*u+S*g,t[1]=b*r+x*h+w*d+S*v,t[2]=b*s+x*l+w*p+S*m,t[3]=b*a+x*c+w*f+S*y,b=i.c,x=i.d,w=0,S=0,t[4]=b*n+x*o+w*u+S*g,t[5]=b*r+x*h+w*d+S*v,t[6]=b*s+x*l+w*p+S*m,t[7]=b*a+x*c+w*f+S*y,b=0,x=0,w=1,S=0,t[8]=b*n+x*o+w*u+S*g,t[9]=b*r+x*h+w*d+S*v,t[10]=b*s+x*l+w*p+S*m,t[11]=b*a+x*c+w*f+S*y,b=i.e,x=i.f,w=0,S=1,t[12]=b*n+x*o+w*u+S*g,t[13]=b*r+x*h+w*d+S*v,t[14]=b*s+x*l+w*p+S*m,t[15]=b*a+x*c+w*f+S*y,t},t.multiplyMat4Mat4=Ch,t.named=v,t.newThemeObj=Pr,t.nodeEnvModule=Aw,t.oneToMultiMorph=(t,e,i)=>{var n;const r=e.filter((t=>t&&t.toCustomPath&&t.valid));r.length||__DEV__&&console.error(r," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");const s=("clone"===(null==i?void 0:i.splitPath)?Aa:null!==(n=null==i?void 0:i.splitPath)&&void 0!==n?n:Ta)(t,r.length,!1),a=null==i?void 0:i.onEnd;let o=r.length;const h=()=>{o--,0===o&&a&&a()};r.forEach(((e,n)=>{var a;const o=s[n],l=(null!==(a=null==i?void 0:i.delay)&&void 0!==a?a:0)+((null==i?void 0:i.individualDelay)?i.individualDelay(n,r.length,o,e):0);ba(o,e,Object.assign({},i,{onEnd:h,delay:l}),t.globalTransMatrix)}))},t.ortho=Bh,t.parsePadding=ps,t.parseStroke=us,t.parseSvgPath=Ue,t.pathCanvasPickModule=LA,t.pathMathPickModule=gx,t.pathModule=wg,t.pathToBezierCurves=Us,t.point=gi,t.pointEqual=ms,t.pointInterpolation=ys,t.pointInterpolationHighPerformance=function(t,e,i,n){const{x:r,y:s}=Nt(t.x,t.y,e.x,e.y,i),{x:a,y:o}=Nt(t.x1,t.y1,e.x1,e.y1,i);return n.x=r,n.y=s,n.x1=a,n.y1=o,n.defined=e.defined,n},t.pointsEqual=function(t,e){return!(!t||!e)&&(Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every(((t,i)=>ms(t,e[i]))):!Number.isNaN(t.x+t.y)&&ms(t,e))},t.pointsInterpolation=bs,t.polygonCanvasPickModule=GA,t.polygonMathPickModule=lx,t.polygonModule=Ag,t.preLoadAllModule=Jp,t.pyramid3dCanvasPickModule=wT,t.pyramid3dModule=Xg,t.rafBasedSto=Ts,t.rect3dCanvasPickModule=lT,t.rect3dModule=Wg,t.rectCanvasPickModule=ZS,t.rectFillVisible=Ho,t.rectMathPickModule=Tx,t.rectModule=lg,t.rectStrokeVisible=Yo,t.recursiveCallBinarySplit=Js,t.registerArc=tC,t.registerArc3d=iC,t.registerArc3dGraphic=qg,t.registerArcGraphic=$g,t.registerArea=rC,t.registerAreaGraphic=Kg,t.registerCircle=aC,t.registerCircleGraphic=Zg,t.registerDirectionalLight=Rf,t.registerFlexLayoutPlugin=xv,t.registerGlyph=hC,t.registerGlyphGraphic=Jg,t.registerGroup=cC,t.registerGroupGraphic=Qg,t.registerHtmlAttributePlugin=pv,t.registerImage=dC,t.registerImageGraphic=tv,t.registerLine=fC,t.registerLineGraphic=ev,t.registerOrthoCamera=Ef,t.registerPath=vC,t.registerPathGraphic=iv,t.registerPolygon=yC,t.registerPolygonGraphic=nv,t.registerPyramid3d=xC,t.registerPyramid3dGraphic=rv,t.registerReactAttributePlugin=gv,t.registerRect=SC,t.registerRect3d=TC,t.registerRect3dGraphic=av,t.registerRectGraphic=sv,t.registerRichtext=_C,t.registerRichtextGraphic=ov,t.registerShadowRoot=PC,t.registerShadowRootGraphic=cv,t.registerSymbol=MC,t.registerSymbolGraphic=hv,t.registerText=kC,t.registerTextGraphic=lv,t.registerViewTransform3dPlugin=mv,t.registerWrapText=IC,t.registerWrapTextGraphic=uv,t.renderCommandList=Je,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.richTextMathPickModule=_x,t.richtextCanvasPickModule=QA,t.richtextModule=kg,t.rotateX=bh,t.rotateY=xh,t.rotateZ=wh,t.roughModule=LC,t.runFill=Go,t.runStroke=Fo,t.scaleMat4=Th,t.segments=Xe,t.shouldUseMat4=Nh,t.snapLength=ti,t.splitArc=Hs,t.splitArea=Xs,t.splitCircle=Vs,t.splitGraphic=Ta,t.splitLine=$s,t.splitPath=ta,t.splitPolygon=Qs,t.splitRect=zs,t.splitToGrids=Fs,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=Vo,t.symbolCanvasPickModule=mA,t.symbolMathPickModule=kx,t.symbolModule=gg,t.taroEnvModule=Ww,t.textAttributesToStyle=mh,t.textCanvasPickModule=RA,t.textDrawOffsetX=gh,t.textDrawOffsetY=function(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0},t.textLayoutOffsetY=vh,t.textMathPickModule=Dx,t.textModule=bg,t.transformKeys=xs,t.transformMat4=Ph,t.transformUtil=ef,t.translate=Sh,t.ttEnvModule=wS,t.version="0.21.14",t.verticalLayout=Qa,t.vglobal=Qp,t.waitForAllSubLayers=function(t){return $a(this,void 0,void 0,(function*(){const e=[],i=t.getChildren();yield new Promise((t=>{mn.global.getRequestAnimationFrame()((()=>{t(null)}))})),i.forEach((t=>{t.subLayers.size&&t.subLayers.forEach((t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise((e=>{t.drawContribution.hooks.completeDraw.tap("outWait",(()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((t=>"outWait"!==t.name)),e(null)}))})))}))})),yield Promise.all(e)}))},t.wrapCanvas=Nn,t.wrapContext=function(t,e){return jn.getNamed(Wn,mn.global.env)(t,e)},t.wxEnvModule=iS,t.xul=function(t){const e=at(t)?t[0]:t,i=[];if(!e)return i;if(!0===Xa(e)){const t=(new Va).parse(e);t.tc&&Object.keys(t.tc).forEach((e=>{"text"===e?i.push(function(t){const e={text:""};no(t,e);const i=t["#text"];return i&&(e.text=i),e}(t.tc[e])):i.push(function(t){const e={image:"",width:0,height:0};no(t,e);const i=e.image;return i&&(e.image=i.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">")),e}(t.tc[e]))}))}return i}}));
|
|
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).VRender={})}(this,(function(t){"use strict";class e{static GenAutoIncrementId(){return e.auto_increment_id++}}e.auto_increment_id=0;class i{constructor(t){this.id=e.GenAutoIncrementId(),this.registry=t}}const n="named",r="inject",s="multi_inject",a="inversify:tagged",o="inversify:paramtypes";class h{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===n?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var l=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),n=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),r=new WeakMap;function s(t,e,i){let s=r.get(t);if(l(s)){if(!i)return;s=new n,r.set(t,s)}let a=s.get(e);if(l(a)){if(!i)return;a=new n,s.set(e,a)}return a}function a(t,e,i){if(o(t,e,i))return!0;const n=g(e);return!c(n)&&a(t,n,i)}function o(t,e,i){const n=s(e,i,!1);return!l(n)&&!!n.has(t)}function h(t,e,i){if(o(t,e,i))return function(t,e,i){const n=s(e,i,!1);if(!l(n))return n.get(t)}(t,e,i);const n=g(e);return c(n)?void 0:h(t,n,i)}function l(t){return void 0===t}function c(t){return null===t}function u(t){return"object"==typeof t?null!==t:"function"==typeof t}function d(t,i){switch(function(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}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const n=3===i?"string":5===i?"number":"default",r=function(t,e){const i=t[e];if(null!=i){if(!f(i))throw new TypeError;return i}}(t,e);if(void 0!==r){const e=r.call(t,n);if(u(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(f(e)){const i=e.call(t);if(!u(i))return i}const i=t.valueOf;if(f(i)){const e=i.call(t);if(!u(e))return e}}else{const e=t.valueOf;if(f(e)){const i=e.call(t);if(!u(i))return i}const i=t.toString;if(f(i)){const e=i.call(t);if(!u(e))return e}}throw new TypeError}(t,"default"===n?"number":n)}function p(t){const e=d(t,3);return function(t){return"symbol"==typeof t}(e)?e:function(t){return""+t}(e)}function f(t){return"function"==typeof t}function g(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;const s=r.constructor;return"function"!=typeof s||s===t?e:s}t("defineMetadata",(function(t,e,i,n){if(!u(i))throw new TypeError;return function(t,e,i,n){s(i,n,!0).set(t,e)}(t,e,i,n)})),t("hasMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return l(i)||(i=p(i)),a(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return l(i)||(i=p(i)),o(t,e,i)})),t("getMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return l(i)||(i=p(i)),h(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function c(t,e,i,n){!function(t,e,i,n){const r=[n];let s={};l.hasOwnMetadata(t,e)&&(s=l.getMetadata(t,e));let a=s[i];void 0===a&&(a=[]),a.push(...r),s[i]=a,l.defineMetadata(t,s,e)}(a,t,i.toString(),n)}function u(t){return(e,i,n)=>{c(e,0,n,t)}}function d(t){return e=>(i,n,r)=>u(new h(t,e))(i,n,r)}const p=d(r),f=d(s);function g(){return function(t){return l.defineMetadata(o,null,t),t}}function v(t){return u(new h(n,t))}const m="Singleton",y="Transient",b="ConstantValue",x="DynamicValue",w="Factory",S="Function",A="Instance",T="Invalid";class C{constructor(t,i){this.id=e.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=i,this.type=T,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new C(this.serviceIdentifier,this.scope);return t.activated=t.scope===m&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class _{getConstructorMetadata(t){return{compilerGeneratedMetadata:l.getMetadata(o,t),userGeneratedMetadata:l.getMetadata(a,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const B=(P=n,t=>{const e=e=>{if(null==e)return!1;if(e.key===P&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;e<i.length;e++)if(i[e].key===P&&i[e].value===t)return!0;return!1};return e.metaData=new h(P,t),e});var P;class R{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=m,this}inTransientScope(){return this._binding.scope=y,this}whenTargetNamed(t){return this._binding.constraint=B(t),this}}class M{constructor(t){this._binding=t}to(t){return this._binding.type=A,this._binding.implementationType=t,new R(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=x,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new R(this._binding)}toConstantValue(t){return this._binding.type=b,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=m,new R(this._binding)}toFactory(t){return this._binding.type=w,this._binding.factory=t,this._binding.scope=m,new R(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}class E{constructor(t){const i=t||{};i.defaultScope=i.defaultScope||y,this.options=i,this.id=e.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new _}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const n=this._getNotAllArgs(t,!1,e,i);return this._get(n)}getNamed(t,e){return this.getTagged(t,n,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new C(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new M(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const n=this.bind(i);return t(n,e),n},i=()=>t=>this.unbind(t),n=()=>t=>this.isBound(t),r=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:r(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,n){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:n}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),n=Object.keys(i),a=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const o={inject:n[r],multiInject:n[s]},h=o.inject||o.multiInject,l={serviceIdentifier:h,constructorArgsMetadata:e},c=(this._bindingDictionary.get(h)||[]).filter((t=>t.constraint(l)));if(c.length){const t={injectIdentifier:h,metadata:e,bindings:c};a.push(t)}}return a}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case b:case S:e=t.cache;break;case A:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===m&&(t.cache=e,t.activated=!0)}}const k=Symbol("ContributionProvider");class O{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function I(t,e){t(k).toDynamicValue((t=>{let{container:i}=t;return new O(e,i)})).inSingletonScope().whenTargetNamed(e)}function L(t,e){t(k).toDynamicValue((t=>{let{container:i}=t;return new O(e,i)})).whenTargetNamed(e)}class D{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let n;if("string"==typeof e)n={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof n.name||""===n.name)throw new Error("Missing name for tap");return n=Object.assign({type:t,fn:i},n),n}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let n=this.taps.length;for(;n>0;){n--;const t=this.taps[n];this.taps[n+1]=t;const r=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(r>i)){n++;break}}this.taps[n]=t}}class j extends D{call(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.taps.map((t=>t.fn)).forEach((t=>t(...e)))}}const U=Symbol.for("EnvContribution"),W=Symbol.for("VGlobal"),N="PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";var G,F=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},z=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},H=function(t,e){return function(i,n){e(i,n,t)}},V=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};t.DefaultGlobal=class{get env(){return this._env}get isImageAnonymous(){return this._isImageAnonymous}set isImageAnonymous(t){this._isImageAnonymous=t}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){this.contributions=t,this._isImageAnonymous=!0,this.id=e.GenAutoIncrementId(),this.hooks={onSetEnv:new j(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const n=i.configure(this,t);n&&n.then&&e.push(n)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const n=this.bindContribution(e);if(n&&n.then)return n.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}loadFont(t,e,i){return V(this,void 0,void 0,(function*(){return this._env||this.setEnv("browser"),this.envContribution.loadFont(t,e,i)}))}isChrome(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}updateDom(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}getElementTop(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}},t.DefaultGlobal=F([g(),H(0,p(k)),H(0,v(U)),z("design:paramtypes",[Object])],t.DefaultGlobal),t.MeasureModeEnum=void 0,(G=t.MeasureModeEnum||(t.MeasureModeEnum={}))[G.estimate=0]="estimate",G[G.actualBounding=1]="actualBounding",G[G.fontBounding=2]="fontBounding";function Y(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var X={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function r(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function s(t,e,n,s,a){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new r(n,s||t,a),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],o]:t._events[h].push(o):(t._events[h]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,n,r=[];if(0===this._eventsCount)return r;for(n in t=this._events)e.call(t,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},o.prototype.listeners=function(t){var e=i?i+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,a=new Array(s);r<s;r++)a[r]=n[r].fn;return a},o.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},o.prototype.emit=function(t,e,n,r,s,a){var o=i?i+t:t;if(!this._events[o])return!1;var h,l,c=this._events[o],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,n),!0;case 4:return c.fn.call(c.context,e,n,r),!0;case 5:return c.fn.call(c.context,e,n,r,s),!0;case 6:return c.fn.call(c.context,e,n,r,s,a),!0}for(l=1,h=new Array(u-1);l<u;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var d,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),u){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,n);break;case 4:c[l].fn.call(c[l].context,e,n,r);break;default:if(!h)for(d=1,h=new Array(u-1);d<u;d++)h[d-1]=arguments[d];c[l].fn.apply(c[l].context,h)}}return!0},o.prototype.on=function(t,e,i){return s(this,t,e,i,!1)},o.prototype.once=function(t,e,i){return s(this,t,e,i,!0)},o.prototype.removeListener=function(t,e,n,r){var s=i?i+t:t;if(!this._events[s])return this;if(!e)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||r&&!o.once||n&&o.context!==n||a(this,s);else{for(var h=0,l=[],c=o.length;h<c;h++)(o[h].fn!==e||r&&!o[h].once||n&&o[h].context!==n)&&l.push(o[h]);l.length?this._events[s]=1===l.length?l[0]:l:a(this,s)}return this},o.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&a(this,e)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,t.exports=o}(X);var $=Y(X.exports);var q=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var K=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||q(t,"Boolean")};var Z=t=>"function"==typeof t;var J=t=>null==t;var Q=t=>null!=t;var et=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var it=t=>"object"==typeof t&&null!==t;var nt=function(t){if(!it(t)||!q(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var rt=t=>void 0===t;var st=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||q(t,"String")};var at=t=>Array.isArray?Array.isArray(t):q(t,"Array");var ot=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var ht=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||q(t,"Number")};var lt=t=>ht(t)&&Number.isFinite(t);var ct=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var ut=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t);const dt=Object.prototype.hasOwnProperty;var pt=(t,e)=>null!=t&&dt.call(t,e);function ft(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){if(t===e)return;if(Q(e)&&"object"==typeof e){const r=Object(e),s=[];for(const t in r)s.push(t);let{length:a}=s,o=-1;for(;a--;){const a=s[++o];!Q(r[a])||"object"!=typeof r[a]||n&&at(t[a])?vt(t,a,r[a]):gt(t,e,a,i,n)}}}}function gt(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const s=t[i],a=e[i];let o=e[i],h=!0;if(at(a)){if(n)o=[];else if(at(s))o=s;else if(ot(s)){o=new Array(s.length);let t=-1;const e=s.length;for(;++t<e;)o[t]=s[t]}}else nt(a)?(o=null!=s?s:{},"function"!=typeof s&&"object"==typeof s||(o={})):h=!1;h&&ft(o,a,n,r),vt(t,i,o)}function vt(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function mt(t,e){if(!at(t)||!at(e))return!1;if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0}const yt="undefined"!=typeof console;function bt(t,e,i){const n=[e].concat([].slice.call(i));yt&&console[t].apply(console,n)}var xt;!function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Info=3]="Info",t[t.Debug=4]="Debug"}(xt||(xt={}));class wt{static getInstance(t,e){return wt._instance&&ht(t)?wt._instance.level(t):wt._instance||(wt._instance=new wt(t,e)),wt._instance}static setInstance(t){return wt._instance=t}static setInstanceLevel(t){wt._instance?wt._instance.level(t):wt._instance=new wt(t)}static clearInstance(){wt._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xt.None,e=arguments.length>1?arguments[1]:void 0;this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this._onErrorHandler.forEach((t=>t(...e)))}canLogInfo(){return this._level>=xt.Info}canLogDebug(){return this._level>=xt.Debug}canLogError(){return this._level>=xt.Error}canLogWarn(){return this._level>=xt.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(){for(var t,e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];return this._level>=xt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):bt(null!==(t=this._method)&&void 0!==t?t:"error","ERROR",i)),this}warn(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=xt.Warn&&bt(this._method||"warn","WARN",e),this}info(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=xt.Info&&bt(this._method||"log","INFO",e),this}debug(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this._level>=xt.Debug&&bt(this._method||"log","DEBUG",e),this}}wt._instance=null;const St=1e-10,At=1e-10;function Tt(t,e){const i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:St,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:At)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}var Ct=function(t,e,i){return t<e?e:t>i?i:t};const _t=1e-12,Bt=Math.PI,Pt=Bt/2,Rt=2*Bt,Mt=2*Math.PI,Et=Math.abs,kt=Math.atan2,Ot=Math.cos,It=Math.max,Lt=Math.min,Dt=Math.sin,jt=Math.sqrt,Ut=Math.pow;function Wt(t){return t>=1?Pt:t<=-1?-Pt:Math.asin(t)}function Nt(t,e,i,n,r){let s=i,a=n;return"number"==typeof t&&"number"==typeof i&&(s=(1-r)*t+r*i),"number"==typeof e&&"number"==typeof n&&(a=(1-r)*e+r*n),{x:s,y:a}}function Gt(t,e){return t[0]*e[1]-t[1]*e[0]}function Ft(t){const e=t.toString().split(/[eE]/),i=(e[0].split(".")[1]||"").length-(+e[1]||0);return i>0?i:0}class zt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=n}clone(){return new zt(this.x,this.y)}copyFrom(t){return this.x=t.x,this.y=t.y,this.x1=t.x1,this.y1=t.y1,this.defined=t.defined,this.context=t.context,this}set(t,e){return this.x=t,this.y=e,this}add(t){return ht(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return ht(t)?(this.x-=t,void(this.y-=t)):(this.x-=t.x,this.y-=t.y,this)}multi(t){throw new Error("暂不支持")}div(t){throw new Error("暂不支持")}}class Ht{static distancePP(t,e){return jt(Ut(t.x-e.x,2)+Ut(t.y-e.y,2))}static distanceNN(t,e,i,n){return jt(Ut(t-i,2)+Ut(e-n,2))}static distancePN(t,e,i){return jt(Ut(e-t.x,2)+Ut(i-t.y,2))}static pointAtPP(t,e,i){return new zt((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function Vt(t){return t*(Math.PI/180)}const Yt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-Rt;)t+=Rt;else if(t>0)for(;t>Rt;)t-=Rt;return t};function Xt(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function $t(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function qt(t,e,i,n){if(!function(t,e,i,n){let r=t[0],s=e[0],a=i[0],o=n[0];return s<r&&([r,s]=[s,r]),o<a&&([o,a]=[a,o]),!(s<a||o<r||(r=t[1],s=e[1],a=i[1],o=n[1],s<r&&([r,s]=[s,r]),o<a&&([o,a]=[a,o]),s<a||o<r))}(t,e,i,n))return!1;const r=[0,0],s=[0,0],a=[0,0];if($t(r,e,t),$t(s,n,i),function(t,e){return Et(t[0]-e[0])+Et(t[1]-e[1])<1e-12}(r,s))return!0;$t(a,i,t);const o=Gt(a,s)/Gt(r,s);return o>=0&&o<=1&&[t[0]+r[0]*o,t[1]+r[1]*o]}var Kt;!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Kt||(Kt={}));const Zt=(t,e,i)=>{let n=t.x1,r=t.x2,s=t.y1,a=t.y2,o=e.x1,h=e.x2,l=e.y1,c=e.y2;return i&&(n>r&&([n,r]=[r,n]),s>a&&([s,a]=[a,s]),o>h&&([o,h]=[h,o]),l>c&&([l,c]=[c,l])),{x11:n,x12:r,y11:s,y12:a,x21:o,x22:h,y21:l,y22:c}};function Jt(t,e,i){if(t&&e){if(!i)return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1);const{x11:n,x12:r,y11:s,y12:a,x21:o,x22:h,y21:l,y22:c}=Zt(t,e,!0);return!(n>h||r<o||s>c||a<l)}return!0}function Qt(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function te(t,e){let{x:i,y:n}=t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(i-r.x)*Math.cos(e)-(n-r.y)*Math.sin(e)+r.x,y:(i-r.x)*Math.sin(e)+(n-r.y)*Math.cos(e)+r.y}}function ee(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function ie(t,e){const i=e?Vt(t.angle):t.angle,n=ee(t);return[te({x:t.x1,y:t.y1},i,n),te({x:t.x2,y:t.y1},i,n),te({x:t.x2,y:t.y2},i,n),te({x:t.x1,y:t.y2},i,n)]}function ne(t,e,i,n,r,s){if(s>e&&s>n||s<e&&s<n)return 0;if(n===e)return 0;const a=(s-e)/(n-e);let o=n<e?1:-1;1!==a&&0!==a||(o=n<e?.5:-.5);const h=a*(i-t)+t;return h===r?1/0:h>r?o:0}const re=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,n=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,n=e<<10|i,n+=65536),12288===n||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":8361===n||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||172===n||175===n||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":161===n||164===n||167<=n&&n<=168||170===n||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||198===n||208===n||215<=n&&n<=216||222<=n&&n<=225||230===n||232<=n&&n<=234||236<=n&&n<=237||240===n||242<=n&&n<=243||247<=n&&n<=250||252===n||254===n||257===n||273===n||275===n||283===n||294<=n&&n<=295||299===n||305<=n&&n<=307||312===n||319<=n&&n<=322||324===n||328<=n&&n<=331||333===n||338<=n&&n<=339||358<=n&&n<=359||363===n||462===n||464===n||466===n||468===n||470===n||472===n||474===n||476===n||593===n||609===n||708===n||711===n||713<=n&&n<=715||717===n||720===n||728<=n&&n<=731||733===n||735===n||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||1025===n||1040<=n&&n<=1103||1105===n||8208===n||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||8240===n||8242<=n&&n<=8243||8245===n||8251===n||8254===n||8308===n||8319===n||8321<=n&&n<=8324||8364===n||8451===n||8453===n||8457===n||8467===n||8470===n||8481<=n&&n<=8482||8486===n||8491===n||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||8585===n||8592<=n&&n<=8601||8632<=n&&n<=8633||8658===n||8660===n||8679===n||8704===n||8706<=n&&n<=8707||8711<=n&&n<=8712||8715===n||8719===n||8721===n||8725===n||8730===n||8733<=n&&n<=8736||8739===n||8741===n||8743<=n&&n<=8748||8750===n||8756<=n&&n<=8759||8764<=n&&n<=8765||8776===n||8780===n||8786===n||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||8853===n||8857===n||8869===n||8895===n||8978===n||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||9675===n||9678<=n&&n<=9681||9698<=n&&n<=9701||9711===n||9733<=n&&n<=9734||9737===n||9742<=n&&n<=9743||9748<=n&&n<=9749||9756===n||9758===n||9792===n||9794===n||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||9839===n||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||9955===n||9960<=n&&n<=9983||10045===n||10071===n||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||65533===n||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"};function se(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;i||(i=1);const{fontStyle:n=e.fontStyle,fontVariant:r=e.fontVariant,fontWeight:s=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(n?n+" ":"")+(r?r+" ":"")+(s?s+" ":"")+a*i+"px "+(o||"sans-serif")}class ae{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),Q(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=Q(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(J(this._canvas)&&(Q(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),J(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&Q(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),J(this._context)&&Q(this._canvas)){const t=this._canvas.getContext("2d");Q(t)&&(t.save(),t.font=se(this.textSpec),this._contextSaved=!0,this._context=t)}return!J(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:n={}}=this._option,{fontStyle:r=n.fontStyle,fontVariant:s=n.fontVariant,fontWeight:a=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=n.fontSize)&&void 0!==e?e:12),fontFamily:h=(null!==(i=n.fontFamily)&&void 0!==i?i:"sans-serif"),align:l,textAlign:c=(null!=l?l:"center"),baseline:u,textBaseline:d=(null!=u?u:"middle"),ellipsis:p,limit:f}=this._userSpec;let{lineHeight:g=o}=this._userSpec;if(st(g)&&"%"===g[g.length-1]){const t=Number.parseFloat(g.substring(0,g.length-1))/100;g=o*t}return{fontStyle:r,fontVariant:s,fontFamily:h,fontSize:o,fontWeight:a,textAlign:c,textBaseline:d,ellipsis:p,limit:f,lineHeight:g}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(J(t))return{width:0,height:0};if(J(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:n,textAlign:r,textBaseline:s,ellipsis:a,limit:o,lineHeight:h}=this.textSpec;let l;try{const c=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:n,textAlign:r,textBaseline:s,ellipsis:!!a,maxLineWidth:o||1/0,lineHeight:h});l={width:c.width(),height:c.height()}}catch(e){this._notSupportVRender=!0,l=this.measureWithNaiveCanvas(t)}return l}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:n,lineHeight:r}=this.textSpec;return{width:i.width,height:null!==(e=r)&&void 0!==e?e:n,fontBoundingBoxAscent:i.fontBoundingBoxAscent,fontBoundingBoxDescent:i.fontBoundingBoxDescent}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;i<t.length;i++){const n=t[i];let r=this._measureSpecialChar(n);J(r)&&ae.NUMBERS_CHAR_SET.includes(n)&&(r=this._measureNumberChar()),J(r)&&["F","W"].includes(re(n))&&(r=this._measureFullSizeChar()),J(r)&&(r=this._measureLetterChar()),e.width+=r.width,e.height=Math.max(e.height,r.height),!J(r.fontBoundingBoxAscent)&&(e.fontBoundingBoxAscent=r.fontBoundingBoxAscent),!J(r.fontBoundingBoxDescent)&&(e.fontBoundingBoxDescent=r.fontBoundingBoxDescent)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:n,lineHeight:r}=this.textSpec;for(let e=0;e<t.length;e++){const r=t[e],s=["F","W"].includes(re(r))?1:.53;i.width+=s*n}return i.height=null!==(e=r)&&void 0!==e?e:n,i}_measureReduce(t,e){var i;const{fontSize:n,lineHeight:r}=this.textSpec,s={width:0,height:0};if(J(t))return s;if(at(t)){const a=t.filter(Q).map((t=>t.toString()));return 0===a.length?s:1===a.length?e(a[0]):{width:a.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:a.length*((null!==(i=r)&&void 0!==i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(J(this._numberCharSize)){const t=this._standardMethod(ae.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/ae.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return J(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(ae.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(J(this._letterCharSize)){const t=this._standardMethod(ae.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/ae.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(t){return Q(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){Q(this._canvas)&&(this._canvas=null),Q(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}ae.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",ae.NUMBERS_CHAR_SET="0123456789",ae.FULL_SIZE_CHAR="字";function oe(t,e,i){const{x1:n,y1:r,x2:s,y2:a}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*n+i.c*r+i.e,i.b*n+i.d*r+i.f),t.add(i.a*s+i.c*r+i.e,i.b*s+i.d*r+i.f),t.add(i.a*s+i.c*a+i.e,i.b*s+i.d*a+i.f),t.add(i.a*n+i.c*a+i.e,i.b*n+i.d*a+i.f),e)}class he{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new he(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=n,this}set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return i<t?(this.x2=t,this.x1=i):(this.x1=t,this.x2=i),n<e?(this.y2=e,this.y1=n):(this.y1=e,this.y2=n),this}add(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t<this.x1&&(this.x1=t),e<this.y1&&(this.y1=e),t>this.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return at(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=this.rotatedPoints(t,e,i);return this.clear().add(n[0],n[1]).add(n[2],n[3]).add(n[4],n[5]).add(n[6],n[7])}scale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const r=this.scalePoints(t,e,i,n);return this.clear().add(r[0],r[1]).add(r[2],r[3])}union(t){return t.x1<this.x1&&(this.x1=t.x1),t.y1<this.y1&&(this.y1=t.y1),t.x2>this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2<this.x2&&(this.x2=t.x2),t.y2<this.y2&&(this.y2=t.y2),this}encloses(t){return t&&this.x1<=t.x1&&this.x2>=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2<t.x1||this.x1>t.x2||this.y2<t.y1||this.y1>t.y2)}contains(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!(t<this.x1||t>this.x2||e<this.y1||e>this.y2)}containsPoint(t){return!(t.x<this.x1||t.x>this.x2||t.y<this.y1||t.y>this.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.x1*=t,this.x2*=t,this}scaleY(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return oe(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:n,y1:r,x2:s,y2:a}=this,o=Math.cos(t),h=Math.sin(t),l=e-e*o+i*h,c=i-e*h-i*o;return[o*n-h*r+l,h*n+o*r+c,o*n-h*a+l,h*n+o*a+c,o*s-h*r+l,h*s+o*r+c,o*s-h*a+l,h*s+o*a+c]}scalePoints(t,e,i,n){const{x1:r,y1:s,x2:a,y2:o}=this;return[t*r+(1-t)*i,e*s+(1-e)*n,t*a+(1-t)*i,e*o+(1-e)*n]}}class le extends he{}class ce extends he{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;var i;super(t),t&&(this.angle=null!==(i=t.angle)&&void 0!==i?i:e)}intersects(t){return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=ie(t,i),r=ie(e,i),s=(t,e)=>[e.x-t.x,e.y-t.y],a=s(ee(t),ee(e)),o=s(n[0],n[1]),h=s(n[1],n[2]),l=s(r[0],r[1]),c=s(r[1],r[2]),u=i?Vt(t.angle):t.angle;let d=i?Vt(90-t.angle):t.angle+Pt;const p=i?Vt(e.angle):e.angle;let f=i?Vt(90-e.angle):e.angle+Pt;d>Mt&&(d-=Mt),f>Mt&&(f-=Mt);const g=(t,e,i,n)=>{const r=[Math.cos(e),Math.sin(e)];return t+(Qt(r,i)+Qt(r,n))/2>Qt(r,a)};return g((t.x2-t.x1)/2,u,l,c)&&g((t.y2-t.y1)/2,d,l,c)&&g((e.x2-e.x1)/2,p,o,h)&&g((e.y2-e.y1)/2,f,o,h)}(this,t)}setValue(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return super.setValue(t,e,i,n),this.angle=r,this}clone(){return new ce(this)}}class ue{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,n,r,s){return!(this.e!==r||this.f!==s||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}setValue(t,e,i,n,r,s){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=r,this.f=s,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,n=this.d,r=this.e,s=this.f,a=new ue,o=t*n-e*i;return a.a=n/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*s-n*r)/o,a.f=-(t*s-e*r)/o,a}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,r=this.b*e+this.d*i,s=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=n,this.b=r,this.c=s,this.d=a,this}rotateByCenter(t,e,i){const n=Math.cos(t),r=Math.sin(t),s=(1-n)*e+r*i,a=(1-n)*i-r*e,o=n*this.a-r*this.b,h=r*this.a+n*this.b,l=n*this.c-r*this.d,c=r*this.c+n*this.d,u=n*this.e-r*this.f+s,d=r*this.e+n*this.f+a;return this.a=o,this.b=h,this.c=l,this.d=c,this.e=u,this.f=d,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,n,r,s){return this.multiply(t,e,i,n,r,s),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:n,e:r,f:s}=this;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=s,this.f=r,this}multiply(t,e,i,n,r,s){const a=this.a,o=this.b,h=this.c,l=this.d,c=a*t+h*e,u=o*t+l*e,d=a*i+h*n,p=o*i+l*n,f=a*r+h*s+this.e,g=o*r+l*s+this.f;return this.a=c,this.b=u,this.c=d,this.d=p,this.e=f,this.f=g,this}interpolate(t,e){const i=new ue;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:n,c:r,d:s,e:a,f:o}=this,h=i*s-n*r,l=s/h,c=-n/h,u=-r/h,d=i/h,p=(r*o-s*a)/h,f=-(i*o-n*a)/h,{x:g,y:v}=t;e.x=g*l+v*u+p,e.y=g*c+v*d+f}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new ue(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,n=this.d,r=t*n-e*i,s={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);s.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),s.scaleX=a,s.scaleY=r/a,s.skewX=(t*i+e*n)/r,s.skewY=0}else if(0!==i||0!==n){const a=Math.sqrt(i*i+n*n);s.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/a):-Math.acos(i/a)),s.scaleX=r/a,s.scaleY=a,s.skewX=0,s.skewY=(t*i+e*n)/r}return s.rotateDeg=180*s.rotateDeg/Math.PI,s}}class de{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:n=this.L_TIME,R_COUNT:r=this.R_COUNT}=e;if(t.size<i)return 0;let s=0;const a=e=>{s++,t.delete(e)},o=Date.now();return t.forEach(((t,e)=>{if(t.timestamp.length<r)return a(e);let i=0;for(;o-t.timestamp[t.timestamp.length-1-i]<n&&(i++,!(i>=r)););if(i<r)return a(e);for(;o-t.timestamp[0]>n;)t.timestamp.shift()})),s}addLimitedTimestamp(t,e,i){const{R_TIMESTAMP_MAX_SIZE:n=this.R_TIMESTAMP_MAX_SIZE}=i;t.timestamp.length>n&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:i=this.L_TIME}=e,n=Date.now();t.forEach((t=>{for(;n-t.timestamp[0]>i;)t.timestamp.shift()}))}clearItemTimestamp(t,e){const{L_TIME:i=this.L_TIME}=e,n=Date.now();for(;n-t.timestamp[0]>i;)t.timestamp.shift()}}function pe(t,e,i){e/=100,i/=100;const n=(1-Math.abs(2*i-1))*e,r=n*(1-Math.abs(t/60%2-1)),s=i-n/2;let a=0,o=0,h=0;return 0<=t&&t<60?(a=n,o=r,h=0):60<=t&&t<120?(a=r,o=n,h=0):120<=t&&t<180?(a=0,o=n,h=r):180<=t&&t<240?(a=0,o=r,h=n):240<=t&&t<300?(a=r,o=0,h=n):300<=t&&t<360&&(a=n,o=0,h=r),a=Math.round(255*(a+s)),o=Math.round(255*(o+s)),h=Math.round(255*(h+s)),{r:a,g:o,b:h}}function fe(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,e,i),r=Math.max(t,e,i),s=r-n;let a=0,o=0,h=0;return a=0===s?0:r===t?(e-i)/s%6:r===e?(i-t)/s+2:(t-e)/s+4,a=Math.round(60*a),a<0&&(a+=360),h=(r+n)/2,o=0===s?0:s/(1-Math.abs(2*h-1)),o=+(100*o).toFixed(1),h=+(100*h).toFixed(1),{h:a,s:o,l:h}}const ge=/^#([0-9a-f]{3,8})$/,ve={transparent:4294967040},me={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 ye(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function be(t){return ht(t)?new Te(t>>16,t>>8&255,255&t,1):at(t)?new Te(t[0],t[1],t[2]):new Te(255,255,255)}function xe(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function we(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Se=(t,e)=>{const i=ge.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new Te((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?be(t):8===e?new Te(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class Ae{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Ae(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Ae(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof Ae?t:new Ae(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3();case"wcag":return i.getLuminanceWCAG()}}static parseColorString(t){if(Q(ve[t]))return function(t){return ht(t)?new Te(t>>>24,t>>>16&255,t>>>8&255,255&t):at(t)?new Te(t[0],t[1],t[2],t[3]):new Te(255,255,255,1)}(ve[t]);if(Q(me[t]))return be(me[t]);const e=`${t}`.trim().toLowerCase(),i=Se(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Te(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=pe(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Te(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=Ae.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new Te(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t))),this}add(t){const{r:e,g:i,b:n}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,n+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:n}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(n*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const n=this.color.opacity,r=fe(this.color.r,this.color.g,this.color.b),s=pe(J(t)?r.h:Ct(t,0,360),J(e)?r.s:e>=0&&e<=1?100*e:e,J(i)?r.l:i<=1&&i>=0?100*i:i);return this.color=new Te(s.r,s.g,s.b,n),this}setRGB(t,e,i){return!J(t)&&(this.color.r=t),!J(e)&&(this.color.g=e),!J(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=Se(e,!0);return null!=i?i:this}setColorName(t){const e=me[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}getLuminanceWCAG(){const t=this.color.r/255,e=this.color.g/255,i=this.color.b/255;let n,r,s;return n=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),r=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),s=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*r+.0722*s}clone(){return new Ae(this.color.toString())}copyGammaToLinear(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=xe(t.color.r),this.color.g=xe(t.color.g),this.color.b=xe(t.color.b),this}copyLinearToSRGB(t){return this.color.r=we(t.color.r),this.color.g=we(t.color.g),this.color.b=we(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Te{constructor(t,e,i,n){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),Q(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${ye(this.r)+ye(this.g)+ye(this.b)+(1===this.opacity?"":ye(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:n}=fe(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}const Ce=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase(),_e=Rt-1e-8;class Be{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,r,s){if(Math.abs(r-n)>_e)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,h,l,c=1/0,u=-1/0,d=1/0,p=-1/0;function f(t){h=i*Math.cos(t),l=i*Math.sin(t),h<c&&(c=h),h>u&&(u=h),l<d&&(d=l),l>p&&(p=l)}if(f(n),f(r),r!==n)if((n%=Rt)<0&&(n+=Rt),(r%=Rt)<0&&(r+=Rt),r<n&&(s=!s,a=n,n=r,r=a),s)for(r-=Rt,a=n-n%Pt,o=0;o<4&&a>r;++o,a-=Pt)f(a);else for(a=n-n%Pt+Pt,o=0;o<4&&a<r;++o,a+=Pt)f(a);this.bounds.add(t+c,e+d),this.bounds.add(t+u,e+p)}arcTo(t,e,i,n,r){this.bounds.add(t,e)}bezierCurveTo(t,e,i,n,r,s){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(r,s)}closePath(){}ellipse(){throw new Error("不支持ellipse")}lineTo(t,e){this.bounds.add(t,e)}moveTo(t,e){this.bounds.add(t,e)}quadraticCurveTo(t,e,i,n){this.bounds.add(t,e),this.bounds.add(i,n)}rect(t,e,i,n){this.bounds.add(t,e),this.bounds.add(t+i,e+n)}clear(){this.bounds.clear()}release(){}}class Pe{constructor(){this.curves=[],this.bounds=new le}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Re=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Me={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7},Ee={A:0,AT:1,C:2,Z:3,E:4,L:5,M:6,Q:7,R:8};let ke,Oe,Ie,Le,De,je;function Ue(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const r=[];for(let t=0,s=e.length;t<s;t++)if(ke=e[t],Oe=ke.slice(1),Ie=ke[0],i=[Ie],n=Oe.match(Re),null!==n){for(let t=0,e=n.length;t<e;t++)Le=n[t],De=parseFloat(Le),Number.isNaN(De)||i.push(De);if(je=Me[Ie],i.length-1>je){let t,e=Ie;for(let n=1,s=i.length;n<s;n+=je){t=[e];for(let e=n,r=n+je;e<r;e++)t.push(i[e]);r.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else r.push(i)}else r.push(i);return r}var We,Ne,Ge,Fe,ze,He,Ve,Ye;function Xe(t,e,i,n,r,s,a,o,h){const l=Vt(a),c=Math.sin(l),u=Math.cos(l),d=u*(o-t)*.5+c*(h-e)*.5,p=u*(h-e)*.5-c*(o-t)*.5;let f=d*d/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);f>1&&(f=Math.sqrt(f),i*=f,n*=f);const g=u/i,v=c/i,m=-c/n,y=u/n,b=g*o+v*h,x=m*o+y*h,w=g*t+v*e,S=m*t+y*e;let A=1/((w-b)*(w-b)+(S-x)*(S-x))-.25;A<0&&(A=0);let T=Math.sqrt(A);s===r&&(T=-T);const C=.5*(b+w)-T*(S-x),_=.5*(x+S)+T*(w-b),B=Math.atan2(x-_,b-C);let P=Math.atan2(S-_,w-C)-B;P<0&&1===s?P+=Rt:P>0&&0===s&&(P-=Rt);const R=Math.ceil(Math.abs(P/(Pt+.001))),M=[];for(let t=0;t<R;++t){const e=B+t*P/R,r=B+(t+1)*P/R;M[t]=[C,_,e,r,i,n,c,u]}return M}function $e(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=h*s,c=-o*a,u=o*s,d=h*a,p=Math.cos(n),f=Math.sin(n),g=Math.cos(r),v=Math.sin(r),m=.5*(r-n),y=Math.sin(.5*m),b=8/3*y*y/Math.sin(m),x=e+p-b*f,w=i+f+b*p,S=e+g,A=i+v,T=S+b*v,C=A-b*g;return[l*x+c*w,u*x+d*w,l*T+c*C,u*T+d*C,l*S+c*A,u*S+d*A]}function qe(t,e,i,n){const r=Xe(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<r.length;++e){const i=$e(r[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}t.UpdateTag=void 0,(We=t.UpdateTag||(t.UpdateTag={}))[We.NONE=0]="NONE",We[We.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",We[We.UPDATE_SHAPE=2]="UPDATE_SHAPE",We[We.CLEAR_SHAPE=253]="CLEAR_SHAPE",We[We.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",We[We.INIT=179]="INIT",We[We.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",We[We.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",We[We.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",We[We.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",We[We.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",We[We.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",We[We.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",We[We.CLEAR_LAYOUT=127]="CLEAR_LAYOUT",t.IContainPointMode=void 0,(Ne=t.IContainPointMode||(t.IContainPointMode={}))[Ne.GLOBAL=1]="GLOBAL",Ne[Ne.LOCAL=16]="LOCAL",Ne[Ne.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",Ne[Ne.LOCAL_ACCURATE=48]="LOCAL_ACCURATE",t.AttributeUpdateType=void 0,(Ge=t.AttributeUpdateType||(t.AttributeUpdateType={}))[Ge.INIT=0]="INIT",Ge[Ge.DEFAULT=1]="DEFAULT",Ge[Ge.STATE=2]="STATE",Ge[Ge.ANIMATE_BIND=10]="ANIMATE_BIND",Ge[Ge.ANIMATE_PLAY=11]="ANIMATE_PLAY",Ge[Ge.ANIMATE_START=12]="ANIMATE_START",Ge[Ge.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",Ge[Ge.ANIMATE_END=14]="ANIMATE_END",Ge[Ge.TRANSLATE=20]="TRANSLATE",Ge[Ge.TRANSLATE_TO=21]="TRANSLATE_TO",Ge[Ge.SCALE=22]="SCALE",Ge[Ge.SCALE_TO=23]="SCALE_TO",Ge[Ge.ROTATE=24]="ROTATE",Ge[Ge.ROTATE_TO=25]="ROTATE_TO",t.AnimateStatus=void 0,(Fe=t.AnimateStatus||(t.AnimateStatus={}))[Fe.INITIAL=0]="INITIAL",Fe[Fe.RUNNING=1]="RUNNING",Fe[Fe.PAUSED=2]="PAUSED",Fe[Fe.END=3]="END",t.AnimateMode=void 0,(ze=t.AnimateMode||(t.AnimateMode={}))[ze.NORMAL=0]="NORMAL",ze[ze.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY",t.AnimateStepType=void 0,(He=t.AnimateStepType||(t.AnimateStepType={})).wait="wait",He.from="from",He.to="to",He.customAnimate="customAnimate",t.Direction=void 0,function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(t.Direction||(t.Direction={})),t.CurveTypeEnum=void 0,(Ve=t.CurveTypeEnum||(t.CurveTypeEnum={}))[Ve.CubicBezierCurve=0]="CubicBezierCurve",Ve[Ve.QuadraticBezierCurve=1]="QuadraticBezierCurve",Ve[Ve.ArcCurve=2]="ArcCurve",Ve[Ve.LineCurve=3]="LineCurve",Ve[Ve.EllipseCurve=4]="EllipseCurve",Ve[Ve.MoveCurve=5]="MoveCurve",t.BaseRenderContributionTime=void 0,(Ye=t.BaseRenderContributionTime||(t.BaseRenderContributionTime={}))[Ye.beforeFillStroke=0]="beforeFillStroke",Ye[Ye.afterFillStroke=1]="afterFillStroke";const Ke=(t,e,i,n,r,s,a)=>{const o=Math.abs(i-e),h=o>.5*Math.PI?Math.ceil(2*o/Math.PI):1,l=(i-e)/h;for(let i=0;i<h;i++){const o=e+l*i,h=e+l*(i+1),c=4*Math.tan(Math.abs(l)/4)/3,u=h<o?-1:1,d=Math.cos(o),p=Math.sin(o),f=Math.cos(h),g=Math.sin(h),v=d*s+n,m=p*a+r,y=f*s+n,b=g*a+r,x=s*c*u,w=a*c*u;t.push(v-x*p,m+w*d,y+x*g,b-w*f,y,b)}},Ze=[(t,e,i,n,r,s,a)=>e.arc(t[1]*r+i,t[2]*s+n,t[3]*(r+s)/2,t[4],t[5],t[6],a),(t,e,i,n,r,s,a)=>e.arcTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*(r+s)/2,a),(t,e,i,n,r,s,a)=>e.bezierCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,t[5]*r+i,t[6]*s+n,a),(t,e,i,n)=>e.closePath(),(t,e,i,n,r,s)=>e.ellipse(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,t[5],t[6],t[7],t[8]),(t,e,i,n,r,s,a)=>e.lineTo(t[1]*r+i,t[2]*s+n,a),(t,e,i,n,r,s,a)=>e.moveTo(t[1]*r+i,t[2]*s+n,a),(t,e,i,n,r,s,a)=>e.quadraticCurveTo(t[1]*r+i,t[2]*s+n,t[3]*r+i,t[4]*s+n,a),(t,e,i,n,r,s,a)=>e.rect(t[1]*r+i,t[2]*s+n,t[3]*r,t[4]*s,a)];function Je(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6?arguments[6]:void 0;for(let o=0;o<t.length;o++){const h=t[o];Ze[h[0]](h,e,i,n,r,s,a)}}class Qe{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function ti(t,e){let i=0;const n=t.length;for(let r=0;r<n;r++){const s=t[r],a=e[r],o=t[(r+1)%n],h=e[(r+1)%n];i+=Ht.distanceNN(s,a,o,h)}return i/2}function ei(t,e,i,n,r){return ti([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])}function ii(t,e,i,n,r){const s=1-r;return s*s*s*t+3*e*r*s*s+3*i*r*r*s+n*r*r*r}function ni(t,e,i,n,r){const s=ii(t.x,e.x,i.x,n.x,r),a=ii(t.y,e.y,i.y,n.y,r);return new zt(s,a)}function ri(t,e){const{p0:i,p1:n,p2:r,p3:s}=t,a=ni(i,n,r,s,e),o=Ht.pointAtPP(i,n,e),h=Ht.pointAtPP(n,r,e),l=Ht.pointAtPP(r,s,e),c=Ht.pointAtPP(o,h,e),u=Ht.pointAtPP(h,l,e);return[new si(i,o,c,a),new si(a,u,l,s)]}class si extends Qe{constructor(e,i,n,r){super(),this.type=t.CurveTypeEnum.CubicBezierCurve,this.p0=e,this.p1=i,this.p2=n,this.p3=r}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y+this.p3.x+this.p3.y)}getPointAt(t){if(!1!==this.defined)return ni(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?ei(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(e){return e===t.Direction.ROW?Et(this.p0.x-this.p3.x):e===t.Direction.COLUMN?Et(this.p0.y-this.p3.y):0}getAngleAt(t){const e=It(t-.01,0),i=Lt(t+.01,1),n=this.getPointAt(e),r=this.getPointAt(i);return kt(r.y-n.y,r.x-n.x)}}function ai(t,e){const{p0:i,p1:n}=t,r=Ht.pointAtPP(i,n,e);return[new oi(i,r),new oi(r,n)]}class oi extends Qe{constructor(e,i){super(),this.type=t.CurveTypeEnum.LineCurve,this.p0=e,this.p1=i}getPointAt(t){if(!1!==this.defined)return Ht.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=kt(this.p1.y-this.p0.y,this.p1.x-this.p0.x)),this.angle}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y)}calcLength(){return this._validPoint()?Ht.distancePP(this.p0,this.p1):60}calcProjLength(e){return e===t.Direction.ROW?Et(this.p0.x-this.p1.x):e===t.Direction.COLUMN?Et(this.p0.y-this.p1.y):0}}class hi{get endX(){return this._lastX}get endY(){return this._lastY}constructor(t,e){this.init(t,e)}init(t,e){this._lastX=this._lastY=this._startX=this._startY=0,this.curveType=t,this.direction=e,this.curves=[]}bezierCurveTo(t,e,i,n,r,s,a,o){const h=new si(new zt(this._lastX,this._lastY),new zt(t,e),new zt(i,n),new zt(r,s));h.originP1=this._lastOriginP,h.originP2=o,h.defined=a,this.curves.push(h),this._lastX=r,this._lastY=s,this._lastOriginP=o}closePath(){if(this.curves.length<2)return;const t=this.curves[this.curves.length-1];this.lineTo(this._startX,this._startY,t.defined,this._startOriginP)}ellipse(){throw new Error("SegContext不支持调用ellipse")}lineTo(t,e,i,n){const r=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(r),this._lastX=t,this._lastY=e,this._lastOriginP=n}moveTo(t,e,i){return this._lastX=this._startX=t,this._lastY=this._startY=e,this._lastOriginP=i,this._startOriginP=i,this}quadraticCurveTo(t,e,i,n){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,n,r){const s=new oi(new zt(this._lastX,this._lastY),new zt(t,e));return s.originP1=n,s.originP2=r,s.defined=i,s}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(e){var i,n;if(e===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],n=null!==(i=e.p3)&&void 0!==i?i:e.p1;return Et(t.p0.y-n.y)}if(e===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],i=null!==(n=e.p3)&&void 0!==n?n:e.p1;return Et(t.p0.x-i.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class li extends hi{bezierCurveTo(t,e,i,n,r,s,a,o){return super.bezierCurveTo(e,t,n,i,s,r,a,o)}lineTo(t,e,i,n){return super.lineTo(e,t,i,n)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function ci(t,e){let i=!1;for(let n=0,r=e.length;n<=r;n++)n>=r===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function ui(e,i,n){const r=null!=i?i:Et(n[n.length-1].x-n[0].x)>Et(n[n.length-1].y-n[0].y)?t.Direction.ROW:t.Direction.COLUMN;return"monotoneY"===e?new li(e,r):new hi(e,r)}class di{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function pi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const r=ui("linear",i,t);return fi(new di(r,n),t),r}function fi(t,e){return ci(t,e)}function gi(t,e,i,n,r){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,n,t.lastPoint1)}class vi{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&gi(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:gi(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function mi(t,e){return ci(t,e)}function yi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return pi(t,e);const r=ui("basis",i,t);return mi(new vi(r,n),t),r}function bi(t){return t<0?-1:1}function xi(t,e,i){const n=t._x1-t._x0,r=e-t._x1,s=(t._y1-t._y0)/(n||Number(r<0&&-0)),a=(i-t._y1)/(r||Number(n<0&&-0)),o=(s*r+a*n)/(n+r);return(bi(s)+bi(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function wi(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Si(t,e,i,n,r){const s=t._x0,a=t._y0,o=t._x1,h=t._y1,l=(o-s)/3;t.context.bezierCurveTo(s+l,a+l*e,o-l,h-l*i,o,h,n,t.lastPoint1)}class Ai{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:Si(this,this._t0,wi(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,n=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,n,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,n,t);break;case 1:this._point=2;break;case 2:this._point=3,Si(this,wi(this,e=xi(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Si(this,this._t0,e=xi(this,i,n),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=n,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class Ti extends Ai{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Ci(t,e){return ci(t,e)}function _i(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return pi(t,e);const r=ui("monotoneX",i,t);return Ci(new Ai(r,n),t),r}function Bi(t,e){return ci(t,e)}function Pi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;if(t.length<3-Number(!!n))return pi(t,e);const r=ui("monotoneY",i,t);return Bi(new Ti(r,n),t),r}let Ri=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0<this._t&&this._t<1&&2===this._point&&this.context.lineTo(this._x,this._y,!1!==this._lastDefined,this.lastPoint),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const n=this._x*(1-this._t)+e*this._t;.5===this._t?this.context.lineTo(n,this._y,!1!==this._lastDefined,this.lastPoint):this.context.lineTo(n,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(n,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function Mi(e,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:s}=n;if(e.length<2-Number(!!s))return null;const a=new hi("step",null!=r?r:Et(e[e.length-1].x-e[0].x)>Et(e[e.length-1].y-e[0].y)?t.Direction.ROW:t.Direction.COLUMN);return Ei(new Ri(a,i,s),e),a}function Ei(t,e){return ci(t,e)}class ki extends di{lineEnd(){this.context.closePath()}}function Oi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:n}=e;if(t.length<2-Number(!!n))return null;const r=ui("linear",i,t);return Ii(new ki(r,n),t),r}function Ii(t,e){return ci(t,e)}function Li(t,e,i,n,r){let s=t._x1,a=t._y1,o=t._x2,h=t._y2;if(t._l01_a>_t){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);s=(s*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>_t){const n=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,r=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*n+t._x1*t._l23_2a-e*t._l12_2a)/r,h=(h*n+t._y1*t._l23_2a-i*t._l12_2a)/r}t.context.bezierCurveTo(s,a,o,h,t._x2,t._y2,n,t.lastPoint1)}function Di(t,e){return function(i,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:s,startPoint:a}=r;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return pi(i,r);const o=ui(t,s,i);return ci(new e(o,n,a),i),o}}const ji=Di("catmullRom",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:Li(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});const Ui=Di("catmullRomClosed",class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,n=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:Li(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});function Wi(t,e,i){var n,r;switch(e){case"linear":default:return pi(t,i);case"basis":return yi(t,i);case"monotoneX":return _i(t,i);case"monotoneY":return Pi(t,i);case"step":return Mi(t,.5,i);case"stepBefore":return Mi(t,0,i);case"stepAfter":return Mi(t,1,i);case"catmullRom":return ji(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return Ui(t,null!==(r=null==i?void 0:i.curveTension)&&void 0!==r?r:.5,i);case"linearClosed":return Oi(t,i)}}class Ni extends Pe{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Be(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([Ee.M,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([Ee.L,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([Ee.Q,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,s){return this.commandList.push([Ee.C,t,e,i,n,r,s]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,r,s),this}arcTo(t,e,i,n,r){return this.commandList.push([Ee.AT,t,e,i,n,r]),this._ctx&&this._ctx.arcTo(t,e,i,n,r),this}ellipse(t,e,i,n,r,s,a,o){return this.commandList.push([Ee.E,t,e,i,n,r,s,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,n,r,s,a,o),this}rect(t,e,i,n){return this.commandList.push([Ee.R,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,r,s){return this.commandList.push([Ee.A,t,e,i,n,r,s]),this._ctx&&this._ctx.arc(t,e,i,n,r,s),this}closePath(){return this.commandList.push([Ee.Z]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[Ee.M]=t=>`M${t[1]} ${t[2]}`,t[Ee.L]=t=>`L${t[1]} ${t[2]}`,t[Ee.Q]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[Ee.C]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[Ee.A]=t=>{const e=[];Ke(e,t[4],t[5],t[1],t[2],t[3],t[3]);let i="";for(let t=0;t<e.length;t+=6)i+=`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`;return i},t[Ee.R]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[Ee.Z]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,n,r){this.clear();const s=Ue(t);return this._runCommandStrList(s,e,i,n,r),this._updateBounds(),this}fromLine(e){const{points:i,curveType:n,clipRangeByDimension:r}=e.attribute;if(!i)return;const s=Wi(i,n);"x"===r?this.direction=t.Direction.ROW:"y"===r?this.direction=t.Direction.COLUMN:"auto"===r&&(this.direction=s.direction),this.curves=s.curves}fromCustomPath2D(t,e,i,n,r){return this.clear(),this._runCommandList(t.commandList,e,i,n,r),this._updateBounds(),this}transform(t,e,i,n){const r=this.commandList;if(!this.transformCbList){const t=[];t[Ee.M]=this.moveToTransform,t[Ee.L]=this.lineToTransform,t[Ee.Q]=this.quadraticCurveToTransform,t[Ee.C]=this.bezierCurveToTransform,t[Ee.AT]=this.arcToTransform,t[Ee.E]=this.ellipseTransform,t[Ee.R]=this.rectTransform,t[Ee.A]=this.arcTransform,t[Ee.Z]=this.closePathTransform,this.transformCbList=t}r.forEach((r=>{this.transformCbList[r[0]](r,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}lineToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i}quadraticCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i}bezierCurveToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*n+e,t[6]=t[6]*r+i}arcToTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n+e,t[4]=t[4]*r+i,t[5]=t[5]*(n+r)/2}ellipseTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}rectTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*n,t[4]=t[4]*r}arcTransform(t,e,i,n,r){t[1]=t[1]*n+e,t[2]=t[2]*r+i,t[3]=t[3]*(n+r)/2}closePathTransform(){}_runCommandStrList(t){let e,i,n,r,s,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,c=null,u=0,d=0,p=0,f=0;for(let g=0,v=t.length;g<v;++g){switch(e=t[g],1===h&&1===l||(e=Fi(e,h,l)),e[0]){case"l":u+=e[1],d+=e[2],this.lineTo(u+a,d+o);break;case"L":u=e[1],d=e[2],this.lineTo(u+a,d+o);break;case"h":u+=e[1],this.lineTo(u+a,d+o);break;case"H":u=e[1],this.lineTo(u+a,d+o);break;case"v":d+=e[1],this.lineTo(u+a,d+o);break;case"V":d=e[1],this.lineTo(u+a,d+o);break;case"m":u+=e[1],d+=e[2],this.moveTo(u+a,d+o);break;case"M":u=e[1],d=e[2],this.moveTo(u+a,d+o);break;case"c":i=u+e[5],n=d+e[6],p=u+e[3],f=d+e[4],this.bezierCurveTo(u+e[1]+a,d+e[2]+o,p+a,f+o,i+a,n+o),u=i,d=n;break;case"C":u=e[5],d=e[6],p=e[3],f=e[4],this.bezierCurveTo(e[1]+a,e[2]+o,p+a,f+o,u+a,d+o);break;case"s":i=u+e[3],n=d+e[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+a,f+o,u+e[1]+a,d+e[2]+o,i+a,n+o),p=u+e[1],f=d+e[2],u=i,d=n;break;case"S":i=e[3],n=e[4],p=2*u-p,f=2*d-f,this.bezierCurveTo(p+a,f+o,e[1]+a,e[2]+o,i+a,n+o),u=i,d=n,p=e[1],f=e[2];break;case"q":i=u+e[3],n=d+e[4],p=u+e[1],f=d+e[2],this.quadraticCurveTo(p+a,f+o,i+a,n+o),u=i,d=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+a,e[2]+o,i+a,n+o),u=i,d=n,p=e[1],f=e[2];break;case"t":i=u+e[1],n=d+e[2],null===c[0].match(/[QqTt]/)?(p=u,f=d):"t"===c[0]?(p=2*u-r,f=2*d-s):"q"===c[0]&&(p=2*u-p,f=2*d-f),r=p,s=f,this.quadraticCurveTo(p+a,f+o,i+a,n+o),u=i,d=n,p=u+e[1],f=d+e[2];break;case"T":i=e[1],n=e[2],p=2*u-p,f=2*d-f,this.quadraticCurveTo(p+a,f+o,i+a,n+o),u=i,d=n;break;case"a":qe(this,u+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+u+a,e[7]+d+o]),u+=e[6],d+=e[7];break;case"A":qe(this,u+a,d+o,[e[1],e[2],e[3],e[4],e[5],e[6]+a,e[7]+o]),u=e[6],d=e[7];break;case"z":case"Z":this.closePath()}c=e}}_runCommandList(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==r)for(let s=0,a=t.length;s<a;++s){const a=t[s].slice();switch(a[0]){case Ee.L:this.lineToTransform(a,e,i,n,r);break;case Ee.M:this.moveToTransform(a,e,i,n,r);break;case Ee.C:this.bezierCurveToTransform(a,e,i,n,r);break;case Ee.Q:this.quadraticCurveToTransform(a,e,i,n,r);break;case Ee.A:this.arcToTransform(a,e,i,n,r);break;case Ee.E:this.ellipseTransform(a,e,i,n,r);break;case Ee.R:this.rectTransform(a,e,i,n,r);break;case Ee.AT:this.arcToTransform(a,e,i,n,r);break;case Ee.Z:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Je(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===t.Direction.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Et(t.p0.y-e.p1.y)}if(this.direction===t.Direction.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return Et(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let n=0;n<this.curves.length;n++){e=this.curves[n];const r=e.getLength(this.direction);if(i+r>=t)break;i+=r}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}}const Gi=["l",0,0,0,0,0,0,0];function Fi(t,e,i){const n=Gi[0]=t[0];if("a"===n||"A"===n)Gi[1]=e*t[1],Gi[2]=i*t[2],Gi[3]=t[3],Gi[4]=t[4],Gi[5]=t[5],Gi[6]=e*t[6],Gi[7]=i*t[7];else if("h"===n||"H"===n)Gi[1]=e*t[1];else if("v"===n||"V"===n)Gi[1]=i*t[1];else for(let n=1,r=t.length;n<r;++n)Gi[n]=(n%2==1?e:i)*t[n];return Gi}const zi={alignSelf:"auto"},Hi={x:0,y:0,z:0,dx:0,dy:0,dz:0,scrollX:0,scrollY:0,scaleX:1,scaleY:1,scaleZ:1,angle:0,alpha:0,beta:0,scaleCenter:[0,0],anchor:[0,0],anchor3d:[0,0],postMatrix:new ue},Vi={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},Yi={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Xi=Object.assign({outerBorder:Object.assign(Object.assign({},Yi),{distance:0}),innerBorder:Object.assign(Object.assign({},Yi),{distance:0})},Yi),$i={text:"",maxLineWidth:1/0,maxWidth:1/0,textAlign:"left",textBaseline:"alphabetic",fontSize:16,fontFamily:"PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",fontWeight:"",ellipsis:"…",fontVariant:"",fontStyle:"",lineHeight:void 0,underline:0,lineThrough:0,scaleIn3d:!1,direction:"horizontal",wordBreak:"break-all",ignoreBuf:!1,verticalMode:0,wrap:!1,whiteSpace:"no-wrap",heightLimit:1/0,lineClamp:1/0,suffixPosition:"end",underlineDash:[],underlineOffset:0,disableAutoClipedPoptip:void 0,measureMode:t.MeasureModeEnum.fontBounding,keepCenterInLine:!1},qi={pickStrokeBuffer:0},Ki=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},Vi),Xi),zi),qi),Zi={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Ji={_debug_bounds:!1},Qi=Object.assign(Object.assign(Object.assign({strokeSeg:null,renderable:!0,pickable:!0,shadowGraphic:void 0,childrenPickable:!0,fillPickable:!0,strokePickable:!0,visible:!0,zIndex:0,layout:null,boundsPadding:0,fillStrokeOrder:0,renderStyle:"default",pickMode:"accurate",customPickShape:null,boundsMode:"accurate",keepDirIn3d:!0,shadowRootIdx:1,globalZIndex:1,globalCompositeOperation:"",overflow:"hidden",shadowPickMode:"graphic",keepStrokeScale:!1},Ji),Ki),Hi);const tn=Object.assign(Object.assign({},Qi),{startAngle:0,endAngle:Mt,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),en=Object.assign(Object.assign(Object.assign({},Qi),Zi),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),nn=Object.assign(Object.assign({},Qi),{radius:1,startAngle:0,endAngle:Mt}),rn=Object.assign(Object.assign({},Qi),{width:0,height:0,cornerRadius:0,path:[],clip:!1,visibleAll:!0,display:"relative",flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",alignItems:"flex-start",alignContent:"flex-start",baseOpacity:1}),sn=Object.assign(Object.assign({},Qi),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),an=Object.assign(Object.assign(Object.assign({},Qi),Zi),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),on=Object.assign(Object.assign({},Qi),{path:new Ni,fillStrokeOrder:1,customPath:()=>{wt.getInstance().warn("空函数")}}),hn=Object.assign(Object.assign({},Qi),{points:[],cornerRadius:0,closePath:!0}),ln=Object.assign(Object.assign({},Qi),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),cn=Object.assign(Object.assign({},Qi),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),un=Object.assign(Object.assign({},Qi),{symbolType:"circle",size:10,keepDirIn3d:!0}),dn=Object.assign(Object.assign(Object.assign({},Qi),$i),{strokeBoundsBuffer:0,keepDirIn3d:!0}),pn=Object.assign(Object.assign(Object.assign({},Qi),$i),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),fn=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Qi),{fill:!0,cornerRadius:0}),gn=Object.assign(Object.assign({},fn),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1});class vn{}const mn=new vn,yn=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function n(){return r("linear",t.linearGradient,s)||r("radial",t.radialGradient,o)||r("conic",t.conicGradient,a)}function r(e,n,r){return function(n,s){const a=m(n);if(a){m(t.startCall)||i("Missing (");const n=function(n){const s=r();return s&&(m(t.comma)||i("Missing comma before color stops")),{type:e,orientation:s,colorStops:d(p)}}();return m(t.endCall)||i("Missing )"),n}}(n)}function s(){return v("directional",t.sideOrCorner,1)||v("angular",t.angleValue,1)}function a(){return v("angular",t.fromAngleValue,1)}function o(){let i,n,r=h();return r&&(i=[],i.push(r),n=e,m(t.comma)&&(r=h(),r?i.push(r):e=n)),i}function h(){let t=function(){const t=v("shape",/^(circle)/i,0);return t&&(t.style=g()||l()),t}()||function(){const t=v("shape",/^(ellipse)/i,0);return t&&(t.style=f()||l()),t}();if(t)t.at=c();else{const e=l();if(e){t=e;const i=c();i&&(t.at=i)}else{const e=u();e&&(t={type:"default-radial",at:e})}}return t}function l(){return v("extent-keyword",t.extentKeywords,1)}function c(){if(v("position",/^at/,0)){const t=u();return t||i("Missing positioning value"),t}}function u(){const t={x:f(),y:f()};if(t.x||t.y)return{type:"position",value:t}}function d(e){let n=e();const r=[];if(n)for(r.push(n);m(t.comma);)n=e(),n?r.push(n):i("One extra comma");return r}function p(){const e=v("hex",t.hexColor,1)||v("rgba",t.rgbaColor,1)||v("rgb",t.rgbColor,1)||v("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=f(),e}function f(){return v("%",t.percentageValue,1)||v("position-keyword",t.positionKeywords,1)||g()}function g(){return v("px",t.pixelValue,1)||v("em",t.emValue,1)}function v(t,e,i){const n=m(e);if(n)return{type:t,value:n[i]}}function m(t){const i=/^[\n\r\t\s]+/.exec(e);i&&y(i[0].length);const n=t.exec(e);return n&&y(n[0].length),n}function y(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=d(n);return e.length>0&&i("Invalid input not EOF"),t}()}}();class bn{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(bn.IsGradientStr(t))try{const e=yn(t)[0];if(e){if("linear"===e.type)return bn.ParseLinear(e);if("radial"===e.type)return bn.ParseRadial(e);if("conic"===e.type)return bn.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,n=Bt/2,r=parseFloat(e.value)/180*Bt-n;return{gradient:"conical",x:.5,y:.5,startAngle:r,endAngle:r+Mt,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,n=Bt/2;let r="angular"===e.type?parseFloat(e.value)/180*Bt:0;for(;r<0;)r+=Mt;for(;r>=Mt;)r-=Mt;let s=0,a=0,o=0,h=0;return r<n?(s=0,a=1,o=Math.sin(r),h=a-Math.cos(r)):r<Bt?(s=0,a=0,o=Math.cos(r-n),h=Math.sin(r-n)):r<Bt+n?(s=1,a=0,o=s-Math.sin(r-Bt),h=Math.cos(r-Bt)):(s=1,o=s-Math.cos(r-n-Bt),h-=Math.sin(r-n-Bt)),{gradient:"linear",x0:s,y0:a,x1:o,y1:h,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function xn(t,e,i){let n=e;const{a:r,b:s,c:a,d:o}=t.currentMatrix,h=Math.sign(r)*Math.sqrt(r*r+s*s),l=Math.sign(o)*Math.sqrt(a*a+o*o);return h+l===0?0:(n=n/Math.abs(h+l)*2*i,n)}function wn(t,e,i){let n,r,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!e||!0===e)return"black";if(at(e))for(let t=0;t<e.length&&(r=e[t],!r);t++);else r=e;if(r=bn.Parse(r),"string"==typeof r)return r;if(i.AABBBounds&&(!i.attribute||0!==i.attribute.scaleX||0!==i.attribute.scaleY)){const e=i.AABBBounds;let o=e.x2-e.x1,h=e.y2-e.y1,l=e.x1-s,c=e.y1-a;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;o/=t,h/=e,l/=t,c/=e}"linear"===r.gradient?n=function(t,e,i,n,r,s){var a,o,h,l;const c=t.createLinearGradient(i+(null!==(a=e.x0)&&void 0!==a?a:0)*r,n+(null!==(o=e.y0)&&void 0!==o?o:0)*s,i+(null!==(h=e.x1)&&void 0!==h?h:1)*r,n+(null!==(l=e.y1)&&void 0!==l?l:0)*s);return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c}(t,r,l,c,o,h):"conical"===r.gradient?n=function(t,e,i,n,r,s){var a,o;const h=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*r,n+(null!==(o=e.y)&&void 0!==o?o:0)*s,e.startAngle,e.endAngle);return e.stops.forEach((t=>{h.addColorStop(t.offset,t.color)})),h.GetPattern(r+i,s+n,void 0)}(t,r,l,c,o,h):"radial"===r.gradient&&(n=function(t,e,i,n,r,s){var a,o,h,l,c,u;const d=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*r,n+(null!==(o=e.y0)&&void 0!==o?o:.5)*s,Math.max(r,s)*(null!==(h=e.r0)&&void 0!==h?h:0),i+(null!==(l=e.x1)&&void 0!==l?l:.5)*r,n+(null!==(c=e.y1)&&void 0!==c?c:.5)*s,Math.max(r,s)*(null!==(u=e.r1)&&void 0!==u?u:.5));return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d}(t,r,l,c,o,h))}return n||"orange"}const Sn={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},An=!0,Tn=!1,Cn=/\w|\(|\)|-/,_n=/[.?!,;:/,。?!、;:]/,Bn=/\S/,Pn=(t,e)=>{let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily})};function Rn(t,e,i,n,r){if(!e||e<=0)return 0;const s=mn.graphicUtil.textMeasure;let a=n,o=t.slice(0,a),h=Math.floor(s.measureText(o,i).width),l=t.slice(0,a+1),c=Math.floor(s.measureText(l,i).width);for(;h>e||c<=e;){if(h>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),h=Math.floor(s.measureText(o,i).width),l=t.slice(0,a+1),c=Math.floor(s.measureText(l,i).width)}return r&&(a=Mn(t,a)),a}function Mn(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e;for(;Cn.test(t[n-1])&&Cn.test(t[n])||_n.test(t[n]);)if(n--,n<=0)return i?En(t,e):e;return n}function En(t,e){let i=e;for(;Cn.test(t[i-1])&&Cn.test(t[i])||_n.test(t[i]);)if(i++,i>=t.length)return i;return i}function kn(t,e){const i=mn.graphicUtil.textMeasure.measureText(t,e),n={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(n.width=Math.floor(i.width),n.height=e.fontSize||0,n.ascent=n.height,n.descent=0):(n.width=Math.floor(i.width),n.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),n.ascent=Math.floor(i.actualBoundingBoxAscent),n.descent=n.height-n.ascent),n}var On=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let In=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}_measureTextWithoutAlignBaseline(t,e,i){this.context.setTextStyleWithoutAlignBaseline(e);const n=this.context.measureText(t);return i?this.compatibleMetrics(n,e):n}_measureTextWithAlignBaseline(t,e,i){this.context.setTextStyle(e);const n=this.context.measureText(t);return i?this.compatibleMetrics(n,e):n}compatibleMetrics(t,e){if(null==t.actualBoundingBoxAscent||null==t.actualBoundingBoxDescent||null==t.fontBoundingBoxAscent||null==t.fontBoundingBoxDescent){t={width:t.width};const{ascent:i,descent:n}=this.measureTextBoundADscentEstimate(e);t.actualBoundingBoxAscent=i,t.actualBoundingBoxDescent=n,t.fontBoundingBoxAscent=i,t.fontBoundingBoxDescent=n}if(null==t.actualBoundingBoxLeft||null==t.actualBoundingBoxRight){t={width:t.width,actualBoundingBoxAscent:t.actualBoundingBoxAscent,actualBoundingBoxDescent:t.actualBoundingBoxDescent,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent};const{left:i,right:n}=this.measureTextBoundLeftRightEstimate(e);t.actualBoundingBoxLeft=i,t.actualBoundingBoxRight=n}return t}estimate(t,e){let{fontSize:i=dn.fontSize}=e,n=0,r=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?n++:r++;return{width:~~(.8*n*i+r*i),height:i}}measureTextWidth(t,e,i){return this.context?(i=null!=i?i:this._measureTextWithoutAlignBaseline(t,e)).width:this.estimate(t,e).width}measureTextBoundsWidth(t,e,i){return this.context?(i=null!=i?i:this._measureTextWithoutAlignBaseline(t,e)).width:this.estimate(t,e).width}measureTextBoundsLeftRight(t,e,i){return this.context?{left:(i=null!=i?i:this._measureTextWithAlignBaseline(t,e,!0)).actualBoundingBoxLeft,right:i.actualBoundingBoxRight}:this.measureTextBoundLeftRightEstimate(e)}measureTextPixelHeight(t,e,i){var n;return this.context?(i=null!=i?i:this._measureTextWithoutAlignBaseline(t,e,!0),Math.abs(i.actualBoundingBoxAscent-i.actualBoundingBoxDescent)):null!==(n=e.fontSize)&&void 0!==n?n:$i.fontSize}measureTextPixelADscent(t,e,i){return this.context?{ascent:(i=null!=i?i:this._measureTextWithAlignBaseline(t,e,!0)).actualBoundingBoxAscent,descent:i.actualBoundingBoxDescent}:this.measureTextBoundADscentEstimate(e)}measureTextBoundHieght(t,e,i){var n;return this.context?(i=null!=i?i:this._measureTextWithoutAlignBaseline(t,e,!0),Math.abs(i.fontBoundingBoxAscent-i.fontBoundingBoxDescent)):null!==(n=e.fontSize)&&void 0!==n?n:$i.fontSize}measureTextBoundADscent(t,e,i){return this.context?{ascent:(i=null!=i?i:this._measureTextWithAlignBaseline(t,e,!0)).fontBoundingBoxAscent,descent:i.fontBoundingBoxDescent}:this.measureTextBoundADscentEstimate(e)}measureTextBoundADscentEstimate(t){var e;const i=null!==(e=t.fontSize)&&void 0!==e?e:$i.fontSize;return{ascent:.79*i,descent:.21*i}}measureTextBoundLeftRightEstimate(t){var e;const i=null!==(e=t.fontSize)&&void 0!==e?e:$i.fontSize,{textAlign:n}=t;return"center"===n?{left:i/2,right:i/2}:"right"===n||"end"===n?{left:i,right:0}:{left:0,right:i}}measureTextPixelADscentAndWidth(e,i,n){if(!this.context)return Object.assign(Object.assign({},this.measureTextBoundADscentEstimate(i)),{width:this.estimate(e,i).width});const r=this._measureTextWithoutAlignBaseline(e,i,!0);if(n===t.MeasureModeEnum.actualBounding)return{ascent:r.actualBoundingBoxAscent,descent:r.actualBoundingBoxDescent,width:r.width};if(n===t.MeasureModeEnum.estimate)return Object.assign(Object.assign({},this.measureTextBoundADscentEstimate(i)),{width:r.width});if(n===t.MeasureModeEnum.fontBounding){let t=r.fontBoundingBoxAscent,e=r.fontBoundingBoxDescent;if(r.actualBoundingBoxDescent&&e<r.actualBoundingBoxDescent){const i=r.actualBoundingBoxDescent-e;e+=i,t-=i}else if(r.actualBoundingBoxAscent&&t<r.actualBoundingBoxAscent){const i=r.actualBoundingBoxAscent-t;t+=i,e-=i}return{ascent:t,descent:e,width:r.width}}return{ascent:r.actualBoundingBoxAscent,descent:r.actualBoundingBoxDescent,width:r.width}}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,n){if(0===t.length)return{verticalList:t,width:0};const{fontSize:r=12}=e;t.forEach((t=>{t.width=0===t.direction?r:this.measureTextWidth(t.text,e)}));const s=[];let a=0,o=0;for(;o<t.length&&a+t[o].width<i;o++)a+=t[o].width,s.push(t[o]);if(t[o]&&t[o].text.length>1){const r=this._clipText(t[o].text,e,i-a,0,t[o].text.length-1,"end",!1);if(n&&r.str!==t[o].text){let i="",n=0;for(let e=0;e<o;e++){const r=t[e];i+=r.text,n+=r.text.length}i+=t[o].text;let s=Mn(i,n+r.str.length);s-=n,s!==r.str.length-1&&(r.str=r.str.substring(0,s),r.width=this.measureTextWidth(r.str,e))}s.push(Object.assign(Object.assign({},t[o]),{text:r.str,width:r.width})),a+=r.width}return{verticalList:s,width:a}}clipText(t,e,i,n,r){if(0===t.length)return{str:"",width:0};let s=this.measureTextWidth(t,e);if(s<=i)return{str:t,width:s};if(s=this.measureTextWidth(t[0],e),s>i)return{str:"",width:0};const a=this._clipText(t,e,i,0,t.length-1,"end",!1);if(n&&a.str!==t){let i=Mn(t,a.str.length,r);i!==a.str.length&&(i>a.str.length&&(a.wordBreaked=i,i=a.str.length),a.str=t.substring(0,i),a.width=this.measureTextWidth(a.str,e))}return a}_clipText(t,e,i,n,r,s,a){let o;if("start"===s)o=this._clipTextStart(t,e,i,n,r),a&&(o.result=a+o.str);else if("middle"===s){const n=this._clipTextMiddle(t,e,i,"","",0,0,1);o={str:"none",width:n.width,result:n.left+a+n.right}}else o=this._clipTextEnd(t,e,i,n,r),a&&(o.result=o.str+a);return o}_clipTextEnd(t,e,i,n,r){if(n===r){wt.getInstance().warn(`【_clipTextEnd】不应该走到这里${t}, ${n}, ${r}`);const i=t.substring(0,r+1);return{str:i,width:this.measureTextWidth(i,e)}}const s=Math.floor((n+r)/2),a=t.substring(0,s+1),o=this.measureTextWidth(a,e);let h;if(o>i){if(a.length<=1)return{str:"",width:0};const r=t.substring(0,s);return h=this.measureTextWidth(r,e),h<=i?{str:r,width:h}:this._clipTextEnd(t,e,i,n,s)}if(o<i){if(s>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(0,s+2);return h=this.measureTextWidth(n,e),h>=i?{str:a,width:o}:this._clipTextEnd(t,e,i,s,r)}return{str:a,width:o}}_clipTextStart(t,e,i,n,r){const s=Math.ceil((n+r)/2),a=t.substring(s-1,t.length),o=this.measureTextWidth(a,e);let h;if(o>i){if(a.length<=1)return{str:"",width:0};const n=t.substring(s,t.length);return h=this.measureTextWidth(n,e),h<=i?{str:n,width:h}:this._clipTextStart(t,e,i,s,t.length)}if(o<i){if(s<=0)return{str:t,width:this.measureTextWidth(t,e)};const r=t.substring(s-2,t.length);return h=this.measureTextWidth(r,e),h>=i?{str:a,width:o}:this._clipTextStart(t,e,i,n,s)}return{str:a,width:o}}_clipTextMiddle(t,e,i,n,r,s,a,o){const h=t.substring(0,o),l=this.measureTextWidth(h,e);if(l+a>i)return{left:n,right:r,width:s+a};const c=t.substring(t.length-o,t.length),u=this.measureTextWidth(c,e);return l+u>i?{left:h,right:r,width:l+a}:this._clipTextMiddle(t,e,i,h,c,l,u,o+1)}clipTextWithSuffixVertical(t,e,i,n,r,s){if(""===n)return this.clipTextVertical(t,e,i,r);if(0===t.length)return{verticalList:t,width:0};const a=this.clipTextVertical(t,e,i,r);if(a.verticalList.length===t.length&&a.verticalList[a.verticalList.length-1].width===t[t.length-1].width)return a;const o=this.measureTextWidth(n,e);if(o>i)return a;let h;if(i-=o,"start"===s){const s=this.revertVerticalList(t);h=this.clipTextVertical(s,e,i,r);const a=this.revertVerticalList(h.verticalList);a.unshift({text:n,direction:1,width:o}),h.verticalList=a}else if("middle"===s){const s=this.clipTextVertical(t,e,i/2,r),a=this.revertVerticalList(t),l=this.clipTextVertical(a,e,i/2,r);s.verticalList.push({text:n,direction:1,width:o}),this.revertVerticalList(l.verticalList).forEach((t=>s.verticalList.push(t))),h={verticalList:s.verticalList,width:s.width+l.width}}else h=this.clipTextVertical(t,e,i,r),h.verticalList.push({text:n,direction:1,width:o});return h.width+=o,h}revertVerticalList(t){return t.reverse().map((t=>{const e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}clipTextWithSuffix(t,e,i,n,r,s){let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(""===n)return this.clipText(t,e,i,r);if(0===t.length)return{str:"",width:0};const o=this.measureTextWidth(t,e);if(!a&&o<=i)return{str:t,width:o};const h=this.measureTextWidth(n,e);if(h>i)return{str:"",width:0};if(a&&o+h<=i)return{str:t+n,width:o+h};i-=h;const l=this._clipText(t,e,i,0,t.length-1,s,n);if(r&&l.str!==t){const i=Mn(t,l.str.length);i!==l.str.length&&(l.result=t.substring(0,i),l.width=this.measureTextWidth(l.str,e))}else a&&l.str===t&&(l.result=t+n);return l.str=l.result,l.width+=h,l}};In=On([g()],In);var Ln=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};const Dn=Symbol.for("TextMeasureContribution");t.DefaultTextMeasureContribution=class extends In{},t.DefaultTextMeasureContribution=Ln([g()],t.DefaultTextMeasureContribution);const jn=new E,Un=Symbol.for("CanvasFactory"),Wn=Symbol.for("Context2dFactory");function Nn(t){return jn.getNamed(Un,mn.global.env)(t)}const Gn=1e-4,Fn=Math.sqrt(3),zn=1/3;function Hn(t){return t>-nr&&t<nr}function Vn(t){return t>nr||t<-nr}const Yn=[0,0],Xn=[0,0],$n=[0,0];function qn(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}function Kn(t,e,i,n){const r=1-n;return r*(r*t+2*n*e)+n*n*i}function Zn(t,e,i,n,r){const s=1-r;return s*s*(s*t+3*r*e)+r*r*(r*n+3*s*i)}function Jn(t){return(t%=Mt)<0&&(t+=Mt),t}function Qn(t,e,i,n,r,s,a,o,h){if(0===a)return!1;const l=a;return!(h>e+l&&h>n+l&&h>s+l||h<e-l&&h<n-l&&h<s-l||o>t+l&&o>i+l&&o>r+l||o<t-l&&o<i-l&&o<r-l)&&function(t,e,i,n,r,s,a,o,h){let l=0,c=.005,u=1/0;Yn[0]=a,Yn[1]=o;for(let a=0;a<1;a+=.05){Xn[0]=Kn(t,i,r,a),Xn[1]=Kn(e,n,s,a);const o=qn(Yn,Xn);o<u&&(l=a,u=o)}u=1/0;for(let a=0;a<32&&!(c<Gn);a++){const a=l-c,o=l+c;Xn[0]=Kn(t,i,r,a),Xn[1]=Kn(e,n,s,a);const h=qn(Xn,Yn);if(a>=0&&h<u)l=a,u=h;else{$n[0]=Kn(t,i,r,o),$n[1]=Kn(e,n,s,o);const a=qn($n,Yn);o<=1&&a<u?(l=o,u=a):c*=.5}}return h&&(h[0]=Kn(t,i,r,l),h[1]=Kn(e,n,s,l)),Math.sqrt(u)}(t,e,i,n,r,s,o,h,null)<=l/2}function tr(t,e,i,n,r,s,a,o,h,l,c){if(0===h)return!1;const u=h;return!(c>e+u&&c>n+u&&c>s+u&&c>o+u||c<e-u&&c<n-u&&c<s-u&&c<o-u||l>t+u&&l>i+u&&l>r+u&&l>a+u||l<t-u&&l<i-u&&l<r-u&&l<a-u)&&function(t,e,i,n,r,s,a,o,h,l,c){let u,d,p,f,g=0,v=.005,m=1/0;Yn[0]=h,Yn[1]=l;for(let h=0;h<1;h+=.05)Xn[0]=Zn(t,i,r,a,h),Xn[1]=Zn(e,n,s,o,h),p=qn(Yn,Xn),p<m&&(g=h,m=p);m=1/0;for(let h=0;h<32&&!(v<Gn);h++)u=g-v,d=g+v,Xn[0]=Zn(t,i,r,a,u),Xn[1]=Zn(e,n,s,o,u),p=qn(Xn,Yn),u>=0&&p<m?(g=u,m=p):($n[0]=Zn(t,i,r,a,d),$n[1]=Zn(e,n,s,o,d),f=qn($n,Yn),d<=1&&f<m?(g=d,m=f):v*=.5);return c&&(c[0]=Zn(t,i,r,a,g),c[1]=Zn(e,n,s,o,g)),Math.sqrt(m)}(t,e,i,n,r,s,a,o,l,c,null)<=u/2}function er(t,e,i,n,r,s,a,o,h){if(0===a)return!1;const l=a;o-=t,h-=e;const c=Math.sqrt(o*o+h*h);if(c-l>i||c+l<i)return!1;if(Math.abs(n-r)%Mt<1e-4)return!0;if(s){const t=n;n=Jn(r),r=Jn(t)}else n=Jn(n),r=Jn(r);n>r&&(r+=Mt);let u=Math.atan2(h,o);return u<0&&(u+=Mt),u>=n&&u<=r||u+Mt>=n&&u+Mt<=r}function ir(t,e,i,n,r,s,a){if(0===r)return!1;const o=r,h=r/2;let l=0,c=t;if(a>e+h&&a>n+h||a<e-h&&a<n-h||s>t+h&&s>i+h||s<t-h&&s<i-h)return!1;if(t===i)return Math.abs(s-t)<=o/2;l=(e-n)/(t-i),c=(t*n-i*e)/(t-i);const u=l*s-a+c;return u*u/(l*l+1)<=o/2*o/2}const nr=1e-4;function rr(t,e,i,n,r){const s=6*i-12*e+6*t,a=9*e+3*n-3*t-9*i,o=3*e-3*t;let h=0;if(Hn(a)){if(Vn(s)){const t=-o/s;t>=0&&t<=1&&(r[h++]=t)}}else{const t=s*s-4*a*o;if(Hn(t))r[0]=-s/(2*a);else if(t>0){const e=Math.sqrt(t),i=(-s+e)/(2*a),n=(-s-e)/(2*a);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}const sr=[-1,-1,-1],ar=[-1,-1];function or(){const t=ar[0];ar[0]=ar[1],ar[1]=t}function hr(t,e,i,n,r,s,a,o,h,l){if(l>e&&l>n&&l>s&&l>o||l<e&&l<n&&l<s&&l<o)return 0;const c=function(t,e,i,n,r,s){const a=n+3*(e-i)-t,o=3*(i-2*e+t),h=3*(e-t),l=t-r,c=o*o-3*a*h,u=o*h-9*a*l,d=h*h-3*o*l;let p=0;if(Hn(c)&&Hn(u))if(Hn(o))s[0]=0;else{const t=-h/o;t>=0&&t<=1&&(s[p++]=t)}else{const t=u*u-4*c*d;if(Hn(t)){const t=u/c,e=-o/a+t,i=-t/2;e>=0&&e<=1&&(s[p++]=e),i>=0&&i<=1&&(s[p++]=i)}else if(t>0){const e=Math.sqrt(t);let i=c*o+1.5*a*(-u+e),n=c*o+1.5*a*(-u-e);i=i<0?-Math.pow(-i,zn):Math.pow(i,zn),n=n<0?-Math.pow(-n,zn):Math.pow(n,zn);const r=(-o-(i+n))/(3*a);r>=0&&r<=1&&(s[p++]=r)}else{const t=(2*c*o-3*a*u)/(2*Math.sqrt(c*c*c)),e=Math.acos(t)/3,i=Math.sqrt(c),n=Math.cos(e),r=(-o-2*i*n)/(3*a),h=(-o+i*(n+Fn*Math.sin(e)))/(3*a),l=(-o+i*(n-Fn*Math.sin(e)))/(3*a);r>=0&&r<=1&&(s[p++]=r),h>=0&&h<=1&&(s[p++]=h),l>=0&&l<=1&&(s[p++]=l)}}return p}(e,n,s,o,l,sr);if(0===c)return 0;let u=0,d=-1,p=0,f=0;for(let l=0;l<c;l++){const c=sr[l],g=0===c||1===c?.5:1;Zn(t,i,r,a,c)<h||(d<0&&(d=rr(e,n,s,o,ar),ar[1]<ar[0]&&d>1&&or(),p=Zn(e,n,s,o,ar[0]),d>1&&(f=Zn(e,n,s,o,ar[1]))),2===d?c<ar[0]?u+=p<e?g:-g:c<ar[1]?u+=f<p?g:-g:u+=o<f?g:-g:c<ar[0]?u+=p<e?g:-g:u+=o<p?g:-g)}return u}function lr(t,e,i,n,r,s,a,o){if(o>e&&o>n&&o>s||o<e&&o<n&&o<s)return 0;const h=function(t,e,i,n,r){const s=t-2*e+i,a=2*(e-t),o=t-n;let h=0;if(Hn(s)){if(Vn(a)){const t=-o/a;t>=0&&t<=1&&(r[h++]=t)}}else{const t=a*a-4*s*o;if(Hn(t)){const t=-a/(2*s);t>=0&&t<=1&&(r[h++]=t)}else if(t>0){const e=Math.sqrt(t),i=(-a+e)/(2*s),n=(-a-e)/(2*s);i>=0&&i<=1&&(r[h++]=i),n>=0&&n<=1&&(r[h++]=n)}}return h}(e,n,s,o,sr);if(0===h)return 0;const l=function(t,e,i){const n=t+i-2*e;return 0===n?.5:(t-e)/n}(e,n,s);if(l>=0&&l<=1){let o=0;const c=Kn(e,n,s,l);for(let n=0;n<h;n++){const h=0===sr[n]||1===sr[n]?.5:1;Kn(t,i,r,sr[n])<a||(sr[n]<l?o+=c<e?h:-h:o+=s<c?h:-h)}return o}const c=0===sr[0]||1===sr[0]?.5:1;return Kn(t,i,r,sr[0])<a?0:s<e?c:-c}function cr(t,e,i,n,r,s,a,o){if((o-=e)>i||o<-i)return 0;const h=Math.sqrt(i*i-o*o);sr[0]=-h,sr[1]=h;const l=Math.abs(n-r);if(l<1e-4)return 0;if(l>=Mt-1e-4){n=0,r=Mt;const e=s?1:-1;return a>=sr[0]+t&&a<=sr[1]+t?e:0}if(n>r){const t=n;n=r,r=t}n<0&&(n+=Mt,r+=Mt);let c=0;for(let e=0;e<2;e++){const i=sr[e];if(i+t>a){let t=Math.atan2(o,i),e=s?1:-1;t<0&&(t=Mt+t),(t>=n&&t<=r||t+Mt>=n&&t+Mt<=r)&&(t>Bt/2&&t<1.5*Bt&&(e=-e),c+=e)}}return c}function ur(t){return Math.round(t/Bt*1e8)/1e8%2*Bt}function dr(t,e){let i=ur(t[0]);i<0&&(i+=Mt);const n=i-t[0];let r=t[1];r+=n,!e&&r-i>=Mt?r=i+Mt:e&&i-r>=Mt?r=i-Mt:!e&&i>r?r=i+(Mt-ur(i-r)):e&&i<r&&(r=i-(Mt-ur(r-i))),t[0]=i,t[1]=r}const pr=[0,0];function fr(t,e,i,n,r){const s=t,a=t.length;let o,h,l=0,c=0,u=0,d=0,p=0;for(let t=0;t<a;t++){const a=s[t],f=0===t;a[0]===Ee.M&&t>1&&(i||(l+=ne(c,u,d,p,n,r))),f&&(c=a[1],u=a[2],d=c,p=u);const g=a[0],v=a[1],m=a[2],y=a[3],b=a[4],x=a[5],w=a[6];let S=b,A=x;pr[0]=S,pr[1]=A,dr(pr,Boolean(a[6])),S=pr[0],A=pr[1];const T=S,C=A-S,_=!!(1-(a[6]?0:1)),B=(n-v)*y/y+v;switch(g){case Ee.M:d=v,p=m,c=d,u=p;break;case Ee.L:if(i){if(ir(c,u,v,m,e,n,r))return!0}else l+=ne(c,u,v,m,n,r)||0;c=v,u=m;break;case Ee.C:if(i){if(tr(c,u,v,m,y,b,x,w,e,n,r))return!0}else l+=hr(c,u,v,m,y,b,x,w,n,r)||0;c=x,u=w;break;case Ee.Q:if(i){if(Qn(c,u,v,m,y,b,e,n,r))return!0}else l+=lr(c,u,v,m,y,b,n,r)||0;c=y,u=b;break;case Ee.A:if(o=Math.cos(T)*y+v,h=Math.sin(T)*y+m,f?(d=o,p=h):l+=ne(c,u,o,h,n,r),i){if(er(v,m,y,T,T+C,_,e,B,r))return!0}else l+=cr(v,m,y,T,T+C,_,B,r);c=Math.cos(T+C)*y+v,u=Math.sin(T+C)*y+m;break;case Ee.R:if(d=c=v,p=u=m,o=d+y,h=p+b,i){if(ir(d,p,o,p,e,n,r)||ir(o,p,o,h,e,n,r)||ir(o,h,d,h,e,n,r)||ir(d,h,d,p,e,n,r))return!0}else l+=ne(o,p,o,h,n,r),l+=ne(d,h,d,p,n,r);break;case Ee.Z:if(i){if(ir(c,u,d,p,e,n,r))return!0}else l+=ne(c,u,d,p,n,r);c=d,u=p}}return i||function(t,e){return Math.abs(t-e)<nr}(u,p)||(l+=ne(c,u,d,p,n,r)||0),0!==l}class gr{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=Nn(Object.assign({nativeCanvas:mn.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=Nn(Object.assign({nativeCanvas:mn.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const vr=new gr;var mr=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},yr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const br=Symbol.for("VWindow"),xr=Symbol.for("WindowHandlerContribution");t.DefaultWindow=class{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){this.hooks={onChange:new j(["x","y","width","height"])},this.active=()=>{const t=this.global;t.env&&!this.actived&&(jn.getNamed(xr,t.env).configure(this,t),this.actived=!0)},this._uid=e.GenAutoIncrementId(),this.global=mn.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}}set style(t){this._handler.setStyle(t)}create(t){var e,i;this._handler.createWindow(t);const n=this._handler.getWH();this._width=n.width,this._height=n.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(i=t.height)&&void 0!==i?i:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t){this._handler.clearViewBox(t)}setViewBox(t){this._handler.setViewBox(t)}setViewBoxTransform(t,e,i,n,r,s){this._handler.setViewBoxTransform(t,e,i,n,r,s)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){const i=this._handler.getViewBox(),n={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},n),n.x-=i.x1,n.y-=i.y1,n}hasSubView(){const t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&Tt(this.width,t.width())&&Tt(this.height,t.height()))}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}},t.DefaultWindow=mr([g(),yr("design:paramtypes",[])],t.DefaultWindow);var wr,Sr=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Ar=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Tr=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultGraphicUtil=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(t){this.contributions=t,this.configured=!1,this.global=mn.global,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){this.configured||(this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const t=vr.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure=t}measureText(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"native";var n;this.configure(this.global,this.global.env);const r=this.global.measureTextMethod;this.global.measureTextMethod=i;const s={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:$i.fontSize};return this.global.measureTextMethod=r,s}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new ae(Object.assign({defaultFontParams:{fontFamily:$i.fontFamily,fontSize:$i.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+ae.ALPHABET_CHAR_SET+ae.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const n=jn.get(br),r=t.AABBBounds,s=r.width(),a=r.height(),o=-r.x1,h=-r.y1;n.create({viewBox:{x1:o,y1:h,x2:r.x2,y2:r.y2},width:s,height:a,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});const l=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(n,[t],{transMatrix:n.getViewBoxTransform(),viewBox:n.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=l;const c=n.getNativeHandler();return c.nativeCanvas?c.nativeCanvas:null}},t.DefaultGraphicUtil=Sr([g(),Tr(0,p(k)),Tr(0,v(Dn)),Ar("design:paramtypes",[Object])],t.DefaultGraphicUtil),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(wr||(wr={}));const Cr=new ue;t.DefaultTransformUtil=class{constructor(){this.matrix=new ue}init(t){return this.mode=wr.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=wr.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(Cr.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){const{x:n,y:r}=i;this.outTargetMatrix.translate(n,r),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-n,-r)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Cr.a,Cr.b,Cr.c,Cr.d,Cr.e,Cr.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(Cr.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:n}=e;this.outTargetMatrix.translate(i,n),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-n)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(Cr.a,Cr.b,Cr.c,Cr.d,Cr.e,Cr.f),this}scale(t,e,i){return this.mode===wr.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===wr.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return Cr.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Cr.a,Cr.b,Cr.c,Cr.d,Cr.e,Cr.f),this}translate(t,e){return this.mode===wr.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===wr.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}},t.DefaultTransformUtil=Sr([g(),Ar("design:paramtypes",[])],t.DefaultTransformUtil);const _r={arc:tn,area:en,circle:nn,line:an,path:on,symbol:un,text:dn,rect:ln,polygon:hn,richtext:pn,richtextIcon:gn,image:fn,group:rn,glyph:sn},Br=Object.keys(_r);function Pr(){return{arc:Object.assign({},_r.arc),area:Object.assign({},_r.area),circle:Object.assign({},_r.circle),line:Object.assign({},_r.line),path:Object.assign({},_r.path),symbol:Object.assign({},_r.symbol),text:Object.assign({},_r.text),rect:Object.assign({},_r.rect),polygon:Object.assign({},_r.polygon),richtext:Object.assign({},_r.richtext),richtextIcon:Object.assign({},_r.richtextIcon),image:Object.assign({},_r.image),group:Object.assign({},_r.group),glyph:Object.assign({},_r.glyph)}}function Rr(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Mr=Pr();class Er{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Br.forEach((t=>{this._defaultTheme[t]=Object.create(Mr[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.dirty){const n=this.getParentWithTheme(t);if(n){const t=n.theme;(t.dirty||i)&&t.applyTheme(n,e,!0)}this.userTheme?this.doCombine(n&&n.theme.combinedTheme):(n?this.combinedTheme=n.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,wt.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Br.forEach((n=>{const r=Object.create(Mr[n]);t&&t[n]&&Rr(r,t[n]),i[n]&&Rr(r,i[n]),e[n]&&Rr(r,e[n]),this.combinedTheme[n]=r})),e.common&&Br.forEach((t=>{Rr(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const kr=new Er;function Or(t,e){return t.glyphHost?Or(t.glyphHost):e?(t.isContainer,e):Ir(t)||t.attachedThemeGraphic&&Or(t.attachedThemeGraphic)||kr.getTheme()}function Ir(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):kr.getTheme()}return null}var Lr=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};class Dr extends ${get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=e.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Lr(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let n=t(e,i++);if(n.then&&(n=yield n),n)return;e=e._next}}}))}forEach(t){return this.forEachChildren(t)}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this===t||t===e)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&wt.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this===t)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t<e;t++){if(!i)return null;t>0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const n=this.insertInto(t,0);return this._ignoreWarn=!1,n}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=null;return this.forEachChildren(((e,n)=>!(e===this||!t(e,n)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.find(t,!0);if(n)return i=n,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,n)=>{e!==this&&t(e,n)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const n=e.findAll(t,!0);n.length&&(i=i.concat(n))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<t;i++){if(!e._next)return null;e=e._next}return e}at(t){return this.getChildAt(t)}containNode(t){if(!this._idMap)return!1;if(this._idMap.has(t._uid))return!0;let e=this._firstChild;for(;e;){if(e.containNode(t))return!0;e=e._next}return!1}getRootNode(){let t=this.parent;for(;null==t?void 0:t.parent;)t=t.parent;return t||this}hasChildNodes(){return null!==this._firstChild}addChild(t){return this.appendChild(t)}add(t){return this.appendChild(t)}getChildren(){const t=[];let e=this._firstChild;for(;e;)t.push(e),e=e._next;return t}isChildOf(t){return!!this.parent&&this.parent._uid===t._uid}isParentOf(t){return t.isChildOf(this)}isDescendantsOf(t){let e=this.parent;if(!e)return!1;do{if(e._uid===t._uid)return!0;e=e.parent}while(null!==e);return!1}isAncestorsOf(t){return t.isDescendantsOf(this)}getAncestor(t){throw new Error("暂不支持")}setAllDescendantsProps(t,e){let i=this._firstChild;for(;i;)i[t]=e,i.setAllDescendantsProps(t,e),i=i._next}setCount(t){this._count+=t;let e=this.parent;if(e)do{e._count+=t,e=e.parent}while(null!==e)}clone(){throw new Error("暂不支持")}cloneTo(t){throw new Error("暂不支持")}getParent(){return this.parent}del(t){return this.removeChild(t)}addEventListener(t,e,i){const n=K(i,!0)&&i||et(i)&&i.capture,r=et(i)&&i.once,s=Z(e)?void 0:e;return t=n?`${t}capture`:t,e=Z(e)?e:e.handleEvent,r?super.once(t,e,s):super.on(t,e,s),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=K(i,!0)&&i||et(i)&&i.capture,r=Z(e)?void 0:e;t=n?`${t}capture`:t,e=Z(e)?e:e.handleEvent;const s=et(i)&&i.once;return super.off(t,e,r,s),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return et(i)?(i.once=!0,this.addEventListener(t,e,i)):this.addEventListener(t,e,{once:!0})}removeAllEventListeners(){return super.removeAllListeners(),this}removeAllListeners(){return this.removeAllEventListeners()}dispatchEvent(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class jr{get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get x(){return this.canvas.x}get y(){return this.canvas.y}get canvasX(){return this.canvas.x}get canvasY(){return this.canvas.y}get viewX(){return this.viewport.x}get viewY(){return this.viewport.y}constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=jr.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=this.pickParams.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&Z(this.nativeEvent.preventDefault)&&this.nativeEvent.preventDefault()}this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.stopPropagation()}catch(t){this.nativeEvent.stopPropagation&&Z(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Ur extends jr{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f){throw new Error("Method not implemented.")}}class Wr extends Ur{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const n=new Wr(this.manager);n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.detailPath=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice();const r=this.composedDetailPath();return n.detailPath=r&&r.slice(),n.type=this.type,n}}class Nr extends Ur{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const n=new Nr(this.manager);n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.detailPath=[],n.target=null,n.nativeEvent=this.nativeEvent,n.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,n),null===(e=this.manager)||void 0===e||e.copyMouseData(this,n),null===(i=this.manager)||void 0===i||i.copyData(this,n),n.target=this.target,n.path=this.composedPath().slice();const r=this.composedDetailPath();return n.detailPath=r&&r.slice(),n.type=this.type,n}}Nr.DOM_DELTA_PIXEL=0,Nr.DOM_DELTA_LINE=1,Nr.DOM_DELTA_PAGE=2;class Gr extends jr{constructor(t,e){super(),this.type=t,this.detail=e}}const Fr="object"==typeof performance&&performance.now?performance:Date;function zr(t){return"mouse"===t||"pen"===t}class Hr{constructor(t,e){this.dispatch=new $,this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof Wr))return void wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(zr(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,n;if(!(t instanceof Wr))return void wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.createPointerEvent(t,t.type,e),s=zr(r.pointerType),a=this.trackingData(t.pointerId),o=this.findMountedTarget(a.overTargets);if(a.overTargets&&o&&o!==this.rootTarget&&o!==r.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,o||void 0);if(this.dispatchEvent(i,"pointerout"),s&&this.dispatchEvent(i,"mouseout"),!r.composedPath().includes(o)){const e=this.createPointerEvent(t,"pointerleave",o||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!r.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),s&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(o!==r.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(r,e);this.dispatchEvent(i,"pointerover"),s&&this.dispatchEvent(i,"mouseover");let n=null==o?void 0:o.parent;for(;n&&n!==this.rootTarget.parent&&n!==r.target;)n=n.parent;if(!n||n===this.rootTarget.parent){const t=this.clonePointerEvent(r,"pointerenter");t.eventPhase=t.AT_TARGET;let e=t.target;const i=new Set;let n=o;for(;n&&n!==this.rootTarget;)i.add(n),n=n.parent;for(;e&&e!==o&&e!==this.rootTarget.parent;)i.has(e)||(t.currentTarget=e,this.notifyTarget(t),s&&this.notifyTarget(t,"mouseenter")),e=e.parent;this.freeEvent(t)}this.freeEvent(i)}this.dispatchEvent(r,"pointermove"),"touch"===r.pointerType&&this.dispatchEvent(r,"touchmove"),s&&(this.dispatchEvent(r,"mousemove"),this.cursorTarget=r.target,this.cursor=(null===(n=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor()),a.overTargets=r.composedPath(),this.freeEvent(r)},this.onPointerOver=(t,e)=>{var i,n;if(!(t instanceof Wr))return void wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const r=this.trackingData(t.pointerId),s=this.createPointerEvent(t,t.type,e),a=zr(s.pointerType);this.dispatchEvent(s,"pointerover"),a&&this.dispatchEvent(s,"mouseover"),"mouse"===s.pointerType&&(this.cursorTarget=s.target,this.cursor=(null===(n=null===(i=s.target)||void 0===i?void 0:i.attribute)||void 0===n?void 0:n.cursor)||this.rootTarget.getCursor());const o=this.clonePointerEvent(s,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),a&&this.notifyTarget(o,"mouseenter"),o.target=o.target.parent;r.overTargets=s.composedPath(),this.freeEvent(s),this.freeEvent(o)},this.onPointerOut=(t,e)=>{if(!(t instanceof Wr))return void wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=zr(t.pointerType),n=this.findMountedTarget(i.overTargets),r=this.createPointerEvent(t,"pointerout",n||void 0);this.dispatchEvent(r),e&&this.dispatchEvent(r,"mouseout");const s=this.createPointerEvent(t,"pointerleave",n||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),e&&this.notifyTarget(s,"mouseleave"),s.target=s.target.parent;i.overTargets=[],this.freeEvent(r),this.freeEvent(s)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,e)=>{var i;if(!(t instanceof Wr))return void wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=Fr.now(),r=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)this.dispatchEvent(r,"touchend");else if(zr(r.pointerType)){const t=2===r.button;this.dispatchEvent(r,t?"rightup":"mouseup")}const s=this.trackingData(t.pointerId),a=this.findMountedTarget(s.pressTargetsByButton[t.button]);let o=a;if(a&&!r.composedPath().includes(a)){let e=a;for(;e&&!r.composedPath().includes(e);){if(r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)this.notifyTarget(r,"touchendoutside");else if(zr(r.pointerType)){const t=2===r.button;this.notifyTarget(r,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete s.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(r,"click");e.target=o,e.path=[],e.detailPath=[],s.clicksByButton[t.button]||(s.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:n});const a=s.clicksByButton[t.button];a.target===e.target&&n-a.timeStamp<(null!==(i=this._config.clickInterval)&&void 0!==i?i:200)?++a.clickCount:a.clickCount=1,a.target=e.target,a.timeStamp=n,e.detail=a.clickCount,zr(e.pointerType)?(this.dispatchEvent(e,"click"),2===a.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&this._config.supportsTouchEvents&&(this.dispatchEvent(e,"tap"),2===a.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(r)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof Wr))return void wt.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),n=this.findMountedTarget(i.pressTargetsByButton[t.button]),r=this.createPointerEvent(t,t.type,e);if(n){let e=n;for(;e;)r.currentTarget=e,this.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?this.notifyTarget(r,"touchendoutside"):zr(r.pointerType)&&this.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(r)},this.onWheel=(t,e)=>{if(!(t instanceof Nr))return void wt.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,i,n,r,s,a,o;if(!this.rootTarget)return;const h=this.mappingTable[t.type];let l;const c=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[c])&&(null===(n=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[c])||void 0===n?void 0:n.stage)&&(null===(s=null===(r=this._prePointTargetCache)||void 0===r?void 0:r[c])||void 0===s?void 0:s.stage.renderCount)===(null===(a=this._prePointTargetCache)||void 0===a?void 0:a.stageRenderCount)?l=this._prePointTargetCache[c]:(l=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[c]:l,stageRenderCount:null!==(o=null==l?void 0:l.stage.renderCount)&&void 0!==o?o:-1})),h)for(let e=0,i=h.length;e<i;e++)h[e].fn(t,l);else wt.getInstance().warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let n=0,r=i.length-1;n<r;n++)if(t.currentTarget=i[n],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){t.eventPhase=t.BUBBLING_PHASE;for(let n=i.length-2;n>=0;n--)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){if(this.pauseNotify)return;e=null!=e?e:t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){var n,r;const s=this.allocateEvent(Wr);return this.copyPointerData(t,s),this.copyMouseData(t,s),this.copyData(t,s),s.nativeEvent=t.nativeEvent,s.originalEvent=t,s.target=i||this.pickTarget(null!==(n=s.viewX)&&void 0!==n?n:s.global.x,null!==(r=s.viewY)&&void 0!==r?r:s.global.y,s),"string"==typeof e&&(s.type=e),s}createWheelEvent(t,e){var i,n;const r=this.allocateEvent(Nr);return this.copyWheelData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=e||this.pickTarget(null!==(i=r.viewX)&&void 0!==i?i:r.global.x,null!==(n=r.viewY)&&void 0!==n?n:r.global.y,r),r}clonePointerEvent(t,e){const i=this.allocateEvent(Wr);i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice();const n=t.composedDetailPath();return i.detailPath=n&&n.slice(),i.type=null!=e?e:i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof Wr&&e instanceof Wr&&(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)}copyMouseData(t,e){t instanceof Ur&&e instanceof Ur&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach((i=>{e[i].x=t[i].x,e[i].y=t[i].y})))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Fr.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.detailPath=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].once&&t.currentTarget.removeEventListener(e,i[n].fn,{once:!0}),i[n].fn.call(i[n].context,t);this.emitDelegation(t,e)}emitDelegation(t,e){const i=t.currentTarget._events["*"];if(i)if("fn"in i)i.fn.call(i.context,t,e);else for(let n=0,r=i.length;n<r&&!t.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,t,e)}pickTarget(t,e,i){let n;const r=this.rootTarget.pick(t,e);return n=r&&r.graphic?r.graphic:r&&r.group?r.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,i&&(i.pickParams=r.params),n}release(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}}const Vr={dispatchEvent(t){var e;if(!(t instanceof jr))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return t.defaultPrevented=!1,t.path=[],t.detailPath&&(t.detailPath=[]),t.target=this,null===(e=null==t?void 0:t.manager)||void 0===e||e.dispatchEvent(t),!t.defaultPrevented},emit(t,e){return this.dispatchEvent(new Gr(t,e))}},Yr={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Xr{constructor(t){this.resolution=1,this.onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,i=e.length;t<i;t++){const i=e[t],n=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(n)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerMove=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,n=i.length;t<n;t++){const n=this.bootstrapEvent(this.rootPointerEvent,i[t]);n.type+=e,this.manager.mapEvent(n)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerOverOut=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:n,global:r,autoPreventDefault:s=!1,clickInterval:a,supportsTouchEvents:o=r.supportsTouchEvents,supportsPointerEvents:h=r.supportsPointerEvents}=t;this.manager=new Hr(n,{clickInterval:a,supportsTouchEvents:o}),this.globalObj=r,this.supportsPointerEvents=h,this.supportsTouchEvents=o,this.supportsMouseEvents=r.supportsMouseEvents,this.applyStyles=r.applyStyles,this.autoPreventDefault=s,this.eventsAdded=!1,this.rootPointerEvent=new Wr,this.rootWheelEvent=new Nr,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:n}=this;if(this.currentCursor===t)return;this.currentCursor=t;const r=this.cursorStyles[t];r?"string"==typeof r&&i?n.style.cursor=r:"function"==typeof r?r(t):"object"==typeof r&&i&&Object.assign(n.style,r):i&&st(t)&&!pt(this.cursorStyles,t)&&(n.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e,i;const n=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(n)return n;let r=0,s=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};r=e.clientX||0,s=e.clientY||0}else r=t.clientX||0,s=t.clientY||0;const a=this.domElement.getBoundingClientRect();return{x:r-a.left,y:s-a.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,n=t.changedTouches.length;i<n;i++){const n=t.changedTouches[i];rt(n.button)&&(n.button=0),rt(n.buttons)&&(n.buttons=1),rt(n.isPrimary)&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),rt(n.width)&&(n.width=n.radiusX||1),rt(n.height)&&(n.height=n.radiusY||1),rt(n.tiltX)&&(n.tiltX=0),rt(n.tiltY)&&(n.tiltY=0),rt(n.pointerType)&&(n.pointerType="touch"),rt(n.pointerId)&&(n.pointerId=n.identifier||0),rt(n.pressure)&&(n.pressure=n.force||.5),rt(n.twist)&&(n.twist=0),rt(n.tangentialPressure)&&(n.tangentialPressure=0),rt(n.layerX)&&(n.layerX=n.offsetX=n.clientX),rt(n.layerY)&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,n.type=t.type,e.push(n)}else if(!this.globalObj.supportsMouseEvents||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof PointerEvent)){const i=t;rt(i.isPrimary)&&(i.isPrimary=!0),rt(i.width)&&(i.width=1),rt(i.height)&&(i.height=1),rt(i.tiltX)&&(i.tiltX=0),rt(i.tiltY)&&(i.tiltY=0),rt(i.pointerType)&&(i.pointerType="mouse"),rt(i.pointerId)&&(i.pointerId=1),rt(i.pressure)&&(i.pressure=.5),rt(i.twist)&&(i.twist=0),rt(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}else e.push(t);return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:i,y:n}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=n,e.global.x=i,e.global.y=n,e.offset.x=i,e.offset.y=n;const{x:r,y:s}=this.mapToViewportPoint(e);return e.viewport.x=r,e.viewport.y=s,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:i,y:n}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=n,t.global.x=i,t.global.y=n,t.offset.x=i,t.offset.y=n;const{x:r,y:s}=this.mapToViewportPoint(t);return t.viewport.x=r,t.viewport.y=s,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Yr[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Fr.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetViewPort(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){const e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),i=this.domElement.getViewBox(),n=i.width(),r=i.height();return!(e.x<n&&e.y<r&&e.x>0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}var $r;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}($r||($r={}));class qr{static Avaliable(){return!!mn.global.getRequestAnimationFrame()}avaliable(){return qr.Avaliable()}tick(t,e){mn.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class Kr{static Avaliable(){return!0}avaliable(){return Kr.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class Zr extends ${set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(),this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(),i||t.tick(this.interval,this.handleTick))},this._handlerTick=()=>{const t=this.tickerHandler.getTime();let e=0;this.lastFrameTime>=0&&(e=t-this.lastFrameTime),this.lastFrameTime=t,this.status===$r.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(e)})),this.emit("afterTick"))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=$r.INITIAL,mn.global.hooks.onSetEnv.tap("default-ticker",(()=>{this.initHandler()})),mn.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:qr},{mode:"timeout",cons:Kr}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new qr;break;case"timeout":t=new Kr;break;default:wt.getInstance().warn("非法的计时器模式"),t=new qr}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==$r.INITIAL&&(this.status=$r.PAUSE,!0)}resume(){return this.status!==$r.INITIAL&&(this.status=$r.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===$r.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===$r.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=$r.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=$r.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}trySyncTickStatus(){this.status===$r.RUNNING&&this._handlerTick()}}class Jr{constructor(){this.time=0}static Avaliable(){return!0}avaliable(){return Jr.Avaliable()}tick(t,e){this.time=Math.max(0,t+this.time),e(this,{once:!0})}tickTo(t,e){this.time=Math.max(0,t),e(this,{once:!0})}release(){this.timerId>0&&(this.timerId=-1)}getTime(){return this.time}}class Qr{constructor(){}static linear(t){return t}static none(){return this.linear}static get(t){return t<-1?t=-1:t>1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}static bounceIn(t){return 1-Qr.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Qr.bounceIn(2*t):.5*Qr.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/Mt*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Mt/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/Mt*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*Mt/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/Mt*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*Mt/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*Mt/e)*.5+1}}}Qr.quadIn=Qr.getPowIn(2),Qr.quadOut=Qr.getPowOut(2),Qr.quadInOut=Qr.getPowInOut(2),Qr.cubicIn=Qr.getPowIn(3),Qr.cubicOut=Qr.getPowOut(3),Qr.cubicInOut=Qr.getPowInOut(3),Qr.quartIn=Qr.getPowIn(4),Qr.quartOut=Qr.getPowOut(4),Qr.quartInOut=Qr.getPowInOut(4),Qr.quintIn=Qr.getPowIn(5),Qr.quintOut=Qr.getPowOut(5),Qr.quintInOut=Qr.getPowInOut(5),Qr.backIn=Qr.getBackIn(1.7),Qr.backOut=Qr.getBackOut(1.7),Qr.backInOut=Qr.getBackInOut(1.7),Qr.elasticIn=Qr.getElasticIn(1,.3),Qr.elasticOut=Qr.getElasticOut(1,.3),Qr.elasticInOut=Qr.getElasticInOut(1,.3*1.5);class ts{constructor(){this.id=e.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(e){if(this.paused)return;let i=this.animateHead;for(this.animateCount=0;i;)i.status===t.AnimateStatus.END?this.removeAnimate(i):i.status===t.AnimateStatus.RUNNING||i.status===t.AnimateStatus.INITIAL?(this.animateCount++,i.advance(e)):i.status===t.AnimateStatus.PAUSED&&this.animateCount++,i=i.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}const es=new ts;class is{constructor(t,e,i,n,r){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=r,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class ns extends is{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class rs{constructor(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.GenAutoIncrementId(),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:es,r=arguments.length>2?arguments[2]:void 0;this.id=i,this.timeline=n||es,this.status=t.AnimateStatus.INITIAL,this.tailAnimate=new ss(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=r}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=It(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){rs.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rs.mode;e&&i&t.AnimateMode.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_PLAY})}runCb(t){const e=new ns((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,r,s){const a=rs.interpolateMap.get(t)||rs.interpolateMap.get("");return!!a&&a(t,e,i,n,r,s)}pause(){this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.PAUSED)}resume(){this.status===t.AnimateStatus.PAUSED&&(this.status=t.AnimateStatus.RUNNING)}to(t,e,i,n){if(this.tailAnimate.to(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,n){if(this.tailAnimate.from(t,e,i,n),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new ss(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(e){if(this._duringTime<this._startTime){if(this._duringTime+e*this.timeScale<this._startTime)return void(this._duringTime+=e*this.timeScale);e=this._duringTime+e*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===t.AnimateStatus.INITIAL&&(this.status=t.AnimateStatus.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+e*this.timeScale)&&this.status===t.AnimateStatus.RUNNING&&(this.status=t.AnimateStatus.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const n=this.rawPosition,r=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const s=t>=r;if(s&&(t=r),t===n)return s;for(let n=0;n<this.subAnimates.length&&(e=this.subAnimates[n],!(i+e.totalDuration>=t));n++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),s}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=t.AnimateStatus.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}rs.mode=t.AnimateMode.NORMAL,rs.interpolateMap=new Map;class ss{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new as(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(e){let i=e.duration;(null==i||i<0)&&(i=0);const n=e.easing,r="string"==typeof n?Qr[n]:n,s=this._addStep(i,null,r);return s.type=t.AnimateStepType.customAnimate,this._appendProps(e.getEndProps(),s,!1),this._appendCustomAnimate(e,s),this}to(e,i,n,r){(null==i||i<0)&&(i=0);const s="string"==typeof n?Qr[n]:n,a=this._addStep(i,null,s);return a.type=t.AnimateStepType.to,this._appendProps(e,a,!!r&&r.tempProps),a.propKeys||(a.propKeys=Object.keys(a.props)),r&&r.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(a.propKeys)})),this}from(e,i,n,r){this.to(e,0,n,r);const s={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{s[t]=this.getLastPropByName(t,this.stepTail)})),this.to(s,i,n,r),this.stepTail.type=t.AnimateStepType.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(e){if(e>0){const i=this._addStep(+e,null);i.type=t.AnimateStepType.wait,i.prev.customAnimate?i.props=i.prev.customAnimate.getEndProps():i.props=i.prev.props,this.target.onAddStep&&this.target.onAddStep(i)}return this}_addStep(t,e,i){const n=new as(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(n),this.stepTail=n,n}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let n=e.prev;const r=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));n.prev;)n.props&&(n.propKeys||(n.propKeys=Object.keys(n.props)),n.propKeys.forEach((t=>{void 0===r[t]&&(r[t]=n.props[t])}))),e.propKeys=Object.keys(e.props),n=n.prev;const s=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(r)),e.propKeys.forEach((t=>{if(void 0===s[t]){const e=this.animate.getStartProps();s[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,n=this.loop,r=this.rawPosition;let s,a,o=!1;const h=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<h)return this.rawPosition=t,!1;if(t-=h,i<=0&&(o=!0,i<0))return o;if(s=Math.floor(t/i),a=t-s*i,o=t>=n*i+i,o&&(a=i,s=n,t=a*s+i),t===r)return o;const l=!this.reversed!=!(this.bounce&&s%2);return l&&(a=i-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+h,this.updatePosition(o,l),o}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,r=this.duration;if(this.target&&i){let s=i.next;for(;s&&s.position<=n;)i=s,s=i.next;let a=t?0===r?1:n/r:(n-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,a)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return wt.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class as{constructor(t,e,i,n){this.duration=e,this.position=t,this.props=i,this.easing=n}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const os={duration:200,easing:"cubicOut"},hs={duration:1e3,easing:"quadInOut"};var ls;t.Edge=void 0,(ls=t.Edge||(t.Edge={}))[ls.Top=1]="Top",ls[ls.Right=2]="Right",ls[ls.Bottom=4]="Bottom",ls[ls.Left=8]="Left",ls[ls.ALL=15]="ALL";const cs=[!1,!1,!1,!1],us=t=>{var e;let i=!0;if(K(t,!0)){for(let n=0;n<4;n++)cs[n]=t,i&&(i=!(null!==(e=cs[n])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)cs[e]=!!t[e],i&&(i=!!cs[e]);else cs[0]=!1,cs[1]=!1,cs[2]=!1,cs[3]=!1;return{isFullStroke:i,stroke:cs}},ds=[0,0,0,0],ps=t=>t?at(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(ds[0]=t[0],ds[2]=t[0],ds[1]=t[1],ds[3]=t[1],ds):t:t:0,fs=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],gs=[1,2,3,0,1,2,3,0];function vs(t,e,i,n){for(;t>=Mt;)t-=Mt;for(;t<0;)t+=Mt;for(;t>e;)e+=Mt;fs[0].x=i,fs[1].y=i,fs[2].x=-i,fs[3].y=-i;const r=Math.ceil(t/Pt)%4,s=Math.ceil(e/Pt)%4;if(n.add(Ot(t)*i,Dt(t)*i),n.add(Ot(e)*i,Dt(e)*i),r!==s||e-t>Bt){let t=!1;for(let e=0;e<gs.length;e++)if(t||r!==gs[e]){if(t&&s===gs[e])break;if(t){const t=fs[gs[e]];n.add(t.x,t.y)}}else{t=!0;const e=fs[r];n.add(e.x,e.y)}}}function ms(t,e){return t.x===e.x&&t.y===e.y&&t.x1===e.x1&&t.y1===e.y1&&t.defined===e.defined}function ys(t,e,i){const{x:n,y:r}=Nt(t.x,t.y,e.x,e.y,i),{x:s,y:a}=Nt(t.x1,t.y1,e.x1,e.y1,i),o=new zt(n,r,s,a);return o.defined=e.defined,o}function bs(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let n=[];if(t.length>e.length){n=e.map((t=>{const e=new zt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<e.length;r++)n[r]=ys(t[r],e[r],i)}else{n=e.map((t=>{const e=new zt(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let r=0;r<t.length;r++)n[r]=ys(t[r],e[r],i)}return n}const xs=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","scrollX","scrollY"],ws=t=>xs.includes(t);function Ss(t,e){if(at(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}class As{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:As.TimeOut;this.durations=[],this.timeout=t,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout((()=>{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}As.TimeOut=1e3/60;const Ts=new As,Cs=(t,e)=>st(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t,_s=(t,e)=>{const i=Cs(t,e);return isNaN(i)?i:Math.max(e,i)};var Bs;!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(Bs||(Bs={}));class Ps extends is{constructor(t,e,i,n,r){super(null,null,i,n,r),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==r?void 0:r.group,this._clipGraphic=null==r?void 0:r.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:t.AttributeUpdateType.ANIMATE_END})}onUpdate(e,i,n){if(!this._clipGraphic)return;const r={};Object.keys(this.clipFromAttribute).forEach((t=>{r[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*i})),this._clipGraphic.setAttributes(r,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:i,end:e}})}}function Rs(t,e,i,n,r,s){const a=(e-t)*r+t,o=(i-e)*r+e,h=(n-i)*r+i,l=(o-a)*r+a,c=(h-o)*r+o,u=(c-l)*r+l;s[0]=t,s[1]=a,s[2]=l,s[3]=u,s[4]=u,s[5]=c,s[6]=h,s[7]=n}function Ms(t,e){const i=t.length,n=e.length;if(i===n)return[t,e];const r=[],s=[],a=i<n?t:e,o=Math.min(i,n),h=Math.abs(n-i)/6,l=(o-2)/6,c=Math.ceil(h/l),u=[a[0],a[1]];let d=h;for(let t=2;t<o;t+=6){let e=a[t-2],i=a[t-1],n=a[t],o=a[t+1],h=a[t+2],l=a[t+3];const p=a[t+4],f=a[t+5];if(d<=0){u.push(n,o,h,l,p,f);continue}const g=Math.min(d,c)+1;for(let t=1;t<=g;t++){const a=t/g;Rs(e,n,h,p,a,r),Rs(i,o,l,f,a,s),e=r[3],i=s[3],u.push(r[1],s[1],r[2],s[2],e,i),n=r[5],o=s[5],h=r[6],l=s[6]}d-=g-1}return a===t?[u,e]:[t,u]}function Es(t,e){const i=t||e,n=i.length,r=i[n-2],s=i[n-1],a=[];for(let t=0;t<e.length;t+=2)a[t]=r,a[t+1]=s;return a}function ks(t){const e=[],i=t.length;for(let n=0;n<i;n+=2)e[n]=t[i-n-2],e[n+1]=t[i-n-1];return e}function Os(t){let e=0,i=0,n=0;const r=t.length;for(let s=0,a=r-2;s<r;a=s,s+=2){const r=t[a],o=t[a+1],h=t[s],l=t[s+1],c=r*l-h*o;e+=c,i+=(r+h)*c,n+=(o+l)*c}return 0===e?[t[0]||0,t[1]||0,0]:[i/e/3,n/e/3,e]}function Is(t,e,i,n){const r=(t.length-2)/6;let s=1/0,a=0;const o=t.length,h=o-2;for(let l=0;l<r;l++){const r=6*l;let c=0;for(let s=0;s<o;s+=2){const a=0===s?r:(r+s-2)%h+2,o=t[a]-i[0],l=t[a+1]-i[1],u=e[s]-n[0]-o,d=e[s+1]-n[1]-l;c+=u*u+d*d}c<s&&(s=c,a=l)}return a}function Ls(t,e,i,n){const r=[];let s;for(let a=0;a<t.length;a++){let o=t[a];const h=e[a],l=Os(o),c=Os(h);null==s&&(s=l[2]<0!=c[2]<0);const u=[],d=[];let p=0,f=1/0;const g=[],v=o.length;s&&(o=ks(o));const m=6*Is(o,h,l,c),y=v-2;for(let t=0;t<y;t+=2){const e=(m+t)%y+2;u[t+2]=o[e]-l[0],u[t+3]=o[e+1]-l[1]}if(u[0]=o[m]-l[0],u[1]=o[m+1]-l[1],i>0){const t=n/i;for(let e=-n/2;e<=n/2;e+=t){const t=Math.sin(e),i=Math.cos(e);let n=0;for(let e=0;e<o.length;e+=2){const r=u[e],s=u[e+1],a=h[e]-c[0],o=h[e+1]-c[1],l=a*i-o*t,d=a*t+o*i;g[e]=l,g[e+1]=d;const p=l-r,f=d-s;n+=p*p+f*f}if(n<f){f=n,p=e;for(let t=0;t<g.length;t++)d[t]=g[t]}}}else for(let t=0;t<v;t+=2)d[t]=h[t]-c[0],d[t+1]=h[t+1]-c[1];r.push({from:u,to:d,fromCp:l,toCp:c,rotation:-p})}return r}function Ds(t,e){let i,n;const r=[],s=[];for(let a=0;a<Math.max(t.length,e.length);a++){const o=t[a],h=e[a];let l,c;o?h?([l,c]=Ms(o,h),i=l,n=c):(c=Es(n,o),l=o):(l=Es(i,h),c=h),r.push(l),s.push(c)}return[r,s]}const js=(t,e,i,n,r)=>{Tt(e,n)&&Tt(i,r)||t.push(e,i,n,r,n,r)};function Us(t){const e=t.commandList,i=[];let n,r=0,s=0,a=0,o=0;const h=(t,e)=>{n&&n.length>2&&i.push(n),n=[t,e]};let l,c,u,d;for(let t=0,i=e.length;t<i;t++){const i=e[t],p=0===t;switch(p&&(a=r=i[1],o=s=i[2],[Ee.L,Ee.C,Ee.Q].includes(i[0])&&(n=[a,o])),i[0]){case Ee.M:r=a=i[1],s=o=i[2],h(a,o);break;case Ee.L:l=i[1],c=i[2],js(n,r,s,l,c),r=l,s=c;break;case Ee.C:n.push(i[1],i[2],i[3],i[4],r=i[5],s=i[6]);break;case Ee.Q:l=i[1],c=i[2],u=i[3],d=i[4],n.push(r+2/3*(l-r),s+2/3*(c-s),u+2/3*(l-u),d+2/3*(c-d),u,d),r=u,s=d;break;case Ee.A:{const t=i[1],e=i[2],u=i[3],d=u,f=i[4],g=i[5],v=!!i[6];l=Math.cos(f)*u+t,c=Math.sin(f)*u+e,p?(a=l,o=c,h(a,o)):js(n,r,s,l,c),r=Math.cos(g)*u+t,s=Math.sin(g)*u+e;const m=(v?-1:1)*Math.PI/2;for(let i=f;v?i>g:i<g;i+=m){const r=v?Math.max(i+m,g):Math.min(i+m,g);Ke(n,i,r,t,e,u,d)}break}case Ee.E:{const t=i[1],e=i[2],u=i[3],d=i[4],f=i[5],g=i[6],v=i[7]+g,m=!!i[8],y=!Tt(f,0),b=Math.cos(f),x=Math.sin(f);let w=Math.cos(g)*u,S=Math.sin(g)*d;y?(l=w*b-S*x+t,c=w*x+S*b+e):(l=w+t,c=S+e),p?(a=l,o=c,h(a,o)):js(n,r,s,l,c),w=Math.cos(v)*u,S=Math.sin(v)*d,y?(r=w*b-S*x+t,s=w*x+S*b+e):(r=w+t,s=S+e);const A=(m?-1:1)*Math.PI/2;for(let i=g;m?i>v:i<v;i+=A){const r=m?Math.max(i+A,v):Math.min(i+A,v);if(Ke(n,i,r,t,e,u,d),y){const i=n.length;for(let r=i-6;r<=i-1;r+=2)w=n[r],S=n[r+1],n[r]=(w-t)*b-(S-e)*x+t,n[r+1]=(w-t)*x+(S-e)*b+e}}break}case Ee.R:a=r=i[1],o=s=i[2],l=a+i[3],c=o+i[4],h(l,o),js(n,l,o,l,c),js(n,l,c,a,c),js(n,a,c,a,o),js(n,a,o,l,o);break;case Ee.AT:{const t=i[1],e=i[2],h=i[3],l=i[4],c=i[5],u=Ht.distancePP({x:r,y:s},{x:t,y:e}),d=Ht.distancePP({x:h,y:l},{x:t,y:e}),p=((r-t)*(h-t)+(s-e)*(l-e))/(u*d),f=c/Math.sin(p/2),g=(r+h-2*t)/2,v=(s+l-2*e)/2,m=Ht.distancePP({x:g,y:v},{x:0,y:0}),y=t+f*g/m,b=h+f*v/m,x=Math.sqrt(f*f-c*c);a=t+x*(r-t)/u,o=e+x*(s-e)/u,js(n,r,s,a,o),r=t+x*(h-t)/d,s=e+x*(l-e)/d;const w=Xt({x:y,y:b},{x:a,y:o}),S=Xt({x:y,y:b},{x:r,y:s});Ke(n,w,S,y,b,c,c);break}case Ee.Z:n&&js(n,r,s,a,o),r=a,s=o}}return n&&n.length>2&&i.push(n),i}function Ws(t,e){for(let i=0;i<t.length;i++){const n=t[i];for(let t=0;t<n.length;t+=2){const i=n[t],r=n[t+1],s={x:i,y:r};e.transformPoint({x:i,y:r},s),n[t]=s.x,n[t+1]=s.y}}}function Ns(t){const e=new Ni;for(let i=0;i<t.length;i++){const n=t[i];if(n.length>2){e.moveTo(n[0],n[1]);for(let t=2;t<n.length;t+=6)e.bezierCurveTo(n[t],n[t+1],n[t+2],n[t+3],n[t+4],n[t+5])}}return e}const Gs=t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=J(t.width)?t.x1-t.x:t.width,i=J(t.height)?t.y1-t.y:t.height,n=0,r=0;return e<0?(n=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(r=i,i=-i):Number.isNaN(i)&&(i=0),{x:n,y:r,width:e,height:i}};function Fs(t,e,i){const n=t/e;let r,s;t>=e?(s=Math.ceil(Math.sqrt(i*n)),r=Math.floor(i/s),0===r&&(r=1,s=i)):(r=Math.ceil(Math.sqrt(i/n)),s=Math.floor(i/r),0===s&&(s=1,r=i));const a=[];for(let t=0;t<r;t++)a.push(s);const o=i-r*s;if(o>0)for(let t=0;t<o;t+=s)t+s<o?a.push(s):a.push(o-t);return a}const zs=(t,e)=>{const{width:i,height:n}=Gs(t.attribute),r=Fs(i,n,e),s=[],a=n/r.length;for(let t=0,e=r.length;t<e;t++){const e=r[t],n=i/e;for(let i=0;i<e;i++)s.push({x:0+i*n,y:0+t*a,width:n,height:a})}return s},Hs=(t,e)=>{const i=t.getParsedAngle(),n=i.startAngle,r=i.endAngle,s=t.getComputedAttribute("innerRadius"),a=t.getComputedAttribute("outerRadius"),o=Math.abs(n-r),h=Math.abs(a-s),l=Fs(o*(s+a)/2,h,e),c=[],u=h/l.length,d=a>=s?1:-1,p=r>=n?1:-1;for(let t=0,e=l.length;t<e;t++){const e=l[t],i=o/e;for(let r=0;r<e;r++)c.push({innerRadius:a-u*t*d,outerRadius:a-u*(t+1)*d,startAngle:n+i*r*p,endAngle:n+i*(r+1)*p})}return c},Vs=(t,e)=>{const i=t.getComputedAttribute("startAngle"),n=t.getComputedAttribute("endAngle"),r=t.getComputedAttribute("radius"),s=Math.abs(i-n),a=Fs(s*r,r,e),o=[],h=s/a[0],l=r/a.length,c=n>=i?1:-1;for(let t=0,e=a.length;t<e;t++)for(let e=0,n=a[t];e<n;e++)o.push({innerRadius:l*t,outerRadius:l*(t+1),startAngle:i+h*e*c,endAngle:i+h*(e+1)*c});return o},Ys=(t,e)=>{const i=t.filter((t=>!1!==t.defined&&ht(t.x)&&ht(t.y)));if(0===i.length)return[];if(1===i.length)return new Array(e).fill(0).map((t=>i[0]));const n=[];if(e<=i.length){const t=i.length/e;let r=0,s=0;for(;r<e;)n.push(i[Math.floor(s)]),s+=t,r++;return n}const r=e-i.length,s=1/(r/(i.length-1)+1);let a=0;for(let e=0,i=t.length;e<i;e++)if(n.push(t[e]),e<i-1){let i=s;const o=t[e].x,h=t[e].y,l=t[e+1].x,c=t[e+1].y;for(;i<1&&a<r;)n.push({x:o+(l-o)*i,y:h+(c-h)*i}),i+=s,a+=1}return n},Xs=(t,e)=>{var i,n;const r=t.attribute;let s=r.points;const a=r.segments;s||(s=a.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]));const o=s.filter((t=>!1!==t.defined&&ht(t.x)&&ht(t.y)));if(!o.length)return[];const h=[];o.forEach((t=>{h.push({x:t.x,y:t.y})}));for(let t=o.length-1;t>=0;t--){const e=o[t];h.push({x:null!==(i=e.x1)&&void 0!==i?i:e.x,y:null!==(n=e.y1)&&void 0!==n?n:e.y})}const l=[];return Js(s,e,l),l},$s=(t,e)=>{const i=t.attribute,n=i.points;if(n)return Ys(n,e);if(i.segments){const t=i.segments.reduce(((t,e)=>{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[]);return Ys(t,e)}return[]};const qs=t=>t.map((t=>({x:t.x,y:t.y}))),Ks=(t,e,i)=>{const n=t.length,r=[];for(let o=0;o<n;o++){const h=t[o],l=o===n-1?t[0]:t[o+1],c=qt([e.x,e.y],[i.x,i.y],[h.x,h.y],[l.x,l.y]);c&&"boolean"!=typeof c&&r.push({dot:(s=[c[0]-e.x,c[1]-e.x],a=[i.x-e.x,i.y-e.x],s[0]*a[1]-s[1]*a[0]),point:{x:c[0],y:c[1]},edgeIndex:o})}var s,a;if(r.length<2)return[qs(t),qs(t)];r.sort(((t,e)=>t.dot-e.dot));let o=r[0],h=r[r.length-1];o.edgeIndex>h.edgeIndex&&([o,h]=[h,o]);const l=o.point,c=h.point,u=[{x:l.x,y:l.y}];for(let e=o.edgeIndex+1;e<=h.edgeIndex;e++)u.push({x:t[e].x,y:t[e].y});u.push({x:c.x,y:c.y});const d=[{x:c.x,y:c.y}];for(let e=h.edgeIndex+1,i=o.edgeIndex+n;e<=i;e++){const i=t[e%n];d.push({x:i.x,y:i.y})}return d.push({x:l.x,y:l.y}),[u,d]},Zs=t=>{const e=new he;t.forEach((t=>{e.add(t.x,t.y)}));const i=e.width(),n=e.height();if(i>=n){const n=e.x1+i/2;return Ks(t,{x:n,y:e.y1},{x:n,y:e.y2})}const r=e.y1+n/2;return Ks(t,{x:e.x1,y:r},{x:e.x2,y:r})},Js=(t,e,i)=>{if(1===e)i.push({points:t});else{const n=Math.floor(e/2),r=Zs(t);Js(r[0],n,i),Js(r[1],e-n,i)}},Qs=(t,e)=>{const i=t.attribute.points;if(!i||!i.length)return[];if(1===e)return[{points:qs(i)}];const n=[];return Js(i,e,n),n},ta=(t,e)=>{const i=Us(t.getParsedPathShape());if(!i.length||e<0)return[];const n=i.length;if(i.length>=e){const t=[],r=Math.floor(i.length/e);for(let s=0;s<e;s++){const a=i.slice(s*r,s===e-1?n:(s+1)*r);t.push({path:Ns(a)})}return t}const r=[],s=Math.floor(e/n);let a=e;for(let t=0;t<n;t++){const e=[];for(let n=2,r=i[t].length;n<r;n+=2)e.push({x:i[0][n],y:i[0][n+1]});Js(e,t===n-1?a:s,r),a-=s}return r};var ea;t.ColorType=void 0,(ea=t.ColorType||(t.ColorType={}))[ea.Color255=0]="Color255",ea[ea.Color1=1]="Color1";class ia{static Get(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.ColorType.Color1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(i===t.ColorType.Color1){const t=ia.store1[e];if(t)return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n;const i=Ae.parseColorString(e);if(i){const t=[i.r/255,i.g/255,i.b/255,i.opacity];ia.store1[e]=t,ia.store255[e]=[i.r,i.g,i.b,i.opacity],n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3]}return n}const r=ia.store255[e];if(r)return n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=r[3],n;const s=Ae.parseColorString(e);return s&&(ia.store1[e]=[s.r/255,s.g/255,s.b/255,s.opacity],ia.store255[e]=[s.r,s.g,s.b,s.opacity],n[0]=s.r,n[1]=s.g,n[2]=s.b,n[3]=s.opacity),n}static Set(e,i,n){if(i===t.ColorType.Color1){if(ia.store1[e])return;ia.store1[e]=n,ia.store255[e]=[Math.floor(255*n[0]),Math.floor(255*n[1]),Math.floor(255*n[2]),Math.floor(255*n[3])]}else{if(ia.store255[e])return;ia.store255[e]=n,ia.store1[e]=[n[0]/255,n[1]/255,n[2]/255,n[3]]}}}function na(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&ht(t[0])?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function ra(t,e,i,n,r){return Array.isArray(t)&&!ht(t[0])||Array.isArray(e)&&!ht(e[0])?new Array(4).fill(0).map(((r,s)=>sa(at(t)?t[s]:t,at(e)?e[s]:e,i,n))):sa(t,e,i,n,r)}function sa(e,i,n,r,s){if(!e||!i)return e&&na(e)||i&&na(i)||!1;let a,o,h=!1,l=!1;if(Array.isArray(e)?a=e:"string"==typeof e?a=ia.Get(e,t.ColorType.Color255):h=!0,Array.isArray(i)?o=i:"string"==typeof i?o=ia.Get(i,t.ColorType.Color255):l=!0,h!==l){const t=h?e:i,a=h?i:e,o=Object.assign(Object.assign({},t),{stops:t.stops.map((t=>Object.assign(Object.assign({},t),{color:na(a)})))});return h?ra(t,o,n,r,s):ra(o,t,n,r,s)}if(h){if(e.gradient===i.gradient){const t=e,r=i,s=t.stops,a=r.stops;if(s.length!==a.length)return!1;if("linear"===t.gradient)return aa(t,r,n);if("radial"===t.gradient)return oa(t,r,n);if("conical"===t.gradient)return ha(t,r,n)}return!1}return s&&s(a,o),na(la(a,o,n),r)}function aa(t,e,i){const n=t.stops,r=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:da(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function oa(t,e,i){const n=t.stops,r=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:da(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function ha(t,e,i){const n=t.stops,r=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(n.length).fill(0).map(((t,e)=>({color:da(n[e].color,r[e].color,i),offset:n[e].offset+(r[e].offset-n[e].offset)*i})))}}function la(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}ia.store255={},ia.store1={};const ca=[0,0,0,0],ua=[0,0,0,0];function da(e,i,n){return ia.Get(e,t.ColorType.Color255,ca),ia.Get(i,t.ColorType.Color255,ua),`rgba(${Math.round(ca[0]+(ua[0]-ca[0])*n)},${Math.round(ca[1]+(ua[1]-ca[1])*n)},${Math.round(ca[2]+(ua[2]-ca[2])*n)},${ca[3]+(ua[3]-ca[3])*n})`}const pa=(t,e,i)=>{t.forEach((t=>{if(Number.isFinite(t.to))e[t.key]=t.from+(t.to-t.from)*i;else if("fill"===t.key||"stroke"===t.key){const n=ra(t.from,t.to,i,!1);n&&(e[t.key]=n)}}))},fa=(t,e,i)=>{const n=[],r=[];e.clear();for(let s=0;s<t.length;s++){const a=t[s],o=a.from,h=a.to,l=a.rotation*i,c=a.fromCp,u=a.toCp,d=Math.sin(l),p=Math.cos(l);r[0]=c[0]+(u[0]-c[0])*i,r[1]=c[1]+(u[1]-c[1])*i;for(let t=0;t<o.length;t+=2){const e=o[t],s=o[t+1],a=e*(1-i)+h[t]*i,l=s*(1-i)+h[t+1]*i;n[t]=a*p-l*d+r[0],n[t+1]=a*d+l*p+r[1]}let f=n[0],g=n[1];e.moveTo(f,g);for(let t=2;t<o.length;t+=6){const i=n[t],r=n[t+1],s=n[t+2],a=n[t+3],o=n[t+4],h=n[t+5];f===i&&g===r&&s===o&&a===h?e.lineTo(o,h):e.bezierCurveTo(i,r,s,a,o,h),f=o,g=h}}},ga=(t,e,i)=>{const n=t?Us(t):[],r=Us(e);i&&n&&(i.fromTransform&&Ws(n,i.fromTransform.clone().getInverse()),Ws(n,i.toTransfrom));const[s,a]=Ds(n,r);return t?Ls(s,a,10,Math.PI):a.map(((t,e)=>({from:s[e],to:t,fromCp:[0,0],toCp:[0,0],rotation:0})))},va=["fill","fillOpacity","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","lineDashOffset"],ma=(e,i)=>{if(!e||!i)return null;const n=[];let r=!1;return Object.keys(e).forEach((s=>{if(!va.includes(s))return;const a=i[s];J(a)||J(e[s])||a===e[s]||("fill"===s||"stroke"===s?n.push({from:"string"==typeof e[s]?ia.Get(e[s],t.ColorType.Color255):e[s],to:"string"==typeof a?ia.Get(a,t.ColorType.Color255):a,key:s}):n.push({from:e[s],to:a,key:s}),r=!0)})),r?n:null};class ya extends is{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs,this.saveOnEnd=t.saveOnEnd}getEndProps(){return{}}onBind(){this.target.createPathProxy(),this.onUpdate(!1,0,this.target.attribute)}onEnd(){}onUpdate(t,e,i){const n=this.target,r="function"==typeof n.pathProxy?n.pathProxy(n.attribute):n.pathProxy;fa(this.morphingData,r,e),this.otherAttrs&&this.otherAttrs.length&&pa(this.otherAttrs,i,e),t&&!this.saveOnEnd&&(this.target.pathProxy=null)}}const ba=(t,e,i,n)=>{var r,s,a;if(t&&(!t.valid||!t.toCustomPath))return __DEV__&&console.error(t," is not validate"),null;if(!e.valid||!e.toCustomPath)return __DEV__&&console.error(e," is not validate"),null;let o=null==t?void 0:t.globalTransMatrix;n&&o&&(o=n.clone().multiply(o.a,o.b,o.c,o.d,o.e,o.f));const h=ga(null===(r=null==t?void 0:t.toCustomPath)||void 0===r?void 0:r.call(t),e.toCustomPath(),{fromTransform:o,toTransfrom:e.globalTransMatrix}),l=ma(null==t?void 0:t.attribute,e.attribute),c=e.animate(i);return(null==i?void 0:i.delay)&&c.wait(i.delay),c.play(new ya({morphingData:h,otherAttrs:l},null!==(s=null==i?void 0:i.duration)&&void 0!==s?s:hs.duration,null!==(a=null==i?void 0:i.easing)&&void 0!==a?a:hs.easing)),c};class xa extends is{constructor(t,e,i){super(0,1,e,i),this.morphingData=t.morphingData,this.otherAttrs=t.otherAttrs}getEndProps(){return{}}onBind(){this.addPathProxy()}addPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.createPathProxy()})),this.onUpdate(!1,0,this.target.attribute)}clearPathProxy(){this.target.shadowRoot.forEachChildren((t=>{t.pathProxy=null}))}onEnd(){}onUpdate(t,e,i){this.target.shadowRoot.forEachChildren(((t,i)=>{var n;fa(this.morphingData[i],"function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy,e),(null===(n=this.otherAttrs)||void 0===n?void 0:n[i])&&this.otherAttrs[i].length&&pa(this.otherAttrs[i],t.attribute,e)})),t&&(this.clearPathProxy(),this.morphingData=null)}}const wa=t=>{const e={};return Object.keys(t).forEach((i=>{ws(i)||(e[i]=t[i])})),e},Sa=(t,e,i)=>{const n=wa(t.attribute),r=t.attachShadow();if(e.length)r.setTheme({[e[0].type]:n}),e.forEach((t=>{t.setAttributes({pickable:!1}),r.appendChild(t)}));else{const s=t.AABBBounds,a=s.width(),o=s.height();r.setTheme({rect:n}),new Array(i).fill(0).forEach((t=>{const i=mn.graphicService.creator.rect({x:0,y:0,width:a,height:o,pickable:!1});r.appendChild(i),e.push(i)}))}},Aa=(t,e,i)=>{const n=[],r=i?null:wa(t.attribute),s=t.toCustomPath();for(let t=0;t<e;t++){const t={path:(new Ni).fromCustomPath2D(s)};n.push(mn.graphicService.creator.path(i?t:Object.assign({},r,t)))}return i&&Sa(t,n,e),n},Ta=(t,e,i)=>{const n=[],r=i?null:wa(t.attribute);if("rect"===t.type)zs(t,e).forEach((t=>{n.push(mn.graphicService.creator.rect(i?t:Object.assign({},r,t)))}));else if("arc"===t.type)Hs(t,e).forEach((t=>{n.push(mn.graphicService.creator.arc(i?t:Object.assign({},r,t)))}));else if("circle"===t.type)Vs(t,e).forEach((t=>{n.push(mn.graphicService.creator.arc(i?t:Object.assign({},r,t)))}));else if("line"===t.type){const s=$s(t,e),a={size:10,symbolType:"circle"};s.forEach((t=>{n.push(mn.graphicService.creator.symbol(i?Object.assign({},t,a):Object.assign({},r,t,a)))}))}else"polygon"===t.type?Qs(t,e).forEach((t=>{n.push(mn.graphicService.creator.polygon(i?t:Object.assign({},r,t)))})):"area"===t.type?Xs(t,e).forEach((t=>{n.push(mn.graphicService.creator.polygon(i?t:Object.assign({},r,t)))})):"path"===t.type&&ta(t,e).forEach((t=>{"path"in t?n.push(mn.graphicService.creator.path(i?t:Object.assign({},r,t))):n.push(mn.graphicService.creator.polygon(i?t:Object.assign({},r,t)))}));return i&&Sa(t,n,e),n};class Ca{static GetImage(t,e){var i;const n=Ca.cache.get(t);n?"fail"===n.loadState?mn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):Ca.loadImage(t,e)}static GetSvg(t,e){var i;let n=Ca.cache.get(t);n?"fail"===n.loadState?mn.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===n.loadState||"loading"===n.loadState?null===(i=n.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,n.data):(n={type:"image",loadState:"init"},Ca.cache.set(t,n),n.dataPromise=mn.global.loadSvg(t),n.dataPromise?(n.waitingMark=[e],n.dataPromise.then((e=>{var i;n.loadState=(null==e?void 0:e.data)?"success":"fail",n.data=null==e?void 0:e.data,null===(i=n.waitingMark)||void 0===i||i.map(((i,r)=>{(null==e?void 0:e.data)?(n.loadState="success",n.data=e.data,i.imageLoadSuccess(t,e.data)):(n.loadState="fail",i.imageLoadFail(t))})),n.waitingMark&&(n.waitingMark=[])}))):(n.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Ca.cache.get(t);return i?"fail"===i.loadState?Promise.reject():"init"===i.loadState||"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Ca.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=mn.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=mn.global.loadBlob(t):"json"===e&&(i.dataPromise=mn.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Ca.isLoading&&Ca.toLoadAueue.length){Ca.isLoading=!0;const t=Ca.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,r={type:"image",loadState:"init"};if(Ca.cache.set(i,r),r.dataPromise=mn.global.loadImage(i),r.dataPromise){r.waitingMark=n;const t=r.dataPromise.then((t=>{var e;r.loadState=(null==t?void 0:t.data)?"success":"fail",r.data=null==t?void 0:t.data,null===(e=r.waitingMark)||void 0===e||e.map(((e,n)=>{(null==t?void 0:t.data)?(r.loadState="success",r.data=t.data,e.imageLoadSuccess(i,t.data)):(r.loadState="fail",e.imageLoadFail(i))})),r.waitingMark&&(r.waitingMark=[])}));e.push(t)}else r.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Ca.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Ca.loading()})).catch((t=>{console.error(t),Ca.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Ca.loading()}))}}),0)}static loadImage(t,e){const i=_a(t,Ca.toLoadAueue);if(-1!==i)return Ca.toLoadAueue[i].marks.push(e),void Ca.loading();Ca.toLoadAueue.push({url:t,marks:[e]}),Ca.loading()}static improveImageLoading(t){const e=_a(t,Ca.toLoadAueue);if(-1!==e){const t=Ca.toLoadAueue.splice(e,1);Ca.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function _a(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}Ca.cache=new Map,Ca.isLoading=!1,Ca.toLoadAueue=[],Ca.onLoadSuccessCb=[];const Ba=new ue,Pa=new le,Ra=["lineWidth","scaleX","scaleY","angle","anchor","visible"],Ma=["x","y"],Ea=["scaleX","scaleY"],ka=["angle"],Oa=new zt,Ia={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class La extends Dr{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(La.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var i;super(),this._AABBBounds=new le,this._updateTag=t.UpdateTag.INIT,this.attribute=e,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,e.background?this.loadImage(null!==(i=e.background.background)&&void 0!==i?i:e.background,!0):e.shadowGraphic&&this.setShadowGraphic(e.shadowGraphic)}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}getOffsetXY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i,n;const{dx:r=t.dx,dy:s=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;Oa.x=r+(null!==(i=t.scrollX)&&void 0!==i?i:0),Oa.y=s+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else Oa.x=r,Oa.y=s;return Oa}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;mn.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return mn.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new ce),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,n=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:r=e.boundsPadding}=i,s=ps(r);return s&&n.expand(s),this.clearUpdateBoundTag(),n}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new Be(t);return Je(e.commandList,i,0,0),!0}tryUpdateGlobalAABBBounds(){const t=this.AABBBounds;return this._globalAABBBounds?this._globalAABBBounds.setValue(t.x1,t.y1,t.x2,t.y2):this._globalAABBBounds=t.clone(),this._globalAABBBounds.empty()||this.parent&&this._globalAABBBounds.transformWithMatrix(this.parent.globalTransMatrix),this._globalAABBBounds}tryUpdateGlobalTransMatrix(){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();return this.shouldUpdateGlobalMatrix()&&this.doUpdateGlobalMatrix(),this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!0}tryUpdateLocalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._transMatrix||(this._transMatrix=new ue),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&mn.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)&&mn.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&t.UpdateTag.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_LOCAL_MATRIX)}isValid(){var t,e;const i=this.attribute;return Number.isFinite((null!==(t=i.x)&&void 0!==t?t:0)+(null!==(e=i.y)&&void 0!==e?e:0))}_validNumber(t){return null==t||Number.isFinite(t)}shouldUpdateShape(){return!!(this._updateTag&t.UpdateTag.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=t.UpdateTag.CLEAR_SHAPE}containsPoint(e,i,n,r){if(!r)return!1;if(n===t.IContainPointMode.GLOBAL){const t=new zt(e,i);this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),e=t.x,i=t.y}return r.containsPoint(this,{x:e,y:i})}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;(t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,i)||t).background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._setAttributes(t,e,i)}_setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;const n=Object.keys(t);for(let e=0;e<n.length;e++){const i=n[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(n)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,n){var r;const s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);s?this._setAttributes(s,i,n):J(null===(r=this.normalAttrs)||void 0===r?void 0:r[t])?(this.attribute[t]=e,this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n)):this.normalAttrs[t]=e,"background"===t?this.loadImage(e,!0):"shadowGraphic"===t&&this.setShadowGraphic(e)}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ra;for(let i=0;i<e.length;i++){const n=e[i];if(-1!==t.indexOf(n))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ra;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(e){const i={type:t.AttributeUpdateType.INIT};e=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,null,i)||e,this.attribute=e,e.background?this.loadImage(e.background,!0):e.shadowGraphic&&this.setShadowGraphic(e.shadowGraphic),this._updateTag=t.UpdateTag.INIT,this.valid=this.isValid(),this.onAttributeUpdate(i)}translate(e,i){var n,r;if(0===e&&0===i)return this;const s={type:t.AttributeUpdateType.TRANSLATE},a=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,Ma,s);a&&(e=a.x,i=a.y,delete a.x,delete a.y,this._setAttributes(a));const o=this.attribute,h=o.postMatrix;return h?mn.transformUtil.fromMatrix(h,h).translate(e,i):(o.x=(null!==(n=o.x)&&void 0!==n?n:Hi.x)+e,o.y=(null!==(r=o.y)&&void 0!==r?r:Hi.y)+i),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(e,i){const n=this.attribute;if(n.x===e&&n.y===i)return this;const r={type:t.AttributeUpdateType.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:e,y:i},this.attribute,Ma,r);return s?(this._setAttributes(s,!1,r),this):(n.x=e,n.y=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}scale(e,i,n){var r,s;if(1===e&&1===i)return this;const a={type:t.AttributeUpdateType.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i,scaleCenter:n},this.attribute,Ea,a);o&&(e=o.scaleX,i=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));const h=this.attribute;if(n){let{postMatrix:t}=this.attribute;t||(t=new ue,h.postMatrix=t),mn.transformUtil.fromMatrix(t,t).scale(e,i,n)}else h.scaleX=(null!==(r=h.scaleX)&&void 0!==r?r:Hi.scaleX)*e,h.scaleY=(null!==(s=h.scaleY)&&void 0!==s?s:Hi.scaleY)*i;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(a),this}scaleTo(e,i){const n=this.attribute;if(n.scaleX===e&&n.scaleY===i)return this;const r={type:t.AttributeUpdateType.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:e,scaleY:i},this.attribute,Ea,r);return s?(this._setAttributes(s,!1,r),this):(n.scaleX=e,n.scaleY=i,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this)}rotate(e,i){var n;if(0===e)return this;const r={type:t.AttributeUpdateType.ROTATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:e,rotateCenter:i},this.attribute,ka,r);s&&(delete s.angle,this._setAttributes(s,!1,r));const a=this.attribute;if(i){let{postMatrix:t}=this.attribute;t||(t=new ue,a.postMatrix=t),mn.transformUtil.fromMatrix(t,t).rotate(e,i)}else a.angle=(null!==(n=a.angle)&&void 0!==n?n:Hi.angle)+e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}rotateTo(e){const i=this.attribute;if(i.angle===e)return this;const n={type:t.AttributeUpdateType.ROTATE_TO},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(e,this.attribute,ka,n);return r?(this._setAttributes(r,!1,n),this):(i.angle=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new rs(null==t?void 0:t.id,this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(e.bind(this),t){const{onStart:i,onFrame:n,onEnd:r,onRemove:s}=t;null!=i&&e.onStart(i),null!=n&&e.onFrame(n),null!=r&&e.onEnd(r),null!=s&&e.onRemove(s),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(mn.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!J(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(e,i,n,r){var s,a,o,h;if(n){const n=Object.keys(e),l=this.getNoWorkAnimateAttr(),c={};let u;n.forEach((t=>{l[t]?(u||(u={}),u[t]=e[t]):c[t]=r&&void 0===e[t]?this.getDefaultAttribute(t):e[t]}));const d=this.animate({slience:!0});d.stateNames=i,d.to(c,null!==(a=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==a?a:os.duration,null!==(h=null===(o=this.stateAnimateConfig)||void 0===o?void 0:o.easing)&&void 0!==h?h:os.easing),u&&this.setAttributes(u,!1,{type:t.AttributeUpdateType.STATE})}else this.stopStateAnimates(),this.setAttributes(e,!1,{type:t.AttributeUpdateType.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const n=i.getEndProps();pt(n,t)&&(e=n[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var n;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const r=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(r,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const n={};t.forEach((e=>{var i;const r=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];r&&Object.assign(n,r)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS)===t.UpdateTag.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=t.UpdateTag.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=t.UpdateTag.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=t.UpdateTag.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=t.UpdateTag.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&t.UpdateTag.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],n=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:n}=this.attribute;return Pa.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(Pa),this.setAttributes({scaleX:t,scaleY:i,angle:n}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,r=n();i[0]=r.x1+(r.x2-r.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,r=n();i[1]=r.y1+(r.y2-r.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=Hi.x,y:e=Hi.y,scaleX:i=Hi.scaleX,scaleY:n=Hi.scaleY,angle:r=Hi.angle,scaleCenter:s,anchor:a,postMatrix:o}=this.attribute;let h=[0,0];const l={};if(a&&(h=this.getAnchor(a,l)),!s||1===i&&1===n)!function(t,e,i,n,r,s,a,o){const h=e.a,l=e.b,c=e.c,u=e.d,d=e.e,p=e.f,f=Ot(a),g=Dt(a);let v,m;o?(v=o[0],m=o[1]):(v=i,m=n);const y=v-i,b=m-n,x=h*f+c*g,w=l*f+u*g,S=c*f-h*g,A=u*f-l*g;t.a=r*x,t.b=r*w,t.c=s*S,t.d=s*A,t.e=d+h*v+c*m-x*y-S*b,t.f=p+l*v+u*m-w*y-A*b}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,r,a&&h);else{const a=this._transMatrix;a.reset(),a.translate(h[0],h[1]),a.rotate(r),a.translate(-h[0],-h[1]),a.translate(t,e),h=this.getAnchor(s,l),mn.transformUtil.fromMatrix(a,a).scale(i,n,{x:h[0],y:h[1]})}const c=this.getOffsetXY(Hi);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,o){const t=Ba.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),mn.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(e){e&&this.setAttributes(e,!1,{type:t.AttributeUpdateType.ANIMATE_END})}onStep(e,i,n,r,s){const a={};if(n.customAnimate)n.customAnimate.update(s,r,a);else{const t=n.props,o=n.parsedProps,h=n.propKeys;this.stepInterpolate(e,i,a,n,r,s,t,void 0,o,h)}this.setAttributes(a,!1,{type:t.AttributeUpdateType.ANIMATE_UPDATE,animationState:{ratio:r,end:s,step:n,isFirstFrameOfStep:e.getLastStep()!==n}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,r,s,a,o,h,l){l||(l=Object.keys(a),n.propKeys=l),s?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):l.forEach((s=>{var l;if(!e.validAttr(s))return;const c=a[s],u=null!==(l=o&&o[s])&&void 0!==l?l:t.getLastPropByName(s,n);if(null==c||null==u||c===u)return void(i[s]=c);let d;d=e.interpolateFunc&&e.interpolateFunc(s,r,u,c,i),d||(d=e.customInterpolate(s,r,u,c,this,i),d||this.defaultInterpolate(c,u,s,i,h,r)||this._interpolate(s,r,u,c,i))})),n.parsedProps=h}defaultInterpolate(t,e,i,n,r,s){if(Number.isFinite(t))return n[i]=e+(t-e)*s,!0;if("fill"===i){r||(r={});const a=r.fillColorArray,o=ra(e,null!=a?a:t,s,!1,((t,e)=>{r.fillColorArray=e}));return o&&(n[i]=o),!0}if("stroke"===i){r||(r={});const a=r.strokeColorArray,o=ra(e,null!=a?a:t,s,!1,((t,e)=>{r.strokeColorArray=e}));return o&&(n[i]=o),!0}if("shadowColor"===i){r||(r={});const a=r.shadowColorArray,o=ra(e,null!=a?a:t,s,!0,((t,e)=>{r.shadowColorArray=e}));return o&&(n[i]=o),!0}return!1}_interpolate(t,e,i,n,r){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:mn.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return st(t,!0)?this.pathProxy=(new Ni).fromString(t):this.pathProxy=new Ni,this.pathProxy}loadImage(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const n={data:"init",state:null};this.resources.set(i,n),"string"==typeof t?(n.state="loading",t.startsWith("<svg")?(Ca.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(ct(t)||t.includes("/")||ut(t))&&(Ca.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):et(t)?(n.state="success",n.data=t,this.backgroundImg=this.backgroundImg||e):n.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const n=this.resources.get(t);n&&(n.state="success",n.data=e,i&&i(),this.addUpdateBoundTag(),this.stage&&this.stage.renderNextFrame())}imageLoadFail(t,e){if(!this.resources)return;const i=this.resources.get(t);i&&(i.state="fail",e&&e())}_stopAnimates(t){t&&t.forEach((t=>{t.stop()}))}stopAnimates(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",mn.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const r=new Gr(t,e);r.bubbles=!1,r.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(r)}}}La.mixin(Vr);class Da{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function ja(t,e,i,n){const r=t.indexOf(e,i);if(-1===r)throw new Error(n);return r+e.length-1}function Ua(t,e,i){const n=function(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",r="";for(let s=e;s<t.length;s++){let e=t[s];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:r,index:s};if(t[s+1]===n[1])return{data:r,index:s}}else"\t"===e&&(e=" ");r+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!n)return;let r=n.data;const s=n.index,a=r.search(/\s/);let o=r,h=!0;-1!==a&&(o=r.substr(0,a).replace(/\s\s*$/,""),r=r.substr(a+1));const l=o;if(i){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1),h=o!==n.data.substr(t+1))}return{tagName:o,tagExp:r,closeIndex:s,attrExpPresent:h,rawTagName:l}}const Wa=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class Na{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const n=e.tagname;"string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const n={};if(!t)return;const r=function(t,e){const i=[];let n=e.exec(t);for(;n;){const r=[];r.startIndex=e.lastIndex-n[0].length;const s=n.length;for(let t=0;t<s;t++)r.push(n[t]);i.push(r),n=e.exec(t)}return i}(t,Wa),s=r.length;for(let t=0;t<s;t++){const e=r[t][1],i=r[t][4];e&&(n[e]=void 0===i||(isNaN(i)?i:Number(i)))}return n}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Da("!xml");let i=e,n="",r="";for(let s=0;s<t.length;s++)if("<"===t[s])if("/"===t[s+1]){const e=ja(t,">",s,"Closing Tag is not closed."),a=r.lastIndexOf(".");r=r.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",s=e}else if("?"===t[s+1])s=Ua(t,s,!1,"?>").closeIndex+1;else if("!--"===t.substr(s+1,3))s=ja(t,"--\x3e",s+4,"Comment is not closed.");else{const a=Ua(t,s,!1);let o=a.tagName,h=a.tagExp;const l=a.attrExpPresent,c=a.closeIndex;if(o!==e.tagname&&(r+=r?"."+o:o),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),r=r.substr(0,r.length-1),h=o):h=h.substr(0,h.length-1);const t=new Da(o);o!==h&&l&&(t[":@"]=this.buildAttributesMap(h,r,o)),this.addChild(i,t,r),r=r.substr(0,r.lastIndexOf("."))}else{const t=new Da(o);this.tagsNodeStack.push(i),o!==h&&l&&(t[":@"]=this.buildAttributesMap(h,r,o)),this.addChild(i,t,r),i=t}n="",s=c}else n+=t[s];return e.child}}function Ga(t,e){return Fa(t)}function Fa(t,e){const i={};for(let e=0;e<t.length;e++){const r=t[e],s=za(r);if(void 0!==s&&r[s]){const t=Fa(r[s]);n=t,Object.keys(n).length,r[":@"]&&Ha(t,r[":@"]),void 0!==i[s]&&i.hasOwnProperty(s)?(Array.isArray(i[s])||(i[s]=[i[s]]),i[s].push(t)):i[s]=t}}var n;return i}function za(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function Ha(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let r=0;r<n;r++){const n=i[r];t[n]=e[n]}}}class Va{constructor(t){this.options=Object.assign({},Va.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Ga(new Na(this.options).parseXml(t),this.options)}}function Ya(t){return t.startsWith("<svg")||t.startsWith("<?xml")}function Xa(t){return t.startsWith("<")}Va.defaultOptions={};var $a=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};function qa(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(n/2+(i?function(t,e){return t?e:0}(i,e):0))),t}let Ka=0;function Za(){return Ka++}var Ja;function Qa(e){const i=[];let n=0,r="";for(let s=0;s<e.length;s++)io(e[s])?n?r+=e[s]:(n=1,r=e[s]):(n&&(i.push({text:r,direction:t.TextDirection.VERTICAL}),r="",n=0),i.push({text:e[s],direction:t.TextDirection.HORIZONTAL}));return r&&i.push({text:r,direction:t.TextDirection.VERTICAL}),i}t.TextDirection=void 0,(Ja=t.TextDirection||(t.TextDirection={}))[Ja.HORIZONTAL=0]="HORIZONTAL",Ja[Ja.VERTICAL=1]="VERTICAL";const to=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>to.set(t,!0)));const eo=new Map;function io(t){if(to.has(t))return!0;if(eo.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}function no(t,e){const i=t.attribute;i&&i.split(";").forEach((t=>{if(!t)return;const i=t.split(":");if(2===i.length){const t=parseFloat(i[1]);e[i[0].trim()]=isFinite(t)?t:i[1].trim()}else{let t="";for(let e=1;e<i.length;e++)e>1&&(t+=":"),t+=i[e].trim();e[i[0].trim()]=t}}))}[""].forEach((t=>eo.set(t,!0)));const ro=Za(),so=Za(),ao=Za(),oo=Za(),ho=Za(),lo=Za(),co=Za(),uo=Za(),po=Za(),fo=Za(),go=Za(),vo=Za(),mo=Za(),yo=Za(),bo=Za(),xo=Za(),wo=Symbol.for("GraphicService"),So=Symbol.for("GraphicCreator"),Ao={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"},To=Object.keys(Ao),Co={"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"},_o=Object.keys(Co);var Bo;t.GroupUpdateAABBBoundsMode=void 0,(Bo=t.GroupUpdateAABBBoundsMode||(t.GroupUpdateAABBBoundsMode={}))[Bo.LESS_GROUP=0]="LESS_GROUP",Bo[Bo.MORE_GROUP=1]="MORE_GROUP";class Po extends La{constructor(e){super(e),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=lo,this._childUpdateTag=t.UpdateTag.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new Er),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Er)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(e,i,n){if(n===t.IContainPointMode.GLOBAL){const t=new zt(e,i);return this.parent&&this.parent.globalTransMatrix.transformPoint(t,t),this.AABBBounds.contains(t.x,t.y)}return this.AABBBounds.contains(e,i)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;mn.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),mn.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=Hi.x,y:e=Hi.y,dx:i=Hi.dx,dy:n=Hi.dy,scaleX:r=Hi.scaleX,scaleY:s=Hi.scaleY,angle:a=Hi.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==r||1!==s||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Or(this).group}updateAABBBounds(t,e,i){const n=i;i=i.clone();const{width:r,height:s,path:a,clip:o=e.clip}=t;if(a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=r&&null!=s&&i.set(0,0,Math.max(0,r),Math.max(0,s)),!o){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:n=0}=t;i.translate(e,n)}return mn.graphicService.updateTempAABBBounds(i),mn.graphicService.transformAABBBounds(t,i,e,!1,this),n.copy(i),n}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=t.UpdateTag.CLEAR_BOUNDS,this._childUpdateTag&=t.UpdateTag.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&t.UpdateTag.UPDATE_BOUNDS||(this._childUpdateTag|=t.UpdateTag.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),mn.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),mn.graphicService.onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,mn.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{mn.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),mn.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&t.UpdateTag.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let n=this._getChildByName(t);return n?n.setAttributes(e):(n=mn.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new Po(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Po.NOWORK_ANIMATE_ATTR}}function Ro(t){return new Po(t)}Po.NOWORK_ANIMATE_ATTR=Ia;class Mo extends Po{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,n){var r;super({}),this.stage=t,this.global=e,this.window=i,this.main=n.main,this.layerHandler=n.layerHandler,this.layerHandler.init(this,i,{main:n.main,canvasId:n.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(r=n.zIndex)&&void 0!==r?r:0}),this.layer=this,this.subLayers=new Map,this.theme=new Er,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{mn.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)}))}render(t,e){var i;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this))),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{mn.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}const Eo=Symbol.for("TransformUtil"),ko=Symbol.for("GraphicUtil"),Oo=Symbol.for("LayerService"),Io=Symbol.for("StaticLayerHandlerContribution"),Lo=Symbol.for("DynamicLayerHandlerContribution"),Do=Symbol.for("VirtualLayerHandlerContribution");var jo,Uo=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Wo=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.DefaultLayerService=jo=class{static GenerateLayerId(){return`${jo.idprefix}_${jo.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=mn.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}getRecommendedLayerType(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}getLayerHandler(t){let e;return e="static"===t?jn.get(Io):"dynamic"===t?jn.get(Lo):jn.get(Do),e}createLayer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};var i;this.tryInit();let n=this.getRecommendedLayerType(e.layerMode);n=e.main||e.canvasId?"static":n;const r=this.getLayerHandler(n),s=new Mo(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:n,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:jo.GenerateLayerId(),layerHandler:r})),a=this.layerMap.get(t)||[];return a.push(s),this.layerMap.set(t,a),this.staticLayerCountInEnv--,s}prepareStageLayer(t){let e;t.forEachChildren((t=>{const i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i,e.secondaryHandlers=[])}))}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}releaseStage(t){this.layerMap.delete(t)}},t.DefaultLayerService.idprefix="visactor_layer",t.DefaultLayerService.prefix_count=0,t.DefaultLayerService=jo=Uo([g(),Wo("design:paramtypes",[])],t.DefaultLayerService);var No=new i((e=>{e(W).to(t.DefaultGlobal).inSingletonScope(),e(br).to(t.DefaultWindow),e(ko).to(t.DefaultGraphicUtil).inSingletonScope(),e(Eo).to(t.DefaultTransformUtil).inSingletonScope(),e(Oo).to(t.DefaultLayerService).inSingletonScope()}));function Go(t,e){return!(!t&&!e)}function Fo(t,e){let i;return i=at(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function zo(t,e,i){return i&&t*e>0}function Ho(t,e,i,n,r){return r&&t*e>0&&0!==i&&0!==n}function Vo(t,e){return t*e>0}function Yo(t,e,i,n){return t*e>0&&0!==i&&0!==n}function Xo(t,e,i,n,r,s,a,o){if(!t.pathProxy)return!1;const h=Or(t,null==s?void 0:s.theme)[t.type.replace("3d","")],{fill:l=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:d=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:g=h.visible,x:v=h.x,y:m=h.y}=t.attribute,y=zo(u,d,l),b=Vo(u,f),x=Go(l),w=Fo(c,p);if(!g)return!0;if(!x&&!w)return!0;if(!(y||b||a||o))return!0;e.beginPath();return Je(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),w&&(o?o(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,i-v,n-m,h),e.stroke())),x&&(a?a(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,i-v,n-m,h),e.fill())),!0}function $o(t,e,i,n,r,s,a,o){const h=i-t,l=n-e,c=a-r,u=o-s;let d=u*h-c*l;return d*d<_t?[]:(d=(c*(e-s)-u*(t-r))/d,[t+d*h,e+d*l])}function qo(t,e,i,n,r,s,a){const o=t-i,h=e-n,l=(a?s:-s)/Math.sqrt(o*o+h*h),c=l*h,u=-l*o,d=t+c,p=e+u,f=i+c,g=n+u,v=(d+f)/2,m=(p+g)/2,y=f-d,b=g-p,x=y*y+b*b,w=r-s,S=d*g-f*p,A=(b<0?-1:1)*Math.sqrt(Math.max(0,w*w*x-S*S));let T=(S*b-y*A)/x,C=(-S*y-b*A)/x;const _=(S*b+y*A)/x,B=(-S*y+b*A)/x,P=T-v,R=C-m,M=_-v,E=B-m;return P*P+R*R>M*M+E*E&&(T=_,C=B),{cx:T,cy:C,x01:-c,y01:-u,x11:T*(r/w-1),y11:C*(r/w-1)}}function Ko(t,e,i,n,r){const s=Et(i-e),a=t.getParsedCornerRadius(),o=at(a),{outerDeltaAngle:h,innerDeltaAngle:l,outerStartAngle:c,outerEndAngle:u,innerEndAngle:d,innerStartAngle:p}=t.getParsePadAngle(e,i),f=o?a[0]:a,g=o?a[1]:a,v=o?a[2]:a,m=o?a[3]:a,y=Math.max(g,f),b=Math.max(v,m);let x=y,w=b;const S=r*Ot(c),A=r*Dt(c),T=n*Ot(d),C=n*Dt(d);let _,B,P,R;if((b>_t||y>_t)&&(_=r*Ot(u),B=r*Dt(u),P=n*Ot(p),R=n*Dt(p),s<Bt)){const t=$o(S,A,P,R,_,B,T,C);if(t){const e=S-t[0],i=A-t[1],s=_-t[0],a=B-t[1],o=1/Dt(function(t){return t>1?0:t<-1?Bt:Math.acos(t)}((e*s+i*a)/(jt(e*e+i*i)*jt(s*s+a*a)))/2),h=jt(t[0]*t[0]+t[1]*t[1]);w=Lt(b,(n-h)/(o-1)),x=Lt(y,(r-h)/(o+1))}}return{outerDeltaAngle:h,xors:S,yors:A,xirs:P,yirs:R,xore:_,yore:B,xire:T,yire:C,limitedOcr:x,limitedIcr:w,outerCornerRadiusStart:f,outerCornerRadiusEnd:g,maxOuterCornerRadius:y,maxInnerCornerRadius:b,outerStartAngle:c,outerEndAngle:u,innerDeltaAngle:l,innerEndAngle:d,innerStartAngle:p,innerCornerRadiusStart:m,innerCornerRadiusEnd:v}}function Zo(t,e,i,n,r,s,a){const{startAngle:o,endAngle:h}=t.getParsedAngle(),l=Et(h-o),c=h>o;let u=!1;if(r<s){const t=r;r=s,s=t}if(r<=_t)e.moveTo(i,n);else if(l>=Mt-_t)e.moveTo(i+r*Ot(o),n+r*Dt(o)),e.arc(i,n,r,o,h,!c),s>_t&&(e.moveTo(i+s*Ot(h),n+s*Dt(h)),e.arc(i,n,s,h,o,c));else{const{outerDeltaAngle:l,xors:d,yors:p,xirs:f,yirs:g,limitedOcr:v,outerCornerRadiusStart:m,outerCornerRadiusEnd:y,maxOuterCornerRadius:b,xore:x,yore:w,xire:S,yire:A,outerStartAngle:T,outerEndAngle:C,limitedIcr:_,innerDeltaAngle:B,innerEndAngle:P,innerStartAngle:R,innerCornerRadiusStart:M,innerCornerRadiusEnd:E,maxInnerCornerRadius:k}=Ko(t,o,h,s,r);if(l<.001)a&&(a[3]||a[1])&&e.moveTo(i+d,n+p),u=!0;else if(v>_t){const t=Lt(m,v),s=Lt(y,v),o=qo(f,g,d,p,r,t,Number(c)),h=qo(x,w,S,A,r,s,Number(c));v<b&&t===s?!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),e.arc(i+o.cx,n+o.cy,v,kt(o.y01,o.x01),kt(h.y01,h.x01),!c)):e.moveTo(i+o.cx+v*Ot(kt(h.y01,h.x01)),n+o.cy+v*Dt(kt(h.y01,h.x01))):!a||a[0]?(e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),t>0&&e.arc(i+o.cx,n+o.cy,t,kt(o.y01,o.x01),kt(o.y11,o.x11),!c),e.arc(i,n,r,kt(o.cy+o.y11,o.cx+o.x11),kt(h.cy+h.y11,h.cx+h.x11),!c),s>0&&e.arc(i+h.cx,n+h.cy,s,kt(h.y11,h.x11),kt(h.y01,h.x01),!c)):s>0?e.moveTo(i+h.cx+s*Ot(kt(h.y01,h.x01)),n+h.cy+s*Dt(kt(h.y01,h.x01))):e.moveTo(i+x,n+r*Dt(C))}else!a||a[0]?(e.moveTo(i+d,n+p),e.arc(i,n,r,T,C,!c)):e.moveTo(i+r*Ot(C),n+r*Dt(C));if(!(s>_t)||B<.001)!a||a[1]?e.lineTo(i+S,n+A):e.moveTo(i+S,n+A),u=!0;else if(_>_t){const t=Lt(M,_),r=Lt(E,_),o=qo(S,A,x,w,s,-r,Number(c)),h=qo(d,p,f,g,s,-t,Number(c));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,n+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,n+o.cy+o.y01),_<k&&t===r){const t=kt(h.y01,h.x01);!a||a[2]?e.arc(i+o.cx,n+o.cy,_,kt(o.y01,o.x01),t,!c):e.moveTo(i+o.cx+Ot(t),n+o.cy+Dt(t))}else!a||a[2]?(r>0&&e.arc(i+o.cx,n+o.cy,r,kt(o.y01,o.x01),kt(o.y11,o.x11),!c),e.arc(i,n,s,kt(o.cy+o.y11,o.cx+o.x11),kt(h.cy+h.y11,h.cx+h.x11),c),t>0&&e.arc(i+h.cx,n+h.cy,t,kt(h.y11,h.x11),kt(h.y01,h.x01),!c)):t>0?e.moveTo(i+h.cx+t*Ot(kt(h.y01,h.x01)),n+h.cy+t*Dt(kt(h.y01,h.x01))):e.moveTo(i+f,n+g)}else!a||a[1]?e.lineTo(i+S,n+A):e.moveTo(i+S,n+A),!a||a[2]?e.arc(i,n,s,P,R,c):e.moveTo(i+s*Ot(R),n+s*Dt(R))}return a?a[3]&&e.lineTo(i+r*Ot(o),n+r*Dt(o)):e.closePath(),u}class Jo{static GetCanvas(){try{return Jo.canvas||(Jo.canvas=mn.global.createCanvas({})),Jo.canvas}catch(t){return null}}static GetCtx(){if(!Jo.ctx){const t=Jo.GetCanvas();Jo.ctx=t.getContext("2d")}return Jo.ctx}}class Qo extends de{static getInstance(){return Qo._instance||(Qo._instance=new Qo),Qo._instance}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=Jo.GetCanvas(),n=Jo.GetCtx();if(i.width=e,i.height=1,!n)return;if(n.translate(0,0),!n)throw new Error("获取ctx发生错误");const r=n.createLinearGradient(0,0,e,0);t.forEach((t=>{r.addColorStop(t[0],t[1])})),n.fillStyle=r,n.fillRect(0,0,e,1),this.rgbaSet=n.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:100,a=`${t}${e}${i}${n}`;r.forEach((t=>a+=t.join())),a+=s;let o=this.dataMap.get(a);return o||(o={data:new Qo(r,s),timestamp:[]},this.addLimitedTimestamp(o,Date.now(),{}),this.dataMap.set(a,o)),this.clearCache(this.dataMap,this.cacheParams),o.data}}class th{static GetSize(t){for(let e=0;e<th.ImageSize.length;e++)if(th.ImageSize[e]>=t)return th.ImageSize[e];return t}static Get(t,e,i,n,r,s,a){const o=th.GenKey(t,e,i,n,r),h=th.cache[o];if(!h||0===h.length)return null;for(let t=0;t<h.length;t++)if(h[t].width>=s&&h[t].height>=a)return h[t].pattern;return null}static Set(t,e,i,n,r,s,a,o){const h=th.GenKey(t,e,i,n,r);th.cache[h]?th.cache[h].push({width:a,height:o,pattern:s}):th.cache[h]=[{width:a,height:o,pattern:s}]}static GenKey(t,e,i,n,r){return`${e},${i},${n},${r},${t.join()}`}}function eh(t,e,i,n){const{stops:r,startAngle:s,endAngle:a}=n;for(;i<0;)i+=Mt;for(;i>Mt;)i-=Mt;if(i<s)return r[0].color;if(i>a)return r[0].color;let o,h,l=(i-s)/(a-s);for(let t=0;t<r.length;t++)if(r[t].offset>=l){o=r[t-1],h=r[t];break}return l=(l-o.offset)/(h.offset-o.offset),ra(o.color,h.color,l,!1)}function ih(t,e,i,n,r,s,a,o,h){const l=Math.floor(180*r/Math.PI),c=Jo.GetCanvas(),u=Jo.GetCtx();if(!u)return null;const d=th.GetSize(o),p=th.GetSize(h);let f=th.Get(e,i,n,s,a,d,p);if(f)return f;const g=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(n,2),Math.pow(d-i,2)+Math.pow(n,2)),Math.max(Math.pow(d-i,2)+Math.pow(p-n,2),Math.pow(i,2)+Math.pow(p-n,2)))),v=l+1,m=r/Math.max(1,v-1),y=Qo.getInstance().GetOrCreate(i,n,d,p,e,v),b=2*Math.PI*g/360;c.width=d,c.height=p,u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,d,p),u.translate(i,n),u.rotate(s);for(let t=0,e=v-1;t<e&&!(s+t*m>a);t++){const e=y.getColor(t);u.beginPath(),u.rotate(m),u.moveTo(0,0),u.lineTo(g,-2*b),u.lineTo(g,0),u.fillStyle=e,u.closePath(),u.fill()}const x=u.getImageData(0,0,d,p);return c.width=x.width,c.height=x.height,u.putImageData(x,0,0),f=t.createPattern(c,"no-repeat"),f&&th.Set(e,i,n,s,a,f,d,p),f}th.cache={},th.ImageSize=[20,40,80,160,320,640,1280,2560];const nh=Symbol.for("ArcRenderContribution"),rh=Symbol.for("AreaRenderContribution"),sh=Symbol.for("CircleRenderContribution"),ah=Symbol.for("GroupRenderContribution"),oh=Symbol.for("ImageRenderContribution"),hh=Symbol.for("PathRenderContribution"),lh=Symbol.for("PolygonRenderContribution"),ch=Symbol.for("RectRenderContribution"),uh=Symbol.for("SymbolRenderContribution"),dh=Symbol.for("TextRenderContribution"),ph=Symbol.for("CommonRenderContribution"),fh=Symbol.for("InteractiveSubRenderContribution");function gh(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function vh(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function mh(t){const e={},i=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`;return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((i=>{t[i]&&(e[Ce(i)]=t[i])})),["fontSize","lineHeight"].forEach((n=>{const r=Ce(n);J(t[n])||(e[r]=i(t[n]))})),Q(t.maxLineWidth)&&(e["max-width"]=i(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&st(t.fill)&&(e.color=t.fill),e}function yh(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 bh(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[4],a=e[5],o=e[6],h=e[7],l=e[8],c=e[9],u=e[10],d=e[11];return 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]=s*r+l*n,t[5]=a*r+c*n,t[6]=o*r+u*n,t[7]=h*r+d*n,t[8]=l*r-s*n,t[9]=c*r-a*n,t[10]=u*r-o*n,t[11]=d*r-h*n,t}function xh(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],a=e[1],o=e[2],h=e[3],l=e[8],c=e[9],u=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*r-l*n,t[1]=a*r-c*n,t[2]=o*r-u*n,t[3]=h*r-d*n,t[8]=s*n+l*r,t[9]=a*n+c*r,t[10]=o*n+u*r,t[11]=h*n+d*r,t}function wh(t,e,i){const n=Math.sin(i),r=Math.cos(i),s=e[0],a=e[1],o=e[2],h=e[3],l=e[4],c=e[5],u=e[6],d=e[7];return e!==t&&(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[0]=s*r+l*n,t[1]=a*r+c*n,t[2]=o*r+u*n,t[3]=h*r+d*n,t[4]=l*r-s*n,t[5]=c*r-a*n,t[6]=u*r-o*n,t[7]=d*r-h*n,t}function Sh(t,e,i){const n=i[0],r=i[1],s=i[2];let a,o,h,l,c,u,d,p,f,g,v,m;return e===t?(t[12]=e[0]*n+e[4]*r+e[8]*s+e[12],t[13]=e[1]*n+e[5]*r+e[9]*s+e[13],t[14]=e[2]*n+e[6]*r+e[10]*s+e[14],t[15]=e[3]*n+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],h=e[2],l=e[3],c=e[4],u=e[5],d=e[6],p=e[7],f=e[8],g=e[9],v=e[10],m=e[11],t[0]=a,t[1]=o,t[2]=h,t[3]=l,t[4]=c,t[5]=u,t[6]=d,t[7]=p,t[8]=f,t[9]=g,t[10]=v,t[11]=m,t[12]=a*n+c*r+f*s+e[12],t[13]=o*n+u*r+g*s+e[13],t[14]=h*n+d*r+v*s+e[14],t[15]=l*n+p*r+m*s+e[15]),t}function Ah(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function Th(t,e,i){const n=i[0],r=i[1],s=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ch(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i[0],x=i[1],w=i[2],S=i[3];return t[0]=b*n+x*o+w*u+S*g,t[1]=b*r+x*h+w*d+S*v,t[2]=b*s+x*l+w*p+S*m,t[3]=b*a+x*c+w*f+S*y,b=i[4],x=i[5],w=i[6],S=i[7],t[4]=b*n+x*o+w*u+S*g,t[5]=b*r+x*h+w*d+S*v,t[6]=b*s+x*l+w*p+S*m,t[7]=b*a+x*c+w*f+S*y,b=i[8],x=i[9],w=i[10],S=i[11],t[8]=b*n+x*o+w*u+S*g,t[9]=b*r+x*h+w*d+S*v,t[10]=b*s+x*l+w*p+S*m,t[11]=b*a+x*c+w*f+S*y,b=i[12],x=i[13],w=i[14],S=i[15],t[12]=b*n+x*o+w*u+S*g,t[13]=b*r+x*h+w*d+S*v,t[14]=b*s+x*l+w*p+S*m,t[15]=b*a+x*c+w*f+S*y,t}function _h(t,e,i,n){let r,s,a,o,h,l,c,u,d,p;const f=e[0],g=e[1],v=e[2],m=n[0],y=n[1],b=n[2],x=i[0],w=i[1],S=i[2];return Math.abs(f-x)<_t&&Math.abs(g-w)<_t&&Math.abs(v-S)<_t?yh(t):(c=f-x,u=g-w,d=v-S,p=1/Math.hypot(c,u,d),c*=p,u*=p,d*=p,r=y*d-b*u,s=b*c-m*d,a=m*u-y*c,p=Math.hypot(r,s,a),p?(p=1/p,r*=p,s*=p,a*=p):(r=0,s=0,a=0),o=u*a-d*s,h=d*r-c*a,l=c*s-u*r,p=Math.hypot(o,h,l),p?(p=1/p,o*=p,h*=p,l*=p):(o=0,h=0,l=0),t[0]=r,t[1]=o,t[2]=c,t[3]=0,t[4]=s,t[5]=h,t[6]=u,t[7]=0,t[8]=a,t[9]=l,t[10]=d,t[11]=0,t[12]=-(r*f+s*g+a*v),t[13]=-(o*f+h*g+l*v),t[14]=-(c*f+u*g+d*v),t[15]=1,t)}function Bh(t,e,i,n,r,s,a){const o=1/(e-i),h=1/(n-r),l=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+i)*o,t[13]=(r+n)*h,t[14]=(a+s)*l,t[15]=1,t}function Ph(t,e,i){const n=e[0],r=e[1],s=e[2];let a=i[3]*n+i[7]*r+i[11]*s+i[15];return a=a||1,t[0]=(i[0]*n+i[4]*r+i[8]*s+i[12])/a,t[1]=(i[1]*n+i[5]*r+i[9]*s+i[13])/a,t[2]=(i[2]*n+i[6]*r+i[10]*s+i[14])/a,t}const Rh=Symbol.for("MatrixAllocate"),Mh=Symbol.for("Mat4Allocate");function Eh(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}class kh{constructor(){this.pools=[]}allocate(t,e,i,n,r,s){if(!this.pools.length)return new ue(t,e,i,n,r,s);const a=this.pools.pop();return a.a=t,a.b=e,a.c=i,a.d=n,a.e=r,a.f=s,a}allocateByObj(t){if(!this.pools.length)return new ue(t.a,t.b,t.c,t.d,t.e,t.f);const e=this.pools.pop();return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}class Oh{constructor(){this.pools=[]}static identity(t){return yh(t)}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return Oh.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i<e.length;i++)e[i]=t[i];return e}free(t){t&&this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}const Ih=new kh,Lh=new Oh;var Dh=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},jh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Uh=function(t,e){return function(i,n){e(i,n,t)}};function Wh(t,e,i){var n;const{x:r=i.x,y:s=i.y,z:a=i.z,dx:o=i.dx,dy:h=i.dy,dz:l=i.dz,scaleX:c=i.scaleX,scaleY:u=i.scaleY,scaleZ:d=i.scaleZ,alpha:p=i.alpha,beta:f=i.beta,angle:g=i.angle,anchor3d:v=e.attribute.anchor,anchor:m}=e.attribute,y=[0,0,0];if(v){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;y[0]=i.x1+(i.x2-i.x1)*t}else y[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;y[1]=i.x1+(i.x2-i.x1)*t}else y[1]=v[1];y[2]=null!==(n=v[2])&&void 0!==n?n:0}if(yh(t),Sh(t,t,[r+o,s+h,a+l]),Sh(t,t,[y[0],y[1],y[2]]),bh(t,t,f),xh(t,t,p),Sh(t,t,[-y[0],-y[1],y[2]]),Th(t,t,[c,u,d]),g){const i=Lh.allocate(),n=[0,0];if(m){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=v[1]}Sh(i,i,[n[0],n[1],0]),wh(i,i,g),Sh(i,i,[-n[0],-n[1],0]),Ch(t,t,i)}}function Nh(t){const{alpha:e,beta:i}=t.attribute;return e||i}t.DefaultGraphicService=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new j(["graphic"]),onSetStage:new j(["graphic","stage"]),onRemove:new j(["graphic"]),onRelease:new j(["graphic"]),onAddIncremental:new j(["graphic","group","stage"]),onClearIncremental:new j(["graphic","group","stage"]),beforeUpdateAABBBounds:new j(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new j(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new j(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new le,this.tempAABBBounds2=new le}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,n){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,n)}afterUpdateAABBBounds(t,e,i,n,r){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,r)}clearAABBBounds(t,e,i){this.hooks.clearAABBBounds.taps.length&&this.hooks.clearAABBBounds.call(t,e,i)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const n=new Be(t);return Je(i.commandList,n,0,0),!0}updateHTMLTextAABBBounds(t,e,i,n){const{textAlign:r,textBaseline:s}=t;if(null!=t.forceBoundsHeight){const e=ht(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=vh(s,e,e);i.set(i.x1,n,i.x2,n+e)}if(null!=t.forceBoundsWidth){const e=ht(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=gh(r,e);i.set(n,i.y1,n+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,n,r){if(!e.empty()){const{scaleX:r=i.scaleX,scaleY:s=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:h=i.lineWidth,pickStrokeBuffer:l=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,u=this.tempAABBBounds1,d=this.tempAABBBounds2;if(a&&h){qa(u,(h+l)/Math.abs(r+s),n,c),e.union(u),u.setValue(d.x1,d.y1,d.x2,d.y2)}if(o){const{shadowOffsetX:n=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;qa(u,o/Math.abs(r+s)*2,!1,c+1),u.translate(n,a),e.union(u)}}if(this.combindShadowAABBBounds(e,r),e.empty())return;let s=!0;const a=r.transMatrix;r&&r.isContainer&&(s=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),s&&oe(e,e,a)}validCheck(t,e,i,n){if(!n)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(n.shadowRoot||n.isContainer)return!0;const{visible:r=e.visible}=t;return!(!n.valid||!r)||(i.empty()||(n.parent&&i.transformWithMatrix(n.parent.globalTransMatrix),mn.graphicService.clearAABBBounds(n,n.stage,i),i.clear()),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}},t.DefaultGraphicService=Dh([g(),Uh(0,p(So)),jh("design:paramtypes",[Object])],t.DefaultGraphicService);const Gh={x:0,y:0,z:0,lastModelMatrix:null};class Fh{init(e){e&&(this._renderContribitions=e.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((e=>e.time===t.BaseRenderContributionTime.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((e=>e.time===t.BaseRenderContributionTime.afterFillStroke)))}beforeRenderStep(t,e,i,n,r,s,a,o,h,l,c,u,d){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d)}))}afterRenderStep(t,e,i,n,r,s,a,o,h,l,c,u,d){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d)}))}valid(t,e,i,n){const{fill:r=e.fill,background:s,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:h=e.fillOpacity,lineWidth:l=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:u=e.visible}=t.attribute,d=zo(o,h,r),p=Vo(o,c),f=Go(r,s),g=Fo(a,l);return!(!t.valid||!u)&&!(!f&&!g)&&!!(d||p||i||n||s)&&{fVisible:d,sVisible:p,doFill:f,doStroke:g}}transform(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:r=e.x,y:s=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:h=e.scaleY,angle:l=e.angle,postMatrix:c}=t.attribute,u=i.modelMatrix,d=i.camera;Gh.x=r,Gh.y=s,Gh.z=a,Gh.lastModelMatrix=u;const p=d&&(n||Nh(t)),f=p?t.transMatrix.onlyTranslate()&&!c:1===o&&1===h&&0===l&&!c;if(p){const n=Lh.allocate(),r=Lh.allocate();Wh(r,t,e),Ch(n,u||n,r),Gh.x=0,Gh.y=0,Gh.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),Lh.free(r)}if(f&&!u){const n=t.getOffsetXY(e);Gh.x+=n.x,Gh.y+=n.y,Gh.z=a,i.setTransformForCurrent()}else if(p)Gh.x=0,Gh.y=0,Gh.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(d&&i.project){const n=t.getOffsetXY(e);Gh.x+=n.x,Gh.y+=n.y,this.transformWithoutTranslate(i,Gh.x,Gh.y,Gh.z,o,h,l)}else i.transformFromMatrix(t.transMatrix,!0),Gh.x=0,Gh.y=0,Gh.z=0;return Gh}transformUseContext2d(t,e,i,n){const r=n.camera;if(this.camera=r,r){const e=t.AABBBounds,r=e.x2-e.x1,s=e.y2-e.y1,a=n.project(0,0,i),o=n.project(r,0,i),h=n.project(r,s,i),l={x:0,y:0},c={x:r,y:0},u={x:r,y:s};n.camera=null;const d=1/(l.x*(u.y-c.y)-c.x*u.y+u.x*c.y+(c.x-u.x)*l.y),p=-(l.y*(h.x-o.x)-c.y*h.x+u.y*o.x+(c.y-u.y)*a.x)*d,f=(c.y*h.y+l.y*(o.y-h.y)-u.y*o.y+(u.y-c.y)*a.y)*d,g=(l.x*(h.x-o.x)-c.x*h.x+u.x*o.x+(c.x-u.x)*a.x)*d,v=-(c.x*h.y+l.x*(o.y-h.y)-u.x*o.y+(u.x-c.x)*a.y)*d,m=(l.x*(u.y*o.x-c.y*h.x)+l.y*(c.x*h.x-u.x*o.x)+(u.x*c.y-c.x*u.y)*a.x)*d,y=(l.x*(u.y*o.y-c.y*h.y)+l.y*(c.x*h.y-u.x*o.y)+(u.x*c.y-c.x*u.y)*a.y)*d;n.setTransform(p,f,g,v,m,y,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,r,s,a){const o=t.project(e,i,n);t.translate(o.x,o.y,!1),t.scale(r,s,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,r){const{context:s}=n;if(!s)return;const{renderable:a}=t.attribute;if(!1===a)return;s.highPerformanceSave();const o=this.transform(t,e,s,i),{x:h,y:l,z:c,lastModelMatrix:u}=o;this.z=c,Xo(t,s,h,l,0,r)||(this.drawShape(t,s,h,l,n,r),this.z=0,s.modelMatrix!==u&&Lh.free(s.modelMatrix),s.modelMatrix=u),s.highPerformanceRestore()}}var zh=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Hh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Vh=function(t,e){return function(i,n){e(i,n,t)}};class Yh{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){var p;const{background:f,backgroundOpacity:g=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:h.backgroundOpacity),opacity:v=h.opacity,backgroundMode:m=h.backgroundMode,backgroundFit:y=h.backgroundFit}=t.attribute;if(f)if(t.backgroundImg&&t.resources){const r=t.resources.get(f);if("success"!==r.state||!r.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Or(t.parent).group,{scrollX:n=i.scrollX,scrollY:r=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,r)}e.clip();const s=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,h),e.globalAlpha=g*v,this.doDrawImage(e,r.data,s,m,y),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.globalAlpha=g*v,e.fillStyle=f,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n,r){if("no-repeat"===n)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const s=i.width(),a=i.height();let o=s,h=a;if(r&&"repeat"!==n&&(e.width||e.height)){const i=e.width,r=e.height;"repeat-x"===n?(o=i*(a/r),h=a):"repeat-y"===n&&(h=r*(s/i),o=s);const l=t.dpr,c=vr.allocate({width:o,height:h,dpr:l}),u=c.getContext("2d");u&&(u.inuse=!0,u.clearMatrix(),u.setTransformForCurrent(!0),u.clearRect(0,0,o,h),u.drawImage(e,0,0,o,h),e=c.nativeCanvas),vr.free(c)}const l=t.dpr,c=t.createPattern(e,n);c.setTransform&&c.setTransform(new DOMMatrix([1/l,0,0,1/l,0,0])),t.fillStyle=c,t.translate(i.x1,i.y1),t.fillRect(0,0,s,a),t.translate(-i.x1,-i.y1)}}}const Xh=new Yh;t.DefaultBaseInteractiveRenderContribution=class{constructor(e){this.subRenderContribitions=e,this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,r,s,a,o,h,l,c,u,d)}))}},t.DefaultBaseInteractiveRenderContribution=zh([g(),Vh(0,p(k)),Vh(0,v(fh)),Hh("design:paramtypes",[Object])],t.DefaultBaseInteractiveRenderContribution);class $h{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,n,r){const s=(t-2*e)/2,a=n.dpr,o=vr.allocate({width:t,height:t,dpr:a}),h=o.getContext("2d");if(!h)return null;h.inuse=!0,h.clearMatrix(),h.setTransformForCurrent(!0),h.clearRect(0,0,t,t),r(s,h);const l=n.createPattern(o.nativeCanvas,"repeat");return l.setTransform&&l.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),vr.free(o),l}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,Mt),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const r=t/2,s=r;n.fillStyle=i,n.moveTo(r,s-e),n.lineTo(e+r,s),n.lineTo(r,s+e),n.lineTo(r-e,s),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(s,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,r)=>{const s=e;r.fillStyle=i,r.fillRect(0,s,t,2*n)}))}createBiasLRLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(0,0),n.lineTo(t,t);const r=t/2,s=-r;n.moveTo(r,s),n.lineTo(r+t,s+t),n.moveTo(-r,-s),n.lineTo(-r+t,-s+t),n.stroke()}))}createBiasRLLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{n.strokeStyle=i,n.lineWidth=e,n.moveTo(t,0),n.lineTo(0,t);const r=t/2,s=r;n.moveTo(t+r,s),n.lineTo(r,s+t),n.moveTo(t-r,-s),n.lineTo(-r,-s+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const r=e,s=r;n.fillStyle=i,n.fillRect(r,s,t,t),n.fillRect(r+t,s+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:f=h.textureColor,textureSize:g=h.textureSize,texturePadding:v=h.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,h,f,g,v)}drawTexture(t,e,i,n,r,s,a,o,h){let l=this.textureMap.get(t);if(!l)switch(t){case"circle":l=this.createCirclePattern(o,h,a,i);break;case"diamond":l=this.createDiamondPattern(o,h,a,i);break;case"rect":l=this.createRectPattern(o,h,a,i);break;case"vertical-line":l=this.createVerticalLinePattern(o,h,a,i);break;case"horizontal-line":l=this.createHorizontalLinePattern(o,h,a,i);break;case"bias-lr":l=this.createBiasLRLinePattern(o,h,a,i);break;case"bias-rl":l=this.createBiasRLLinePattern(o,h,a,i);break;case"grid":l=this.createGridPattern(o,h,a,i)}l&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,r,s),i.fillStyle=l,i.fill(),i.highPerformanceRestore())}}const qh=new $h;class Kh{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{innerPadding:v=h.innerPadding,outerPadding:m=h.outerPadding,startAngle:y=h.startAngle,endAngle:b=h.endAngle,opacity:x=h.opacity,x:w=h.x,y:S=h.y,scaleX:A=h.scaleX,scaleY:T=h.scaleY,keepStrokeScale:C=h.keepStrokeScale}=t.attribute;let{innerRadius:_=h.innerRadius,outerRadius:B=h.outerRadius}=t.attribute;B+=m,_-=v;const P=(r,s)=>{const a=!(!r||!r.stroke),{distance:o=h[s].distance}=r,l=C?o:xn(e,o,e.dpr),c=o/B,d="outerBorder"===s?1:-1;if(t.setAttributes({outerRadius:B+d*l,innerRadius:_-d*l,startAngle:y-d*c,endAngle:b+d*c}),e.beginPath(),Zo(t,e,i,n,B+d*l,_-d*l),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,r,h[s]);else if(a){const a=h[s].opacity;h[s].opacity=x,e.setStrokeStyle(t,r,(w-i)/A,(S-n)/T,h[s]),h[s].opacity=a,e.stroke()}};f&&P(d,"outerBorder"),g&&P(p,"innerBorder"),t.setAttributes({outerRadius:B,innerRadius:_,startAngle:y,endAngle:b})}}const Zh=new Kh,Jh=qh,Qh=Xh;class tl{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{radius:v=h.radius,startAngle:m=h.startAngle,endAngle:y=h.endAngle,opacity:b=h.opacity,x:x=h.x,y:w=h.y,scaleX:S=h.scaleX,scaleY:A=h.scaleY,keepStrokeScale:T=h.keepStrokeScale}=t.attribute,C=(r,s)=>{const a=!(!r||!r.stroke),{distance:o=h[s].distance}=r,l=T?o:xn(e,o,e.dpr),c="outerBorder"===s?1:-1;if(e.beginPath(),e.arc(i,n,v+c*l,m,y),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,r,h[s]);else if(a){const a=h[s].opacity;h[s].opacity=b,e.setStrokeStyle(t,r,(x-i)/S,(w-n)/A,h[s]),h[s].opacity=a,e.stroke()}};f&&C(d,"outerBorder"),g&&C(p,"innerBorder")}}const el=new tl,il=qh,nl=Xh;class rl extends Yh{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{background:d,backgroundMode:p=h.backgroundMode,backgroundFit:f=h.backgroundFit}=t.attribute;if(d)if(t.backgroundImg&&t.resources){const i=t.resources.get(d);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const n=t.AABBBounds;this.doDrawImage(e,i.data,n,p,f),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=d,e.fill(),e.highPerformanceRestore()}}const sl=new rl,al=Bt/2;function ol(t,e,i,n,r,s,a){let o;if(n<0&&(e+=n,n=-n),r<0&&(i+=r,r=-r),ht(s,!0))o=[s=Et(s),s,s,s];else if(Array.isArray(s)){const t=s;let e,i;switch(t.length){case 0:o=[0,0,0,0];break;case 1:e=Et(t[0]),o=[e,e,e,e];break;case 2:case 3:e=Et(t[0]),i=Et(t[1]),o=[e,i,e,i];break;default:o=t,o[0]=Et(o[0]),o[1]=Et(o[1]),o[2]=Et(o[2]),o[3]=Et(o[3])}}else o=[0,0,0,0];if(n<0||o[0]+o[1]+o[2]+o[3]<1e-12)return t.rect(e,i,n,r);const[h,l,c,u]=[[e,i],[e+n,i],[e+n,i+r],[e,i+r]],d=Math.min(n/2,r/2),p=[Math.min(d,o[0]),Math.min(d,o[1]),Math.min(d,o[2]),Math.min(d,o[3])],f=[h[0]+p[0],h[1]],g=[h[0],h[1]+p[0]],v=[l[0]-p[1],l[1]],m=[l[0],l[1]+p[1]],y=[c[0]-p[2],c[1]],b=[c[0],c[1]-p[2]],x=[u[0]+p[3],u[1]],w=[u[0],u[1]-p[3]];if(t.moveTo(f[0],f[1]),a&&a[0]?a[0](f[0],f[1],v[0],v[1]):t.lineTo(v[0],v[1]),!mt(v,m)){a&&a[0]&&t.moveTo(v[0],v[1]);const e=v[0],i=v[1]+p[1];t.arc(e,i,p[1],-al,0,!1)}if(a&&a[1]?a[1](m[0],m[1],b[0],b[1]):t.lineTo(b[0],b[1]),!mt(y,b)){const e=b[0]-p[2],i=b[1];a&&a[1]&&t.moveTo(b[0],b[1]),t.arc(e,i,p[2],0,al,!1)}if(a&&a[2]?a[2](y[0],y[1],x[0],x[1]):t.lineTo(x[0],x[1]),!mt(x,w)){const e=x[0],i=x[1]-p[3];a&&a[2]&&t.moveTo(x[0],x[1]),t.arc(e,i,p[3],al,Bt,!1)}if(a&&a[3]?a[3](w[0],w[1],g[0],g[1]):t.lineTo(g[0],g[1]),!mt(f,g)){const e=f[0],i=f[1]+p[0];a&&a[3]&&t.moveTo(g[0],g[1]),t.arc(e,i,p[0],Bt,Bt+al,!1)}return!a&&t.closePath(),t}var hl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};class ll{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{outerBorder:d,innerBorder:p}=t.attribute,f=d&&!1!==d.visible,g=p&&!1!==p.visible;if(!f&&!g)return;const{cornerRadius:v=h.cornerRadius,opacity:m=h.opacity,x:y=h.x,y:b=h.y,scaleX:x=h.scaleX,scaleY:w=h.scaleY,x1:S,y1:A,keepStrokeScale:T=h.keepStrokeScale}=t.attribute;let{width:C,height:_}=t.attribute;C=(null!=C?C:S-i)||0,_=(null!=_?_:A-n)||0;const B=(r,s)=>{const a=!(!r||!r.stroke),o="outerBorder"===s?-1:1,{distance:l=h[s].distance}=r,c=T?l:xn(e,l,e.dpr),d=i+o*c,p=n+o*c,f=2*c;if(0===v||at(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(d,p,C-o*f,_-o*f)):(e.beginPath(),ol(e,d,p,C-o*f,_-o*f,v)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,r,h[s]);else if(a){const a=h[s].opacity;h[s].opacity=m,e.setStrokeStyle(t,r,(y-i)/x,(b-n)/w,h[s]),h[s].opacity=a,e.stroke()}};f&&B(d,"outerBorder"),g&&B(p,"innerBorder")}}t.SplitRectBeforeRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){const{stroke:p=h.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(d.doStroke=!1)}},t.SplitRectBeforeRenderContribution=hl([g()],t.SplitRectBeforeRenderContribution),t.SplitRectAfterRenderContribution=class{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const{x1:d,y1:p,x:f=h.x,y:g=h.y,stroke:v=h.stroke,cornerRadius:m=h.cornerRadius}=t.attribute;let{width:y,height:b}=t.attribute;if(y=(null!=y?y:d-f)||0,b=(null!=b?b:p-g)||0,Array.isArray(v)&&v.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,n,h),!(0===m||at(m)&&m.every((t=>0===t)))){let r,s=0;return ol(e,i,n,y,b,m,new Array(4).fill(0).map(((a,o)=>(a,l,c,u)=>{v[o]&&(s===o-1&&v[o]===r||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:v[o]}),i,n,h),e.beginPath(),e.moveTo(a,l),r=v[o]),s=o,e.lineTo(c,u),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,n),v[0]?e.lineTo(i+y,n):e.moveTo(i+y,n),v[1]?e.lineTo(i+y,n+b):e.moveTo(i+y,n+b),v[2]?e.lineTo(i,n+b):e.moveTo(i,n+b),v[3]){const t=v[0]?n-e.lineWidth/2:n;e.lineTo(i,t)}else e.moveTo(i,n);e.stroke()}}},t.SplitRectAfterRenderContribution=hl([g()],t.SplitRectAfterRenderContribution);const cl=new ll,ul=qh,dl=Xh;class pl extends ll{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){return super.drawShape(t,e,i,n,r,s,a,o,h,l,c,u)}}const fl=new pl,gl=Xh;class vl{constructor(){this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){const d=t.getParsedPath();if(!d)return;const{outerBorder:p,innerBorder:f}=t.attribute,g=p&&!1!==p.visible,v=f&&!1!==f.visible;if(!g&&!v)return;const{size:m=h.size,opacity:y=h.opacity,x:b=h.x,y:x=h.y,scaleX:w=h.scaleX,scaleY:S=h.scaleY,keepStrokeScale:A=h.keepStrokeScale}=t.attribute,T=(r,s)=>{const a=!(!r||!r.stroke),{distance:o=h[s].distance}=r,l=A?o:xn(e,o,e.dpr),c="outerBorder"===s?1:-1;if(e.beginPath(),!1===d.drawOffset(e,m,i,n,c*l)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),u)u(e,r,h[s]);else if(a){const a=h[s].opacity;h[s].opacity=y,e.setStrokeStyle(t,r,(b-i)/w,(x-n)/S,h[s]),h[s].opacity=a,e.stroke()}};g&&T(p,"outerBorder"),v&&T(f,"innerBorder")}}const ml=new vl,yl=qh,bl=Xh;class xl extends $h{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke}drawShape(t,e,i,n,r,s,a,o,h,l,c,u,d){var p,f,g,v;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:m=t.attribute}=d||{},{texture:y=(null!==(p=t.attribute.texture)&&void 0!==p?p:Ss(h,"texture")),textureColor:b=(null!==(f=t.attribute.textureColor)&&void 0!==f?f:Ss(h,"textureColor")),textureSize:x=(null!==(g=t.attribute.textureSize)&&void 0!==g?g:Ss(h,"textureSize")),texturePadding:w=(null!==(v=t.attribute.texturePadding)&&void 0!==v?v:Ss(h,"texturePadding"))}=m;y&&this.drawTexture(y,t,e,i,n,h,b,x,w)}}var wl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Sl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Al=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasArcRender=class extends Fh{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=ro,this.builtinContributions=[Zh,Qh,Jh],this.init(t)}drawArcTailCapPath(t,e,i,n,r,s,a,o){const h=o-a,l=t.getParsedAngle(),c=l.startAngle;let u=l.endAngle;u=o;const d=u>c;let p=!1;if(r<s){const t=r;r=s,s=t}const{outerDeltaAngle:f,xors:g,yors:v,xirs:m,yirs:y,limitedOcr:b,outerCornerRadiusStart:x,outerCornerRadiusEnd:w,maxOuterCornerRadius:S,xore:A,yore:T,xire:C,yire:_,limitedIcr:B,innerDeltaAngle:P,innerStartAngle:R,innerCornerRadiusStart:M,innerCornerRadiusEnd:E,maxInnerCornerRadius:k}=Ko(t,c,u,s,r);if(b>_t){const t=Lt(x,b),s=Lt(w,b),a=qo(m,y,g,v,r,t,Number(d)),o=qo(A,T,C,_,r,s,Number(d));if(b<S&&t===s)e.moveTo(i+a.cx+a.x01,n+a.cy+a.y01),e.arc(i+a.cx,n+a.cy,b,kt(a.y01,a.x01),kt(o.y01,o.x01),!d);else{const t=u-h-.03,a=kt(o.y11,o.x11);e.arc(i,n,r,t,a,!d),s>0&&e.arc(i+o.cx,n+o.cy,s,kt(o.y11,o.x11),kt(o.y01,o.x01),!d)}}else e.moveTo(i+g,n+v);if(!(s>_t)||P<.001)e.lineTo(i+C,n+_),p=!0;else if(B>_t){const t=Lt(M,B),r=Lt(E,B),a=qo(C,_,A,T,s,-r,Number(d)),o=qo(g,v,m,y,s,-t,Number(d));if(e.lineTo(i+a.cx+a.x01,n+a.cy+a.y01),B<k&&t===r){const t=kt(o.y01,o.x01);e.arc(i+a.cx,n+a.cy,B,kt(a.y01,a.x01),t,!d)}else{r>0&&e.arc(i+a.cx,n+a.cy,r,kt(a.y01,a.x01),kt(a.y11,a.x11),!d);const t=kt(a.cy+a.y11,a.cx+a.x11),o=u-h-.03;e.arc(i,n,s,t,o,d)}}else e.lineTo(i+s*Ot(R),n+s*Dt(R));return p}drawShape(t,e,i,n,r,s,a,o){const h=Or(t,null==s?void 0:s.theme).arc,{fill:l=h.fill,stroke:c=h.stroke,x:u=h.x,y:d=h.y,fillStrokeOrder:p=h.fillStrokeOrder}=t.attribute,f=this.valid(t,h,a,o);if(!f)return;const{fVisible:g,sVisible:v,doFill:m,doStroke:y}=f,{outerPadding:b=h.outerPadding,innerPadding:x=h.innerPadding,cap:w=h.cap,forceShowCap:S=h.forceShowCap}=t.attribute;let{outerRadius:A=h.outerRadius,innerRadius:T=h.innerRadius}=t.attribute;A+=b,T-=x;let C=0;const _=(K(w)&&w||w[0])&&"conical"===l.gradient;if(_){const{sc:e,startAngle:i,endAngle:n}=t.getParsedAngle();Et(n-i)<Mt-_t&&(C=e||0,l.startAngle-=C,l.endAngle-=C)}let B=!1;const{isFullStroke:P,stroke:R}=us(c);if(m||P){e.beginPath(),Zo(t,e,i,n,A,T),B=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,m,y,g,v,h,r,a,o);const s=()=>{m&&(a?a(e,t.attribute,h):g&&(e.setCommonStyle(t,t.attribute,u-i,d-n,h),e.fill()))},l=()=>{y&&P&&(o?o(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,h),e.stroke()))};p?(l(),s()):(s(),l())}if(!P&&y&&(e.beginPath(),Zo(t,e,i,n,A,T,R),B||this.beforeRenderStep(t,e,i,n,m,y,g,v,h,r,a,o),o?o(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke())),(K(w)&&w||w[1])&&S){const{startAngle:s,endAngle:l}=t.getParsedAngle();if(Et(l-s)>=Mt-_t){e.beginPath();const s=Math.abs(A-T)/2/A,{endAngle:l=h.endAngle,fill:c=h.fill}=t.attribute,u=l;this.drawArcTailCapPath(t,e,i,n,A,T,u,u+s),B||this.beforeRenderStep(t,e,i,n,m,y,g,v,h,r,a,o);const d=()=>{y&&(o||v&&(e.setStrokeStyle(t,t.attribute,i,n,h),e.stroke()))};(()=>{if(m){const r=c;if("conical"===r.gradient){const s=eh(0,0,l,r);a||zo&&(e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=s,e.fill())}}})(),d()}}this.afterRenderStep(t,e,i,n,m,y,g,v,h,r,a,o),_&&(l.startAngle+=C,l.endAngle+=C)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}},t.DefaultCanvasArcRender=wl([g(),Al(0,p(k)),Al(0,v(nh)),Sl("design:paramtypes",[Object])],t.DefaultCanvasArcRender);var Tl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Cl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_l=function(t,e){return function(i,n){e(i,n,t)}};function Bl(t,e,i,n){if(!e.p1)return;const{offsetX:r=0,offsetY:s=0,offsetZ:a=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(r+e.p1.x,s+e.p1.y,r+e.p2.x,s+e.p2.y,r+e.p3.x,s+e.p3.y,a):t.lineTo(r+e.p1.x,s+e.p1.y,a);else if(e.p2&&e.p3){const[n]=ri(e,i);t.bezierCurveTo(r+n.p1.x,s+n.p1.y,r+n.p2.x,s+n.p2.y,r+n.p3.x,s+n.p3.y,a)}else{const n=e.getPointAt(i);t.lineTo(r+n.x,s+n.y,a)}}function Pl(t,e,i,n,r,s,a){var o;let h=e.p0,l=n;if(i&&i.originP1===i.originP2&&(h=i.p0),e.defined)n||(t.lineTo(h.x+r,h.y+s,a),l=!n);else{const{originP1:c,originP2:u}=e;let d;if(c&&!1!==c.defined&&!i?d=h:c&&!1!==u.defined&&(d=null!==(o=e.p3)&&void 0!==o?o:e.p1),n){l=!n;const i=d?d.x:e.p0.x,o=d?d.y:e.p0.y;t.moveTo(i+r,o+s,a)}else d&&(l=!n,t.lineTo(d.x+r,d.y+s,a))}return l}function Rl(e,i,n,r,s){const{offsetX:a=0,offsetY:o=0,offsetZ:h=0,mode:l="none",drawConnect:c=!1}=s||{};if(c&&"none"===l)return;if(!i)return;let u=!0;const{curves:d}=i;if(n>=1){if(c){let t,i=!0;d.forEach(((n,r)=>{n.originP1!==n.originP2?(i=Pl(e,n,t,i,a,o,h),t=n):t=n}))}else d.forEach((t=>{t.defined?(u&&e.moveTo(t.p0.x+a,t.p0.y+o,h),Bl(e,t,1,s),u=!1):u=!0}));return}if(n<=0)return;let p;"x"===r?p=t.Direction.ROW:"y"===r?p=t.Direction.COLUMN:"auto"===r&&(p=i.direction);const f=n*i.tryUpdateLength(p);let g=0,v=!0,m=null;for(let t=0,i=d.length;t<i;t++){const i=d[t],n=i.getLength(p),r=(f-g)/n;if(g+=n,r<0)break;if(c){if(i.originP1===i.originP2){m=i;continue}v=Pl(e,i,m,v,a,o,h),m=i}else{if(!i.defined){u=!0;continue}u&&e.moveTo(i.p0.x+a,i.p0.y+o,h),Bl(e,i,Lt(r,1),s),u=!1}}}function Ml(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},a=e?e.points[e.points.length-1]:i.points[0];t.moveTo(a.x+r,a.y+s),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}))}function El(t,e,i,n){const{offsetX:r=0,offsetY:s=0}=n||{},{points:a}=i,o=[];for(let t=0;t<a.length;t++)a[t].defined;o.push(a),o.forEach(((i,n)=>{var a,o,h,l;const c=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(c.x+r,c.y+s),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+r,e.y+s):t.moveTo(e.x+r,e.y+s)}));for(let e=i.length-1;e>=0;e--){const n=i[e];t.lineTo(null!==(a=n.x1)&&void 0!==a?a:n.x,null!==(o=n.y1)&&void 0!==o?o:n.y)}t.lineTo(null!==(h=c.x1)&&void 0!==h?h:c.x,null!==(l=c.y1)&&void 0!==l?l:c.y),t.closePath()}))}t.DefaultCanvasCircleRender=class extends Fh{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=oo,this.builtinContributions=[el,nl,il],this.init(t)}drawShape(t,e,i,n,r,s,a,o){const h=Or(t,null==s?void 0:s.theme).circle,{radius:l=h.radius,startAngle:c=h.startAngle,endAngle:u=h.endAngle,x:d=h.x,y:p=h.y,fillStrokeOrder:f=h.fillStrokeOrder}=t.attribute,g=this.valid(t,h,a,o);if(!g)return;const{fVisible:v,sVisible:m,doFill:y,doStroke:b}=g;e.beginPath(),e.arc(i,n,l,c,u),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,y,b,v,m,h,r,a,o);const x=()=>{y&&(a?a(e,t.attribute,h):v&&(e.setCommonStyle(t,t.attribute,d-i,p-n,h),e.fill()))},w=()=>{b&&(o?o(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,d-i,p-n,h),e.stroke()))};f?(w(),x()):(x(),w()),this.afterRenderStep(t,e,i,n,y,b,v,m,h,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).circle;this._draw(t,r,!1,i,n)}},t.DefaultCanvasCircleRender=Tl([g(),_l(0,p(k)),_l(0,v(sh)),Cl("design:paramtypes",[Object])],t.DefaultCanvasCircleRender);var kl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};function Ol(e,i,n,r){var s;const{top:a,bottom:o}=i;if(a.curves.length!==o.curves.length)return;if(n>=1){const t=[],i=[];let n=!0;for(let s=0,h=a.curves.length;s<h;s++){const l=a.curves[s];n!==l.defined?(n?(Il(e,t,i,r),t.length=0,i.length=0):(t.push(l),i.push(o.curves[h-s-1])),n=!n):n&&(t.push(l),i.push(o.curves[h-s-1]))}return void Il(e,t,i,r)}if(n<=0)return;let{direction:h}=r||{};const{curves:l}=a,c=null!==(s=l[l.length-1].p3)&&void 0!==s?s:l[l.length-1].p1,u=Et(c.x-l[0].p0.x),d=Et(c.y-l[0].p0.y);h=null!=h?h:u>d?t.Direction.ROW:t.Direction.COLUMN,Number.isFinite(u)||(h=t.Direction.COLUMN),Number.isFinite(d)||(h=t.Direction.ROW);const p=n*(h===t.Direction.ROW?u:d);let f=0,g=!0;const v=[],m=[];for(let t=0,i=a.curves.length;t<i;t++){const n=a.curves[t],s=n.getLength(h),l=(p-f)/s;if(l<0)break;f+=s;let c=null,u=null;g!==n.defined?(g?(Il(e,v,m,r),v.length=0,m.length=0):(c=n,u=o.curves[i-t-1]),g=!g):g&&(c=n,u=o.curves[i-t-1]),c&&u&&(l<1&&(c=c.p2&&c.p3?ri(c,l)[0]:ai(c,l)[0],u=u.p2&&u.p3?ri(u,1-l)[1]:ai(u,1-l)[1]),c.defined=g,u.defined=g,v.push(c),m.push(u)),c=null,u=null}Il(e,v,m,r)}function Il(t,e,i,n){const{offsetX:r=0,offsetY:s=0,offsetZ:a=0}=n||{};let o=!0;e.forEach((e=>{e.defined?(o&&t.moveTo(e.p0.x+r,e.p0.y+s,a),Bl(t,e,1,n),o=!1):o=!0})),o=!0;for(let e=i.length-1;e>=0;e--){const h=i[e];h.defined?(o&&t.lineTo(h.p0.x+r,h.p0.y+s,a),Bl(t,h,1,n),o=!1):o=!0}t.closePath()}t.DefaultCanvasLineRender=class extends Fh{constructor(){super(...arguments),this.numberType=uo}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).line;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f){var g;if(!e)return;t.beginPath();const v=null!==(g=this.z)&&void 0!==g?g:0;Rl(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u,offsetZ:v}),d.cache&&!at(d.cache)&&d.cache.curves.every((t=>t.defined))&&d.attribute.curveType&&d.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(d,a,o);const{x:m=0,x:y=0}=a;return!1!==i&&(p?p(t,a,o):r&&(t.setCommonStyle(d,a,m-c,y-u,o),t.fill())),!1!==n&&(f?f(t,a,o):s&&(t.setStrokeStyle(d,a,m-c,y-u,o),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,n,r,s,a,o,h,l,c,u,d){var p;e.beginPath();const f=null!==(p=this.z)&&void 0!==p?p:0,{points:g}=t.attribute,v=g[0];e.moveTo(v.x+a,v.y+o,f);for(let t=1;t<g.length;t++){const i=g[t];e.lineTo(i.x+a,i.y+o,f)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h);const{x:m=0,x:y=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,h):r&&(e.setCommonStyle(t,t.attribute,m-a,y-o,h),e.fill())),!1!==n&&(d?d(e,t.attribute,h):s&&(e.setStrokeStyle(t,t.attribute,m-a,y-o,h),e.stroke()))}drawShape(t,e,i,n,r,s,a,o){const h=Or(t,null==s?void 0:s.theme).line,{fill:l=h.fill,stroke:c=h.stroke,fillOpacity:u=h.fillOpacity,strokeOpacity:d=h.strokeOpacity,segments:p,points:f,closePath:g,curveTension:v=h.curveTension,connectedType:m=h.connectedType}=t.attribute;if(!this.valid(t,h,a,o))return;let{curveType:y=h.curveType}=t.attribute;g&&"linear"===y&&(y="linearClosed");const{clipRange:b=h.clipRange,clipRangeByDimension:x=h.clipRangeByDimension}=t.attribute;if(1===b&&!p&&!f.some((t=>!1===t.defined))&&"linear"===y)return this.drawLinearLineHighPerformance(t,e,!!l,!!c,u,d,i,n,h,r,s,a,o);function w(t,e){return"none"===e?t:t.filter((t=>!1!==t.defined))}if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,n=e;if(i&&i.length){let e,n;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(n={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:n.endX,y:n.endY,defined:n.curves[n.curves.length-1].defined}:i>1&&(e.x=n.endX,e.y=n.endY,e.defined=n.curves[n.curves.length-1].defined);const r=Wi(w(t.points,m),y,{startPoint:e,curveTension:v});return n=r,r})).filter((t=>!!t)),"linearClosed"===y){let e;for(let i=0;i<t.cache.length;i++){const n=t.cache[i];for(let t=0;t<n.curves.length;t++)if(n.curves[t].defined){e=n.curves[t].p0;break}if(e)break}t.cache[t.cache.length-1]&&t.cache[t.cache.length-1].lineTo(e.x,e.y,!0)}}else{if(!e||!e.length)return t.cache=null,void t.clearUpdateShapeTag();t.cache=Wi(w(n,m),y,{curveTension:v})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===b){let s=!1;t.cache.forEach(((p,f)=>{s||(s=this.drawSegmentItem(e,p,!!l,!!c,u,d,r[f],[h,t.attribute],b,x,i,n,t,a,o))}))}else{const s=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=b*s;let f=0,g=!1;t.cache.forEach(((s,v)=>{if(g)return;const m=s.getLength(),y=(p-f)/m;f+=m,y>0&&(g=this.drawSegmentItem(e,s,!!l,!!c,u,d,r[v],[h,t.attribute],Lt(y,1),x,i,n,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!l,!!c,u,d,t.attribute,h,b,x,i,n,t,a,o)}},t.DefaultCanvasLineRender=kl([g()],t.DefaultCanvasLineRender);const Ll=new xl,Dl=Xh;var jl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Ul=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wl=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasAreaRender=class extends Fh{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=ao,this.builtinContributions=[Ll,Dl],this.init(t)}drawLinearAreaHighPerformance(t,e,i,n,r,s,a,o,h,l,c,u,d){var p,f,g;const{points:v}=t.attribute;if(v.length<2)return;e.beginPath();const m=null!==(p=this.z)&&void 0!==p?p:0,y=v[0];e.moveTo(y.x+a,y.y+o,m);for(let t=1;t<v.length;t++){const i=v[t];e.lineTo(i.x+a,i.y+o,m)}for(let t=v.length-1;t>=0;t--){const i=v[t];e.lineTo((null!==(f=i.x1)&&void 0!==f?f:i.x)+a,(null!==(g=i.y1)&&void 0!==g?g:i.y)+o,m)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,a,o,!!r,!1,i,!1,h,l,u,null,{attribute:t.attribute});const{x:b=0,x:x=0}=t.attribute;!1!==i&&(u?u(e,t.attribute,h):r&&(e.setCommonStyle(t,t.attribute,b-a,x-o,h),e.fill())),this.afterRenderStep(t,e,a,o,!!r,!1,i,!1,h,l,u,null,{attribute:t.attribute}),(()=>{var i,r;if(n){const{stroke:n=h&&h.stroke}=t.attribute;if(at(n)&&(n[0]||n[2])&&!1===n[1])if(e.beginPath(),n[0]){e.moveTo(y.x+a,y.y+o,m);for(let t=1;t<v.length;t++){const i=v[t];e.lineTo(i.x+a,i.y+o,m)}}else if(n[2]){const t=v[v.length-1];e.moveTo(t.x+a,t.y+o,m);for(let t=v.length-2;t>=0;t--){const n=v[t];e.lineTo((null!==(i=n.x1)&&void 0!==i?i:n.x)+a,(null!==(r=n.y1)&&void 0!==r?r:n.y)+o,m)}}d?d(e,t.attribute,h):(e.setStrokeStyle(t,t.attribute,b-a,x-o,h),e.stroke())}})()}drawShape(t,e,i,n,r,s,a,o){var h,l,c,u,d,p;const f=Or(t,null==s?void 0:s.theme).area,{fill:g=f.fill,stroke:v=f.stroke,fillOpacity:m=f.fillOpacity,z:y=f.z,strokeOpacity:b=f.strokeOpacity,curveTension:x=f.curveTension,connectedType:w=f.connectedType}=t.attribute,S=this.valid(t,f,a,o);if(!S)return;const{doFill:A}=S,T=S.doStroke&&S.sVisible,{clipRange:C=f.clipRange,closePath:_,points:B,segments:P}=t.attribute;let{curveType:R=f.curveType}=t.attribute;function M(t,e){return"connect"!==e?t:t.filter((t=>!1!==t.defined))}if(_&&"linear"===R&&(R="linearClosed"),1===C&&!P&&!B.some((t=>!1===t.defined))&&"linear"===R)return this.drawLinearAreaHighPerformance(t,e,!!g,T,m,b,i,n,f,r,s,a,o);if(t.shouldUpdateShape()){if(P&&P.length){let e,i;const n=P.map(((t,n)=>{if(t.points.length<=1&&0===n)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===n?e={x:i.endX,y:i.endY}:n>1&&(e.x=i.endX,e.y=i.endY);const r=Wi(M(t.points,w),R,{startPoint:e,curveTension:x});return i=r,r})).filter((t=>!!t));let r;const s=[];for(let t=P.length-1;t>=0;t--){const e=P[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(h=e[t].x1)&&void 0!==h?h:e[t].x,y:null!==(l=e[t].y1)&&void 0!==l?l:e[t].y});if(0!==t){const e=P[t-1].points,n=e[e.length-1];n&&i.push({x:null!==(c=n.x1)&&void 0!==c?c:n.x,y:null!==(u=n.y1)&&void 0!==u?u:n.y})}i.length>1&&(r=Wi(M(i,w),"stepBefore"===R?"stepAfter":"stepAfter"===R?"stepBefore":R,{curveTension:x}),s.unshift(r))}t.cacheArea=s.map(((t,e)=>({top:n[e],bottom:t})))}else{if(!B||!B.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=M(B,w),i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(d=e[t].x1)&&void 0!==d?d:e[t].x,y:null!==(p=e[t].y1)&&void 0!==p?p:e[t].y});const n=Wi(e,R,{curveTension:x}),r=Wi(i,"stepBefore"===R?"stepAfter":"stepAfter"===R?"stepBefore":R,{curveTension:x});t.cacheArea={top:n,bottom:r}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===C){let h=!1;t.cacheArea.forEach(((l,c)=>{h||(h=this.drawSegmentItem(e,l,A,m,T,b,s[c],[f,t.attribute],C,i,n,y,t,r,a,o))}))}else{const h=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),l=C*h;let c=0,u=!1;t.cacheArea.forEach(((h,d)=>{if(u)return;const p=h.top.getLength(),g=(l-c)/p;c+=p,g>0&&(u=this.drawSegmentItem(e,h,A,m,T,b,s[d],[f,t.attribute],Lt(g,1),i,n,y,t,r,a,o))}))}}else this.drawSegmentItem(e,t.cacheArea,A,m,T,b,t.attribute,f,C,i,n,y,t,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).area;this._draw(t,r,!1,i,n)}drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f,g){return this._drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f,g)}_drawSegmentItem(e,i,n,r,s,a,o,h,l,c,u,d,p,f,g,v){if(!(i&&i.top&&i.bottom&&i.top.curves&&i.top.curves.length&&i.bottom.curves&&i.bottom.curves.length))return;e.beginPath();const{points:m,segments:y}=p.attribute;let b,x,w=t.Direction.ROW;if(y){const t=y[y.length-1];x=y[0].points[0],b=t.points[t.points.length-1]}else x=m[0],b=m[m.length-1];const S=Et(b.x-x.x),A=Et(b.y-x.y);w=null==b.x1?t.Direction.ROW:null==b.y1?t.Direction.COLUMN:Number.isFinite(S+A)?S>A?t.Direction.ROW:t.Direction.COLUMN:t.Direction.ROW,Ol(e.camera?e:e.nativeContext,i,l,{offsetX:c,offsetY:u,offsetZ:d,direction:w}),this.beforeRenderStep(p,e,c,u,!!r,!1,n,!1,h,f,g,null,{attribute:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(p,o,h);const{x:T=0,x:C=0}=o;return!1!==n&&(g?g(e,o,h):r&&(e.setCommonStyle(p,o,T-c,C-u,h),e.fill())),this.afterRenderStep(p,e,c,u,!!r,!1,n,!1,h,f,g,null,{attribute:o}),(()=>{if(!1!==s)if(v)v(e,o,h);else{const{stroke:n=h&&h[1]&&h[1].stroke}=o;at(n)&&(n[0]||n[2])&&!1===n[1]&&(e.beginPath(),Rl(e.camera?e:e.nativeContext,n[0]?i.top:i.bottom,l,w===t.Direction.ROW?"x":"y",{offsetX:c,offsetY:u,offsetZ:d})),e.setStrokeStyle(p,o,T-c,C-u,h),e.stroke()}})(),!1}},t.DefaultCanvasAreaRender=jl([g(),Wl(0,p(k)),Wl(0,v(rh)),Ul("design:paramtypes",[Object])],t.DefaultCanvasAreaRender);const Nl=qh,Gl=Xh;var Fl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},zl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hl=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasPathRender=class extends Fh{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=po,this.builtinContributions=[Gl,Nl],this.init(t)}drawShape(t,e,i,n,r,s,a,o){var h,l,c;const u=null!==(h=this.tempTheme)&&void 0!==h?h:Or(t,null==s?void 0:s.theme).path,{x:d=u.x,y:p=u.y,fillStrokeOrder:f=u.fillStrokeOrder}=t.attribute,g=null!==(l=this.z)&&void 0!==l?l:0,v=this.valid(t,u,a,o);if(!v)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:x}=v;if(e.beginPath(),t.pathShape)Je(t.pathShape.commandList,e,i,n,1,1,g);else{Je((null!==(c=t.attribute.path)&&void 0!==c?c:u.path).commandList,e,i,n,1,1,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,b,x,m,y,u,r,a,o);const w=()=>{x&&(o?o(e,t.attribute,u):y&&(e.setStrokeStyle(t,t.attribute,d-i,p-n,u),e.stroke()))},S=()=>{b&&(a?a(e,t.attribute,u):m&&(e.setCommonStyle(t,t.attribute,d-i,p-n,u),e.fill()))};f?(w(),S()):(S(),w()),this.afterRenderStep(t,e,i,n,b,x,m,y,u,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).path;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}},t.DefaultCanvasPathRender=Fl([g(),Hl(0,p(k)),Hl(0,v(hh)),zl("design:paramtypes",[Object])],t.DefaultCanvasPathRender);var Vl=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Yl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Xl=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasRectRender=class extends Fh{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=vo,this.builtinContributions=[cl,dl,ul],this.init(t)}drawShape(t,e,i,n,r,s,a,o){var h;const l=null!==(h=this.tempTheme)&&void 0!==h?h:Or(t,null==s?void 0:s.theme).rect,{fill:c=l.fill,background:u,stroke:d=l.stroke,cornerRadius:p=l.cornerRadius,opacity:f=l.opacity,fillOpacity:g=l.fillOpacity,lineWidth:v=l.lineWidth,strokeOpacity:m=l.strokeOpacity,visible:y=l.visible,x1:b,y1:x,x:w=l.x,y:S=l.y,fillStrokeOrder:A=l.fillStrokeOrder}=t.attribute;let{width:T,height:C}=t.attribute;T=(null!=T?T:b-w)||0,C=(null!=C?C:x-S)||0;const _=Ho(f,g,T,C,c),B=Yo(f,m,T,C),P=Go(c,u),R=Fo(d,v);if(!t.valid||!y)return;if(!P&&!R)return;if(!(_||B||a||o||u))return;0===p||at(p)&&p.every((t=>0===t))?(e.beginPath(),e.rect(i,n,T,C)):(e.beginPath(),ol(e,i,n,T,C,p));const M={doFill:P,doStroke:R};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,P,R,_,B,l,r,a,o,M);const E=()=>{M.doFill&&(a?a(e,t.attribute,l):_&&(e.setCommonStyle(t,t.attribute,w-i,S-n,l),e.fill()))},k=()=>{M.doStroke&&(o?o(e,t.attribute,l):B&&(e.setStrokeStyle(t,t.attribute,w-i,S-n,l),e.stroke()))};A?(k(),E()):(E(),k()),this.afterRenderStep(t,e,i,n,P,R,_,B,l,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).rect;this.tempTheme=r,this._draw(t,r,!1,i,n),this.tempTheme=null}},t.DefaultCanvasRectRender=Vl([g(),Xl(0,p(k)),Xl(0,v(ch)),Yl("design:paramtypes",[Object])],t.DefaultCanvasRectRender);var $l=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},ql=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kl=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasSymbolRender=class extends Fh{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=bo,this.builtinContributions=[ml,bl,yl],this.init(t)}drawShape(t,e,i,n,r,s,a,o){var h;const l=Or(t,null==s?void 0:s.theme).symbol,{size:c=l.size,x:u=l.x,y:d=l.y,scaleX:p=l.scaleX,scaleY:f=l.scaleY,fillStrokeOrder:g=l.fillStrokeOrder}=t.attribute,v=this.valid(t,l,a,o);if(!v)return;const{fVisible:m,sVisible:y,doFill:b,doStroke:x}=v,w=t.getParsedPath();if(!w)return;const{keepDirIn3d:S=l.keepDirIn3d}=t.attribute,A=null!==(h=this.z)&&void 0!==h?h:0;e.beginPath();const T=(r,s)=>{var h,c,v;if(t._parsedPath.svgCache){const e=Object.assign({},s);e.fill=null!==(h=s.fill)&&void 0!==h?h:t.attribute.fill,e.opacity=null!==(c=s.opacity)&&void 0!==c?c:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(v=s.stroke)&&void 0!==v?v:t.attribute.stroke,s=e}const m=()=>{s.fill&&(a?a(e,t.attribute,l):(e.setCommonStyle(t,s,u-i,d-n,l),e.fill()))},y=()=>{s.stroke&&(o?o(e,t.attribute,l):(e.setStrokeStyle(t,s,(u-i)/p,(d-n)/f,l),e.stroke()))};g?(y(),m()):(m(),y())};if(S&&e.camera&&e.project){const t=e.project(i,n,A),r=e.camera;e.camera=null,!1===w.draw(e,at(c)?[c[0]*p,c[1]*f]:c*p,t.x,t.y,void 0,T)&&e.closePath(),e.camera=r}else!1===w.draw(e,c,i,n,A,T)&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,n,b,x,m,y,l,r,a,o);const C=()=>{b&&!w.isSvg&&(a?a(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,u-i,d-n,l),e.fill()))},_=()=>{x&&!w.isSvg&&(o?o(e,t.attribute,l):y&&(e.setStrokeStyle(t,t.attribute,(u-i)/p,(d-n)/f,l),e.stroke()))};g?(_(),C()):(C(),_()),this.afterRenderStep(t,e,i,n,b,x,m,y,l,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).symbol;this._draw(t,r,!1,i,n)}},t.DefaultCanvasSymbolRender=$l([g(),Kl(0,p(k)),Kl(0,v(uh)),ql("design:paramtypes",[Object])],t.DefaultCanvasSymbolRender);const Zl=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new le)}allocate(t,e,i,n){if(!this.pools.length)return(new le).setValue(t,e,i,n);const r=this.pools.pop();return r.x1=t,r.y1=e,r.x2=i,r.y2=n,r}allocateByObj(t){if(!this.pools.length)return new le(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}};const Jl=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let Ql,tc;function ec(t){return Ql||(Ql=Jl.CreateGraphic("text",{})),Ql.initAttributes(t),Ql.AABBBounds}const ic=new class extends Yh{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.beforeFillStroke}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){var d,p,f,g,v,m,y,b,x,w;const{backgroundMode:S=h.backgroundMode,backgroundFit:A=h.backgroundFit}=t.attribute;let T,{background:C}=t.attribute;if(!C)return;const _=()=>{"richtext"===t.type&&(e.restore(),e.save(),T&&e.setTransformFromMatrix(T,!0,1))};let B;"richtext"===t.type&&(T=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const P=et(C)&&C.background,R=t.transMatrix.onlyTranslate();if(P){const e=t.AABBBounds,i=(null!==(d=C.x)&&void 0!==d?d:e.x1)+(null!==(p=C.dx)&&void 0!==p?p:0),n=(null!==(f=C.y)&&void 0!==f?f:e.y1)+(null!==(g=C.dy)&&void 0!==g?g:0),r=null!==(v=C.width)&&void 0!==v?v:e.width(),s=null!==(m=C.height)&&void 0!==m?m:e.height();if(B=Zl.allocate(i,n,i+r,n+s),C=C.background,!R){const t=B.width(),e=B.height();B.set((null!==(y=C.x)&&void 0!==y?y:0)+(null!==(b=C.dx)&&void 0!==b?b:0),(null!==(x=C.y)&&void 0!==x?x:0)+(null!==(w=C.dy)&&void 0!==w?w:0),t,e)}}else B=t.AABBBounds,R||(B=ec(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const r=t.resources.get(C);if("success"!==r.state||!r.data)return void _();e.highPerformanceSave(),R&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,n,h),this.doDrawImage(e,r.data,B,S,A),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:r}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.fillStyle=C,r?(ol(e,B.x1,B.y1,B.width(),B.height(),r),e.fill()):e.fillRect(B.x1,B.y1,B.width(),B.height()),e.highPerformanceRestore()}P&&Zl.free(B),_()}};var nc=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},rc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sc=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasTextRender=class extends Fh{constructor(t){super(),this.textRenderContribitions=t,this.numberType=xo,this.builtinContributions=[ic],this.init(t)}drawShape(t,e,i,n,r,s,a,o){var h,l,c;const u=Or(t,null==s?void 0:s.theme).text,{text:d,underline:p=u.underline,lineThrough:f=u.lineThrough,keepDirIn3d:g=u.keepDirIn3d,direction:v=u.direction,fontSize:m=u.fontSize,verticalMode:y=u.verticalMode,x:b=u.x,y:x=u.y}=t.attribute,w=null!==(h=_s(t.attribute.lineHeight,m))&&void 0!==h?h:m,S=this.valid(t,u,a,o);if(!S)return;const{fVisible:A,sVisible:T,doFill:C,doStroke:_}=S,B=!g,P=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,u),this.beforeRenderStep(t,e,i,n,C,_,A,T,u,r,a,o),B&&this.transformUseContext2d(t,u,P,e);const R=(r,s,h,l)=>{let c=i+s;const d=n+h;if(l){e.highPerformanceSave(),c+=m;const t=Ih.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,c,d),e.transformFromMatrix(t,!0),Ih.free(t)}_&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,b-i,x-n,u),e.strokeText(r,c,d,P))),C&&(a?a(e,t.attribute,u):A&&(e.setCommonStyle(t,t.attribute,b-i,x-n,u),e.fillText(r,c,d,P))),l&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(e.setTextStyleWithoutAlignBaseline(t.attribute,u,P),"horizontal"===v){const{multilineLayout:r}=t;if(!r)return void e.highPerformanceRestore();const{xOffset:s,yOffset:h}=r.bbox;_&&(o?o(e,t.attribute,u):T&&(e.setStrokeStyle(t,t.attribute,b-i,x-n,u),r.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+s+i,(t.topOffset||0)+h+n,P)})))),C&&(a?a(e,t.attribute,u):A&&(e.setCommonStyle(t,t.attribute,b-i,x-n,u),r.lines.forEach((r=>{e.fillText(r.str,(r.leftOffset||0)+s+i,(r.topOffset||0)+h+n,P),this.drawUnderLine(p,f,t,(r.leftOffset||0)+s+i,(r.topOffset||0)+h+n,r.descent,(r.descent-r.ascent)/2,P,u,e,{width:r.width})}))))}else{let{textAlign:i=u.textAlign,textBaseline:n=u.textBaseline}=t.attribute;if(!y){const e=i;i=null!==(l=t.getBaselineMapAlign()[n])&&void 0!==l?l:"left",n=null!==(c=t.getAlignMapBaseline()[e])&&void 0!==c?c:"top"}t.tryUpdateAABBBounds();const r=t.cache,{verticalList:s}=r;e.textAlign="left",e.textBaseline="top";const a=w*s.length;let o=0;s.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);o=It(e,o)}));let h=0,d=0;"bottom"===n?d=-a:"middle"===n&&(d=-a/2),"center"===i?h-=o/2:"right"===i&&(h-=o),s.forEach(((t,e)=>{const n=t.reduce(((t,e)=>t+(e.width||0)),0),r=o-n;let s=h;"center"===i?s+=r/2:"right"===i&&(s+=r),t.forEach((t=>{const{text:i,width:n,direction:r}=t;R(i,a-(e+1)*w+d,s,r),s+=n}))}))}B&&this.restoreTransformUseContext2d(t,u,P,e),this.afterRenderStep(t,e,i,n,C,_,A,T,u,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).text,{keepDirIn3d:s=r.keepDirIn3d}=t.attribute,a=!s;this._draw(t,r,a,i,n)}drawUnderLine(t,e,i,n,r,s,a,o,h,l,c){if(e+t<=0)return;const{textAlign:u=h.textAlign,fill:d=h.fill,opacity:p=h.opacity,underlineOffset:f=h.underlineOffset,underlineDash:g=h.underlineDash,fillOpacity:v=h.fillOpacity}=i.attribute,m=!J(c),y=m?c.width:i.clipedWidth,b=m?0:gh(u,y),x={lineWidth:0,stroke:d,opacity:p,strokeOpacity:v};if(t){x.lineWidth=t,l.setStrokeStyle(i,x,n,r,h),g&&l.setLineDash(g),l.beginPath();const e=r+s+f;l.moveTo(n+b,e,o),l.lineTo(n+b+y,e,o),l.stroke()}if(e){x.lineWidth=e,l.setStrokeStyle(i,x,n,r,h),l.beginPath();const t=r+a;l.moveTo(n+b,t,o),l.lineTo(n+b+y,t,o),l.stroke()}}},t.DefaultCanvasTextRender=nc([g(),sc(0,p(k)),sc(0,v(dh)),rc("design:paramtypes",[Object])],t.DefaultCanvasTextRender);var ac=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};function oc(t,e,i,n){t.moveTo(e[0].x+i,e[0].y+n);for(let r=1;r<e.length;r++)t.lineTo(e[r].x+i,e[r].y+n)}function hc(t,e){return Math.sqrt(t*t+e*e)}function lc(t,e,i,n,r){const s=e/i;return{x:t.x-n*s,y:t.y-r*s}}t.AbstractGraphicRender=class{},t.AbstractGraphicRender=ac([g()],t.AbstractGraphicRender);const cc=qh,uc=Xh;var dc=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},pc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fc=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasPolygonRender=class extends Fh{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=fo,this.builtinContributions=[uc,cc],this.init(t)}drawShape(t,e,i,n,r,s,a,o){const h=Or(t,null==s?void 0:s.theme).polygon,{points:l=h.points,cornerRadius:c=h.cornerRadius,x:u=h.x,y:d=h.y,closePath:p=h.closePath,fillStrokeOrder:f=h.fillStrokeOrder}=t.attribute,g=this.valid(t,h,a,o);if(!g)return;const{fVisible:v,sVisible:m,doFill:y,doStroke:b}=g;e.beginPath(),c<=0||at(c)&&c.every((t=>0===t))?oc(e.camera?e:e.nativeContext,l,i,n):function(t,e,i,n,r){let s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var a;if(e.length<3)return void oc(t,e,i,n);let o=0,h=e.length-1;s||(o+=1,h-=1,t.moveTo(e[0].x+i,e[0].y+n));for(let s=o;s<=h;s++){const o=e[0===s?h:(s-1)%e.length],l=e[s%e.length],c=e[(s+1)%e.length],u=l.x-o.x,d=l.y-o.y,p=l.x-c.x,f=l.y-c.y,g=(Math.atan2(d,u)-Math.atan2(f,p))/2,v=Math.abs(Math.tan(g));let m=Array.isArray(r)?null!==(a=r[s%e.length])&&void 0!==a?a:0:r,y=m/v;const b=hc(u,d),x=hc(p,f),w=Math.min(b,x);y>w&&(y=w,m=w*v);const S=lc(l,y,b,u,d),A=lc(l,y,x,p,f),T=2*l.x-S.x-A.x,C=2*l.y-S.y-A.y,_=hc(T,C),B=lc(l,hc(y,m),_,T,C);let P=Math.atan2(S.y-B.y,S.x-B.x);const R=Math.atan2(A.y-B.y,A.x-B.x);let M=R-P;M<0&&(P=R,M=-M),M>Math.PI&&(M-=Math.PI),0===s?t.moveTo(S.x+i,S.y+n):t.lineTo(S.x+i,S.y+n),M&&t.arcTo(l.x+i,l.y+n,A.x+i,A.y+n,m),t.lineTo(A.x+i,A.y+n)}s||t.lineTo(e[h+1].x+i,e[h+1].y+n)}(e.camera?e:e.nativeContext,l,i,n,c,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,y,b,v,m,h,r,a,o);const x=()=>{y&&(a?a(e,t.attribute,h):v&&(e.setCommonStyle(t,t.attribute,u-i,d-n,h),e.fill()))},w=()=>{b&&(o?o(e,t.attribute,h):m&&(e.setStrokeStyle(t,t.attribute,u-i,d-n,h),e.stroke()))};f?(w(),x()):(x(),w()),this.afterRenderStep(t,e,i,n,y,b,v,m,h,r,a,o)}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).polygon;this._draw(t,r,!1,i,n)}},t.DefaultCanvasPolygonRender=dc([g(),fc(0,p(k)),fc(0,v(lh)),pc("design:paramtypes",[Object])],t.DefaultCanvasPolygonRender);var gc=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},vc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},mc=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultCanvasGroupRender=class{constructor(t){this.groupRenderContribitions=t,this.numberType=lo}drawShape(e,i,n,r,s,a,o,h){const l=Or(e,null==a?void 0:a.theme).group,{fill:c=l.fill,background:u,stroke:d=l.stroke,opacity:p=l.opacity,width:f=l.width,height:g=l.height,clip:v=l.clip,fillOpacity:m=l.fillOpacity,strokeOpacity:y=l.strokeOpacity,cornerRadius:b=l.cornerRadius,path:x=l.path,lineWidth:w=l.lineWidth,visible:S=l.visible,fillStrokeOrder:A=l.fillStrokeOrder,x:T=l.x,y:C=l.y}=e.attribute,_=Ho(p,m,f,g,c),B=Yo(p,y,f,g),P=Go(c,u),R=Fo(d,w);if(!e.valid||!S)return;if(!v){if(!P&&!R)return;if(!(_||B||o||h||u))return}if(x&&x.length&&s.drawContribution){const t=i.disableFill,e=i.disableStroke,n=i.disableBeginPath;i.disableFill=!0,i.disableStroke=!0,i.disableBeginPath=!0,x.forEach((t=>{s.drawContribution.getRenderContribution(t).draw(t,s.renderService,s,a)})),i.disableFill=t,i.disableStroke=e,i.disableBeginPath=n}else 0===b||at(b)&&b.every((t=>0===t))?(i.beginPath(),i.rect(n,r,f,g)):(i.beginPath(),ol(i,n,r,f,g,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(sl));const M={doFill:P,doStroke:R};this._groupRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.beforeFillStroke&&a.drawShape(e,i,n,r,P,R,_,B,l,s,o,h,M)})),v&&i.clip(),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,l);const E=()=>{M.doFill&&(o?o(i,e.attribute,l):_&&(i.setCommonStyle(e,e.attribute,T-n,C-r,l),i.fill()))},k=()=>{M.doStroke&&(h?h(i,e.attribute,l):B&&(i.setStrokeStyle(e,e.attribute,T-n,C-r,l),i.stroke()))};A?(k(),E()):(E(),k()),this._groupRenderContribitions.forEach((a=>{a.time===t.BaseRenderContributionTime.afterFillStroke&&a.drawShape(e,i,n,r,P,R,_,B,l,s,o,h)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;const{clip:s,baseOpacity:a=1}=t.attribute;s?r.save():r.highPerformanceSave();const o=r.baseGlobalAlpha;r.baseGlobalAlpha*=a;const h=Or(t,null==n?void 0:n.theme).group,l=r.modelMatrix;if(r.camera){const e=Lh.allocate(),i=Lh.allocate();Wh(i,t,h),Ch(e,l||e,i),r.modelMatrix=e,Lh.free(i),r.setTransform(1,0,0,1,0,0,!0)}else r.transformFromMatrix(t.transMatrix,!0);r.beginPath(),n.skipDraw?this.drawShape(t,r,0,0,i,n,(()=>!1),(()=>!1)):this.drawShape(t,r,0,0,i);const{scrollX:c=h.scrollX,scrollY:u=h.scrollY}=t.attribute;let d;(c||u)&&r.translate(c,u),n&&n.drawingCb&&(d=n.drawingCb()),r.modelMatrix!==l&&Lh.free(r.modelMatrix),r.modelMatrix=l,r.baseGlobalAlpha=o,d&&d.then?d.then((()=>{s?r.restore():r.highPerformanceRestore()})):s?r.restore():r.highPerformanceRestore()}},t.DefaultCanvasGroupRender=gc([g(),mc(0,p(k)),mc(0,v(ah)),vc("design:paramtypes",[Object])],t.DefaultCanvasGroupRender);var yc=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},bc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xc=function(t,e){return function(i,n){e(i,n,t)}};const wc=["","repeat-x","repeat-y","repeat"];t.DefaultCanvasImageRender=class extends Fh{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=co,this.builtinContributions=[fl,gl],this.init(t)}drawShape(t,e,i,n,r,s,a,o){const h=Or(t).image,{width:l=h.width,height:c=h.height,repeatX:u=h.repeatX,repeatY:d=h.repeatY,x:p=h.x,y:f=h.y,cornerRadius:g=h.cornerRadius,fillStrokeOrder:v=h.fillStrokeOrder,image:m}=t.attribute,y=this.valid(t,h,a);if(!y)return;const{fVisible:b,sVisible:x,doFill:w,doStroke:S}=y;if(!m||!t.resources)return;const A=t.resources.get(m);if("success"!==A.state)return;let T=!1;0===g||at(g)&&g.every((t=>0===t))||(e.beginPath(),ol(e,i,n,l,c,g),T=!0),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h);const C=()=>{if(w)if(a)a(e,t.attribute,h);else if(b){e.setCommonStyle(t,t.attribute,i,n,h);let r=0;if("repeat"===u&&(r|=1),"repeat"===d&&(r|=2),r){const t=e.createPattern(A.data,wc[r]);e.fillStyle=t,e.translate(i,n,!0),e.fillRect(0,0,l,c),e.translate(-i,-n,!0)}else e.drawImage(A.data,i,n,l,c)}},_=()=>{S&&(o?o(e,t.attribute,h):x&&(e.setStrokeStyle(t,t.attribute,p-i,f-n,h),e.stroke()))};v?(_(),T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,n,w,!1,b,!1,h,r,a),C(),T&&e.restore()):(T&&(e.save(),e.clip()),this.beforeRenderStep(t,e,i,n,w,!1,b,!1,h,r,a),C(),T&&e.restore(),_()),this.afterRenderStep(t,e,i,n,w,!1,b,!1,h,r,a)}draw(t,e,i){const{image:n}=t.attribute;if(!n||!t.resources)return;const r=t.resources.get(n);if("loading"===r.state&&st(n))return void Ca.improveImageLoading(n);if("success"!==r.state)return;const{context:s}=e.drawParams;if(!s)return;const a=Or(t).image;this._draw(t,a,!1,i)}},t.DefaultCanvasImageRender=yc([g(),xc(0,p(k)),xc(0,v(oh)),bc("design:paramtypes",[Object])],t.DefaultCanvasImageRender);const Sc=Symbol.for("IncrementalDrawContribution"),Ac=Symbol.for("ArcRender"),Tc=Symbol.for("Arc3dRender"),Cc=Symbol.for("AreaRender"),_c=Symbol.for("CircleRender"),Bc=Symbol.for("GraphicRender"),Pc=Symbol.for("GroupRender"),Rc=Symbol.for("LineRender"),Mc=Symbol.for("PathRender"),Ec=Symbol.for("PolygonRender"),kc=Symbol.for("RectRender"),Oc=Symbol.for("Rect3DRender"),Ic=Symbol.for("SymbolRender"),Lc=Symbol.for("TextRender"),Dc=Symbol.for("RichTextRender"),jc=Symbol.for("Pyramid3dRender"),Uc=Symbol.for("GlyphRender"),Wc=Symbol.for("ImageRender"),Nc=Symbol.for("RenderSelector"),Gc=Symbol.for("DrawContribution"),Fc=(t,e,i,n)=>{let r,s=!1,a=!1;if(e.forEachChildren((t=>(s=t.numberType===so,!s))),e.forEachChildren((t=>(a=!!t.findFace,!a))),s){const t=e.getChildren(),o=[...t];o.sort(((t,e)=>{var i,n,r,s;let a=(null!==(n=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==n?n:0)/2,o=(null!==(s=null!==(r=e.attribute.startAngle)&&void 0!==r?r:0+e.attribute.endAngle)&&void 0!==s?s:0)/2;for(;a<0;)a+=Mt;for(;o<0;)o+=Mt;return o-a})),o.forEach((t=>{t._next=null,t._prev=null})),e.removeAllChild(),e.update(),o.forEach((t=>{e.appendChild(t)})),n.hack_pieFace="outside",r=i(s,a),r&&r.graphic||(n.hack_pieFace="inside",r=i(s,a)),r&&r.graphic||(n.hack_pieFace="top",r=i(s,a)),e.removeAllChild(),t.forEach((t=>{t._next=null,t._prev=null})),t.forEach((t=>{e.appendChild(t)}))}else if(a){const n=e.getChildren(),o=n.map((e=>({ave_z:e.findFace().vertices.map((i=>{var n;return t.view(i[0],i[1],null!==(n=i[2]+e.attribute.z)&&void 0!==n?n:0)[2]})).reduce(((t,e)=>t+e),0),g:e})));o.sort(((t,e)=>e.ave_z-t.ave_z)),e.removeAllChild(),o.forEach((t=>{t.g._next=null,t.g._prev=null})),e.update(),o.forEach((t=>{e.add(t.g)})),r=i(s,a),e.removeAllChild(),n.forEach((t=>{t._next=null,t._prev=null})),e.update(),n.forEach((t=>{e.add(t)}))}else r=i(s,a);return r};var zc=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Hc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Vc=Symbol.for("DrawItemInterceptor"),Yc=new le,Xc=new le;class $c{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0||(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0)&&this.drawItem(t,e,i,n,r),!1}beforeDrawItem(t,e,i,n,r){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0||(t.attribute.shadowRootIdx<0||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0)&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.shadowRoot)return!1;const{context:s}=i;if(s.highPerformanceSave(),s.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){Yc.copy(n.dirtyBounds),Xc.copy(n.backupDirtyBounds);const e=t.globalTransMatrix.getInverse();n.dirtyBounds.copy(n.backupDirtyBounds).transformWithMatrix(e),n.backupDirtyBounds.copy(n.dirtyBounds)}return n.renderGroup(t.shadowRoot,i,Ih.allocate(1,0,0,1,0,0)),s.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&(n.dirtyBounds.copy(Yc),n.backupDirtyBounds.copy(Xc)),!0}}class qc{constructor(){this.order=1}afterDrawItem(t,e,i,n,r){return t.attribute._debug_bounds&&this.drawItem(t,e,i,n,r),!1}drawItem(t,e,i,n,r){if(!t.attribute._debug_bounds)return!1;const{context:s}=i;s.highPerformanceSave(),t.parent&&s.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&s.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const a=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(s,t),s.strokeRect(a.x1,a.y1,a.width(),a.height()),s.highPerformanceRestore(),!0}}t.CommonDrawItemInterceptorContribution=class{constructor(){this.order=1,this.interceptors=[new $c,new Zc,new Kc,new qc]}afterDrawItem(t,e,i,n,r){for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].afterDrawItem&&this.interceptors[s].afterDrawItem(t,e,i,n,r))return!0;return!1}beforeDrawItem(t,e,i,n,r){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let s=0;s<this.interceptors.length;s++)if(this.interceptors[s].beforeDrawItem&&this.interceptors[s].beforeDrawItem(t,e,i,n,r))return!0;return!1}},t.CommonDrawItemInterceptorContribution=zc([g(),Hc("design:paramtypes",[])],t.CommonDrawItemInterceptorContribution);class Kc{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,n,r):this.beforeSetInteractive(t,e,i,n,r))}beforeSetInteractive(t,e,i,n,r){let s=t.interactiveGraphic;if(t.attribute.globalZIndex){s||(s=t.clone(),t.interactiveGraphic=s,s.baseGraphic=t),s.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).add(s),!0}if(s){i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(s),t.interactiveGraphic=null,s.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,n,r){const s=t.baseGraphic;let a=!!s.stage,o=s.parent;for(;a&&o&&o.stage!==o;)a=!!o.stage,o=o.parent;if(!a){const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).removeChild(t),!0}if(s){this.processing=!0;const{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(s.parent.globalTransMatrix,!0),s.isContainer?n.renderGroup(s,i,s.parent.globalTransMatrix):n.renderItem(s,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=Jl.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class Zc{constructor(){this.order=1}beforeDrawItem(t,e,i,n,r){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:s,stage:a}=e.drawParams;s.canvas,s.save(),this.initCanvasCtx(s),s.camera=a.camera;const o=s.currentMatrix;o.a/=s.dpr,o.b/=s.dpr,o.c/=s.dpr,o.d/=s.dpr,o.e/=s.dpr,o.f/=s.dpr;const h=Lh.allocate();Ah(h,o);const l=s.modelMatrix;if(l){if(h){const t=Lh.allocate();s.modelMatrix=Ch(t,l,h)}}else s.modelMatrix=h;return s.setTransform(1,0,0,1,0,0,!0),t.isContainer?Fc(s,t,((e,r)=>n.renderGroup(t,i,t.parent.globalTransMatrix,!e&&r)),i):n.renderItem(t,i),s.camera=null,s.restore(),s.modelMatrix!==l&&Lh.free(s.modelMatrix),s.modelMatrix=l,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var Jc=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Qc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tu=function(t,e){return function(i,n){e(i,n,t)}};const eu=Symbol.for("RenderService"),iu=Symbol.for("BeforeRenderConstribution");t.DefaultRenderService=class{constructor(t){this.drawContribution=t}prepare(t){t&&this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}},t.DefaultRenderService=Jc([g(),tu(0,p(Gc)),Qc("design:paramtypes",[Object])],t.DefaultRenderService);var nu=new i((e=>{e(eu).to(t.DefaultRenderService)}));const ru=Symbol.for("GraphicPicker"),su=Symbol.for("PickerService"),au=Symbol.for("BoundsPicker"),ou=Symbol.for("GlobalPickerService"),hu=(t,e,i)=>{const{outerBorder:n,shadowBlur:r=e.shadowBlur}=t;if(n){const t=e.outerBorder,{distance:s=t.distance,lineWidth:a=t.lineWidth}=n;i.expand(s+(r+a)/2)}return i},lu=["radius","startAngle","endAngle",...Ra];class cu extends La{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1}),this.type="circle",this.numberType=oo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}getGraphicTheme(){return Or(this).circle}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateCircleAABBBoundsImprecise(t,e,i):this.updateCircleAABBBoundsAccurate(t,e,i));const{tb1:r,tb2:s}=mn.graphicService.updateTempAABBBounds(i);return hu(t,e,r),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2),mn.graphicService.transformAABBBounds(t,i,e,!1,this),i}updateCircleAABBBoundsImprecise(t,e,i){const{radius:n=e.radius}=t;return i.set(-n,-n,n,n),i}updateCircleAABBBoundsAccurate(t,e,i){const{startAngle:n=e.startAngle,endAngle:r=e.endAngle,radius:s=e.radius}=t;return r-n>Mt-_t?i.set(-s,-s,s,s):vs(n,r,s,i),i}needUpdateTags(t){return super.needUpdateTags(t,lu)}needUpdateTag(t){return super.needUpdateTag(t,lu)}toCustomPath(){var t,e,i;const n=this.attribute,r=null!==(t=n.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),s=null!==(e=n.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),a=null!==(i=n.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),o=new Ni;return o.arc(0,0,r,s,a),o}clone(){return new cu(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return cu.NOWORK_ANIMATE_ATTR}}function uu(t){return new cu(t)}cu.NOWORK_ANIMATE_ATTR=Ia;class du{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i,n){if(t.xOffset="left"===e||"start"===e?0:"center"===e?t.width/-2:"right"===e||"end"===e?-t.width:0,"top"===i)t.yOffset=0;else if("middle"===i)t.yOffset=t.height/-2;else if("alphabetic"===i){let e=.79;if(1===n.length){const t=n[0];e=t.ascent/(t.ascent+t.descent)}t.yOffset=t.height*-e}else t.yOffset=-t.height;return t}GetLayoutByLines(e,i,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",a=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0;const{lineWidth:h,suffixPosition:l="end",measureMode:c=t.MeasureModeEnum.actualBounding,keepCenterInLine:u=!1}=null!=o?o:{};e=e.map((t=>t.toString()));const d=[],p=[0,0];if("number"==typeof h&&h!==1/0){let t;for(let i=0,n=e.length;i<n;i++){const n=this.textMeasure.measureTextPixelADscentAndWidth(e[i],this.textOptions,c);let r=e[i].toString();if(n.width>h){const n=this.textMeasure.clipTextWithSuffix(e[i],this.textOptions,h,s,a,l);r=n.str,t=n.width}else t=n.width;d.push({str:r,width:t,ascent:n.ascent,descent:n.descent,keepCenterInLine:u})}p[0]=h}else{let t,i,n=0;for(let r=0,s=e.length;r<s;r++){i=e[r];const s=this.textMeasure.measureTextPixelADscentAndWidth(e[r],this.textOptions,c);t=s.width,n=Math.max(n,t),d.push({str:i,width:t,ascent:s.ascent,descent:s.descent,keepCenterInLine:u})}p[0]=n}p[1]=d.length*r,p[0]=d.reduce(((t,e)=>Math.max(t,e.width)),0);const f={xOffset:0,yOffset:0,width:p[0],height:p[1]};return this.LayoutBBox(f,i,n,d),this.layoutWithBBox(f,d,i,n,r)}layoutWithBBox(t,e,i,n,r){const s=[0,0],a=e.length*r;"top"===n||("middle"===n?s[1]=(t.height-a)/2:"bottom"===n&&(s[1]=t.height-a));for(let a=0;a<e.length;a++)this.lineOffset(t,e[a],i,n,r,s);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:r,textAlign:i,textBaseline:n}}lineOffset(t,e,i,n,r,s){if("left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=r/2+(e.ascent-e.descent)/2+s[1],!e.keepCenterInLine){const t=0,i=e.ascent+e.descent+t;if(i<r-t&&("bottom"===n?e.topOffset+=(r-i)/2:"top"===n&&(e.topOffset-=(r-i)/2)),"alphabetic"===n){const t=r/(e.ascent+e.descent);e.topOffset=r/2+(e.ascent-e.descent)/2*t+s[1]}}return s[1]+=r,e}}const pu=["text","maxLineWidth","maxWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...Ra];class fu extends La{get font(){const t=this.getGraphicTheme();return this._font||(this._font=se(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme(),n=this.getMaxWidth(i);return Number.isFinite(n)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const i=this.getGraphicTheme(),n=this.attribute,r=this.getMaxWidth(i);if(!Number.isFinite(r))return!1;const{text:s}=this.attribute;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(s)?s.join(""):s)!==t}return"vertical"===n.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==n.text.toString():null!=this.clipedText&&this.clipedText!==n.text.toString()}get multilineLayout(){return this.tryUpdateAABBBounds(),this.cache.layoutData}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=xo,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return at(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Or(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new fu({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const n=this.obbText.AABBBounds,{x:r,y:s}=e,a={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2},o=te(a,i,{x:r,y:s});return this._OBBBounds.copy(n),this._OBBBounds.translate(o.x-a.x,o.y-a.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:n=e.text}=this.attribute;Array.isArray(n)?this.updateMultilineAABBBounds(n):this.updateSingallineAABBBounds(n);const{tb1:r}=mn.graphicService.updateTempAABBBounds(i),{scaleX:s=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:h=e.strokeBoundsBuffer}=t;if(o){qa(r,o/Math.abs(s+a),!0,h),i.union(r)}return mn.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||mn.graphicService.updateHTMLTextAABBBounds(t,e,i),oe(i,i,this.transMatrix),i}updateSingallineAABBBounds(t){this.updateMultilineAABBBounds([t]);const e=this.cache.layoutData;if(e&&e.lines&&e.lines.length){const t=e.lines[0];this.cache.clipedText=t.str,this.cache.clipedWidth=t.width}return this._AABBBounds}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:n=e.underlineOffset}=this.attribute,r="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&n&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+n),r}guessLineHeightBuf(t){return t?.1*t:0}updateHorizontalMultilineAABBBounds(t){var e;const i=this.getGraphicTheme(),n=this.attribute,{fontFamily:r=i.fontFamily,textAlign:s=i.textAlign,textBaseline:a=i.textBaseline,fontSize:o=i.fontSize,fontWeight:h=i.fontWeight,ellipsis:l=i.ellipsis,maxLineWidth:c,stroke:u=i.stroke,wrap:d=i.wrap,measureMode:p=i.measureMode,lineWidth:f=i.lineWidth,whiteSpace:g=i.whiteSpace,suffixPosition:v=i.suffixPosition,ignoreBuf:m=i.ignoreBuf,keepCenterInLine:y=i.keepCenterInLine}=n,b=m?0:this.guessLineHeightBuf(o),x=this.getLineHeight(n,i,b);if("normal"===g||d)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(f/2),this._AABBBounds}const w=mn.graphicUtil.textMeasure,S=new du(r,{fontSize:o,fontWeight:h,fontFamily:r,lineHeight:x},w).GetLayoutByLines(t,s,a,x,!0===l?i.ellipsis:l||void 0,!1,{lineWidth:c,suffixPosition:v,measureMode:p,keepCenterInLine:y}),{bbox:A}=S;return this.cache.layoutData=S,this.clearUpdateShapeTag(),this._AABBBounds.set(A.xOffset,A.yOffset,A.xOffset+A.width,A.yOffset+A.height),u&&this._AABBBounds.expand(f/2),this._AABBBounds}updateWrapAABBBounds(t){var e,i,n;const r=this.getGraphicTheme(),{fontFamily:s=r.fontFamily,textAlign:a=r.textAlign,textBaseline:o=r.textBaseline,fontSize:h=r.fontSize,ellipsis:l=r.ellipsis,maxLineWidth:c,stroke:u=r.stroke,lineWidth:d=r.lineWidth,wordBreak:p=r.wordBreak,fontWeight:f=r.fontWeight,ignoreBuf:g=r.ignoreBuf,measureMode:v=r.measureMode,suffixPosition:m=r.suffixPosition,heightLimit:y=0,lineClamp:b,keepCenterInLine:x=r.keepCenterInLine}=this.attribute,w=g?0:this.guessLineHeightBuf(h),S=this.getLineHeight(this.attribute,r,w);if(!this.shouldUpdateShape()&&(null===(e=this.cache)||void 0===e?void 0:e.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}const A=mn.graphicUtil.textMeasure,T={fontSize:h,fontWeight:f,fontFamily:s,lineHeight:S},C=new du(s,T,A),_=at(t)?t.map((t=>t.toString())):[t.toString()],B=[],P=[0,0];let R=1/0;if(y>0&&(R=Math.max(Math.floor(y/S),1)),b&&(R=Math.min(R,b)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<_.length;t++){const e=_[t];let r=!0;if(t===R-1){const i=A.clipTextWithSuffix(e,T,c,l,!1,m,t!==_.length-1),n=A.measureTextPixelADscentAndWidth(i.str,T,v);B.push({str:i.str,width:i.width,ascent:n.ascent,descent:n.descent,keepCenterInLine:x});break}const s=A.clipText(e,T,c,"break-all"!==p,"keep-all"===p);if(""!==e&&""===s.str||s.wordBreaked){if(l){const t=A.clipTextWithSuffix(e,T,c,l,!1,m);s.str=null!==(i=t.str)&&void 0!==i?i:"",s.width=null!==(n=t.width)&&void 0!==n?n:0}else s.str="",s.width=0;r=!1}const a=A.measureTextPixelADscentAndWidth(s.str,T,v);B.push({str:s.str,width:s.width,ascent:a.ascent,descent:a.descent,keepCenterInLine:x});let o=s.str.length;if(!s.wordBreaked||""!==e&&""===s.str||(r=!0,o=s.wordBreaked),s.str.length===e.length);else if(r){let i=e.substring(o);"keep-all"===p&&(i=i.replace(/^\s+/g,"")),_.splice(t+1,0,i)}}let t=0;B.forEach((e=>{t=Math.max(t,e.width)})),P[0]=t}else{let t,e,i=0;for(let n=0,r=_.length;n<r;n++){if(n===R-1){const t=A.clipTextWithSuffix(_[n],T,c,l,!1,m),e=A.measureTextPixelADscentAndWidth(t.str,T,v);B.push({str:t.str,width:t.width,ascent:e.ascent,descent:e.descent,keepCenterInLine:x}),i=Math.max(i,t.width);break}e=_[n],t=A.measureTextWidth(e,T),i=Math.max(i,t);const r=A.measureTextPixelADscentAndWidth(e,T,v);B.push({str:e,width:t,ascent:r.ascent,descent:r.descent,keepCenterInLine:x})}P[0]=i}P[1]=B.length*S;const M={xOffset:0,yOffset:0,width:P[0],height:P[1]};C.LayoutBBox(M,a,o,B);const E=C.layoutWithBBox(M,B,a,o,S);return this.cache.layoutData=E,this.clearUpdateShapeTag(),this._AABBBounds.set(M.xOffset,M.yOffset,M.xOffset+M.width,M.yOffset+M.height),u&&this._AABBBounds.expand(d/2),this._AABBBounds}updateVerticalMultilineAABBBounds(e){var i,n;const r=this.getGraphicTheme(),s=mn.graphicUtil.textMeasure;let a;const o=this.attribute,{maxLineWidth:h=r.maxLineWidth,ellipsis:l=r.ellipsis,fontFamily:c=r.fontFamily,fontSize:u=r.fontSize,fontWeight:d=r.fontWeight,stroke:p=r.stroke,lineWidth:f=r.lineWidth,verticalMode:g=r.verticalMode,suffixPosition:v=r.suffixPosition}=o,m=this.getLineHeight(o,r,0);let{textAlign:y=r.textAlign,textBaseline:b=r.textBaseline}=o;if(!g){const t=y;y=null!==(i=fu.baselineMapAlign[b])&&void 0!==i?i:"left",b=null!==(n=fu.alignMapBaseline[t])&&void 0!==n?n:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=It(e,a)}));const t=gh(y,a),e=this.cache.verticalList.length*m,i=vh(b,e,u);return this._AABBBounds.set(i,t,i+e,t+a),p&&this._AABBBounds.expand(f/2),this._AABBBounds}const x=e.map((t=>Qa(t.toString())));x.forEach(((e,i)=>{if(Number.isFinite(h))if(l){const t=!0===l?r.ellipsis:l,n=s.clipTextWithSuffixVertical(e,{fontSize:u,fontWeight:d,fontFamily:c},h,t,!1,v);x[i]=n.verticalList,a=n.width}else{const t=s.clipTextVertical(e,{fontSize:u,fontWeight:d,fontFamily:c},h,!1);x[i]=t.verticalList,a=t.width}else a=0,e.forEach((e=>{const i=e.direction===t.TextDirection.HORIZONTAL?u:s.measureTextWidth(e.text,{fontSize:u,fontWeight:d,fontFamily:c});a+=i,e.width=i}))})),this.cache.verticalList=x,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=It(e,a)}));const w=gh(y,a),S=this.cache.verticalList.length*m,A=vh(b,S,u);return this._AABBBounds.set(A,w,A+S,w+a),p&&this._AABBBounds.expand(f/2),this._AABBBounds}getMaxWidth(t){var e,i;const n=this.attribute;return null!==(i=null!==(e=n.maxLineWidth)&&void 0!==e?e:n.maxWidth)&&void 0!==i?i:t.maxWidth}getLineHeight(t,e,i){var n;return null!==(n=_s(t.lineHeight,t.fontSize||e.fontSize))&&void 0!==n?n:(t.fontSize||e.fontSize)+i}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pu;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:pu;return super.needUpdateTag(t,e)}clone(){return new fu(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return fu.NOWORK_ANIMATE_ATTR}getBaselineMapAlign(){return fu.baselineMapAlign}getAlignMapBaseline(){return fu.alignMapBaseline}}function gu(t){return new fu(t)}fu.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Ia),fu.baselineMapAlign={top:"left",bottom:"right",middle:"center"},fu.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const vu=["heightLimit","lineClamp"];class mu extends fu{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return at(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,n,r;const s=this.getGraphicTheme(),{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:h=s.textBaseline,fontSize:l=s.fontSize,ellipsis:c=s.ellipsis,maxLineWidth:u,stroke:d=s.stroke,lineWidth:p=s.lineWidth,wordBreak:f=s.wordBreak,fontWeight:g=s.fontWeight,ignoreBuf:v=s.ignoreBuf,heightLimit:m=0,suffixPosition:y=s.suffixPosition,lineClamp:b}=this.attribute,x=null!==(e=_s(this.attribute.lineHeight,this.attribute.fontSize||s.fontSize))&&void 0!==e?e:this.attribute.fontSize||s.fontSize,w=v?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}const S=mn.graphicUtil.textMeasure,A=new du(a,{fontSize:l,fontWeight:g,fontFamily:a},S),T=t.map((t=>t.toString())),C=[],_=[0,0];let B=1/0;if(m>0&&(B=Math.max(Math.floor(m/x),1)),b&&(B=Math.min(B,b)),"number"==typeof u&&u!==1/0){if(u>0)for(let t=0;t<T.length;t++){const e=T[t];let i=!0;if(t===B-1){const t=A.textMeasure.clipTextWithSuffix(e,A.textOptions,u,c,!1,y);C.push({str:t.str,width:t.width,ascent:0,descent:0,keepCenterInLine:!1});break}const s=A.textMeasure.clipText(e,A.textOptions,u,"break-word"===f);if(""!==e&&""===s.str){if(c){const t=A.textMeasure.clipTextWithSuffix(e,A.textOptions,u,c,!1,y);s.str=null!==(n=t.str)&&void 0!==n?n:"",s.width=null!==(r=t.width)&&void 0!==r?r:0}else s.str="",s.width=0;i=!1}if(C.push({str:s.str,width:s.width,ascent:0,descent:0,keepCenterInLine:!1}),s.str.length===e.length);else if(i){const i=e.substring(s.str.length);T.splice(t+1,0,i)}}let t=0;C.forEach((e=>{t=Math.max(t,e.width)})),_[0]=t}else{let t,e,i=0;for(let n=0,r=T.length;n<r;n++){if(n===B-1){const t=A.textMeasure.clipTextWithSuffix(T[n],A.textOptions,u,c,!1,y);C.push({str:t.str,width:t.width,ascent:0,descent:0,keepCenterInLine:!1}),i=Math.max(i,t.width);break}e=T[n],t=A.textMeasure.measureTextWidth(e,A.textOptions,"break-word"===f),i=Math.max(i,t),C.push({str:e,width:t,ascent:0,descent:0,keepCenterInLine:!1})}_[0]=i}_[1]=C.length*(x+w);const P={xOffset:0,yOffset:0,width:_[0],height:_[1]};A.LayoutBBox(P,o,h);const R=A.layoutWithBBox(P,C,o,h,x);return this.cache.layoutData=R,this.clearUpdateShapeTag(),this._AABBBounds.set(P.xOffset,P.yOffset,P.xOffset+P.width,P.yOffset+P.height),d&&this._AABBBounds.expand(p/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<vu.length;e++){const i=vu[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<vu.length;e++)if(t===vu[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return mu.NOWORK_ANIMATE_ATTR}}function yu(t){return new mu(t)}class bu{bounds(t,e){if(ht(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}parseSize(t){return ht(t)?t:Math.min(t[0],t[1])}}function xu(t,e,i,n,r){return r?t.arc(i,n,e,0,Rt,!1,r):t.arc(i,n,e,0,Rt),!1}var wu=new class extends bu{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,n,r){return xu(t,this.parseSize(e)/2,i,n,r)}drawOffset(t,e,i,n,r,s){return xu(t,this.parseSize(e)/2+r,i,n,s)}drawToSvgPath(t,e,i,n){const r=this.parseSize(t)/2;return`M ${e-r}, ${i} a ${r},${r} 0 1,0 ${2*r},0 a ${r},${r} 0 1,0 -${2*r},0`}};var Su=new class extends bu{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,n,r){return function(t,e,i,n,r){return t.moveTo(-3*e+i,-e+n,r),t.lineTo(-e+i,-e+n,r),t.lineTo(-e+i,-3*e+n,r),t.lineTo(e+i,-3*e+n,r),t.lineTo(e+i,-e+n,r),t.lineTo(3*e+i,-e+n,r),t.lineTo(3*e+i,e+n,r),t.lineTo(e+i,e+n,r),t.lineTo(e+i,3*e+n,r),t.lineTo(-e+i,3*e+n,r),t.lineTo(-e+i,e+n,r),t.lineTo(-3*e+i,e+n,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,r)}drawOffset(t,e,i,n,r,s){return function(t,e,i,n,r,s){return t.moveTo(-3*e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-e+n-r,s),t.lineTo(-e+i-r,-3*e+n-r,s),t.lineTo(e+i+r,-3*e+n-r,s),t.lineTo(e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,-e+n-r,s),t.lineTo(3*e+i+r,e+n+r,s),t.lineTo(e+i+r,e+n+r,s),t.lineTo(e+i+r,3*e+n+r,s),t.lineTo(-e+i-r,3*e+n+r,s),t.lineTo(-e+i-r,e+n+r,s),t.lineTo(-3*e+i-r,e+n+r,s),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,r,s)}};function Au(t,e,i,n,r){return t.moveTo(i,n-e,r),t.lineTo(e+i,n,r),t.lineTo(i,n+e,r),t.lineTo(i-e,n,r),t.closePath(),!0}var Tu=new class extends bu{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,r){return Au(t,this.parseSize(e)/2,i,n,r)}drawFitDir(t,e,i,n,r){return Au(t,this.parseSize(e)/2,i,n,r)}drawOffset(t,e,i,n,r,s){return Au(t,this.parseSize(e)/2+r,i,n,s)}};function Cu(t,e,i,n){const r=2*e;return t.rect(i-e,n-e,r,r),!1}var _u=new class extends bu{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return Cu(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Cu(t,this.parseSize(e)/2+r,i,n)}};function Bu(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i+e+2*r,e+n+r),t.lineTo(i-e-2*r,e+n+r),t.lineTo(i,n-e-2*r),t.closePath(),!0}class Pu extends bu{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,n){return Bu(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Bu(t,this.parseSize(e)/2,i,n,r)}}var Ru=new Pu;var Mu=new class extends Pu{constructor(){super(...arguments),this.type="triangle"}};const Eu=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ku=Math.sin(Rt/10)*Eu,Ou=-Math.cos(Rt/10)*Eu;function Iu(t,e,i,n){const r=ku*e,s=Ou*e;t.moveTo(i,-e+n),t.lineTo(r+i,s+n);for(let a=1;a<5;++a){const o=Rt*a/5,h=Math.cos(o),l=Math.sin(o);t.lineTo(l*e+i,-h*e+n),t.lineTo(h*r-l*s+i,l*r+h*s+n)}return t.closePath(),!0}var Lu=new class extends bu{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,n){return Iu(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Iu(t,this.parseSize(e)/2+r,i,n)}};const Du=jt(3);function ju(t,e,i,n){const r=e,s=r/Du,a=s/5,o=e;return t.moveTo(0+i,-r+n),t.lineTo(s/2+i,n),t.lineTo(a/2+i,n),t.lineTo(a/2+i,o+n),t.lineTo(-a/2+i,o+n),t.lineTo(-a/2+i,n),t.lineTo(-s/2+i,n),t.closePath(),!0}var Uu=new class extends bu{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,n){return ju(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return ju(t,this.parseSize(e)/2+r,i,n)}};function Wu(t,e,i,n){const r=2*e;return t.moveTo(i,-e+n),t.lineTo(r/3/2+i,e+n),t.lineTo(-r/3/2+i,e+n),t.closePath(),!0}var Nu=new class extends bu{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return Wu(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Wu(t,this.parseSize(e)/2+r,i,n)}};function Gu(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Fu=new class extends bu{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return Gu(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Gu(t,this.parseSize(e)/2+r,i,n)}};const zu=-.5,Hu=jt(3)/2,Vu=1/jt(12);function Yu(t,e,i,n){const r=e/2,s=e*Vu,a=r,o=e*Vu+e,h=-a,l=o;return t.moveTo(r+i,s+n),t.lineTo(a+i,o+n),t.lineTo(h+i,l+n),t.lineTo(zu*r-Hu*s+i,Hu*r+zu*s+n),t.lineTo(zu*a-Hu*o+i,Hu*a+zu*o+n),t.lineTo(zu*h-Hu*l+i,Hu*h+zu*l+n),t.lineTo(zu*r+Hu*s+i,zu*s-Hu*r+n),t.lineTo(zu*a+Hu*o+i,zu*o-Hu*a+n),t.lineTo(zu*h+Hu*l+i,zu*l-Hu*h+n),t.closePath(),!1}var Xu=new class extends bu{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,n){return Yu(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Yu(t,this.parseSize(e)/2+r,i,n)}};function $u(t,e,i,n,r){return t.moveTo(-e+i-2*r,n),t.lineTo(e+i+r,e+n+2*r),t.lineTo(e+i+r,n-e-2*r),t.closePath(),!0}var qu=new class extends bu{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,n){return $u(t,this.parseSize(e)/2,i,n,0)}drawOffset(t,e,i,n,r){return $u(t,this.parseSize(e)/2,i,n,r)}};function Ku(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-r,e+n+2*r),t.lineTo(e+i+2*r,n),t.lineTo(i-e-r,n-e-2*r),t.closePath(),!0}var Zu=new class extends bu{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,n){return Ku(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Ku(t,this.parseSize(e)/2,i,n,r)}};function Ju(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-2*r,n-e-r),t.lineTo(i+e+2*r,n-e-r),t.lineTo(i,n+e+2*r),t.closePath(),!0}var Qu=new class extends bu{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,n){return Ju(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r){return Ju(t,this.parseSize(e)/2,i,n,r)}};const td=jt(3);function ed(t,e,i,n){const r=e*td;return t.moveTo(i,n+-r/3*2),t.lineTo(e+i,n+r),t.lineTo(i-e,n+r),t.closePath(),!0}var id=new class extends bu{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return ed(t,this.parseSize(e)/2/td,i,n)}drawOffset(t,e,i,n,r){return ed(t,this.parseSize(e)/2/td+r,i,n)}};function nd(t,e,i,n){const r=2*e;return t.moveTo(e+i,n-r),t.lineTo(i-e,n),t.lineTo(e+i,r+n),!0}var rd=new class extends bu{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,n){return nd(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,r){return nd(t,this.parseSize(e)/4+r,i,n)}};function sd(t,e,i,n){const r=2*e;return t.moveTo(i-e,n-r),t.lineTo(i+e,n),t.lineTo(i-e,r+n),!0}var ad=new class extends bu{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,n){return sd(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,r){return sd(t,this.parseSize(e)/4+r,i,n)}};function od(t,e,i,n){const r=2*e;return t.moveTo(i-r,n+e),t.lineTo(i,n-e),t.lineTo(i+r,n+e),!0}var hd=new class extends bu{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,n){return od(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,r){return od(t,this.parseSize(e)/4+r,i,n)}};function ld(t,e,i,n){const r=2*e;return t.moveTo(i-r,n-e),t.lineTo(i,n+e),t.lineTo(i+r,n-e),!0}var cd=new class extends bu{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,n){return ld(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,r){return ld(t,this.parseSize(e)/4+r,i,n)}};function ud(t,e,i,n,r){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var dd=new class extends bu{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,r){return ud(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r,s){return ud(t,this.parseSize(e)/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=this.parseSize(t)/2;return`M ${e}, ${i-r} L ${e},${i+r}`}};function pd(t,e,i,n,r){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var fd=new class extends bu{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,r){return pd(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r,s){return pd(t,this.parseSize(e)/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=this.parseSize(t)/2;return`M ${e-r}, ${i} L ${e+r},${i}`}};function gd(t,e,i,n,r){return t.moveTo(i-e,n-e),t.lineTo(i+e,n+e),t.moveTo(i+e,n-e),t.lineTo(i-e,n+e),!0}var vd=new class extends bu{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,n,r){return gd(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,r,s){return gd(t,this.parseSize(e)/2+r,i,n)}drawToSvgPath(t,e,i,n){const r=this.parseSize(t)/2;return`M ${e-r}, ${i-r} L ${e+r},${i+r} M ${e+r}, ${i-r} L ${e-r},${i+r}`}};function md(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function yd(t,e,i,n){const r=e,s=e/2;return t.rect(i-r/2,n-s/2,r,s),!1}var bd=new class extends bu{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,n){return ht(e)?yd(t,e,i,n):md(t,e,i,n)}drawOffset(t,e,i,n,r){return ht(e)?yd(t,e+2*r,i,n):md(t,[e[0]+2*r,e[1]+2*r],i,n)}};const xd=new le;class wd{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,at(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,r,s,a){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{t.beginPath(),Je(r.path.commandList,t,i,n,e,e),a&&a(r.path,r.attribute)})),!1):(Je(this.path.commandList,t,i,n,e+r,e+r),!1)}draw(t,e,i,n,r,s){return e=this.parseSize(e),this.drawOffset(t,e,i,n,0,r,s)}parseSize(t){return ht(t)?t:Math.min(t[0],t[1])}bounds(t,e){if(t=this.parseSize(t),this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:n}=i;xd.x1=n.bounds.x1*t,xd.y1=n.bounds.y1*t,xd.x2=n.bounds.x2*t,xd.y2=n.bounds.y2*t,e.union(xd)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}const Sd=[wu,Su,Tu,_u,id,Mu,Lu,Uu,Nu,Fu,Xu,qu,Zu,Ru,Qu,rd,ad,hd,cd,bd,dd,fd,vd],Ad={};Sd.forEach((t=>{Ad[t.type]=t}));const Td={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},Cd=new le,_d=["symbolType","size",...Ra];let Bd=class t extends La{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=bo}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return at(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=this.getGraphicTheme();let{symbolType:i=e.symbolType}=this.attribute,n=Ad[i];if(n)return this._parsedPath=n,n;if(n=t.userSymbolMap[i],n)return this._parsedPath=n,n;if(i=Td[i]||i,!0===Ya(i)){const e=new Va,{svg:n}=e.parse(i);if(!n)return null;const r=at(n.path)?n.path:[n.path];Cd.clear();const s=[];r.forEach((t=>{const e=(new Ni).fromString(t.d),i={};_o.forEach((e=>{t[e]&&(i[Co[e]]=t[e])})),s.push({path:e,attribute:i}),Cd.union(e.bounds)}));const a=Cd.width(),o=Cd.height(),h=1/It(a,o);return s.forEach((t=>t.path.transform(0,0,h,h))),this._parsedPath=new wd(i,s,!0),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}const r=(new Ni).fromString(i),s=r.bounds.width(),a=r.bounds.height(),o=1/It(s,a);return r.transform(0,0,o,o),this._parsedPath=new wd(i,r),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}getGraphicTheme(){return Or(this).symbol}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:r,tb2:s}=mn.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:r=e.shadowBlur,strokeBoundsBuffer:s=e.strokeBoundsBuffer}=t;if(n){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=n;qa(i,a+(r+o)/2,!0,s)}})(t,e,r),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2);const{lineJoin:a=e.lineJoin}=t;return mn.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:n=e.size}=t;if(at(n))i.set(-n[0]/2,-n[1]/2,n[0]/2,n[1]/2);else{const t=n/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:n=e.size}=t;return this.getParsedPath().bounds(n,i),i}needUpdateTags(t){return super.needUpdateTags(t,_d)}needUpdateTag(t){return super.needUpdateTag(t,_d)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=at(e)?e:[e,e];return t.path?(new Ni).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Ni).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Pd(t){return new Bd(t)}Bd.userSymbolMap={},Bd.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Ia);const Rd=["segments","points","curveType","curveTension",...Ra];let Md=class t extends La{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=uo}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,n,r){"points"===t&&(r.points=bs(i,n,e))}getGraphicTheme(){return Or(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),mn.graphicService.updateTempAABBBounds(i);const{lineJoin:n=e.lineJoin}=t;return mn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateLineAABBBoundsByPoints(t,e,i,n){const{points:r=e.points,connectedType:s}=t,a=i;return r.forEach((t=>{!1===t.defined&&"connect"!==s||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments,connectedType:s}=t,a=i;return r.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"connect"!==s||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,Rd)}needUpdateTag(t){return super.needUpdateTag(t,Rd)}toCustomPath(){const t=this.attribute,e=new Ni,i=t.segments,n=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{n(t.points)})):t.points&&n(t.points),e}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Ed(t){return new Md(t)}Md.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Ia);const kd=["width","x1","y1","height","cornerRadius",...Ra];class Od extends La{constructor(t){super(t),this.type="rect",this.numberType=vo}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Or(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:n}=t;const{x1:r,y1:s,x:a,y:o}=t;e=null!=e?e:r-a,n=null!=n?n:s-o,(isFinite(e)||isFinite(n)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,n||0)}const{tb1:n,tb2:r}=mn.graphicService.updateTempAABBBounds(i);return hu(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),mn.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,kd)}needUpdateTag(t){return super.needUpdateTag(t,kd)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:n,height:r}=Gs(t),s=new Ni;return s.moveTo(e,i),s.rect(e,i,n,r),s}clone(){return new Od(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Od.NOWORK_ANIMATE_ATTR}}function Id(t){return new Od(t)}Od.NOWORK_ANIMATE_ATTR=Ia;const Ld=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class Dd extends Od{constructor(t){super(t),this.type="rect3d",this.numberType=mo}findFace(){const t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),{x1:i,y1:n,x:r,y:s,length:a=Lt(e.width,e.height)}=this.attribute;let{width:o,height:h}=this.attribute;o=null!=o?o:i-r,h=null!=h?h:n-s;for(let e=0;e<Ld.length;e++){const i=Ld[e];t.vertices.push([i[0]*o,i[1]*h,i[2]*a])}return t.polygons.push({polygon:[0,1,5,4],normal:[0,-1,0]}),t.polygons.push({polygon:[2,3,7,6],normal:[0,1,0]}),t.polygons.push({polygon:[4,7,3,0],normal:[-1,0,0]}),t.polygons.push({polygon:[1,2,6,5],normal:[1,0,0]}),t.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),t.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),t.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],t}getNoWorkAnimateAttr(){return Dd.NOWORK_ANIMATE_ATTR}}function jd(t){return new Dd(t)}Dd.NOWORK_ANIMATE_ATTR=Ia;class Ud extends La{constructor(t){super(t),this.type="glyph",this.numberType=ho,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,n){super.setAttribute(t,e,i,n),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2?arguments[2]:void 0;super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}getGraphicTheme(){return Or(this).glyph}updateAABBBounds(t,e,i){return this.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i}doUpdateAABBBounds(){this.updateAABBBoundsStamp++,this._AABBBounds.clear();const t=this.updateAABBBounds(this.attribute,this.getGraphicTheme(),this._AABBBounds);return this.clearUpdateBoundTag(),t}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;this.stopStateAnimates();const n={},r=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const s=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];s&&(Object.assign(n,s.attributes),(null===(i=s.subAttributes)||void 0===i?void 0:i.length)&&r.forEach(((t,e)=>{Object.assign(t,s.subAttributes[e])})))})),this.subGraphic.forEach(((i,n)=>{i.updateNormalAttrs(r[n]),i.applyStateAttrs(r[n],t,e)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}clearStates(t){this.stopStateAnimates(),this.hasState()&&this.normalAttrs?(this.currentStates=[],this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}clone(){const t=new Ud(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return Ud.NOWORK_ANIMATE_ATTR}}function Wd(t){return new Ud(t)}Ud.NOWORK_ANIMATE_ATTR=Ia;class Nd{constructor(t,e,i,n,r,s,a,o,h,l,c,u,d,p){this.left=t,this.top=e,this.width=i,this.height=n,this.actualHeight=0,this.bottom=e+n,this.right=t+i,this.ellipsis=r,this.wordBreak=s,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=h,this.layoutDirection=l,this.directionKey=Sn[this.layoutDirection],this.isWidthMax=c,this.isHeightMax=u,this.singleLine=d,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:n}=this.getActualSize(),r=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let s=this.isHeightMax?Math.min(this.height,n):this.height||n||0;s=Math.min(s,n);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-s/2;break;case"bottom":a=-s}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-r:"center"===this.globalAlign&&(o=-r/2);let h=this[this.directionKey.height];this.singleLine&&(h=this.lines[0].height+1);let l=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=h&&0!==h)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i];if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(s=!0,l=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else{const i=Math.floor((h-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:r}=this.lines[i],s=h-this.lines[i].top-this.lines[i].height;if(0===h)this.lines[i].draw(t,!1,o,s+a,this.ellipsis,e);else{if(s+r>this[this.directionKey.top]+h||s<this[this.directionKey.top])return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]&&(n=!0,l=!0),this.lines[i].draw(t,n,o,s+a,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(o+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(o-=this.lines[i].height+this.lines[i].top);const{top:n,height:r}=this.lines[i];if(0===h)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e);else{if(n+r<this[this.directionKey.top]||n+r>this[this.directionKey.top]+h)return l;{let n=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+h&&(n=!0,l=!0),this.lines[i].draw(t,n,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}}}}return l}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const n=this.lines[i];n.actualWidth>t&&(t=n.actualWidth),e+=n.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:n}=this.getRawActualSize();this.width,this.height;let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i],a=r-this.lines[i].top-this.lines[i].height;if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+s>this[this.directionKey.top]+r||a<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&a-this.lines[i+1].height<this[this.directionKey.top]){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:n,height:s}=this.lines[i];if(0===r)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(n+s<this[this.directionKey.top]||n+s>this[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const n=!0===this.ellipsis?"...":this.ellipsis||"",r=this.lines[i].getWidthWithEllips(n);r>t&&(t=r),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class Gd{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";const n=_s(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof n?n>this.fontSize?n:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:r,height:s,descent:a,width:o}=kn(t,i);let h=0,l=0,c=0;this.height>s&&(h=(this.height-s)/2,l=Math.ceil(h),c=Math.floor(h)),"top"===this.textBaseline?(this.ascent=h,this.descent=s-h):"bottom"===this.textBaseline?(this.ascent=s-h,this.descent=h):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=r+l,this.descent=a+c),this.length=t.length,this.width=o||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=kn(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,n,r){let s=this.text,a=this.left+i;e+=this.top;let o=this.direction;if(this.verticalEllipsis)s=this.ellipsisStr,o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)s+=this.ellipsisStr,"right"!==r&&"end"!==r||(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Rn(s,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,s.length-1);if(s=s.slice(0,t),s+=this.ellipsisStr,"right"===r||"end"===r){const{width:e}=kn(this.text.slice(t),this.character);"vertical"===o||(a-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0);const{lineWidth:h=1}=this.character;this.character.stroke&&h&&t.strokeText(s,a,e),this.character.fill&&t.fillText(s,a,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Rn(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:n}=kn(this.text.slice(t),this.character);return i+this.ellipsisWidth-n}return i}}const Fd=["width","height","image",...Ra];class zd extends La{constructor(t){super(t),this.type="image",this.numberType=co,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,n){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,n)}getGraphicTheme(){return Or(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{width:n=e.width,height:r=e.height}=t;i.set(0,0,n,r)}const{tb1:n,tb2:r}=mn.graphicService.updateTempAABBBounds(i);return hu(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),mn.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return fn[t]}needUpdateTags(t){return super.needUpdateTags(t,Fd)}needUpdateTag(t){return super.needUpdateTag(t,Fd)}clone(){return new zd(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return zd.NOWORK_ANIMATE_ATTR}}function Hd(t){return new zd(t)}zd.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Ia);class Vd extends zd{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=ps(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(at(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=ps(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=fn.width,height:e=fn.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:n=e}=this.attribute,r=(i-t)/2,s=(n-e)/2;return this._AABBBounds.expand([0,2*r,2*s,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class Yd{constructor(t,e,i,n,r,s,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=n,this.descent=r,this.top=i-n,this.paragraphs=s.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof Vd?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Sn[this.direction],this.actualWidth=0;let h=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof Gd){const e=Bn.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],h=Math.max(t[this.directionKey.height],h)})),this.height=h,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const i=this.directionKey,n=this.height;let r=this.left,s=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?r=t-this.actualWidth:"center"===this.textAlign?r=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?r=(t-this.actualWidth)/2:s=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof Vd?(t["_"+i.x]=r,r+=t[i.width]+s,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?n-t.height:(n-t.height)/2):(t[i.left]=r,r+=t[i.width]+s)}))}draw(t,e,i,n,r,s){if(r&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const n=this.paragraphs[e];if(n.overflow)t=t&&""===n.text;else if(t){i=!0;break}}let n=0;if(!i)for(let t=this.paragraphs.length-1;t>=0;t--){const i=this.paragraphs[t];if(i.overflow){if(""===i.text)break;continue}if(i instanceof Vd)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const s=!0===r?"...":r||"";i.ellipsisStr=s;const{width:a}=kn(s,i.character),o=a||0;if(o<=this.blankWidth+n){e&&(i.ellipsis="add");break}if(o<=this.blankWidth+n+i.width){i.ellipsis="replace",i.ellipsisWidth=o,i.ellipsisOtherParagraphWidth=this.blankWidth+n;break}i.ellipsis="hide",n+=i.width}}this.paragraphs.forEach(((e,r)=>{if(e instanceof Vd)return e.setAttributes({x:i+e._x,y:n+e._y}),void s(e,t,i+e._x,n+e._y,this.ascent);const a={x1:this.left,y1:this.top,x2:this.left+this.actualWidth,y2:this.top+this.height};(function(t,e){const i=e&&e.stroke||Tn;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:n=1,opacity:r=1}=e;t.globalAlpha=n*r,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,Pn(t,e)})(t,e.character),function(t,e,i){const n=e&&e.fill||An;if(!n)return void(t.globalAlpha=0);const{fillOpacity:r=1,opacity:s=1}=e;t.globalAlpha=r*s,t.fillStyle=i?wn(t,n,{AABBBounds:i}):n,Pn(t,e)}(t,e.character,a),e.draw(t,n+this.ascent,i,0===r,this.textAlign)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const n=this.paragraphs[i];if(n instanceof Vd)break;const{width:r}=kn(t,n.character),s=r||0;if(s<=this.blankWidth+e){n.ellipsis="add",n.ellipsisWidth=s;break}if(s<=this.blankWidth+e+n.width){n.ellipsis="replace",n.ellipsisWidth=s,n.ellipsisOtherParagraphWidth=this.blankWidth+e;break}n.ellipsis="hide",e+=n.width}let i=0;return this.paragraphs.forEach(((t,e)=>{i+=t instanceof Vd?t.width:t.getWidthWithEllips(this.direction)})),i}}class Xd{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=Sn[this.direction]}store(t){if(t instanceof Vd){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new Yd(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t instanceof Vd?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const i=this[this.directionKey.width]-this.lineWidth||0,n=Math.ceil(i/t[this.directionKey.width]*t.length)||0,r=Rn(t.text,i,t.character,n,"break-word"===this.frame.wordBreak);if(0!==r){const[i,n]=function(t,e){const i=t.text.slice(0,e),n=t.text.slice(e);return[new Gd(i,t.newLine,t.character),new Gd(n,!0,t.character)]}(t,r);this.store(i),e?this.send():this.deal(n)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const $d=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize","fontFamily","fontStyle","fontWeight","lineWidth","opacity","fillOpacity","strokeOpacity",...Ra];class qd extends La{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=yo,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const n=this._frameCache.icons.get(t[i]);this.updateHoverIconState(n)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:pn.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:pn.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:pn.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:pn.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:pn.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:pn.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:pn.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:pn.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Or(this).richtext}updateAABBBounds(t,e,i){const{width:n=e.width,height:r=e.height,maxWidth:s=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:o=e.textAlign,textBaseline:h=e.textBaseline}=t;if(n>0&&r>0)i.set(0,0,n,r);else{const t=this.getFrameCache(),{width:e,height:o}=t.getActualSize();let h=n||e||0,l=r||o||0;l="number"==typeof a&&l>a?a:l||0,h="number"==typeof s&&h>s?s:h||0,i.set(0,0,h,l)}let l=0;switch(h){case"top":l=0;break;case"middle":l=-i.height()/2;break;case"bottom":l=-i.height()}let c=0;switch(o){case"left":c=0;break;case"center":c=-i.width()/2;break;case"right":c=-i.width()}return i.translate(c,l),mn.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||mn.graphicService.updateHTMLTextAABBBounds(t,e,i),mn.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,$d)}needUpdateTag(t){return super.needUpdateTag(t,$d)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e<t.lines.length;e++){const i=t.lines[e];for(let t=0;t<i.paragraphs.length;t++){const e=i.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:n,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:h,fillOpacity:l,strokeOpacity:c}=this.attribute;return Object.assign({fill:e,stroke:i,fontSize:n,fontFamily:r,fontStyle:s,fontWeight:a,lineWidth:o,opacity:h,fillOpacity:l,strokeOpacity:c},t)}doUpdateFrameCache(t){var e;const{textConfig:i=[],maxWidth:n,maxHeight:r,width:s,height:a,ellipsis:o,wordBreak:h,verticalDirection:l,textAlign:c,textBaseline:u,layoutDirection:d,singleLine:p,disableAutoWrapLine:f}=this.attribute,g=[],v=null!=t?t:i;for(let t=0;t<v.length;t++)if("image"in v[t]){const e=this.combinedStyleToCharacter(v[t]);e.lineWidth=void 0;const i=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(i)g.push(i);else{const t=new Vd(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,g.push(t)}}else{const e=this.combinedStyleToCharacter(v[t]);if(ht(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const t=e.text.split("\n");for(let i=0;i<t.length;i++)g.push(new Gd(t[i],0!==i,e))}else e.text&&g.push(new Gd(e.text,!1,e))}const m="number"==typeof n&&Number.isFinite(n)&&n>0,y="number"==typeof r&&Number.isFinite(r)&&r>0,b="number"==typeof s&&Number.isFinite(s)&&s>0&&(!m||s<=n),x="number"==typeof a&&Number.isFinite(a)&&a>0&&(!y||a<=r),w=new Nd(0,0,(b?s:m?n:0)||0,(x?a:y?r:0)||0,o,h,l,c,u,d||"horizontal",!b&&m,!x&&y,p||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),S=new Xd(w);if(f){let t=0,e=!1;for(let i=0;i<g.length;i++){const n=g[i];e?(n.overflow=!0,n.left=1/0,n.top=1/0,!n.newLine&&w.lines[w.lines.length-1].paragraphs.push(n)):S.deal(n,!0),w.lines.length!==t&&(t=w.lines.length,S.lineBuffer.length=0,n.overflow=!0,n.left=1e3,n.top=1e3,w.lines[w.lines.length-1].paragraphs.push(n),e=!0),n.newLine&&(e=!1,S.lineWidth=0),S.send()}}else for(let t=0;t<g.length;t++)S.deal(g[t]);if(S.send(),!("horizontal"===w.layoutDirection?b:x)){const t=w.getActualSizeWidthEllipsis();let e="horizontal"===w.layoutDirection?t.width:t.height;("horizontal"===w.layoutDirection?m:y)&&(e=Math.min(e,"horizontal"===w.layoutDirection?n:r)),w.lines.forEach((function(t){t.calcOffset(e,!1)}))}this._frameCache=w}clone(){return new qd(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?this.setAttribute("hoverIconId",e.richtextId):!e&&this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0)}))}updateHoverIconState(t){var e,i,n,r,s;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(t.attribute.cursor),null===(n=this.stage)||void 0===n||n.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(r=this.stage)||void 0===r||r.setCursor(),null===(s=this.stage)||void 0===s||s.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:n}=this.globalTransMatrix;let r;return e.icons.forEach(((e,s)=>{var a,o;const h=e.AABBBounds.clone();h.translate(e._marginArray[3],e._marginArray[0]),h.containsPoint({x:t.x-i,y:t.y-n})&&(r=e,r.globalX=(null!==(a=r.attribute.x)&&void 0!==a?a:0)+i+e._marginArray[3],r.globalY=(null!==(o=r.attribute.y)&&void 0!==o?o:0)+n+e._marginArray[0])})),r}getNoWorkAnimateAttr(){return qd.NOWORK_ANIMATE_ATTR}}function Kd(t){return new qd(t)}qd.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Ia);const Zd=["path","customPath",...Ra];class Jd extends La{constructor(t){super(t),this.type="path",this.numberType=po}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof Ni?e.path:(J(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Ni?this.cache:t.path)}getGraphicTheme(){return Or(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:n,tb2:r}=mn.graphicService.updateTempAABBBounds(i);hu(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:s=e.lineJoin}=t;return mn.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;st(t.path,!0)?this.cache=(new Ni).fromString(t.path):t.customPath&&(this.cache=new Ni,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,Zd)}needUpdateTag(t){return super.needUpdateTag(t,Zd)}toCustomPath(){return(new Ni).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new Jd(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Jd.NOWORK_ANIMATE_ATTR}}function Qd(t){return new Jd(t)}Jd.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Ia);const tp=["segments","points","curveType","curveTension",...Ra];class ep extends La{constructor(t){super(t),this.type="area",this.numberType=ao}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return Or(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),mn.graphicService.updateTempAABBBounds(i);const{lineJoin:n=e.lineJoin}=t;return mn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updateAreaAABBBoundsByPoints(t,e,i,n){const{points:r=e.points}=t,s=i;return r.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),s}updateAreaAABBBoundsBySegments(t,e,i,n){const{segments:r=e.segments}=t,s=i;return r.forEach((t=>{t.points.forEach((t=>{var e,i;s.add(t.x,t.y),s.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),s}_interpolate(t,e,i,n,r){"points"===t&&(r.points=bs(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,tp)}needUpdateTag(t){return super.needUpdateTag(t,tp)}toCustomPath(){const t=new Ni,e=this.attribute,i=e.segments,n=e=>{if(e&&e.length){let i=!0;const n=[];if(e.forEach((e=>{var r,s;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),n.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(s=e.y1)&&void 0!==s?s:e.y}),i=!1)})),n.length){for(let e=n.length-1;e>=0;e--)t.lineTo(n[e].x,n[e].y);t.closePath()}}};return e.points?n(e.points):i&&i.length&&i.forEach((t=>{n(t.points)})),t}clone(){return new ep(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ep.NOWORK_ANIMATE_ATTR}}function ip(t){return new ep(t)}ep.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Ia);const np=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...Ra];class rp extends La{constructor(t){super(t),this.type="arc",this.numberType=ro}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:n}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(n)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:n=t.outerPadding}=this.attribute;let{outerRadius:r=t.outerRadius,innerRadius:s=t.innerRadius}=this.attribute;if(r+=n,s-=i,0===e||"0%"===e)return 0;const a=Math.abs(r-s),o=t=>Math.min(ht(t,!0)?t:a*parseFloat(t)/100,a/2);if(at(e)){const t=e.map((t=>o(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:n=t.cap}=this.attribute,r=i-e>=0?1:-1,s=i-e;if(e=Yt(e),i=e+s,n&&Et(s)<Mt-_t){let s=1,a=1;n.length&&(s=Number(n[0]),a=Number(n[1]));let{outerRadius:o=t.outerRadius,innerRadius:h=t.innerRadius}=this.attribute;const{outerPadding:l=t.outerPadding,innerPadding:c=t.innerPadding}=this.attribute;o+=l,h-=c;const u=Math.abs(o-h)/2,d=u/o;if(u>_t&&o>_t)return{startAngle:e-r*d*s,endAngle:i+r*d*a,sc:r*d*s,ec:r*d*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:n=i.innerPadding,outerPadding:r=i.outerPadding,padAngle:s=i.padAngle}=this.attribute;let{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=this.attribute;a+=r,o-=n;const{padRadius:h=jt(a*a+o*o)}=this.attribute,l=Et(e-t);let c=t,u=e,d=t,p=e;const f=s/2;let g=l,v=l;if(f>_t&&h>_t){const i=e>t?1:-1;let n=Wt(Number(h)/o*Dt(f)),r=Wt(Number(h)/a*Dt(f));return(g-=2*n)>_t?(n*=i,d+=n,p-=n):(g=0,d=p=(t+e)/2),(v-=2*r)>_t?(r*=i,c+=r,u-=r):(v=0,c=u=(t+e)/2),{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:g,outerDeltaAngle:v}}return{outerStartAngle:c,outerEndAngle:u,innerStartAngle:d,innerEndAngle:p,innerDeltaAngle:g,outerDeltaAngle:v}}getGraphicTheme(){return Or(this).arc}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:r,tb2:s}=mn.graphicService.updateTempAABBBounds(i);hu(t,e,r),i.union(r),r.setValue(s.x1,s.y1,s.x2,s.y2);const{lineJoin:a=e.lineJoin}=t;return mn.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:n=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:a=e.innerPadding}=t;return n+=s,r-=a,n<r&&(n=r),i.set(-n,-n,n,n),i}updateArcAABBBoundsAccurate(t,e,i){let{outerRadius:n=e.outerRadius,innerRadius:r=e.innerRadius}=t;const{outerPadding:s=e.outerPadding,innerPadding:a=e.innerPadding}=t;if(n+=s,r-=a,n<r){const t=n;n=r,r=t}let{endAngle:o=e.endAngle,startAngle:h=e.startAngle}=t;if(h>o){const t=h;h=o,o=t}return n<=_t?i.set(0,0,0,0):Math.abs(o-h)>Mt-_t?i.set(-n,-n,n,n):(vs(h,o,n,i),vs(h,o,r,i)),i}needUpdateTags(t){return super.needUpdateTags(t,np)}needUpdateTag(t){return super.needUpdateTag(t,np)}toCustomPath(){var t,e,i,n;const r=this.attribute,{startAngle:s,endAngle:a}=this.getParsedAngle();let o=(null!==(t=r.innerRadius)&&void 0!==t?t:0)-(null!==(e=r.innerPadding)&&void 0!==e?e:0),h=(null!==(i=r.outerRadius)&&void 0!==i?i:0)-(null!==(n=r.outerPadding)&&void 0!==n?n:0);const l=Et(a-s),c=a>s;if(h<o){const t=h;h=o,o=t}const u=new Ni;if(h<=_t)u.moveTo(0,0);else if(l>=Mt-_t)u.moveTo(0+h*Ot(s),0+h*Dt(s)),u.arc(0,0,h,s,a,!c),o>_t&&(u.moveTo(0+o*Ot(a),0+o*Dt(a)),u.arc(0,0,o,a,s,c));else{const t=h*Ot(s),e=h*Dt(s),i=o*Ot(a),n=o*Dt(a);u.moveTo(0+t,0+e),u.arc(0,0,h,s,a,!c),u.lineTo(0+i,0+n),u.arc(0,0,o,a,s,c),u.closePath()}return u}clone(){return new rp(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return rp.NOWORK_ANIMATE_ATTR}}function sp(t){return new rp(t)}rp.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Ia);class ap extends rp{constructor(t){super(t),this.type="arc3d",this.numberType=so}updateAABBBounds(t,e,i){const n=this.stage;if(!n||!n.camera)return i;const{outerRadius:r=e.outerRadius,height:s=0}=t,a=r+s;return i.setValue(-a,-a,a,a),mn.graphicService.updateTempAABBBounds(i),mn.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return ap.NOWORK_ANIMATE_ATTR}}function op(t){return new ap(t)}ap.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Ia);const hp=["points","cornerRadius",...Ra];class lp extends La{constructor(t){super(t),this.type="polygon",this.numberType=fo}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Or(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),mn.graphicService.updateTempAABBBounds(i);const{lineJoin:n=e.lineJoin}=t;return mn.graphicService.transformAABBBounds(t,i,e,"miter"===n,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:n=e.points}=t;return n.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,n,r){"points"===t&&(r.points=bs(i,n,e))}needUpdateTags(t){return super.needUpdateTags(t,hp)}needUpdateTag(t){return super.needUpdateTag(t,hp)}toCustomPath(){const t=this.attribute.points,e=new Ni;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new lp(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return lp.NOWORK_ANIMATE_ATTR}}function cp(t){return new lp(t)}lp.NOWORK_ANIMATE_ATTR=Ia;class up extends lp{constructor(t){super(t),this.type="pyramid3d",this.numberType=go}updateAABBBounds(t,e,i){const n=this.stage;return n&&n.camera?(this.findFace().vertices.forEach((t=>{const e=t[0],n=t[1];i.add(e,n)})),mn.graphicService.updateTempAABBBounds(i),mn.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const n=3===i?t[0]:t[i+1],r=e.x-n.x;return 0===r?0:(e.y-n.y)/r})),i=t.map((t=>({p:t,d:0})));let n=!1,r=0;for(let t=0;t<e.length-1;t++){for(let s=t+1;s<e.length;s++){if(e[t]===e[s]){n=!0;const e=Ht.distancePP(i[t].p,i[t+1].p);i[t].d=e,i[t+1].d=e,r=It(r,e);const a=Ht.distancePP(i[s].p,i[s+1].p);i[s].d=a,i[s+1].d=a,r=It(r,a)}if(n)break}if(n)break}for(let e=t.length-1;e>=0;e--){const n=t[e];i.unshift({p:n,d:0})}for(let e=0;e<t.length;e++){const n=(r-i[e+t.length].d)/2;i[e].d+=n,i[e+t.length].d+=n}const s={polygons:[],vertices:[],edges:[]};return i.forEach((t=>{s.vertices.push([t.p.x,t.p.y,t.d])})),s.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),s.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),s.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),s.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),s.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),s.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),s.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],s}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return up.NOWORK_ANIMATE_ATTR}}function dp(t){return new up(t)}up.NOWORK_ANIMATE_ATTR=Ia;class pp extends Po{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}clearUpdateBoundTag(){super.clearUpdateBoundTag(),this.shadowHost&&this.shadowHost.clearUpdateBoundTag()}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function fp(t){return new pp(t)}var gp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};const vp=Symbol.for("PickItemInterceptor");t.ShadowRootPickItemInterceptorContribution=class{constructor(){this.order=1}afterPickItem(t,e,i,n,r){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,r):null}beforePickItem(t,e,i,n,r){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,r):null}_pickItem(t,e,i,n,r){var s;if(!t.shadowRoot)return null;const{parentMatrix:a}=r||{};if(!a)return null;const o=e.pickContext;o.highPerformanceSave();const h=null===(s=Or(t))||void 0===s?void 0:s[t.type],{shadowPickMode:l=(null==h?void 0:h.shadowPickMode)}=t.attribute,c=t.shadowRoot,u=Ih.allocateByObj(a),d=new zt(u.a*i.x+u.c*i.y+u.e,u.b*i.x+u.d*i.y+u.f),p=e.pickGroup(c,d,u,n);return o.highPerformanceRestore(),!p.graphic&&p.group&&"full"===l&&(p.graphic=p.group),p}},t.ShadowRootPickItemInterceptorContribution=gp([g()],t.ShadowRootPickItemInterceptorContribution),t.InteractivePickItemInterceptorContribution=class{constructor(){this.order=1}beforePickItem(t,e,i,n,r){const s=t.baseGraphic;if(s&&s.parent){const t=new zt(i.x,i.y),r=e.pickContext;r.highPerformanceSave();const a=s.parent.globalTransMatrix;a.transformPoint(t,t);const o=s.isContainer?e.pickGroup(s,t.clone(),a,n):e.pickItem(s,t.clone(),a,n);return r.highPerformanceRestore(),o}return null}},t.InteractivePickItemInterceptorContribution=gp([g()],t.InteractivePickItemInterceptorContribution),t.Canvas3DPickItemInterceptor=class{constructor(){this.order=1}beforePickItem(t,e,i,n,r){if(!t.in3dMode||n.in3dInterceptor)return null;const s=e.pickContext,a=t.stage;if(!s||!a)return null;if(n.in3dInterceptor=!0,s.save(),this.initCanvasCtx(s),s.camera=a.camera,t.isContainer){const a=Fc(s,t,(()=>e.pickGroup(t,i,r.parentMatrix,n)),n);return s.camera=null,n.in3dInterceptor=!1,s.restore(),a}return s.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}},t.Canvas3DPickItemInterceptor=gp([g()],t.Canvas3DPickItemInterceptor);var mp=new i(((e,i,n)=>{n(su)||(e(ou).toSelf(),e(su).toService(ou)),e(t.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(),e(vp).toService(t.Canvas3DPickItemInterceptor),e(t.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(),e(vp).toService(t.ShadowRootPickItemInterceptorContribution),e(t.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(),e(vp).toService(t.InteractivePickItemInterceptorContribution),I(e,vp)})),yp=new i((e=>{e(wo).to(t.DefaultGraphicService).inSingletonScope(),e(So).toConstantValue(Jl)}));const bp=Symbol.for("AutoEnablePlugins"),xp=Symbol.for("PluginService");var wp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Sp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ap=function(t,e){return function(i,n){e(i,n,t)}};let Tp=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&jn.isBound(bp)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}unRegister(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}release(){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};Tp=wp([g(),Ap(0,p(k)),Ap(0,v(bp)),Sp("design:paramtypes",[Object])],Tp);var Cp=new i((t=>{t(xp).to(Tp),L(t,bp)})),_p=new i((t=>{I(t,U)})),Bp=new i((e=>{e(Dn).to(t.DefaultTextMeasureContribution).inSingletonScope(),I(e,Dn)})),Pp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Rp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Mp=class{constructor(){this.type="static",this.offscreen=!1,this.global=mn.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,i.canvasId&&(t=this.global.getElementById(i.canvasId)),t||(t=this.global.createCanvas({width:e.width,height:e.height})),t.style&&(t.style["pointer-events"]="none");const n=e.getContext().getCanvas().nativeCanvas,r=Nn({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:n.offsetLeft,y:n.offsetTop});r.applyPosition(),this.canvas=r,this.context=r.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var n;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(n=e.background)&&void 0!==n?n:"#ffffff"},e),i))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){var n;const r=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:r},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};Mp=Pp([g(),Rp("design:paramtypes",[])],Mp);var Ep=new i((t=>{t(Mp).toSelf(),t(Io).toService(Mp)}));var kp=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};function Op(t,e,i){const n={},r=[];return t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;n[i]?n[i].push(t):(n[i]=[t],r.push(i))}),i),r.sort(((t,e)=>i?e-t:t-e)),{childMap:n,zIdxArray:r}}function Ip(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],s=!1;if(r)s=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:r=e}=t.attribute;if(0===n)i=r;else if(i!==r)return s=!0,!0;return!1}),n)}if(s){const{childMap:s,zIdxArray:a}=Op(t,e,n);let o=!1;for(let t=0;t<a.length&&!o;t++){const e=s[a[t]];r&&e.sort(((t,e)=>{var i,r;return(n?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(r=t.attribute.z)&&void 0!==r?r:0))}));for(let t=0;t<e.length;t++)if(i(e[t],t)){o=!0;break}}}else t.forEachChildren(i,n)}function Lp(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return kp(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,n)}))}function Dp(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(void 0!==n)return r=!0,!0;return!1}),n);let s=null,a=!1;if(r){const{childMap:r,zIdxArray:o}=Op(t,i,n);let h=!1;for(let t=0;t<o.length&&!h;t++){const i=r[o[t]];for(let t=0;t<i.length;t++){if(a){h=!0,s=i[t];break}i[t]._uid!==e||(a=!0)}}}else t.forEachChildren((t=>a?(s=t,!0):(t._uid===e&&(a=!0),!1)),n);return s}var jp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Up=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wp=function(t,e){return function(i,n){e(i,n,t)}};let Np=class{constructor(t,e){this.contributions=t,this.drawItemInterceptorContributions=e,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new he,this.backupDirtyBounds=new he,this.global=mn.global,this.layerService=mn.layerService,at(this.contributions)||(this.contributions=[this.contributions]),this.init()}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}prepareForDraw(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(t,e){this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:n,viewBox:r,transMatrix:s}=e;if(!i)return;const a=this.dirtyBounds.setValue(0,0,r.width(),r.height());if(n.dirtyBounds&&!n.dirtyBounds.empty()){const t=function(t,e,i){if(null===t)return e;if(null===e)return t;const{x11:n,x12:r,y11:s,y12:a,x21:o,x22:h,y21:l,y22:c}=Zt(t,e,i);return n>=h||r<=o||s>=c||a<=l?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(n,o),y1:Math.max(s,l),x2:Math.min(r,h),y2:Math.min(a,c)}}(a,n.dirtyBounds,!1);a.x1=Math.floor(t.x1),a.y1=Math.floor(t.y1),a.x2=Math.ceil(t.x2),a.y2=Math.ceil(t.y2)}const o=i.dpr%1;(o||.5!==o)&&(a.x1=Math.floor(a.x1*i.dpr)/i.dpr,a.y1=Math.floor(a.y1*i.dpr)/i.dpr,a.x2=Math.ceil(a.x2*i.dpr)/i.dpr,a.y2=Math.ceil(a.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(a),i.inuse=!0,i.setClearMatrix(s.a,s.b,s.c,s.d,s.e,s.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(r.x1,r.y1,!0),i.beginPath(),i.rect(a.x1,a.y1,a.width(),a.height()),i.clip(),n.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Qi.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Qi.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,e,Ih.allocate(1,0,0,1,0,0)):this.renderItem(t,e)})),i.restore(),i.setClearMatrix(1,0,0,1,0,0),i.inuse=!1,i.draw()}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=Dp(e,i,Qi.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i,n){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(this.useDirtyBounds&&!Jt(t.AABBBounds,this.dirtyBounds,!1))return;let r,s=i;if(this.useDirtyBounds){r=Zl.allocateByObj(this.dirtyBounds);const e=t.transMatrix;s=Ih.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(s.getInverse())}this.renderItem(t,e,{drawingCb:()=>{var i;n?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e,s):this.renderItem(t,e))})):Ip(t,Qi.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e,s):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(r),Zl.free(r),Ih.free(s))}_increaseRender(t,e){const{layer:i,stage:n}=e,{subLayers:r}=i;let s=r.get(t._uid);s||(s={layer:this.layerService.createLayer(n),zIndex:r.size,group:t},r.set(t._uid,s));const a=s.layer.getNativeHandler().getContext(),o=s.drawContribution||jn.get(Sc);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:s.layer,context:a,startAtId:t._uid,break:!1})),s.drawContribution=o;const h=this._findNextGraphic(t);if(h)if(h.isContainer&&h.incremental)this._increaseRender(h,e);else{let t=r.get(h._uid);t||(t={layer:this.layerService.createLayer(n),zIndex:r.size},r.set(h._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:t.layer,context:i,startAtId:h._uid,break:!1}))}}getRenderContribution(t){let e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforeDrawItem&&r.beforeDrawItem(t,this.currentRenderService,e,this,i))return}const n=this.getRenderContribution(t);if(!n)return;let r,s=this.scrollMatrix&&(0!==this.scrollMatrix.e||0!==this.scrollMatrix.f);if(t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;(e||i)&&(s=!0,this.scrollMatrix||(this.scrollMatrix=Ih.allocate(1,0,0,1,0,0)),this.scrollMatrix.translate(-e,-i))}if(s&&(r=this.dirtyBounds.clone().transformWithMatrix(this.scrollMatrix)),this.useDirtyBounds&&!t.isContainer&&!Jt(t.AABBBounds,null!=r?r:this.dirtyBounds,!1)){if(s&&t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;this.scrollMatrix&&this.scrollMatrix.translate(e,i)}return}const a=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=a),a?t.isContainer&&n.draw(t,this.currentRenderService,e,i):n.draw(t,this.currentRenderService,e,i),s&&t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;this.scrollMatrix&&this.scrollMatrix.translate(e,i)}if(this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const n=this.InterceptorContributions[i];if(n.afterDrawItem&&n.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return wt.getInstance().warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t,e){let i;if(e.attribute.renderStyle){const n=this.styleRenderMap.get(e.attribute.renderStyle);i=n&&n.get(t)}return i||this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){var n,r;const{clear:s,viewBox:a}=i,o=a.width(),h=a.height();if(s){e.clearRect(0,0,o,h);const i=null===(n=t.drawParams)||void 0===n?void 0:n.stage;if(i&&(e.globalAlpha=null!==(r=i.attribute.opacity)&&void 0!==r?r:1),i&&i.backgroundImg&&i.resources){const t=i.resources.get(s);t&&"success"===t.state&&t.data&&e.drawImage(t.data,0,0,o,h)}else e.fillStyle=wn(e,s,{AABBBounds:{x1:0,y1:0,x2:0+o,y2:0+h}},0,0),e.fillRect(0,0,o,h)}}afterDraw(t,e){}};Np=jp([g(),Wp(0,f(Bc)),Wp(1,p(k)),Wp(1,v(Vc)),Up("design:paramtypes",[Array,Object])],Np);var Gp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Fp=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.numberType=uo}drawShape(t,e,i,n,r,s,a,o){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:e,length:s}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(e>h.length)return;const l=Or(t).line,{fill:c=l.fill,stroke:u=l.stroke,opacity:d=l.opacity,fillOpacity:p=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,lineWidth:g=l.lineWidth,visible:v=l.visible}=t.attribute,m=zo(d,p,c),y=Vo(d,f),b=Go(c),x=Fo(u,g);if(!t.valid||!v)return;if(!b&&!x)return;if(!(m||y||a||o))return;const{context:w}=r;for(let r=e;r<e+s;r++)this.drawIncreaseSegment(t,w,h[r-1],h[r],t.attribute.segments[r],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,a,o)}drawIncreaseSegment(t,e,i,n,r,s,a,o){n&&(e.beginPath(),Ml(e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,s),e.setStrokeStyle(t,r,a,o,s),e.stroke())}};Fp=Gp([g()],Fp);var zp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Hp=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.numberType=ao}drawShape(t,e,i,n,r,s,a){if(t.incremental&&r.multiGraphicOptions){const{startAtIdx:s,length:o}=r.multiGraphicOptions,{segments:h=[]}=t.attribute;if(s>h.length)return;const l=Or(t).area,{fill:c=l.fill,fillOpacity:u=l.fillOpacity,opacity:d=l.opacity,visible:p=l.visible}=t.attribute,f=zo(d,u,c),g=Go(c);if(!t.valid||!p)return;if(!g)return;if(!f&&!a)return;for(let r=s;r<s+o;r++)this.drawIncreaseSegment(t,e,h[r-1],h[r],t.attribute.segments[r],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,r,s,a)}drawIncreaseSegment(t,e,i,n,r,s,a,o){n&&(e.beginPath(),El(e.camera?e:e.nativeContext,i,n,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,r,s),e.setCommonStyle(t,r,a,o,s),e.fill())}};Hp=zp([g()],Hp);var Vp,Yp=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Xp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$p=function(t,e){return function(i,n){e(i,n,t)}},qp=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(Vp||(Vp={}));let Kp=class extends Np{constructor(t,e,i,n){super(t,n),this.contributions=t,this.lineRender=e,this.areaRender=i,this.drawItemInterceptorContributions=n,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=Vp.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new j([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return qp(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:n,viewBox:r}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(r.x1,r.y1,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Qi.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Qi.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{n.restore(),n.restore(),n.draw(),n.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return qp(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return qp(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>qp(this,void 0,void 0,(function*(){if(2!==t.count)yield Lp(t,Qi.zIndex,((i,n)=>{if(this.status===Vp.STOP)return!0;if(i.isContainer)return!1;if(n<this.currentIdx)return!1;const r=this.currFrameStartAt+t.incremental;return n<r&&(this.currentIdx=n+1,this.renderItem(i,e)),n===r-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),i(!1);else{const n=t.getChildAt(0);if(n.incremental&&n.attribute.segments)for(n.incrementalAt||(n.incrementalAt=0);n.incrementalAt<n.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:n.incrementalAt,length:n.incremental},this.renderItem(n,e),n.incrementalAt+=n.incremental,yield this.waitToNextFrame();else this.renderItem(n,e);i(!1)}}))})})),this.hooks.completeDraw.call()}))}waitToNextFrame(){return qp(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return qp(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return qp(this,void 0,void 0,(function*(){this.rendering&&(this.status=Vp.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=Vp.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return qp(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>qp(this,void 0,void 0,(function*(){yield Lp(t,Qi.zIndex,(t=>qp(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};Kp=Yp([g(),$p(0,f(Bc)),$p(1,p(Fp)),$p(2,p(Hp)),$p(3,p(k)),$p(3,v(Vc)),Xp("design:paramtypes",[Array,Object,Object,Object])],Kp);var Zp=new i((e=>{e(Yh).toSelf().inSingletonScope(),e($h).toSelf().inSingletonScope(),e(Gc).to(Np),e(Sc).to(Kp),e(Pc).to(t.DefaultCanvasGroupRender).inSingletonScope(),e(Bc).toService(Pc),I(e,ah),e(t.DefaultBaseInteractiveRenderContribution).toSelf().inSingletonScope(),I(e,fh),I(e,Bc),e(t.CommonDrawItemInterceptorContribution).toSelf().inSingletonScope(),e(Vc).toService(t.CommonDrawItemInterceptorContribution),I(e,Vc)}));function Jp(){Jp.__loaded||(Jp.__loaded=!0,jn.load(No),jn.load(yp),jn.load(nu),jn.load(mp),jn.load(Cp),function(t){t.load(_p),t.load(Bp),t.load(Ep)}(jn),function(t){t.load(Zp)}(jn))}Jp.__loaded=!1,Jp();const Qp=jn.get(W);mn.global=Qp;const tf=jn.get(ko);mn.graphicUtil=tf;const ef=jn.get(Eo);mn.transformUtil=ef;const nf=jn.get(wo);mn.graphicService=nf;const rf=jn.get(Oo);mn.layerService=rf;class sf{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.handleChange=t=>{t.glyphHost&&(t=t.glyphHost),t.stage===this.pluginService.stage&&null!=t.stage&&t.stage.renderNextFrame()}}activate(t){this.pluginService=t,mn.graphicService.hooks.onAttributeUpdate.tap(this.key,this.handleChange),mn.graphicService.hooks.onSetStage.tap(this.key,this.handleChange),mn.graphicService.hooks.onRemove.tap(this.key,this.handleChange)}deactivate(t){const e=t=>t.filter((t=>t.name!==this.key));mn.graphicService.hooks.onAttributeUpdate.taps=e(mn.graphicService.hooks.onAttributeUpdate.taps),mn.graphicService.hooks.onSetStage.taps=e(mn.graphicService.hooks.onSetStage.taps),mn.graphicService.hooks.onRemove.taps=e(mn.graphicService.hooks.onRemove.taps)}}class af{constructor(){this.name="AutoRefreshPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.handleChange=t=>{t.glyphHost&&(t=t.glyphHost),t.stage===this.pluginService.stage&&null!=t.stage&&t.stage.renderNextFrame()}}activate(t){this.pluginService=t,this.dpr=mn.global.devicePixelRatio,this.refresh()}refresh(){this._refreshByMediaQuery()||this._refreshByRaf()}_refreshByRaf(){const t=mn.global.getRequestAnimationFrame();this.rafId=t((()=>{mn.global.devicePixelRatio!==this.dpr&&(this.dpr=mn.global.devicePixelRatio,this.pluginService.stage.setDpr(this.dpr,!0)),this.refresh()}))}_refreshByMediaQuery(){try{const t=`(resolution: ${window.devicePixelRatio}dppx)`,e=()=>{window.devicePixelRatio!==this.dpr&&(this.dpr=window.devicePixelRatio,this.pluginService.stage.setDpr(this.dpr,!0))};matchMedia(t).addEventListener("change",e)}catch(t){return!1}return!0}deactivate(t){const e=mn.global.getCancelAnimationFrame();e&&this.rafId&&e(this.rafId)}}class of{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,mn.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,n)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),mn.graphicService.hooks.onClearIncremental.tap(this.key,((e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))}))}deactivate(t){mn.graphicService.hooks.onAddIncremental.taps=mn.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.onClearIncremental.taps=mn.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,mn.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const n=e.layer.subLayers.get(e._uid);n&&n.drawContribution&&n.drawContribution.draw(t.renderService,Object.assign({stage:t,layer:i,viewBox:t.window.getViewBox(),transMatrix:t.window.getViewBoxTransform(),clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:n.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}const hf=new le;class lf{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),mn.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(hf.setValue(n.x1,n.y1,n.x2,n.y2),e.dirty(hf,t.parent&&t.parent.globalTransMatrix)))})),mn.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!r||e.dirty(n.globalAABBBounds))})),mn.graphicService.hooks.clearAABBBounds.tap(this.key,((t,e,i)=>{e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(i)})),mn.graphicService.hooks.onRemove.tap(this.key,(t=>{const e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){mn.graphicService.hooks.beforeUpdateAABBBounds.taps=mn.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.afterUpdateAABBBounds.taps=mn.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.clearAABBBounds.taps=mn.graphicService.hooks.clearAABBBounds.taps.filter((t=>t.name!==this.key)),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.onRemove.taps=mn.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}const cf=new Zr;let uf;function df(){if(null==uf)try{const t=document.createElement("canvas"),e=t.getContext("2d");uf=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),uf&&(uf=!!document.createElement)}catch(t){uf=!1}}function pf(){df();const t=mn.global&&mn.global.env;return t?"browser"===t:uf}function ff(){df();const t=mn.global&&mn.global.env;return t?"node"===t:!uf}cf.addTimeline(es),cf.setFPS(60);class gf{static registerPlugin(t,e){gf._pluginClasses[t]=e}static getPlugin(t){return gf._pluginClasses[t]}}gf._pluginClasses={};const vf="white";class mf extends Po{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){const e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){const e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this.window.getViewBox().width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this.window.getViewBox().height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return null!==(t=this._background)&&void 0!==t?t:vf}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super({}),this.tickedBeforeRender=!0,this._onVisibleChange=t=>{if(!(this._skipRender<0))if(t){if(this.dirtyBounds){const t=this.window.getViewBox();this.dirtyBounds.setValue(t.x1,t.y1,t.width(),t.height())}this._skipRender>1&&this.renderNextFrame(),this._skipRender=0}else this._skipRender=1},this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null,this.tickedBeforeRender=!1},this.afterTickCb=()=>{var t;this.tickedBeforeRender=!0,"performance"===(null===(t=this.params.optimize)||void 0===t?void 0:t.tickRenderMode)||"rendering"!==this.state&&this.render()},this.params=t,this.theme=new Er,this.hooks={beforeRender:new j(["stage"]),afterRender:new j(["stage"])},this.global=mn.global,!this.global.env&&pf()&&this.global.setEnv("browser"),this.window=jn.get(br),this.renderService=jn.get(eu),this.pluginService=jn.get(xp),this.layerService=jn.get(Oo),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,viewBox:t.viewBox,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._background=null!==(e=t.background)&&void 0!==e?e:vf,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),t.autoRefresh&&this.enableAutoRefresh(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.ReactDOM&&this.enableReactAttribute(t.ReactDOM),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||cf,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new ts,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&st(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background}),this.ticker.on("afterTick",this.afterTickCb)}pauseRender(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this._skipRender=t}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new Xr(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}preventRender(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:n=0,beta:r=0,camera:s,fieldRatio:a=1,fieldDepth:o}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:n,beta:r,camera:s,fieldRatio:a,fieldDepth:o})}set3dOptions(t){var e,i,n,r,s,a;this.option3d=t;const o=this.get3dOptions(t),{light:h,center:l,camera:c,alpha:u,beta:d,fieldRatio:p,fieldDepth:f}=o,{dir:g=[1,1,-1],color:v="white",ambient:m}=h,y=(null!==(e=l.x)&&void 0!==e?e:this.width/2)+(null!==(i=l.dx)&&void 0!==i?i:0),b=(null!==(n=l.y)&&void 0!==n?n:this.height/2)+(null!==(r=l.dy)&&void 0!==r?r:0),x=[y,b,(null!==(s=l.z)&&void 0!==s?s:0)+(null!==(a=l.dz)&&void 0!==a?a:0)];let w=0,S=0,A=0;c||(w=Math.sin(u)+y,S=Math.sin(d)+b,A=Math.cos(u)*Math.cos(d)*1);const T=gf.getPlugin("DirectionalLight");T&&(this.light=new T(g,v,m));const C={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:f,viewParams:{pos:[w,S,A],center:x,up:[0,1,0]}};if(this.camera)this.camera.params=C;else{const t=gf.getPlugin("OrthoCamera");t&&(this.camera=new t(C))}t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){if(this.view3dTranform)return;this.view3dTranform=!0;const t=gf.getPlugin("ViewTransform3dPlugin");t&&this.pluginService.register(new t)}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new sf))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRefresh(){this.autoRefresh||(this.autoRefresh=!0,this.pluginService.register(new af))}disableAutoRefresh(){this.autoRefresh&&(this.autoRefresh=!1,this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new of))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new he;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new lf,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableLayout(){if(this._enableLayout)return;this._enableLayout=!0;const t=gf.getPlugin("FlexLayoutPlugin");t&&this.pluginService.register(new t)}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableHtmlAttribute(t){if(this.htmlAttribute)return;const e=gf.getPlugin("HtmlAttributePlugin");e&&(this.htmlAttribute=t,this.pluginService.register(new e))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableReactAttribute(t){if(this.reactAttribute)return;const e=gf.getPlugin("ReactAttributePlugin");e&&(this.reactAttribute=t,this.pluginService.register(new e))}disableReactAttribute(){this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}getPluginsByName(t){return this.pluginService.findPluginsByName(t)}tryUpdateAABBBounds(){const t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){if("released"===this.releaseStatus)return;const i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){"released"!==this.releaseStatus&&this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(t)}render(t,e){if("released"===this.releaseStatus)return;this.ticker.start(),this.timeline.resume();const i=this.state;this.state="rendering",this.tickedBeforeRender||this.ticker.trySyncTickStatus(),this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){if("harmony"===this.global.env){const t=this.window.getContext().nativeContext;this.forEachChildren(((e,i)=>{if(i>0){const i=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(i)}}))}}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){if("released"===this.releaseStatus)return;this.timeline.resume(),this.ticker.start();const t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let e=0;e<t.length;e++){let n=t[e];"virtual"===n.layerMode&&(n=n.getNativeHandler().mainHandler.layer),i.includes(n)||i.push(n)}i.forEach((t=>{t.renderCount>this.renderCount||(t.renderCount=this.renderCount+1,t===this.interactiveLayer&&this.dirtyBounds&&this.dirtyBounds.clear(),t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&(this.dirtyBounds&&this.dirtyBounds.clear(),this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))}resizeWindow(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),i&&this.render()}resize(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render())}resizeView(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render())}setViewBox(t,e,i,n,r){let s=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(s=!1)):(this.viewBox.setValue(t,e,t+i,e+n),!1===r&&(s=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),s&&this.render()}setDpr(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){if("released"===this.releaseStatus)return;const i=this.getPickerService().pick(this.children,new zt(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&(this.interactiveLayer.forEachChildren((t=>{t.setStage&&t.setStage(null,null),this.interactiveLayer.removeChild(t)})),this.interactiveLayer.release()),this.window.release(),this.ticker.remTimeline(this.timeline),this.ticker.removeListener("afterTick",this.afterTickCb),this.renderService.renderTreeRoots=[]}setStage(t){}dirty(t,e){"released"!==this.releaseStatus&&(e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t))}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t){"released"!==this.releaseStatus&&this.forEachChildren(((e,i)=>{e.drawTo(t,{renderService:this.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:e===this.defaultLayer?this.background:void 0,clear:0===i,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())})}))}renderToNewWindow(){let t=arguments.length>1?arguments[1]:void 0;if("released"===this.releaseStatus)return;const e=jn.get(br),i=t?-t.x1:0,n=t?-t.y1:0,r=t?t.x2:this.viewWidth,s=t?t.y2:this.viewHeight,a=t?t.width():this.viewWidth,o=t?t.height():this.viewHeight;return e.create({viewBox:{x1:i,y1:n,x2:r,y2:s},width:a,height:o,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e),e}toCanvas(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;if("released"===this.releaseStatus)return;const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}eventPointTransform(t){const e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}pauseTriggerEvent(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}resumeTriggerEvent(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}getPickerService(){return this.pickerService||(this.pickerService=jn.get(su)),this.pickerService}}var yf=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},bf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const xf=new ue(1,0,0,1,0,0),wf={x:0,y:0};t.EmptyContext2d=class{get nativeContext(){return this.path}constructor(t,e){this.matrix=new ue(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new ue(1,0,0,1,0,0),this.path=new Ni,this._clearMatrix=new ue(1,0,0,1,0,0)}getCanvas(){throw new Error("不支持getCanvas")}getContext(){throw new Error("不支持getContext")}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix=this.cloneMatrix(this.matrix))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Ih.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.restore()}restore(){this.stack.length>0&&(Ih.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent())}highPerformanceRestore(){this.stack.length>0&&(Ih.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(o*t,o*e,o*i,o*n,o*r,o*s),a&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,r,s),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.path.clear()}clip(t,e){}arc(t,e,i,n,r,s){this.path.arc(t,e,i,n,r,s)}arcTo(t,e,i,n,r){this.path.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s){this.path.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.path.closePath()}ellipse(t,e,i,n,r,s,a,o){}lineTo(t,e){this.path.lineTo(t,e)}moveTo(t,e){this.path.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this.path.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n){this.path.rect(t,e,i,n)}createImageData(t,e){return null}createLinearGradient(t,e,i,n){throw new Error("不支持createLinearGradient")}createPattern(t,e){throw new Error("不支持createPattern")}createRadialGradient(t,e,i,n,r,s){throw new Error("不支持createRadialGradient")}createConicGradient(t,e,i,n){return null}fill(t,e){}fillRect(t,e,i,n){this.path.rect(t,e,i,n)}clearRect(t,e,i,n){}fillText(t,e,i){}getImageData(t,e,i,n){return null}getLineDash(){return[]}isPointInPath(t,e){return this.matrix.transformPoint({x:t,y:e},wf),function(t,e,i){return fr(t,0,!1,e,i)}(this.path.commandList,wf.x,wf.y)}isPointInStroke(t,e){if(!this.lineWidth)return!1;this.matrix.transformPoint({x:t,y:e},wf);const i=xn(this,this.lineWidth,this.dpr);return function(t,e,i,n){return fr(t,e,!0,i,n)}(this.path.commandList,i,wf.x,wf.y)}measureText(t){throw new Error("不支持measureText")}putImageData(t,e,i){throw new Error("不支持measureText")}setLineDash(t){}stroke(t){}strokeRect(t,e,i,n){this.path.rect(t,e,i,n)}strokeText(t,e,i){}drawImage(){}setCommonStyle(t,e,i,n,r){}_setCommonStyle(t,e,i,n){}setStrokeStyle(t,e,i,n,r){}_setStrokeStyle(t,e,i,n){}setTextStyleWithoutAlignBaseline(t,e){}setTextStyle(t,e){}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(xf,t,e)}setClearMatrix(t,e,i,n,r,s){this._clearMatrix.setValue(t,e,i,n,r,s)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>Ih.free(t))),this.stack.length=0}},t.EmptyContext2d=yf([g(),bf("design:paramtypes",[Object,Number])],t.EmptyContext2d);const Sf={WIDTH:500,HEIGHT:500,DPR:1};class Af{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){var e;const{nativeCanvas:i,width:n=Sf.WIDTH,height:r=Sf.HEIGHT,dpr:s=Sf.DPR,x:a,y:o,id:h,canvasControled:l=!0}=t;this._x=null!=a?a:0,this._y=null!=o?o:0,this._pixelWidth=n*s,this._pixelHeight=r*s,this._visiable=!1!==t.visiable,this.controled=l,this._displayWidth=n,this._displayHeight=r,this._dpr=s,this._nativeCanvas=i,this._id=null!==(e=i.id)&&void 0!==e?e:h,h&&(i.id=h),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,n){return this._context.getImageData(t,e,i,n)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}Af.env="browser";var Tf=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Cf=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};t.BaseEnvContribution=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new le}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}loadFont(t,e,i){return Cf(this,void 0,void 0,(function*(){return{loadState:"fail"}}))}},t.BaseEnvContribution=Tf([g()],t.BaseEnvContribution);var _f=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Bf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};t.BaseWindowHandlerContribution=class{constructor(){this._uid=e.GenAutoIncrementId(),this.viewBox=new le,this.modelMatrix=new ue(1,0,0,1,0,0)}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}setViewBox(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}getViewBox(){return this.viewBox}setViewBoxTransform(t,e,i,n,r,s){this.modelMatrix.setValue(t,e,i,n,r,s)}getViewBoxTransform(){return this.modelMatrix}},t.BaseWindowHandlerContribution=_f([g(),Bf("design:paramtypes",[])],t.BaseWindowHandlerContribution);class Pf{constructor(e,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.dir=e,this.color=i,this.colorRgb=ia.Get(i,t.ColorType.Color1),this.ambient=n;const r=jt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);this.formatedDir=[e[0]/r,e[1]/r,e[2]/r]}computeColor(e,i){const n=this.formatedDir,r=Lt(It((e[0]*n[0]+e[1]*n[1]+e[2]*n[2])*(1-this.ambient/2),0)+this.ambient,1);let s;s=st(i)?ia.Get(i,t.ColorType.Color1):i;const a=this.colorRgb;return`rgb(${a[0]*s[0]*r}, ${a[1]*s[1]*r}, ${a[2]*s[2]*r})`}}const Rf=()=>{gf.registerPlugin("DirectionalLight",Pf)};class Mf{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=Lh.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Lh.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return _h(this._viewMatrixCached,t,e,i),this._vp||(this._vp=Lh.allocate()),this._vp=Ch(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._viewMatrixCached}getProjectionMatrix(){return this._projectionMatrixCached||(this._projectionMatrixCached=Lh.allocate()),this._projectionMatrixCached}forceGetProjectionMatrix(){this._projectionMatrixCached||(this._projectionMatrixCached=Lh.allocate());const{left:t,top:e,right:i,bottom:n}=this._params;return Bh(this._projectionMatrixCached,t,i,n,e,0,-2e6),this._vp||(this._vp=Lh.allocate()),this._vp=Ch(this._vp,this.getProjectionMatrix(),this.getViewMatrix()),this._projectionMatrixCached}getField(){const{fieldRatio:t=.8,fieldDepth:e,left:i,right:n}=this._params;return(null!=e?e:n-i)*t}getProjectionScale(t){const e=this.getField();return e/(e+t)}view(t,e,i){const n=[0,0,0];return Ph(n,[t,e,i],this._viewMatrixCached),n}vp(t,e,i){const n=[0,0,0],{pos:r}=this._params.viewParams;Ph(n,[t,e,i],this._viewMatrixCached),t=n[0],e=n[1],i=n[2];const s=this.getProjectionScale(i);return{x:t*s+r[0],y:e*s+r[1]}}}const Ef=()=>{gf.registerPlugin("OrthoCamera",Mf)};var kf=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Of=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},If=function(t,e){return function(i,n){e(i,n,t)}};t.DefaultPickService=class{constructor(t){this.pickItemInterceptorContributions=t,this.type="default",this.global=mn.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let n={graphic:null,group:null};i.pickerService=this;const r=i.bounds.width(),s=i.bounds.height();if(!(new le).setValue(0,0,r,s).containsPoint(e))return n;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const a=new ue(1,0,0,1,0,0);let o;for(let r=t.length-1;r>=0&&(n=t[r].isContainer?this.pickGroup(t[r],e,a,i):this.pickItem(t[r],e,a,i),!n.graphic);r--)o||(o=n.group);if(n.graphic||(n.group=o),this.pickContext&&(this.pickContext.inuse=!1),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){var n;return!!(null===(n=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===n?void 0:n.graphic)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=n.pickContext,a=s.modelMatrix;if(s.camera){const e=t.transMatrix,i=Lh.allocate();if(Ah(i,e),a){if(i){const t=Lh.allocate();s.modelMatrix=Ch(t,a,i),Lh.free(i)}}else Ah(i,t.globalTransMatrix),s.modelMatrix=i}if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const o=this.InterceptorContributions[r];if(o.beforePickItem){const r=o.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return s.modelMatrix!==a&&Lh.free(s.modelMatrix),s.modelMatrix=a,r}}const o=t.transMatrix,h=Ih.allocateByObj(i),l=new zt(e.x,e.y);h.transformPoint(l,l);const c=t.AABBBounds.containsPoint(l);if(!c&&!t.stage.camera)return r;const u=this.pickItem(t,l.clone(),i,n);u&&u.graphic&&(r.graphic=u.graphic,r.params=u.params);const d=!1!==t.attribute.pickable&&c;return h.multiply(o.a,o.b,o.c,o.d,o.e,o.f),!1===t.attribute.childrenPickable||u&&u.graphic||Ip(t,Qi.zIndex,(s=>{if(s.isContainer){const i=new zt(e.x,e.y),a=Or(t).group,{scrollX:o=a.scrollX,scrollY:l=a.scrollY}=t.attribute;i.x-=o,i.y-=l,r=this.pickGroup(s,i,h,n)}else{const a=new zt(e.x,e.y);h.transformPoint(a,a);const o=Or(t).group,{scrollX:l=o.scrollX,scrollY:c=o.scrollY}=t.attribute;a.x-=l,a.y-=c;const u=this.pickItem(s,a,i,n);u&&u.graphic&&(r.graphic=u.graphic,r.params=u.params)}return!!r.graphic||!!r.group}),!0,!!s.camera),s.modelMatrix!==a&&Lh.free(s.modelMatrix),s.modelMatrix=a,r.graphic||r.group||!d||t.stage.camera||(r.group=t),Ih.free(h),r}selectPicker(t){return this.pickerMap.get(t.numberType)||null}},t.DefaultPickService=kf([g(),If(0,p(k)),If(0,v(vp)),Of("design:paramtypes",[Object])],t.DefaultPickService);var Lf=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Df=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};function jf(t,e){let i=0;for(i=0;i<t.length;i++){const n=t[i];if(n.text&&"\n"===n.text||e--,e<0)break}return i}t.DefaultGlobalPickerService=class{constructor(){this.global=mn.global,this.global.hooks.onSetEnv.tap("global-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env)}configure(t,e){}pick(t,e,i){let n={graphic:null,group:null};const r=new ue(1,0,0,1,0,0);let s;for(let a=0;a<t.length;a++){if(t[a].isContainer)n=this.pickGroup(t[a],e,r,i);else{const s=this.pickItem(t[a],e,r,i);s&&(n.graphic=s.graphic,n.params=s.params)}if(n.graphic)break;s||(s=n.group)}if(n.graphic||(n.group=s),n.graphic){let t=n.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(n.params={shadowTarget:n.graphic},n.graphic=t.shadowHost)}return n}containsPoint(t,e,i){return!!this.pickItem(t,e,null,i)}pickGroup(t,e,i,n){let r={group:null,graphic:null};if(!1===t.attribute.visibleAll)return r;const s=t.transMatrix,a=new zt(e.x,e.y);i.transformPoint(a,a);const o=t.AABBBounds.containsPoint(a);if(!o)return r;const h=!1!==t.attribute.pickable&&o;return i.multiply(s.a,s.b,s.c,s.d,s.e,s.f),!1!==t.attribute.childrenPickable&&t.forEachChildren((t=>{if(t.isContainer)r=this.pickGroup(t,e,i,n);else{const s=new zt(e.x,e.y);i.transformPoint(s,s);const a=this.pickItem(t,s,i,n);a&&(r.graphic=a.graphic,r.params=a.params)}return!!r.graphic||!!r.group})),r.graphic||r.group||!h||(r.group=t),r}pickItem(t,e,i,n){return!1===t.attribute.pickable?null:t.AABBBounds.containsPoint(e)?{graphic:t}:null}},t.DefaultGlobalPickerService=Lf([g(),Df("design:paramtypes",[])],t.DefaultGlobalPickerService);class Uf{constructor(t){this.handleKeyDown=t=>{"Delete"!==t.key&&"Backspace"!==t.key||this.handleInput({data:null,type:"Backspace"})},this.handleCompositionStart=()=>{const{textConfig:t=[]}=this.currRt.attribute,e=jf(t,this.cursorIndex),i=t[e];t.splice(e+1,0,Object.assign(Object.assign({},i),{text:""})),this.isComposing=!0},this.handleCompositionEnd=()=>{this.isComposing=!1;const{textConfig:t=[]}=this.currRt.attribute,e=jf(t,this.cursorIndex+1),i=t[e];t.splice(e,1);const n=i.text,r=Array.from(n.toString());for(let n=0;n<r.length;n++)t.splice(n+e,0,Object.assign(Object.assign({},i),{text:r[n]}));this.currRt.setAttributes({textConfig:t}),this.onChangeCbList.forEach((t=>{t(n,this.isComposing,this.cursorIndex+r.length,this.currRt,"right")}))},this.handleInput=t=>{if(!this.currRt)return;let e=t.data;"Backspace"===t.type||e||(e="\n");const{textConfig:i=[]}=this.currRt.attribute;let n=this.selectionStartCursorIdx,r=this.cursorIndex;n>r&&([n,r]=[r,n]),this.selectionStartCursorIdx=n,this.cursorIndex=n,n=jf(i,n);const s=this.selectionStartCursorIdx-n;r=jf(i,r);const a=i[n+(this.isComposing?1:0)];let o=a;"Backspace"!==t.type||this.isComposing?(n!==r&&i.splice(n+1,r-n),this.isComposing||(o=Object.assign(Object.assign({},a),{text:""}),n+=1,i.splice(n,0,o)),o.text=e):n!==r?i.splice(n+1,r-n):(i.splice(n,1),n-=1),this.currRt.setAttributes({textConfig:i}),this.isComposing?this.onInputCbList.forEach((t=>{t(e,this.isComposing,n+s,this.currRt,"\n"===e?"left":"right")})):this.onChangeCbList.forEach((t=>{t(e,this.isComposing,n+s,this.currRt,"\n"===e?"left":"right")}))},this.container=null!=t?t:document.body;const e=document.createElement("textarea");e.autocomplete="off",e.innerText="",this.applyStyle(e),this.container.append(e),this.textAreaDom=e,this.isComposing=!1,this.onInputCbList=[],this.onChangeCbList=[]}onInput(t){this.onInputCbList.push(t)}onChange(t){this.onChangeCbList.push(t)}applyStyle(t){t.setAttribute("style","width: 100px; height: 30px; left: 0; top: 0; position: absolute; z-index: -1; outline: none; resize: none; border: none; overflow: hidden; color: transparent; user-select: none; caret-color: transparent;background-color: transparent;"),t.addEventListener("input",this.handleInput),t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd),window.addEventListener("keydown",this.handleKeyDown)}moveTo(t,e,i,n,r){this.textAreaDom.style.left=`${t}px`,this.textAreaDom.style.top=`${e}px`,setTimeout((()=>{this.textAreaDom.focus(),this.textAreaDom.setSelectionRange(0,0)})),this.currRt=i,this.cursorIndex=n,this.selectionStartCursorIdx=r}release(){this.textAreaDom.removeEventListener("input",this.handleInput),this.textAreaDom.removeEventListener("compositionstart",this.handleCompositionStart),this.textAreaDom.removeEventListener("compositionend",this.handleCompositionEnd),window.removeEventListener("keydown",this.handleKeyDown)}}class Wf{constructor(t,e,i,n,r){this.curCursorIdx=n,this.selectionStartCursorIdx=i,this.cacheCurCursorIdx=e,this.cacheSelectionStartCursorIdx=t,this.rt=r}hasFormat(t){return null!=this.getFormat(t)}getFormat(t){if(!this.rt)return null;const e=this.rt.attribute.textConfig,i=e[this.selectionStartCursorIdx+1][t];if(null==i)return null;for(let n=this.selectionStartCursorIdx+2;n<=this.curCursorIdx;n++)if(i!==e[n][t])return null;return i}getAllFormat(t){if(!this.rt)return[];const e=this.rt.attribute.textConfig,i=e[this.selectionStartCursorIdx+1][t],n=new Set;n.add(i);for(let i=this.selectionStartCursorIdx+2;i<=this.curCursorIdx;i++){const r=e[i];n.add(r[t])}return Array.from(n.values())}}const Nf="FORMAT_TEXT_COMMAND";class Gf{constructor(){this.pools=[]}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}}class Ff extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.rect(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.rect(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const zf=new Ff;class Hf extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.arc(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.arc(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Vf=new Hf;class Yf extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.area(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.area(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Xf=new Yf;class $f extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.circle(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.circle(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const qf=new $f;class Kf extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.line(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.line(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Zf=new Kf;class Jf extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.path(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.path(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const Qf=new Jf;class tg extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.symbol(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.symbol(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const eg=new tg;class ig extends Gf{allocate(t){if(!this.pools.length)return mn.graphicService.creator.text(t);const e=this.pools.pop();return e.initAttributes(t),e}allocateByObj(t){if(!this.pools.length)return mn.graphicService.creator.text(t.attribute);const e=this.pools.pop();return e.initAttributes(t.attribute),e}}const ng=new ig;class rg{constructor(){this.map={text:ng,symbol:eg}}gc(t){t.isContainer?t.forEachChildren((t=>this.gc(t))):this.gcItem(t)}gcItem(t){const e=this.map[t.type];e&&e.free(t)}}const sg=new rg;let ag=!1;const og=new i((e=>{ag||(ag=!0,e(t.DefaultCanvasArcRender).toSelf().inSingletonScope(),e(Ac).to(t.DefaultCanvasArcRender).inSingletonScope(),e(Bc).toService(Ac),e(nh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,nh))}));let hg=!1;const lg=new i((e=>{hg||(hg=!0,e(t.DefaultCanvasRectRender).toSelf().inSingletonScope(),e(kc).to(t.DefaultCanvasRectRender).inSingletonScope(),e(Bc).toService(kc),e(t.SplitRectAfterRenderContribution).toSelf(),e(t.SplitRectBeforeRenderContribution).toSelf(),e(ch).toService(t.SplitRectAfterRenderContribution),e(ch).toService(t.SplitRectBeforeRenderContribution),e(ch).toService(t.DefaultBaseInteractiveRenderContribution),I(e,ch))}));let cg=!1;const ug=new i((e=>{cg||(cg=!0,e(t.DefaultCanvasLineRender).toSelf().inSingletonScope(),e(Fp).toSelf().inSingletonScope(),e(Rc).to(t.DefaultCanvasLineRender).inSingletonScope(),e(Bc).toService(Rc))}));let dg=!1;const pg=new i((e=>{dg||(dg=!0,e(t.DefaultCanvasAreaRender).toSelf().inSingletonScope(),e(Cc).to(t.DefaultCanvasAreaRender).inSingletonScope(),e(Bc).toService(Cc),e(rh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,rh),e(Hp).toSelf().inSingletonScope())}));let fg=!1;const gg=new i((e=>{fg||(fg=!0,e(t.DefaultCanvasSymbolRender).toSelf().inSingletonScope(),e(Ic).to(t.DefaultCanvasSymbolRender).inSingletonScope(),e(Bc).toService(Ic),e(uh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,uh))}));let vg=!1;const mg=new i((e=>{vg||(vg=!0,e(t.DefaultCanvasCircleRender).toSelf().inSingletonScope(),e(_c).to(t.DefaultCanvasCircleRender).inSingletonScope(),e(Bc).toService(_c),e(sh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,sh))}));let yg=!1;const bg=new i((e=>{yg||(yg=!0,e(Lc).to(t.DefaultCanvasTextRender).inSingletonScope(),e(Bc).toService(Lc),e(dh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,dh))}));let xg=!1;const wg=new i((e=>{xg||(xg=!0,e(t.DefaultCanvasPathRender).toSelf().inSingletonScope(),e(Mc).to(t.DefaultCanvasPathRender).inSingletonScope(),e(Bc).toService(Mc),e(hh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,hh))}));let Sg=!1;const Ag=new i((e=>{Sg||(Sg=!0,e(Ec).to(t.DefaultCanvasPolygonRender).inSingletonScope(),e(Bc).toService(Ec),e(lh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,lh))}));var Tg=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Cg=class{constructor(){this.numberType=ho}drawShape(t,e,i,n,r,s,a,o){r.drawContribution&&t.getSubGraphic().forEach((t=>{const h=r.drawContribution.getRenderContribution(t);h&&h.drawShape&&h.drawShape(t,e,i,n,r,s,a,o)}))}draw(t,e,i,n){const{context:r}=i;if(!r)return;if(r.highPerformanceSave(),!i.drawContribution)return;const s=Or(t),a=t.getSubGraphic();a.length&&a.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:s})})),r.highPerformanceRestore()}};Cg=Tg([g()],Cg);let _g=!1;const Bg=new i((t=>{_g||(_g=!0,t(Uc).to(Cg).inSingletonScope(),t(Bc).toService(Uc))}));var Pg=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Rg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Mg=class extends Fh{constructor(){super(),this.numberType=yo,this.builtinContributions=[ic],this.init()}drawShape(t,e,i,n,r){const s=Or(t).richtext,{strokeOpacity:a=s.strokeOpacity,opacity:o=s.opacity,fillOpacity:h=s.fillOpacity,visible:l=s.visible}=t.attribute;if(!t.valid||!l)return;const c=zo(o,h,!0),u=zo(o,a,!0);c&&(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,s),e.translate(i,n),this.beforeRenderStep(t,e,i,n,c,u,c,u,s,r),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,n,c,u,c,u,s,r))}drawIcon(t,e,i,n,r){var s;const a=Or(t).richtextIcon,{width:o=a.width,height:h=a.height,opacity:l=a.opacity,image:c,backgroundFill:u=a.backgroundFill,backgroundFillOpacity:d=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:f=a.backgroundStrokeOpacity,backgroundRadius:g=a.backgroundRadius,margin:v}=t.attribute,{backgroundWidth:m=o,backgroundHeight:y=h}=t.attribute;if(v&&(i+=t._marginArray[3],n+=t._marginArray[0]),t._hovered){const t=(m-o)/2,r=(y-h)/2;0===g?(e.beginPath(),e.rect(i-t,n-r,m,y)):(e.beginPath(),ol(e,i-t,n-r,m,y,g)),u&&(e.globalAlpha=d,e.fillStyle=u,e.fill()),p&&(e.globalAlpha=f,e.strokeStyle=p,e.stroke())}const b=c&&(null===(s=null==t?void 0:t.resources)||void 0===s?void 0:s.get(c));b&&"success"===b.state&&(e.globalAlpha=l,e.drawImage(b.data,i,n,o,h))}draw(t,e,i){const n=Or(t).richtext;this._draw(t,n,!1,i)}};Mg=Pg([g(),Rg("design:paramtypes",[])],Mg);let Eg=!1;const kg=new i((t=>{Eg||(Eg=!0,t(Dc).to(Mg).inSingletonScope(),t(Bc).toService(Dc))}));let Og=!1;const Ig=new i((e=>{Og||(Og=!0,e(Wc).to(t.DefaultCanvasImageRender).inSingletonScope(),e(Bc).toService(Wc),e(oh).toService(t.DefaultBaseInteractiveRenderContribution),I(e,oh))}));class Lg extends Fh{stroke(t,e,i,n,r){const s=n.vertices;n.edges.forEach((n=>{const a=s[n[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},h=s[n[1]],l={x:t+h[0],y:e+h[1],z:i+h[2]};r.beginPath(),r.moveTo(o.x,o.y,o.z),r.lineTo(l.x,l.y,l.z),r.stroke()}))}fill(e,i,n,r,s,a,o,h,l,c,u){const d=ia.Get(a,t.ColorType.Color255),p=r.vertices,f=p.map((t=>o.view(t[0],t[1],t[2])[2])),g=[];r.polygons.forEach(((t,e)=>{if(s&&!s[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i}=t,n=f[i[0]],r=f[i[1]],a=f[i[2]],o=f[i[3]];t.ave_z=n+r+a+o})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((t=>{const{polygon:r,normal:s}=t.polygon,f=p[r[0]],g=p[r[1]],v=p[r[2]],m=p[r[3]],y={x:e+f[0],y:i+f[1],z:n+f[2]},b={x:e+g[0],y:i+g[1],z:n+g[2]},x={x:e+v[0],y:i+v[1],z:n+v[2]},w={x:e+m[0],y:i+m[1],z:n+m[2]};o.beginPath(),o.moveTo(y.x,y.y,y.z),o.lineTo(b.x,b.y,b.z),o.lineTo(x.x,x.y,x.z),o.lineTo(w.x,w.y,w.z),o.closePath(),u?u(o,l&&l.attribute,c):(o.fillStyle=h?h.computeColor(s,d):a,o.fill())}))}}var Dg=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let jg=class extends Lg{constructor(){super(...arguments),this.type="rect3d",this.numberType=mo}drawShape(t,e,i,n,r,s,a,o){var h;const l=Or(t,null==s?void 0:s.theme).rect,{fill:c=l.fill,stroke:u=l.stroke,x1:d,y1:p,x:f,y:g,opacity:v=l.opacity,fillOpacity:m=l.fillOpacity,lineWidth:y=l.lineWidth,strokeOpacity:b=l.strokeOpacity,visible:x=l.visible}=t.attribute;let{width:w,height:S}=t.attribute;w=(null!=w?w:d-f)||0,S=(null!=S?S:p-g)||0;const A=null!==(h=this.z)&&void 0!==h?h:0,T=Ho(v,m,w,S,c),C=Yo(v,b,w,S),_=Go(c),B=Fo(u,y);if(!t.valid||!x)return;if(!_&&!B)return;if(!(T||C||a||o))return;const{light:P}=r.stage||{},R=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,A,R,null,r,e,P,null,null,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,A,R,e))}draw(t,e,i){const n=Or(t).rect;this._draw(t,n,!1,i)}};jg=Dg([g()],jg);let Ug=!1;const Wg=new i((t=>{Ug||(Ug=!0,t(Oc).to(jg).inSingletonScope(),t(Bc).toService(Oc))}));var Ng=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Gg=class extends Fh{constructor(){super(...arguments),this.numberType=so}drawShape(e,i,n,r,s,a,o,h){var l;const c=Or(e,null==a?void 0:a.theme).arc,{fill:u=c.fill}=e.attribute,d=this.valid(e,c,o,h);if(!d)return;const{fVisible:p,sVisible:f,doFill:g,doStroke:v}=d,m=null!==(l=this.z)&&void 0!==l?l:0,{outerPadding:y=c.outerPadding,innerPadding:b=c.innerPadding,height:x=10}=e.attribute;let{outerRadius:w=c.outerRadius,innerRadius:S=c.innerRadius}=e.attribute;w+=y,S-=b;const A=ia.Get(u,t.ColorType.Color255),{light:T}=s.stage||{},C=s.hack_pieFace,_={top:m,bottom:m+x},B={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===C||"top"===C?(i.beginPath(),function(t,e,i,n,r,s,a){const{startAngle:o,endAngle:h}=t.getParsedAngle(),l=Et(h-o),c=h>o;let u=!1;if(s<a){const t=s;s=a,a=t}if(s<=_t)e.moveTo(i,n,r);else if(l>=Mt-_t)e.moveTo(i+s*Ot(o),n+s*Dt(o),r),e.arc(i,n,s,o,h,!c,r),a>_t&&(e.moveTo(i+a*Ot(h),n+a*Dt(h),r),e.arc(i,n,a,h,o,c,r));else{const{outerDeltaAngle:l,innerDeltaAngle:d,outerStartAngle:p,outerEndAngle:f,innerEndAngle:g,innerStartAngle:v}=t.getParsePadAngle(o,h),m=s*Ot(p),y=s*Dt(p),b=a*Ot(g),x=a*Dt(g);l<.001?u=!0:(e.moveTo(i+m,n+y,r),e.arc(i,n,s,p,f,!c,r)),!(a>_t)||d<.001?(e.lineTo(i+b,n+x,r),u=!0):(e.lineTo(i+b,n+x,r),e.arc(i,n,a,g,v,c,r))}e.closePath()}(e,i,n,r,_[C],w,S),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,c),g&&(o?o(i,e.attribute,c):p&&(i.setCommonStyle(e,e.attribute,n,r,c),i.fillStyle=T?T.computeColor(B[C],A):u,i.fill())),v&&(h?h(i,e.attribute,c):f&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke()))):"outside"!==C&&"inside"!==C||("inside"===C&&(i.save(),i.beginPath(),i.arc(n,r,S,0,Mt,!0,_.top),i.clip()),i.beginPath(),function(t,e,i,n,r,s,a,o){const{startAngle:h,endAngle:l}=t.getParsedAngle(),c=Et(l-h),u=l>h;let d=!1;if(a<=_t)e.moveTo(i,n,r);else if(c>=Mt-_t)e.moveTo(i+a*Ot(h),n+a*Dt(h),r),e.arc(i,n,a,h,l,!u,r),e.lineTo(i+a*Ot(l),n+a*Dt(l),s),e.arc(i,n,a,l,h,u,s);else{const{innerouterDeltaAngle:t,innerouterStartAngle:c,innerouterEndAngle:p}=o(h,l),f=a*Ot(c),g=a*Dt(c),v=a*Ot(p),m=a*Dt(p);t<.001?d=!0:(e.moveTo(i+f,n+g,r),e.arc(i,n,a,c,p,!u,r),e.lineTo(i+v,n+m,s),e.arc(i,n,a,p,c,u,s))}e.closePath()}(e,i,n,r,_.top,_.bottom,"outside"===C?w:S,((t,i)=>{const{outerDeltaAngle:n,innerDeltaAngle:r,outerStartAngle:s,outerEndAngle:a,innerEndAngle:o,innerStartAngle:h}=e.getParsePadAngle(t,i);return"outside"===C?{innerouterDeltaAngle:n,innerouterEndAngle:a,innerouterStartAngle:s}:{innerouterDeltaAngle:r,innerouterEndAngle:o,innerouterStartAngle:h}})),i.setShadowBlendStyle&&i.setShadowBlendStyle(e,e.attribute,c),g&&(o?o(i,e.attribute,c):p&&(i.setCommonStyle(e,e.attribute,n,r,c),i.fillStyle=T?T.computeColor(B[C],A):u,i.fill())),v&&(h?h(i,e.attribute,c):f&&(i.setStrokeStyle(e,e.attribute,n,r,c),i.stroke())),"inside"===C&&i.restore())}draw(t,e,i,n){const r=Or(t,null==n?void 0:n.theme).arc;this._draw(t,r,!1,i,n)}};Gg=Ng([g()],Gg);let Fg=!1;const zg=new i((t=>{Fg||(Fg=!0,t(Tc).to(Gg).inSingletonScope(),t(Bc).toService(Tc))}));var Hg=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Vg=class extends Lg{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=go}drawShape(t,e,i,n,r,s,a,o){var h;const l=Or(t,null==s?void 0:s.theme).polygon,{fill:c=l.fill,stroke:u=l.stroke,face:d=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(h=this.z)&&void 0!==h?h:0;if(!this.valid(t,l,a,o))return;const{light:f}=r.stage||{},g=t.findFace();if(!1!==c){e.setCommonStyle(t,t.attribute,i,n,l);let r=c;"string"!=typeof r&&(r="black"),this.fill(i,n,p,g,d,r,e,f,t,l,a)}!1!==u&&(e.setStrokeStyle(t,t.attribute,i,n,l),this.stroke(i,n,p,g,e))}draw(t,e,i){const n=Or(t).polygon;this._draw(t,n,!1,i)}};Vg=Hg([g()],Vg);let Yg=!1;const Xg=new i((t=>{Yg||(Yg=!0,t(jc).to(Vg).inSingletonScope(),t(Bc).toService(jc))}));function $g(){Jl.RegisterGraphicCreator("arc",sp)}function qg(){Jl.RegisterGraphicCreator("arc3d",op)}function Kg(){Jl.RegisterGraphicCreator("area",ip)}function Zg(){Jl.RegisterGraphicCreator("circle",uu)}function Jg(){Jl.RegisterGraphicCreator("glyph",Wd)}function Qg(){Jl.RegisterGraphicCreator("group",Ro)}function tv(){Jl.RegisterGraphicCreator("image",Hd)}function ev(){Jl.RegisterGraphicCreator("line",Ed)}function iv(){Jl.RegisterGraphicCreator("path",Qd)}function nv(){Jl.RegisterGraphicCreator("polygon",cp)}function rv(){Jl.RegisterGraphicCreator("pyramid3d",dp)}function sv(){Jl.RegisterGraphicCreator("rect",Id)}function av(){Jl.RegisterGraphicCreator("rect3d",jd)}function ov(){Jl.RegisterGraphicCreator("richtext",Kd)}function hv(){Jl.RegisterGraphicCreator("symbol",Pd)}function lv(){Jl.RegisterGraphicCreator("text",gu)}function cv(){Jl.RegisterGraphicCreator("shadowRoot",fp)}function uv(){Jl.RegisterGraphicCreator("wrapText",yu)}class dv{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0,this.onWheel=t=>{try{const e=new t.constructor(t.type,t);this.pluginService.stage.window.getContext().getCanvas().nativeCanvas.dispatchEvent(e)}catch(t){return}}}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML([...t.stage.getChildren()])}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.onRemove.unTap(this.key),mn.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,i){let n;return n=e?"string"==typeof e?mn.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:mn.global.createDom(Object.assign({tagName:"div",parent:n},i)),nativeContainer:n}}parseDefaultStyleFromGraphic(t){return mh("text"===t.type&&t.attribute?t.attribute:Or(t).text)}getTransformOfText(t){const e=Or(t).text,{textAlign:i=e.textAlign,textBaseline:n=e.textBaseline}=t.attribute,r=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:s,scaleX:a,scaleY:o}=r,h={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},l={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:i,transform:`translate(${h[i]},${h[n]}) rotate(${s}deg) scaleX(${a}) scaleY(${o})`,transformOrigin:`${l[i]} ${l[n]}`}}updateStyleOfWrapContainer(t,e,i,n,r){const{pointerEvents:s,penetrateEventList:a=[]}=r;let o=this.parseDefaultStyleFromGraphic(t);o.display=!1!==t.attribute.visible?"block":"none",o.pointerEvents=!0===s?"all":s||"none","none"!==o.pointerEvents&&(this.removeWrapContainerEventListener(i),a.forEach((t=>{"wheel"===t&&i.addEventListener("wheel",this.onWheel)}))),i.style.position||(i.style.position="absolute",n.style.position="relative");let h=0,l=0;const c=t.globalAABBBounds;let u=r.anchorType;if(J(u)&&(u="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===u&&(u="top-left"),"position"===u||c.empty()){const e=t.globalTransMatrix;h=e.e,l=e.f}else{const t=((t,e)=>{const{x1:i,x2:n,y1:r,y2:s}=t,a=Math.abs(n-i),o=Math.abs(s-r);let h=(i+n)/2,l=(r+s)/2,c=0,u=0;switch(e){case"top":case"inside-top":u=-.5;break;case"bottom":case"inside-bottom":u=.5;break;case"left":case"inside-left":c=-.5;break;case"right":case"inside-right":c=.5;break;case"top-right":c=.5,u=-.5;break;case"top-left":c=-.5,u=-.5;break;case"bottom-right":c=.5,u=.5;break;case"bottom-left":c=-.5,u=.5}return h+=c*a,l+=u*o,{x:h,y:l}})(c,u);h=t.x,l=t.y}const d=mn.global.getElementTopLeft(n,!1),p=e.window.getTopLeft(!1),f=e.viewBox,g=h+p.left-d.left+f.x1,v=l+p.top-d.top+f.y1;if(o.left=`${g}px`,o.top=`${v}px`,"text"===t.type&&"position"===u&&(o=Object.assign(Object.assign({},o),this.getTransformOfText(t))),Z(r.style)){const e=r.style({top:v,left:g,width:c.width(),height:c.height()},t,i);e&&(o=Object.assign(Object.assign({},o),e))}else et(r.style)?o=Object.assign(Object.assign({},o),r.style):st(r.style)&&r.style&&(o=Object.assign(Object.assign({},o),function(){const t={};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";").forEach((e=>{if(e){const i=e.split(":");if(2===i.length){const e=i[0].trim(),n=i[1].trim();e&&n&&(t[e]=n)}}})),t}(r.style)));mn.global.updateDom(i,{width:r.width,height:r.height,style:o})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===mn.global.env&&(t.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Qi.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Qi.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&mn.global.removeDom(e),this.htmlMap[t]=null}removeWrapContainerEventListener(t){t.removeEventListener("wheel",this.onWheel)}renderGraphicHTML(t){var e;const{html:i}=t.attribute;if(!i)return;const n=t.stage;if(!n)return;const{dom:r,container:s}=i;if(!r)return;const a=J(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[a]&&s&&s!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])"string"==typeof r?this.htmlMap[a].wrapContainer.innerHTML=r:r!==this.htmlMap[a].wrapContainer.firstChild&&(this.htmlMap[a].wrapContainer.removeChild(this.htmlMap[a].wrapContainer.firstChild),this.htmlMap[a].wrapContainer.appendChild(r));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(n,s);t&&("string"==typeof r?t.innerHTML=r:t.appendChild(r),this.htmlMap||(this.htmlMap={}),this.htmlMap[a]={wrapContainer:t,nativeContainer:e,container:s,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:o,nativeContainer:h}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,n,o,h,i),this.htmlMap[a].renderId=this.renderId}release(){"browser"===mn.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}const pv=()=>{gf.registerPlugin("HtmlAttributePlugin",dv)};class fv extends dv{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:i,unmount:n}=this.htmlMap[t];e?mn.global.getRequestAnimationFrame()((()=>{e.unmount()})):n&&n(),i&&mn.global.removeDom(i),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{react:i}=t.attribute;if(!i)return;const n=t.stage;if(!n)return;const r=n.params.ReactDOM,{element:s,container:a}=i;if(!s||!r||!r.createRoot&&!r.render)return;const o=J(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])r.createRoot?this.htmlMap[o].root.render(s):r.render(s,this.htmlMap[o].wrapContainer);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(n,a);if(t)if(this.htmlMap||(this.htmlMap={}),r.createRoot){const i=r.createRoot(t);i.render(s),this.htmlMap[o]={root:i,wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId}}else r.render(s,t),this.htmlMap[o]={wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId,unmount:()=>{r.unmountComponentAtNode(t)}}}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:h,nativeContainer:l}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,n,h,l,i),this.htmlMap[o].renderId=this.renderId}}const gv=()=>{gf.registerPlugin("ReactAttributePlugin",fv)};class vv{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const n=this.pluginService.stage;if(this.option3d||(this.option3d=n.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const r=t.page.x-this.pageX,s=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=r/100,o=s/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+a,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+o,n.set3dOptions(this.option3d),n.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}const mv=()=>{gf.registerPlugin("ViewTransform3dPlugin",vv)},yv=new le;class bv{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=e.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new le}pauseLayout(t){this.pause=t}tryLayoutChildren(t){t.firstChild&&this.tryLayout(t.firstChild)}tryLayout(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.pause)return;const i=t.parent;if(!(e||i&&t.needUpdateLayout()))return;const n=Or(i).group,{display:r=n.display}=i.attribute;if("flex"!==r)return;const{flexDirection:s=n.flexDirection,flexWrap:a=n.flexWrap,alignItems:o=n.alignItems,clip:h=n.clip}=i.attribute,{alignContent:l=(null!=o?o:n.alignContent)}=i.attribute;let{width:c,height:u,justifyContent:d=n.justifyContent}=i.attribute;const p=i.getChildren();if(null==c||null==u){let t=0,e=0,i=0;if(p.forEach((n=>{const r=this.getAABBBounds(n);r.empty()||("column"===s||"column-reverse"===s?(e+=r.height(),t=Math.max(t,r.width())):(t+=r.width(),e=Math.max(e,r.height())),i+=r.x1,i+=r.y1,i+=r.x2,i+=r.y2)})),!isFinite(i))return;c=t,u=e}null==i.attribute.width?i.attribute.width=c:c=i.attribute.width,null==i.attribute.height?i.attribute.height=u:u=i.attribute.height,this.tempBounds.copy(i._AABBBounds);const f={main:{len:c,field:"x"},cross:{len:u,field:"y"}},g=f.main,v=f.cross;"column"!==s&&"column-reverse"!==s||(g.len=u,v.len=c,g.field="y",v.field="x"),"row-reverse"!==s&&"column-reverse"!==s||("flex-start"===d?d="flex-end":"flex-end"===d?d="flex-start":p.reverse());let m=0,y=0;const b=[];p.forEach((t=>{const e=this.getAABBBounds(t);if(e.empty())return;const i="x"===g.field?e.width():e.height(),n="x"===v.field?e.width():e.height();b.push({mainLen:i,crossLen:n}),m+=i,y=Math.max(y,n)}));const x=[];if(m>g.len&&"wrap"===a){let t=0,e=0;b.forEach(((i,n)=>{let{mainLen:r,crossLen:s}=i;t+r>g.len?0===t?(x.push({idx:n,mainLen:t+r,crossLen:s}),t=0,e=0):(x.push({idx:n-1,mainLen:t,crossLen:e}),t=r,e=s):(t+=r,e=Math.max(e,s))})),x.push({idx:b.length-1,mainLen:t,crossLen:e})}else x.push({idx:b.length-1,mainLen:m,crossLen:y});let w=0;if(x.forEach((t=>{this.layoutMain(i,p,d,g,b,w,t),w=t.idx+1})),y=x.reduce(((t,e)=>t+e.crossLen),0),1===x.length){const t={"flex-start":0,"flex-end":v.len,center:v.len/2};this.layoutCross(p,o,v,t,b,x[0],0)}else if("flex-start"===l){w=0;let t=0;x.forEach(((e,i)=>{const n={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(p,"flex-start",v,n,b,x[i],w),w=e.idx+1,t+=e.crossLen}))}else if("center"===l){w=0;let t=Math.max(0,(v.len-y)/2);x.forEach(((e,i)=>{const n={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(p,"center",v,n,b,x[i],w),w=e.idx+1,t+=e.crossLen}))}else if("space-around"===l){w=0;const t=Math.max(0,(v.len-y)/x.length/2);let e=t;x.forEach(((i,n)=>{const r={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(p,"flex-start",v,r,b,x[n],w),w=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===l){w=0;const t=Math.max(0,(v.len-y)/(2*x.length-2));let e=0;x.forEach(((i,n)=>{const r={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(p,"flex-start",v,r,b,x[n],w),w=i.idx+1,e+=i.crossLen+2*t}))}p.forEach(((t,e)=>{t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),i.addUpdateLayoutTag();const S=this.getAABBBounds(i);h||this.tempBounds.equals(S)||this.tryLayout(i,!1)}getAABBBounds(t){this.skipBoundsTrigger=!0;const e=t.AABBBounds;return this.skipBoundsTrigger=!1,e}updateChildPos(t,e,i){return t+(null!=e?e:0)-i}layoutMain(t,e,i,n,r,s,a){if("flex-start"===i){let t=0;for(let i=s;i<=a.idx;i++){const s=t+(e[i],n.field,0),a=this.getAABBBounds(e[i]);!a.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],a[`${n.field}1`])),t+=r[i].mainLen}}else if("flex-end"===i){let t=n.len;for(let i=a.idx;i>=s;i--){t-=r[i].mainLen;const s=t+(e[i],n.field,0),a=this.getAABBBounds(e[i]);!a.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],a[`${n.field}1`]))}}else if("space-around"===i)if(a.mainLen>=n.len){let t=0;for(let i=s;i<=a.idx;i++){const s=t+(e[i],n.field,0),a=this.getAABBBounds(e[i]);!a.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],a[`${n.field}1`])),t+=r[i].mainLen}}else{const t=a.idx-s+1,i=(n.len-a.mainLen)/t/2;let o=i;for(let t=s;t<=a.idx;t++){const s=o+(e[t],n.field,0),a=this.getAABBBounds(e[t]);!a.empty()&&(e[t].attribute[n.field]=this.updateChildPos(s,e[t].attribute[n.field],a[`${n.field}1`])),o+=r[t].mainLen+2*i}}else if("space-between"===i)if(a.mainLen>=n.len){let t=0;for(let i=s;i<=a.idx;i++){const s=t+(e[i],n.field,0),a=this.getAABBBounds(e[i]);!a.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],a[`${n.field}1`])),t+=r[i].mainLen}}else{const t=a.idx-s+1,i=(n.len-a.mainLen)/(2*t-2);let o=0;for(let t=s;t<=a.idx;t++){const s=o+(e[t],n.field,0),a=this.getAABBBounds(e[t]);!a.empty()&&(e[t].attribute[n.field]=this.updateChildPos(s,e[t].attribute[n.field],a[`${n.field}1`])),o+=r[t].mainLen+2*i}}else if("center"===i){let t=(n.len-a.mainLen)/2;for(let i=s;i<=a.idx;i++){const s=t+(e[i],n.field,0),a=this.getAABBBounds(e[i]);!a.empty()&&(e[i].attribute[n.field]=this.updateChildPos(s,e[i].attribute[n.field],a[`${n.field}1`])),t+=r[i].mainLen}}}layoutCross(t,e,i,n,r,s,a){var o;for(let h=a;h<=s.idx;h++){const s=t[h];let{alignSelf:a}=s.attribute;a&&"auto"!==a||(a=e);const l=this.getAABBBounds(s),c=null!==(o=n[a])&&void 0!==o?o:n["flex-start"];"flex-end"===a?!l.empty()&&(s.attribute[i.field]=this.updateChildPos(c-r[h].crossLen+(i.field,0),s.attribute[i.field],l[`${i.field}1`])):"center"===a?!l.empty()&&(s.attribute[i.field]=this.updateChildPos(c-r[h].crossLen/2+(i.field,0),s.attribute[i.field],l[`${i.field}1`])):!l.empty()&&(s.attribute[i.field]=this.updateChildPos(c+(i.field,0),s.attribute[i.field],l[`${i.field}1`]))}}activate(t){this.pluginService=t,mn.graphicService.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),t.stage&&t.stage===this.pluginService.stage&&this.tryLayout(t,!1)})),mn.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,n)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&yv.copy(n)})),mn.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,n,r)=>{e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&(yv.equals(i)||this.tryLayout(t,!1))})),mn.graphicService.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t,!1)}))}deactivate(t){mn.graphicService.hooks.onAttributeUpdate.taps=mn.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.beforeUpdateAABBBounds.taps=mn.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.afterUpdateAABBBounds.taps=mn.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),mn.graphicService.hooks.onSetStage.taps=mn.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}const xv=()=>{gf.registerPlugin("FlexLayoutPlugin",bv)};function wv(t,e,i){if(t&&t.length){const[n,r]=e,s=Math.PI/180*i,a=Math.cos(s),o=Math.sin(s);t.forEach((t=>{const[e,i]=t;t[0]=(e-n)*a-(i-r)*o+n,t[1]=(e-n)*o+(i-r)*a+r}))}}function Sv(t){const e=t[0],i=t[1];return Math.sqrt(Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2))}function Av(t,e){const i=e.hachureAngle+90;let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);const r=[0,0];if(i)for(const e of t)wv(e,r,i);const s=function(t,e){const i=[];for(const e of t){const t=[...e];t[0].join(",")!==t[t.length-1].join(",")&&t.push([t[0][0],t[0][1]]),t.length>2&&i.push(t)}const n=[];e=Math.max(e,.1);const r=[];for(const t of i)for(let e=0;e<t.length-1;e++){const i=t[e],n=t[e+1];if(i[1]!==n[1]){const t=Math.min(i[1],n[1]);r.push({ymin:t,ymax:Math.max(i[1],n[1]),x:t===i[1]?i[0]:n[0],islope:(n[0]-i[0])/(n[1]-i[1])})}}if(r.sort(((t,e)=>t.ymin<e.ymin?-1:t.ymin>e.ymin?1:t.x<e.x?-1:t.x>e.x?1:t.ymax===e.ymax?0:(t.ymax-e.ymax)/Math.abs(t.ymax-e.ymax))),!r.length)return n;let s=[],a=r[0].ymin;for(;s.length||r.length;){if(r.length){let t=-1;for(let e=0;e<r.length&&!(r[e].ymin>a);e++)t=e;r.splice(0,t+1).forEach((t=>{s.push({s:a,edge:t})}))}if(s=s.filter((t=>!(t.edge.ymax<=a))),s.sort(((t,e)=>t.edge.x===e.edge.x?0:(t.edge.x-e.edge.x)/Math.abs(t.edge.x-e.edge.x))),s.length>1)for(let t=0;t<s.length;t+=2){const e=t+1;if(e>=s.length)break;const i=s[t].edge,r=s[e].edge;n.push([[Math.round(i.x),a],[Math.round(r.x),a]])}a+=e,s.forEach((t=>{t.edge.x=t.edge.x+e*t.edge.islope}))}return n}(t,n);if(i){for(const e of t)wv(e,r,-i);!function(t,e,i){const n=[];t.forEach((t=>n.push(...t))),wv(n,e,i)}(s,r,-i)}return s}class Tv{constructor(t){this.helper=t}fillPolygons(t,e){return this._fillPolygons(t,e)}_fillPolygons(t,e){const i=Av(t,e);return{type:"fillSketch",ops:this.renderLines(i,e)}}renderLines(t,e){const i=[];for(const n of t)i.push(...this.helper.doubleLineOps(n[0][0],n[0][1],n[1][0],n[1][1],e));return i}}class Cv extends Tv{fillPolygons(t,e){let i=e.hachureGap;i<0&&(i=4*e.strokeWidth),i=Math.max(i,.1);const n=Av(t,Object.assign({},e,{hachureGap:i})),r=Math.PI/180*e.hachureAngle,s=[],a=.5*i*Math.cos(r),o=.5*i*Math.sin(r);for(const[t,e]of n)Sv([t,e])&&s.push([[t[0]-a,t[1]+o],[...e]],[[t[0]+a,t[1]-o],[...e]]);return{type:"fillSketch",ops:this.renderLines(s,e)}}}class _v extends Tv{fillPolygons(t,e){const i=this._fillPolygons(t,e),n=Object.assign({},e,{hachureAngle:e.hachureAngle+90}),r=this._fillPolygons(t,n);return i.ops=i.ops.concat(r.ops),i}}class Bv{constructor(t){this.helper=t}fillPolygons(t,e){const i=Av(t,e=Object.assign({},e,{hachureAngle:0}));return this.dotsOnLines(i,e)}dotsOnLines(t,e){const i=[];let n=e.hachureGap;n<0&&(n=4*e.strokeWidth),n=Math.max(n,.1);let r=e.fillWeight;r<0&&(r=e.strokeWidth/2);const s=n/4;for(const a of t){const t=Sv(a),o=t/n,h=Math.ceil(o)-1,l=t-h*n,c=(a[0][0]+a[1][0])/2-n/4,u=Math.min(a[0][1],a[1][1]);for(let t=0;t<h;t++){const a=u+l+t*n,o=c-s+2*Math.random()*s,h=a-s+2*Math.random()*s,d=this.helper.ellipse(o,h,r,r,e);i.push(...d.ops)}}return{type:"fillSketch",ops:i}}}class Pv{constructor(t){this.helper=t}fillPolygons(t,e){const i=Av(t,e);return{type:"fillSketch",ops:this.dashedLine(i,e)}}dashedLine(t,e){const i=e.dashOffset<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashOffset,n=e.dashGap<0?e.hachureGap<0?4*e.strokeWidth:e.hachureGap:e.dashGap,r=[];return t.forEach((t=>{const s=Sv(t),a=Math.floor(s/(i+n)),o=(s+n-a*(i+n))/2;let h=t[0],l=t[1];h[0]>l[0]&&(h=t[1],l=t[0]);const c=Math.atan((l[1]-h[1])/(l[0]-h[0]));for(let t=0;t<a;t++){const s=t*(i+n),a=s+i,l=[h[0]+s*Math.cos(c)+o*Math.cos(c),h[1]+s*Math.sin(c)+o*Math.sin(c)],u=[h[0]+a*Math.cos(c)+o*Math.cos(c),h[1]+a*Math.sin(c)+o*Math.sin(c)];r.push(...this.helper.doubleLineOps(l[0],l[1],u[0],u[1],e))}})),r}}class Rv{constructor(t){this.helper=t}fillPolygons(t,e){const i=e.hachureGap<0?4*e.strokeWidth:e.hachureGap,n=e.zigzagOffset<0?i:e.zigzagOffset,r=Av(t,e=Object.assign({},e,{hachureGap:i+n}));return{type:"fillSketch",ops:this.zigzagLines(r,n,e)}}zigzagLines(t,e,i){const n=[];return t.forEach((t=>{const r=Sv(t),s=Math.round(r/(2*e));let a=t[0],o=t[1];a[0]>o[0]&&(a=t[1],o=t[0]);const h=Math.atan((o[1]-a[1])/(o[0]-a[0]));for(let t=0;t<s;t++){const r=2*t*e,s=2*(t+1)*e,o=Math.sqrt(2*Math.pow(e,2)),l=[a[0]+r*Math.cos(h),a[1]+r*Math.sin(h)],c=[a[0]+s*Math.cos(h),a[1]+s*Math.sin(h)],u=[l[0]+o*Math.cos(h+Math.PI/4),l[1]+o*Math.sin(h+Math.PI/4)];n.push(...this.helper.doubleLineOps(l[0],l[1],u[0],u[1],i),...this.helper.doubleLineOps(u[0],u[1],c[0],c[1],i))}})),n}}const Mv={};class Ev{constructor(t){this.seed=t}next(){return this.seed?(2**31-1&(this.seed=Math.imul(48271,this.seed)))/2**31:Math.random()}}const kv={A:7,a:7,C:6,c:6,H:1,h:1,L:2,l:2,M:2,m:2,Q:4,q:4,S:4,s:4,T:2,t:2,V:1,v:1,Z:0,z:0};function Ov(t,e){return t.type===e}function Iv(t){const e=[],i=function(t){const e=new Array;for(;""!==t;)if(t.match(/^([ \t\r\n,]+)/))t=t.substr(RegExp.$1.length);else if(t.match(/^([aAcChHlLmMqQsStTvVzZ])/))e[e.length]={type:0,text:RegExp.$1},t=t.substr(RegExp.$1.length);else{if(!t.match(/^(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)/))return[];e[e.length]={type:1,text:`${parseFloat(RegExp.$1)}`},t=t.substr(RegExp.$1.length)}return e[e.length]={type:2,text:""},e}(t);let n="BOD",r=0,s=i[r];for(;!Ov(s,2);){let a=0;const o=[];if("BOD"===n){if("M"!==s.text&&"m"!==s.text)return Iv("M0,0"+t);r++,a=kv[s.text],n=s.text}else Ov(s,1)?a=kv[n]:(r++,a=kv[s.text],n=s.text);if(!(r+a<i.length))throw new Error("Path data ended short");for(let t=r;t<r+a;t++){const e=i[t];if(!Ov(e,1))throw new Error("Param not a number: "+n+","+e.text);o[o.length]=+e.text}if("number"!=typeof kv[n])throw new Error("Bad segment: "+n);{const t={key:n,data:o};e.push(t),r+=a,s=i[r],"M"===n&&(n="L"),"m"===n&&(n="l")}}return e}function Lv(t){let e=0,i=0,n=0,r=0;const s=[];for(const{key:a,data:o}of t)switch(a){case"M":s.push({key:"M",data:[...o]}),[e,i]=o,[n,r]=o;break;case"m":e+=o[0],i+=o[1],s.push({key:"M",data:[e,i]}),n=e,r=i;break;case"L":s.push({key:"L",data:[...o]}),[e,i]=o;break;case"l":e+=o[0],i+=o[1],s.push({key:"L",data:[e,i]});break;case"C":s.push({key:"C",data:[...o]}),e=o[4],i=o[5];break;case"c":{const t=o.map(((t,n)=>n%2?t+i:t+e));s.push({key:"C",data:t}),e=t[4],i=t[5];break}case"Q":s.push({key:"Q",data:[...o]}),e=o[2],i=o[3];break;case"q":{const t=o.map(((t,n)=>n%2?t+i:t+e));s.push({key:"Q",data:t}),e=t[2],i=t[3];break}case"A":s.push({key:"A",data:[...o]}),e=o[5],i=o[6];break;case"a":e+=o[5],i+=o[6],s.push({key:"A",data:[o[0],o[1],o[2],o[3],o[4],e,i]});break;case"H":s.push({key:"H",data:[...o]}),e=o[0];break;case"h":e+=o[0],s.push({key:"H",data:[e]});break;case"V":s.push({key:"V",data:[...o]}),i=o[0];break;case"v":i+=o[0],s.push({key:"V",data:[i]});break;case"S":s.push({key:"S",data:[...o]}),e=o[2],i=o[3];break;case"s":{const t=o.map(((t,n)=>n%2?t+i:t+e));s.push({key:"S",data:t}),e=t[2],i=t[3];break}case"T":s.push({key:"T",data:[...o]}),e=o[0],i=o[1];break;case"t":e+=o[0],i+=o[1],s.push({key:"T",data:[e,i]});break;case"Z":case"z":s.push({key:"Z",data:[]}),e=n,i=r}return s}function Dv(t){const e=[];let i="",n=0,r=0,s=0,a=0,o=0,h=0;for(const{key:l,data:c}of t){switch(l){case"M":e.push({key:"M",data:[...c]}),[n,r]=c,[s,a]=c;break;case"C":e.push({key:"C",data:[...c]}),n=c[4],r=c[5],o=c[2],h=c[3];break;case"L":e.push({key:"L",data:[...c]}),[n,r]=c;break;case"H":n=c[0],e.push({key:"L",data:[n,r]});break;case"V":r=c[0],e.push({key:"L",data:[n,r]});break;case"S":{let t=0,s=0;"C"===i||"S"===i?(t=n+(n-o),s=r+(r-h)):(t=n,s=r),e.push({key:"C",data:[t,s,...c]}),o=c[0],h=c[1],n=c[2],r=c[3];break}case"T":{const[t,s]=c;let a=0,l=0;"Q"===i||"T"===i?(a=n+(n-o),l=r+(r-h)):(a=n,l=r);const u=n+2*(a-n)/3,d=r+2*(l-r)/3,p=t+2*(a-t)/3,f=s+2*(l-s)/3;e.push({key:"C",data:[u,d,p,f,t,s]}),o=a,h=l,n=t,r=s;break}case"Q":{const[t,i,s,a]=c,l=n+2*(t-n)/3,u=r+2*(i-r)/3,d=s+2*(t-s)/3,p=a+2*(i-a)/3;e.push({key:"C",data:[l,u,d,p,s,a]}),o=t,h=i,n=s,r=a;break}case"A":{const t=Math.abs(c[0]),i=Math.abs(c[1]),s=c[2],a=c[3],o=c[4],h=c[5],l=c[6];0===t||0===i?(e.push({key:"C",data:[n,r,h,l,h,l]}),n=h,r=l):n===h&&r===l||(Uv(n,r,h,l,t,i,s,a,o).forEach((function(t){e.push({key:"C",data:t})})),n=h,r=l);break}case"Z":e.push({key:"Z",data:[]}),n=s,r=a}i=l}return e}function jv(t,e,i){return[t*Math.cos(i)-e*Math.sin(i),t*Math.sin(i)+e*Math.cos(i)]}function Uv(t,e,i,n,r,s,a,o,h,l){const c=(u=a,Math.PI*u/180);var u;let d=[],p=0,f=0,g=0,v=0;if(l)[p,f,g,v]=l;else{[t,e]=jv(t,e,-c),[i,n]=jv(i,n,-c);const a=(t-i)/2,l=(e-n)/2;let u=a*a/(r*r)+l*l/(s*s);u>1&&(u=Math.sqrt(u),r*=u,s*=u);const d=r*r,m=s*s,y=d*m-d*l*l-m*a*a,b=d*l*l+m*a*a,x=(o===h?-1:1)*Math.sqrt(Math.abs(y/b));g=x*r*l/s+(t+i)/2,v=x*-s*a/r+(e+n)/2,p=Math.asin(parseFloat(((e-v)/s).toFixed(9))),f=Math.asin(parseFloat(((n-v)/s).toFixed(9))),t<g&&(p=Math.PI-p),i<g&&(f=Math.PI-f),p<0&&(p=2*Math.PI+p),f<0&&(f=2*Math.PI+f),h&&p>f&&(p-=2*Math.PI),!h&&f>p&&(f-=2*Math.PI)}let m=f-p;if(Math.abs(m)>120*Math.PI/180){const t=f,e=i,o=n;f=h&&f>p?p+120*Math.PI/180*1:p+120*Math.PI/180*-1,d=Uv(i=g+r*Math.cos(f),n=v+s*Math.sin(f),e,o,r,s,a,0,h,[f,t,g,v])}m=f-p;const y=Math.cos(p),b=Math.sin(p),x=Math.cos(f),w=Math.sin(f),S=Math.tan(m/4),A=4/3*r*S,T=4/3*s*S,C=[t,e],_=[t+A*b,e-T*y],B=[i+A*w,n-T*x],P=[i,n];if(_[0]=2*C[0]-_[0],_[1]=2*C[1]-_[1],l)return[_,B,P].concat(d);{d=[_,B,P].concat(d);const t=[];for(let e=0;e<d.length;e+=3){const i=jv(d[e][0],d[e][1],c),n=jv(d[e+1][0],d[e+1][1],c),r=jv(d[e+2][0],d[e+2][1],c);t.push([i[0],i[1],n[0],n[1],r[0],r[1]])}return t}}const Wv={randOffset:function(t,e){return qv(t,e)},randOffsetWithRange:function(t,e,i){return $v(t,e,i)},ellipse:function(t,e,i,n,r){return zv(t,e,r,Fv(i,n,r)).opset},doubleLineOps:function(t,e,i,n,r){return Kv(t,e,i,n,r,!0)}};function Nv(t,e,i,n,r){return{type:"path",ops:Kv(t,e,i,n,r)}}function Gv(t,e,i){const n=(t||[]).length;if(n>2){const r=[];for(let e=0;e<n-1;e++)r.push(...Kv(t[e][0],t[e][1],t[e+1][0],t[e+1][1],i));return e&&r.push(...Kv(t[n-1][0],t[n-1][1],t[0][0],t[0][1],i)),{type:"path",ops:r}}return 2===n?Nv(t[0][0],t[0][1],t[1][0],t[1][1],i):{type:"path",ops:[]}}function Fv(t,e,i){const n=Math.sqrt(2*Math.PI*Math.sqrt((Math.pow(t/2,2)+Math.pow(e/2,2))/2)),r=Math.ceil(Math.max(i.curveStepCount,i.curveStepCount/Math.sqrt(200)*n)),s=2*Math.PI/r;let a=Math.abs(t/2),o=Math.abs(e/2);const h=1-i.curveFitting;return a+=qv(a*h,i),o+=qv(o*h,i),{increment:s,rx:a,ry:o}}function zv(t,e,i,n){const[r,s]=tm(n.increment,t,e,n.rx,n.ry,1,n.increment*$v(.1,$v(.4,1,i),i),i);let a=Qv(r,null,i);if(!i.disableMultiStroke&&0!==i.roughness){const[r]=tm(n.increment,t,e,n.rx,n.ry,1.5,0,i),s=Qv(r,null,i);a=a.concat(s)}return{estimatedPoints:s,opset:{type:"path",ops:a}}}function Hv(t,e,i,n,r,s,a,o,h){const l=t,c=e;let u=Math.abs(i/2),d=Math.abs(n/2);u+=qv(.01*u,h),d+=qv(.01*d,h);let p=r,f=s;for(;p<0;)p+=2*Math.PI,f+=2*Math.PI;f-p>2*Math.PI&&(p=0,f=2*Math.PI);const g=2*Math.PI/h.curveStepCount,v=Math.min(g/2,(f-p)/2),m=em(v,l,c,u,d,p,f,1,h);if(!h.disableMultiStroke){const t=em(v,l,c,u,d,p,f,1.5,h);m.push(...t)}return a&&(o?m.push(...Kv(l,c,l+u*Math.cos(p),c+d*Math.sin(p),h),...Kv(l,c,l+u*Math.cos(f),c+d*Math.sin(f),h)):m.push({op:"lineTo",data:[l,c]},{op:"lineTo",data:[l+u*Math.cos(p),c+d*Math.sin(p)]})),{type:"path",ops:m}}function Vv(t,e){const i=[];for(const n of t)if(n.length){const t=e.maxRandomnessOffset||0,r=n.length;if(r>2){i.push({op:"move",data:[n[0][0]+qv(t,e),n[0][1]+qv(t,e)]});for(let s=1;s<r;s++)i.push({op:"lineTo",data:[n[s][0]+qv(t,e),n[s][1]+qv(t,e)]})}}return{type:"fillPath",ops:i}}function Yv(t,e){return function(t,e){let i=t.fillStyle||"hachure";if(!Mv[i])switch(i){case"zigzag":Mv[i]||(Mv[i]=new Cv(e));break;case"cross-hatch":Mv[i]||(Mv[i]=new _v(e));break;case"dots":Mv[i]||(Mv[i]=new Bv(e));break;case"dashed":Mv[i]||(Mv[i]=new Pv(e));break;case"zigzag-line":Mv[i]||(Mv[i]=new Rv(e));break;default:i="hachure",Mv[i]||(Mv[i]=new Tv(e))}return Mv[i]}(e,Wv).fillPolygons(t,e)}function Xv(t){return t.randomizer||(t.randomizer=new Ev(t.seed||0)),t.randomizer.next()}function $v(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return i.roughness*n*(Xv(i)*(e-t)+t)}function qv(t,e){return $v(-t,t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function Kv(t,e,i,n,r){const s=arguments.length>5&&void 0!==arguments[5]&&arguments[5]?r.disableMultiStrokeFill:r.disableMultiStroke,a=Zv(t,e,i,n,r,!0,!1);if(s)return a;const o=Zv(t,e,i,n,r,!0,!0);return a.concat(o)}function Zv(t,e,i,n,r,s,a){const o=Math.pow(t-i,2)+Math.pow(e-n,2),h=Math.sqrt(o);let l=1;l=h<200?1:h>500?.4:-.0016668*h+1.233334;let c=r.maxRandomnessOffset||0;c*c*100>o&&(c=h/10);const u=c/2,d=.2+.2*Xv(r);let p=r.bowing*r.maxRandomnessOffset*(n-e)/200,f=r.bowing*r.maxRandomnessOffset*(t-i)/200;p=qv(p,r,l),f=qv(f,r,l);const g=[],v=()=>qv(u,r,l),m=()=>qv(c,r,l),y=r.preserveVertices;return s&&(a?g.push({op:"move",data:[t+(y?0:v()),e+(y?0:v())]}):g.push({op:"move",data:[t+(y?0:qv(c,r,l)),e+(y?0:qv(c,r,l))]})),a?g.push({op:"bcurveTo",data:[p+t+(i-t)*d+v(),f+e+(n-e)*d+v(),p+t+2*(i-t)*d+v(),f+e+2*(n-e)*d+v(),i+(y?0:v()),n+(y?0:v())]}):g.push({op:"bcurveTo",data:[p+t+(i-t)*d+m(),f+e+(n-e)*d+m(),p+t+2*(i-t)*d+m(),f+e+2*(n-e)*d+m(),i+(y?0:m()),n+(y?0:m())]}),g}function Jv(t,e,i){const n=[];n.push([t[0][0]+qv(e,i),t[0][1]+qv(e,i)]),n.push([t[0][0]+qv(e,i),t[0][1]+qv(e,i)]);for(let r=1;r<t.length;r++)n.push([t[r][0]+qv(e,i),t[r][1]+qv(e,i)]),r===t.length-1&&n.push([t[r][0]+qv(e,i),t[r][1]+qv(e,i)]);return Qv(n,null,i)}function Qv(t,e,i){const n=t.length,r=[];if(n>3){const s=[],a=1-i.curveTightness;r.push({op:"move",data:[t[1][0],t[1][1]]});for(let e=1;e+2<n;e++){const i=t[e];s[0]=[i[0],i[1]],s[1]=[i[0]+(a*t[e+1][0]-a*t[e-1][0])/6,i[1]+(a*t[e+1][1]-a*t[e-1][1])/6],s[2]=[t[e+1][0]+(a*t[e][0]-a*t[e+2][0])/6,t[e+1][1]+(a*t[e][1]-a*t[e+2][1])/6],s[3]=[t[e+1][0],t[e+1][1]],r.push({op:"bcurveTo",data:[s[1][0],s[1][1],s[2][0],s[2][1],s[3][0],s[3][1]]})}if(e&&2===e.length){const t=i.maxRandomnessOffset;r.push({op:"lineTo",data:[e[0]+qv(t,i),e[1]+qv(t,i)]})}}else 3===n?(r.push({op:"move",data:[t[1][0],t[1][1]]}),r.push({op:"bcurveTo",data:[t[1][0],t[1][1],t[2][0],t[2][1],t[2][0],t[2][1]]})):2===n&&r.push(...Kv(t[0][0],t[0][1],t[1][0],t[1][1],i));return r}function tm(t,e,i,n,r,s,a,o){const h=[],l=[];if(0===o.roughness){t/=4,l.push([e+n*Math.cos(-t),i+r*Math.sin(-t)]);for(let s=0;s<=2*Math.PI;s+=t){const t=[e+n*Math.cos(s),i+r*Math.sin(s)];h.push(t),l.push(t)}l.push([e+n*Math.cos(0),i+r*Math.sin(0)]),l.push([e+n*Math.cos(t),i+r*Math.sin(t)])}else{const c=qv(.5,o)-Math.PI/2;l.push([qv(s,o)+e+.9*n*Math.cos(c-t),qv(s,o)+i+.9*r*Math.sin(c-t)]);const u=2*Math.PI+c-.01;for(let a=c;a<u;a+=t){const t=[qv(s,o)+e+n*Math.cos(a),qv(s,o)+i+r*Math.sin(a)];h.push(t),l.push(t)}l.push([qv(s,o)+e+n*Math.cos(c+2*Math.PI+.5*a),qv(s,o)+i+r*Math.sin(c+2*Math.PI+.5*a)]),l.push([qv(s,o)+e+.98*n*Math.cos(c+a),qv(s,o)+i+.98*r*Math.sin(c+a)]),l.push([qv(s,o)+e+.9*n*Math.cos(c+.5*a),qv(s,o)+i+.9*r*Math.sin(c+.5*a)])}return[l,h]}function em(t,e,i,n,r,s,a,o,h){const l=s+qv(.1,h),c=[];c.push([qv(o,h)+e+.9*n*Math.cos(l-t),qv(o,h)+i+.9*r*Math.sin(l-t)]);for(let s=l;s<=a;s+=t)c.push([qv(o,h)+e+n*Math.cos(s),qv(o,h)+i+r*Math.sin(s)]);return c.push([e+n*Math.cos(a),i+r*Math.sin(a)]),c.push([e+n*Math.cos(a),i+r*Math.sin(a)]),Qv(c,null,h)}function im(t,e,i,n,r,s,a,o){const h=[],l=[o.maxRandomnessOffset||1,(o.maxRandomnessOffset||1)+.3];let c=[0,0];const u=o.disableMultiStroke?1:2,d=o.preserveVertices;for(let p=0;p<u;p++)0===p?h.push({op:"move",data:[a[0],a[1]]}):h.push({op:"move",data:[a[0]+(d?0:qv(l[0],o)),a[1]+(d?0:qv(l[0],o))]}),c=d?[r,s]:[r+qv(l[p],o),s+qv(l[p],o)],h.push({op:"bcurveTo",data:[t+qv(l[p],o),e+qv(l[p],o),i+qv(l[p],o),n+qv(l[p],o),c[0],c[1]]});return h}function nm(t){return[...t]}function rm(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)}function sm(t,e,i){const n=rm(e,i);if(0===n)return rm(t,e);let r=((t[0]-e[0])*(i[0]-e[0])+(t[1]-e[1])*(i[1]-e[1]))/n;return r=Math.max(0,Math.min(1,r)),rm(t,am(e,i,r))}function am(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]}function om(t,e,i,n){const r=n||[];if(function(t,e){const i=t[e+0],n=t[e+1],r=t[e+2],s=t[e+3];let a=3*n[0]-2*i[0]-s[0];a*=a;let o=3*n[1]-2*i[1]-s[1];o*=o;let h=3*r[0]-2*s[0]-i[0];h*=h;let l=3*r[1]-2*s[1]-i[1];return l*=l,a<h&&(a=h),o<l&&(o=l),a+o}(t,e)<i){const i=t[e+0];r.length?(s=r[r.length-1],a=i,Math.sqrt(rm(s,a))>1&&r.push(i)):r.push(i),r.push(t[e+3])}else{const n=.5,s=t[e+0],a=t[e+1],o=t[e+2],h=t[e+3],l=am(s,a,n),c=am(a,o,n),u=am(o,h,n),d=am(l,c,n),p=am(c,u,n),f=am(d,p,n);om([s,l,d,f],0,i,r),om([f,p,u,h],0,i,r)}var s,a;return r}function hm(t,e){return lm(t,0,t.length,e)}function lm(t,e,i,n,r){const s=r||[],a=t[e],o=t[i-1];let h=0,l=1;for(let n=e+1;n<i-1;++n){const e=sm(t[n],a,o);e>h&&(h=e,l=n)}return Math.sqrt(h)>n?(lm(t,e,l+1,n,s),lm(t,l,i,n,s)):(s.length||s.push(a),s.push(o)),s}function cm(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15,i=arguments.length>2?arguments[2]:void 0;const n=[],r=(t.length-1)/3;for(let i=0;i<r;i++)om(t,3*i,e,n);return i&&i>0?lm(n,0,n.length,i):n}const um="none";class dm{constructor(t){this.defaultOptions={maxRandomnessOffset:2,roughness:1,bowing:1,stroke:"#000",strokeWidth:1,curveTightness:0,curveFitting:.95,curveStepCount:9,fillStyle:"hachure",fillWeight:-1,hachureAngle:-41,hachureGap:-1,dashOffset:-1,dashGap:-1,zigzagOffset:-1,seed:0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!1},this.config=t||{},this.config.options&&(this.defaultOptions=this._o(this.config.options))}static newSeed(){return Math.floor(Math.random()*2**31)}_o(t){return t?Object.assign({},this.defaultOptions,t):this.defaultOptions}_d(t,e,i){return{shape:t,sets:e||[],options:i||this.defaultOptions}}line(t,e,i,n,r){const s=this._o(r);return this._d("line",[Nv(t,e,i,n,s)],s)}rectangle(t,e,i,n,r){const s=this._o(r),a=[],o=function(t,e,i,n,r){return function(t,e){return Gv(t,!0,e)}([[t,e],[t+i,e],[t+i,e+n],[t,e+n]],r)}(t,e,i,n,s);if(s.fill){const r=[[t,e],[t+i,e],[t+i,e+n],[t,e+n]];"solid"===s.fillStyle?a.push(Vv([r],s)):a.push(Yv([r],s))}return s.stroke!==um&&a.push(o),this._d("rectangle",a,s)}ellipse(t,e,i,n,r){const s=this._o(r),a=[],o=Fv(i,n,s),h=zv(t,e,s,o);if(s.fill)if("solid"===s.fillStyle){const i=zv(t,e,s,o).opset;i.type="fillPath",a.push(i)}else a.push(Yv([h.estimatedPoints],s));return s.stroke!==um&&a.push(h.opset),this._d("ellipse",a,s)}circle(t,e,i,n){const r=this.ellipse(t,e,i,i,n);return r.shape="circle",r}linearPath(t,e){const i=this._o(e);return this._d("linearPath",[Gv(t,!1,i)],i)}arc(t,e,i,n,r,s){let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0;const h=this._o(o),l=[],c=Hv(t,e,i,n,r,s,a,!0,h);if(a&&h.fill)if("solid"===h.fillStyle){const a=Object.assign({},h);a.disableMultiStroke=!0;const o=Hv(t,e,i,n,r,s,!0,!1,a);o.type="fillPath",l.push(o)}else l.push(function(t,e,i,n,r,s,a){const o=t,h=e;let l=Math.abs(i/2),c=Math.abs(n/2);l+=qv(.01*l,a),c+=qv(.01*c,a);let u=r,d=s;for(;u<0;)u+=2*Math.PI,d+=2*Math.PI;d-u>2*Math.PI&&(u=0,d=2*Math.PI);const p=(d-u)/a.curveStepCount,f=[];for(let t=u;t<=d;t+=p)f.push([o+l*Math.cos(t),h+c*Math.sin(t)]);return f.push([o+l*Math.cos(d),h+c*Math.sin(d)]),f.push([o,h]),Yv([f],a)}(t,e,i,n,r,s,h));return h.stroke!==um&&l.push(c),this._d("arc",l,h)}curve(t,e){const i=this._o(e),n=[],r=function(t,e){let i=Jv(t,1*(1+.2*e.roughness),e);if(!e.disableMultiStroke){const n=Jv(t,1.5*(1+.22*e.roughness),function(t){const e=Object.assign({},t);return e.randomizer=void 0,t.seed&&(e.seed=t.seed+1),e}(e));i=i.concat(n)}return{type:"path",ops:i}}(t,i);if(i.fill&&i.fill!==um&&t.length>=3){const e=cm(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=t.length;if(i<3)throw new Error("A curve must have at least three points.");const n=[];if(3===i)n.push(nm(t[0]),nm(t[1]),nm(t[2]),nm(t[2]));else{const i=[];i.push(t[0],t[0]);for(let e=1;e<t.length;e++)i.push(t[e]),e===t.length-1&&i.push(t[e]);const r=[],s=1-e;n.push(nm(i[0]));for(let t=1;t+2<i.length;t++){const e=i[t];r[0]=[e[0],e[1]],r[1]=[e[0]+(s*i[t+1][0]-s*i[t-1][0])/6,e[1]+(s*i[t+1][1]-s*i[t-1][1])/6],r[2]=[i[t+1][0]+(s*i[t][0]-s*i[t+2][0])/6,i[t+1][1]+(s*i[t][1]-s*i[t+2][1])/6],r[3]=[i[t+1][0],i[t+1][1]],n.push(r[1],r[2],r[3])}}return n}(t),10,(1+i.roughness)/2);"solid"===i.fillStyle?n.push(Vv([e],i)):n.push(Yv([e],i))}return i.stroke!==um&&n.push(r),this._d("curve",n,i)}polygon(t,e){const i=this._o(e),n=[],r=Gv(t,!0,i);return i.fill&&("solid"===i.fillStyle?n.push(Vv([t],i)):n.push(Yv([t],i))),i.stroke!==um&&n.push(r),this._d("polygon",n,i)}path(t,e){const i=this._o(e),n=[];if(!t)return this._d("path",n,i);t=(t||"").replace(/\n/g," ").replace(/(-\s)/g,"-").replace("/(ss)/g"," ");const r=i.fill&&"transparent"!==i.fill&&i.fill!==um,s=i.stroke!==um,a=!!(i.simplification&&i.simplification<1),o=function(t,e,i){const n=Dv(Lv(Iv(t))),r=[];let s=[],a=[0,0],o=[];const h=()=>{o.length>=4&&s.push(...cm(o,1)),o=[]},l=()=>{h(),s.length&&(r.push(s),s=[])};for(const{key:t,data:e}of n)switch(t){case"M":l(),a=[e[0],e[1]],s.push(a);break;case"L":h(),s.push([e[0],e[1]]);break;case"C":if(!o.length){const t=s.length?s[s.length-1]:a;o.push([t[0],t[1]])}o.push([e[0],e[1]]),o.push([e[2],e[3]]),o.push([e[4],e[5]]);break;case"Z":h(),s.push([a[0],a[1]])}if(l(),!i)return r;const c=[];for(const t of r){const e=hm(t,i);e.length&&c.push(e)}return c}(t,0,a?4-4*i.simplification:(1+i.roughness)/2);return r&&("solid"===i.fillStyle?n.push(Vv(o,i)):n.push(Yv(o,i))),s&&(a?o.forEach((t=>{n.push(Gv(t,!1,i))})):n.push(function(t,e){const i=Dv(Lv(Iv(t))),n=[];let r=[0,0],s=[0,0];for(const{key:t,data:a}of i)switch(t){case"M":{const t=1*(e.maxRandomnessOffset||0),i=e.preserveVertices;n.push({op:"move",data:a.map((n=>n+(i?0:qv(t,e))))}),s=[a[0],a[1]],r=[a[0],a[1]];break}case"L":n.push(...Kv(s[0],s[1],a[0],a[1],e)),s=[a[0],a[1]];break;case"C":{const[t,i,r,o,h,l]=a;n.push(...im(t,i,r,o,h,l,s,e)),s=[h,l];break}case"Z":n.push(...Kv(s[0],s[1],r[0],r[1],e)),s=[r[0],r[1]]}return{type:"path",ops:n}}(t,i))),this._d("path",n,i)}opsToPath(t,e){let i="";for(const n of t.ops){const t="number"==typeof e&&e>=0?n.data.map((t=>+t.toFixed(e))):n.data;switch(n.op){case"move":i+=`M${t[0]} ${t[1]} `;break;case"bcurveTo":i+=`C${t[0]} ${t[1]}, ${t[2]} ${t[3]}, ${t[4]} ${t[5]} `;break;case"lineTo":i+=`L${t[0]} ${t[1]} `}}return i.trim()}toPaths(t){const e=t.sets||[],i=t.options||this.defaultOptions,n=[];for(const t of e){let e=null;switch(t.type){case"path":e={d:this.opsToPath(t),stroke:i.stroke,strokeWidth:i.strokeWidth,fill:um};break;case"fillPath":e={d:this.opsToPath(t),stroke:um,strokeWidth:0,fill:i.fill||um};break;case"fillSketch":e=this.fillSketch(t,i)}e&&n.push(e)}return n}fillSketch(t,e){let i=e.fillWeight;return i<0&&(i=e.strokeWidth/2),{d:this.opsToPath(t),stroke:e.fill||um,strokeWidth:i,fill:um}}}class pm{constructor(t,e){this.canvas=t,this.ctx=this.canvas.getContext("2d"),this.gen=new dm(e)}draw(t){const e=t.sets||[],i=t.options||this.getDefaultOptions(),n=this.ctx,r=t.options.fixedDecimalPlaceDigits;for(const s of e)switch(s.type){case"path":n.save(),n.strokeStyle="none"===i.stroke?"transparent":i.stroke,n.lineWidth=i.strokeWidth,i.strokeLineDash&&n.setLineDash(i.strokeLineDash),i.strokeLineDashOffset&&(n.lineDashOffset=i.strokeLineDashOffset),this._drawToContext(n,s,r),n.restore();break;case"fillPath":{n.save(),n.fillStyle=i.fill||"";const e="curve"===t.shape||"polygon"===t.shape||"path"===t.shape?"evenodd":"nonzero";this._drawToContext(n,s,r,e),n.restore();break}case"fillSketch":this.fillSketch(n,s,i)}}fillSketch(t,e,i){let n=i.fillWeight;n<0&&(n=i.strokeWidth/2),t.save(),i.fillLineDash&&t.setLineDash(i.fillLineDash),i.fillLineDashOffset&&(t.lineDashOffset=i.fillLineDashOffset),t.strokeStyle=i.fill||"",t.lineWidth=n,this._drawToContext(t,e,i.fixedDecimalPlaceDigits),t.restore()}_drawToContext(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"nonzero";t.beginPath();for(const n of e.ops){const e="number"==typeof i&&i>=0?n.data.map((t=>+t.toFixed(i))):n.data;switch(n.op){case"move":t.moveTo(e[0],e[1]);break;case"bcurveTo":t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]);break;case"lineTo":t.lineTo(e[0],e[1])}}"fillPath"===e.type?t.fill(n):t.stroke()}get generator(){return this.gen}getDefaultOptions(){return this.gen.defaultOptions}line(t,e,i,n,r){const s=this.gen.line(t,e,i,n,r);return this.draw(s),s}rectangle(t,e,i,n,r){const s=this.gen.rectangle(t,e,i,n,r);return this.draw(s),s}ellipse(t,e,i,n,r){const s=this.gen.ellipse(t,e,i,n,r);return this.draw(s),s}circle(t,e,i,n){const r=this.gen.circle(t,e,i,n);return this.draw(r),r}linearPath(t,e){const i=this.gen.linearPath(t,e);return this.draw(i),i}polygon(t,e){const i=this.gen.polygon(t,e);return this.draw(i),i}arc(t,e,i,n,r,s){let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6],o=arguments.length>7?arguments[7]:void 0;const h=this.gen.arc(t,e,i,n,r,s,a,o);return this.draw(h),h}curve(t,e){const i=this.gen.curve(t,e);return this.draw(i),i}path(t,e){const i=this.gen.path(t,e);return this.draw(i),i}}var fm=(t,e)=>new pm(t,e);const gm={maxRandomnessOffset:3,roughness:1,bowing:1,curveFitting:.95,curveTightness:void 0,curveStepCount:9,fillStyle:"hachure",fillWeight:void 0,hachureAngle:60,hachureGap:6,simplification:0,dashOffset:void 0,dashGap:void 0,zigzagOffset:void 0,seed:1,fillLineDash:void 0,fillLineDashOffset:void 0,disableMultiStroke:!1,disableMultiStrokeFill:!1,preserveVertices:!0,fixedDecimalPlaceDigits:void 0};class vm{drawShape(t,e,i,n,r,s,a,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,a,o)}}var mm=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},ym=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bm=function(t,e){return function(i,n){e(i,n,t)}};let xm=class extends vm{constructor(t){super(),this.canvasRenderer=t,this.style="rough",this.type="arc",this.numberType=ro}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,a=fm(s);r.highPerformanceSave();const o=t.getGraphicTheme();let{x:h=o.x,y:l=o.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const{dx:e=o.dx,dy:i=o.dy}=t.attribute;h+=e,l+=i,r.setTransformForCurrent()}else h=0,l=0,r.transformFromMatrix(t.transMatrix,!0);const c=new Ni,{fill:u=o.fill,stroke:d=o.stroke,lineWidth:p=o.lineWidth,outerRadius:f=o.outerRadius,innerRadius:g=o.innerRadius,maxRandomnessOffset:v=gm.maxRandomnessOffset,roughness:m=gm.roughness,bowing:y=gm.bowing,curveFitting:b=gm.curveFitting,curveTightness:x=gm.curveTightness,curveStepCount:w=gm.curveStepCount,fillStyle:S=gm.fillStyle,fillWeight:A=gm.fillWeight,hachureAngle:T=gm.hachureAngle,hachureGap:C=gm.hachureGap,simplification:_=gm.simplification,dashOffset:B=gm.dashOffset,dashGap:P=gm.dashGap,zigzagOffset:R=gm.zigzagOffset,seed:M=gm.seed,fillLineDash:E=gm.fillLineDash,fillLineDashOffset:k=gm.fillLineDashOffset,disableMultiStroke:O=gm.disableMultiStroke,disableMultiStrokeFill:I=gm.disableMultiStrokeFill,preserveVertices:L=gm.preserveVertices,fixedDecimalPlaceDigits:D=gm.fixedDecimalPlaceDigits}=t.attribute;Zo(t,c,h,l,f,g),a.path(c.toString(),{fill:u||void 0,stroke:d||void 0,strokeWidth:p,maxRandomnessOffset:v,roughness:m,bowing:y,curveFitting:b,curveTightness:x,curveStepCount:w,fillStyle:S,fillWeight:A,hachureAngle:T,hachureGap:C,simplification:_,dashOffset:B,dashGap:P,zigzagOffset:R,seed:M,fillLineDash:E,fillLineDashOffset:k,disableMultiStroke:O,disableMultiStrokeFill:I,preserveVertices:L,fixedDecimalPlaceDigits:D}),r.highPerformanceRestore()}};xm=mm([g(),bm(0,p(t.DefaultCanvasArcRender)),ym("design:paramtypes",[Object])],xm);var wm=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Sm=class extends t.DefaultCanvasAreaRender{constructor(){super(...arguments),this.style="rough"}drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f){if(f)return super.drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f);t.highPerformanceSave();const g=t.canvas.nativeCanvas,v=fm(g,{}),m=new Ni;Ol(m,e,h,{offsetX:l,offsetY:c});const{maxRandomnessOffset:y=gm.maxRandomnessOffset,roughness:b=gm.roughness,bowing:x=gm.bowing,curveFitting:w=gm.curveFitting,curveTightness:S=gm.curveTightness,curveStepCount:A=gm.curveStepCount,fillStyle:T=gm.fillStyle,fillWeight:C=gm.fillWeight,hachureAngle:_=gm.hachureAngle,hachureGap:B=gm.hachureGap,simplification:P=gm.simplification,dashOffset:R=gm.dashOffset,dashGap:M=gm.dashGap,zigzagOffset:E=gm.zigzagOffset,seed:k=gm.seed,fillLineDash:O=gm.fillLineDash,fillLineDashOffset:I=gm.fillLineDashOffset,disableMultiStroke:L=gm.disableMultiStroke,disableMultiStrokeFill:D=gm.disableMultiStrokeFill,preserveVertices:j=gm.preserveVertices,fixedDecimalPlaceDigits:U=gm.fixedDecimalPlaceDigits}=a;let{fill:W,stroke:N,lineWidth:G}=a;return Array.isArray(o)?o.forEach((t=>{W=null!=W?W:t.fill,N=null!=N?N:t.stroke,G=null!=G?G:t.lineWidth})):(W=null!=W?W:o.fill,N=null!=N?N:o.stroke,G=null!=G?G:o.lineWidth),v.path(m.toString(),{fill:i?W:void 0,strokeWidth:G,maxRandomnessOffset:y,roughness:b,bowing:x,curveFitting:w,curveTightness:S,curveStepCount:A,fillStyle:T,fillWeight:C,hachureAngle:_,hachureGap:B,simplification:P,dashOffset:R,dashGap:M,zigzagOffset:E,seed:k,fillLineDash:O,fillLineDashOffset:I,disableMultiStroke:L,disableMultiStrokeFill:D,preserveVertices:j,fixedDecimalPlaceDigits:U}),t.highPerformanceRestore(),!1}};Sm=wm([g()],Sm);var Am=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Tm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cm=function(t,e){return function(i,n){e(i,n,t)}};let _m=class extends vm{constructor(t){super(),this.canvasRenderer=t,this.style="rough",this.type="circle",this.numberType=oo}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,a=fm(s,{}),o=t.getGraphicTheme();let{x:h=o.x,y:l=o.y}=t.attribute;t.transMatrix.onlyTranslate()?r.onlyTranslate()||r.clearMatrix():(h=0,l=0,r.transformFromMatrix(t.transMatrix,!0));const{radius:c=o.radius,fill:u=o.fill,stroke:d=o.stroke,lineWidth:p=o.lineWidth}=t.attribute;a.circle(h,l,c,{fill:u||void 0,stroke:d||void 0,strokeWidth:p,fillStyle:"zigzag",roughness:.5})}};_m=Am([g(),Cm(0,p(t.DefaultCanvasCircleRender)),Tm("design:paramtypes",[Object])],_m);var Bm=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Pm=class extends t.DefaultCanvasLineRender{constructor(){super(...arguments),this.style="rough"}drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f){if(p||f)return super.drawSegmentItem(t,e,i,n,r,s,a,o,h,l,c,u,d,p,f);t.highPerformanceSave();const g=t.canvas.nativeCanvas,v=fm(g,{}),m=new Ni;Rl(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:u});const{maxRandomnessOffset:y=gm.maxRandomnessOffset,roughness:b=gm.roughness,bowing:x=gm.bowing,curveFitting:w=gm.curveFitting,curveTightness:S=gm.curveTightness,curveStepCount:A=gm.curveStepCount,fillStyle:T=gm.fillStyle,fillWeight:C=gm.fillWeight,hachureAngle:_=gm.hachureAngle,hachureGap:B=gm.hachureGap,simplification:P=gm.simplification,dashOffset:R=gm.dashOffset,dashGap:M=gm.dashGap,zigzagOffset:E=gm.zigzagOffset,seed:k=gm.seed,fillLineDash:O=gm.fillLineDash,fillLineDashOffset:I=gm.fillLineDashOffset,disableMultiStroke:L=gm.disableMultiStroke,disableMultiStrokeFill:D=gm.disableMultiStrokeFill,preserveVertices:j=gm.preserveVertices,fixedDecimalPlaceDigits:U=gm.fixedDecimalPlaceDigits}=a;let{fill:W,stroke:N,lineWidth:G}=a;return Array.isArray(o)?o.forEach((t=>{W=null!=W?W:t.fill,N=null!=N?N:t.stroke,G=null!=G?G:t.lineWidth})):(W=null!=W?W:o.fill,N=null!=N?N:o.stroke,G=null!=G?G:o.lineWidth),v.path(m.toString(),{fill:i?W:void 0,stroke:n?N:void 0,strokeWidth:G,maxRandomnessOffset:y,roughness:b,bowing:x,curveFitting:w,curveTightness:S,curveStepCount:A,fillStyle:T,fillWeight:C,hachureAngle:_,hachureGap:B,simplification:P,dashOffset:R,dashGap:M,zigzagOffset:E,seed:k,fillLineDash:O,fillLineDashOffset:I,disableMultiStroke:L,disableMultiStrokeFill:D,preserveVertices:j,fixedDecimalPlaceDigits:U}),t.highPerformanceRestore(),!1}};Pm=Bm([g()],Pm);var Rm=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Mm=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Em=function(t,e){return function(i,n){e(i,n,t)}};let km=class extends vm{constructor(t){super(),this.canvasRenderer=t,this.style="rough",this.type="path",this.numberType=po}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,a=fm(s,{});r.highPerformanceSave();const o=t.getGraphicTheme();r.transformFromMatrix(t.transMatrix,!0);const{fill:h=o.fill,stroke:l=o.stroke,lineWidth:c=o.lineWidth,path:u=o.path,maxRandomnessOffset:d=gm.maxRandomnessOffset,roughness:p=gm.roughness,bowing:f=gm.bowing,curveFitting:g=gm.curveFitting,curveTightness:v=gm.curveTightness,curveStepCount:m=gm.curveStepCount,fillStyle:y=gm.fillStyle,fillWeight:b=gm.fillWeight,hachureAngle:x=gm.hachureAngle,hachureGap:w=gm.hachureGap,simplification:S=gm.simplification,dashOffset:A=gm.dashOffset,dashGap:T=gm.dashGap,zigzagOffset:C=gm.zigzagOffset,seed:_=gm.seed,fillLineDash:B=gm.fillLineDash,fillLineDashOffset:P=gm.fillLineDashOffset,disableMultiStroke:R=gm.disableMultiStroke,disableMultiStrokeFill:M=gm.disableMultiStrokeFill,preserveVertices:E=gm.preserveVertices,fixedDecimalPlaceDigits:k=gm.fixedDecimalPlaceDigits}=t.attribute;"string"==typeof u&&a.path(u,{fill:h||void 0,stroke:l||void 0,strokeWidth:c,maxRandomnessOffset:d,roughness:p,bowing:f,curveFitting:g,curveTightness:v,curveStepCount:m,fillStyle:y,fillWeight:b,hachureAngle:x,hachureGap:w,simplification:S,dashOffset:A,dashGap:T,zigzagOffset:C,seed:_,fillLineDash:B,fillLineDashOffset:P,disableMultiStroke:R,disableMultiStrokeFill:M,preserveVertices:E,fixedDecimalPlaceDigits:k}),r.highPerformanceRestore()}};km=Rm([g(),Em(0,p(t.DefaultCanvasPathRender)),Mm("design:paramtypes",[Object])],km);var Om=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Im=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Lm=function(t,e){return function(i,n){e(i,n,t)}};let Dm=class extends vm{constructor(t){super(),this.canvasRenderer=t,this.style="rough",this.type="rect",this.numberType=vo}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,a=fm(s);r.highPerformanceSave();const o=t.getGraphicTheme();let{x:h=o.x,y:l=o.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const{dx:e=o.dx,dy:i=o.dy}=t.attribute;h+=e,l+=i,r.setTransformForCurrent()}else h=0,l=0,r.transformFromMatrix(t.transMatrix,!0);const{fill:c=o.fill,stroke:u=o.stroke,fillColor:d=o.fill,strokeColor:p=o.stroke,x1:f,y1:g,lineWidth:v=o.lineWidth,maxRandomnessOffset:m=gm.maxRandomnessOffset,roughness:y=gm.roughness,bowing:b=gm.bowing,curveFitting:x=gm.curveFitting,curveTightness:w=gm.curveTightness,curveStepCount:S=gm.curveStepCount,fillStyle:A=gm.fillStyle,fillWeight:T=gm.fillWeight,hachureAngle:C=gm.hachureAngle,hachureGap:_=gm.hachureGap,simplification:B=gm.simplification,dashOffset:P=gm.dashOffset,dashGap:R=gm.dashGap,zigzagOffset:M=gm.zigzagOffset,seed:E=gm.seed,fillLineDash:k=gm.fillLineDash,fillLineDashOffset:O=gm.fillLineDashOffset,disableMultiStroke:I=gm.disableMultiStroke,disableMultiStrokeFill:L=gm.disableMultiStrokeFill,preserveVertices:D=gm.preserveVertices,fixedDecimalPlaceDigits:j=gm.fixedDecimalPlaceDigits}=t.attribute;let{width:U=o.width,height:W=o.height}=t.attribute;U=(null!=U?U:f-h)||0,W=(null!=W?W:g-l)||0,a.rectangle(h,l,U,W,{fill:c?d:void 0,stroke:u?p:void 0,strokeWidth:v,maxRandomnessOffset:m,roughness:y,bowing:b,curveFitting:x,curveTightness:w,curveStepCount:S,fillStyle:A,fillWeight:T,hachureAngle:C,hachureGap:_,simplification:B,dashOffset:P,dashGap:R,zigzagOffset:M,seed:E,fillLineDash:k,fillLineDashOffset:O,disableMultiStroke:I,disableMultiStrokeFill:L,preserveVertices:D,fixedDecimalPlaceDigits:j}),r.highPerformanceRestore()}};Dm=Om([g(),Lm(0,p(t.DefaultCanvasRectRender)),Im("design:paramtypes",[Object])],Dm);var jm=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Um=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wm=function(t,e){return function(i,n){e(i,n,t)}};let Nm=class extends Fh{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=bo,this.style="rough"}draw(t,e,i,n){const{context:r}=i;if(!r)return;const s=r.canvas.nativeCanvas,a=fm(s);r.highPerformanceSave();const o=t.getGraphicTheme(),h=this.transform(t,o,r),{x:l,y:c,z:u,lastModelMatrix:d}=h,p=t.getParsedPath();if(!p)return;const{fill:f=o.fill,stroke:g=o.stroke,fillColor:v=o.fill,strokeColor:m=o.stroke,size:y=o.size,lineWidth:b=o.lineWidth,maxRandomnessOffset:x=gm.maxRandomnessOffset,roughness:w=gm.roughness,bowing:S=gm.bowing,curveFitting:A=gm.curveFitting,curveTightness:T=gm.curveTightness,curveStepCount:C=gm.curveStepCount,fillStyle:_=gm.fillStyle,fillWeight:B=gm.fillWeight,hachureAngle:P=gm.hachureAngle,hachureGap:R=gm.hachureGap,simplification:M=gm.simplification,dashOffset:E=gm.dashOffset,dashGap:k=gm.dashGap,zigzagOffset:O=gm.zigzagOffset,seed:I=gm.seed,fillLineDash:L=gm.fillLineDash,fillLineDashOffset:D=gm.fillLineDashOffset,disableMultiStroke:j=gm.disableMultiStroke,disableMultiStrokeFill:U=gm.disableMultiStrokeFill,preserveVertices:W=gm.preserveVertices,fixedDecimalPlaceDigits:N=gm.fixedDecimalPlaceDigits}=t.attribute;let G="";if(p.drawToSvgPath)G=p.drawToSvgPath(y,l,c);else{const t=new Ni;p.draw(t,y,l,c)&&t.closePath(),G=t.toString()}a.path(G,{fill:f?v:void 0,stroke:g?m:void 0,strokeWidth:b,maxRandomnessOffset:x,roughness:w,bowing:S,curveFitting:A,curveTightness:T,curveStepCount:C,fillStyle:_,fillWeight:B,hachureAngle:P,hachureGap:R,simplification:M,dashOffset:E,dashGap:k,zigzagOffset:O,seed:I,fillLineDash:L,fillLineDashOffset:D,disableMultiStroke:j,disableMultiStrokeFill:U,preserveVertices:W,fixedDecimalPlaceDigits:N}),r.highPerformanceRestore()}drawShape(t,e,i,n,r,s,a,o){if(this.canvasRenderer.drawShape)return this.canvasRenderer.drawShape(t,e,i,n,r,s,a,o)}};Nm=jm([g(),Wm(0,p(t.DefaultCanvasSymbolRender)),Um("design:paramtypes",[Object])],Nm);var Gm=new i((t=>{t(_m).toSelf().inSingletonScope(),t(Bc).to(_m),t(Dm).toSelf().inSingletonScope(),t(Bc).to(Dm),t(km).toSelf().inSingletonScope(),t(Bc).to(km),t(Nm).toSelf().inSingletonScope(),t(Bc).to(Nm),t(Pm).toSelf().inSingletonScope(),t(Bc).to(Pm),t(Sm).toSelf().inSingletonScope(),t(Bc).to(Sm),t(xm).toSelf().inSingletonScope(),t(Bc).to(xm)}));const Fm=Symbol.for("MathPickerContribution"),zm=Symbol.for("MathArcPicker"),Hm=Symbol.for("MathAreaPicker"),Vm=Symbol.for("MathCirclePicker"),Ym=Symbol.for("MathImagePicker"),Xm=Symbol.for("MathLinePicker"),$m=Symbol.for("MathPathPicker"),qm=Symbol.for("MathRectPicker"),Km=Symbol.for("MathSymbolPicker"),Zm=Symbol.for("MathTextPicker"),Jm=Symbol.for("MathPolygonPicker"),Qm=Symbol.for("MathGlyphPicker"),ty=Symbol.for("CanvasArcPicker"),ey=Symbol.for("CanvasArc3dPicker"),iy=Symbol.for("CanvasAreaPicker"),ny=Symbol.for("CanvasCirclePicker"),ry=Symbol.for("CanvasImagePicker"),sy=Symbol.for("CanvasGifImagePicker"),ay=Symbol.for("CanvasLinePicker"),oy=Symbol.for("CanvasPathPicker"),hy=Symbol.for("CanvasRectPicker"),ly=Symbol.for("CanvasRect3dPicker"),cy=Symbol.for("CanvasSymbolPicker"),uy=Symbol.for("CanvasTextPicker"),dy=Symbol.for("CanvasPolygonPicker"),py=Symbol.for("CanvasPyramid3dPicker"),fy=Symbol.for("CanvasRichTextPicker"),gy=Symbol.for("CanvasGlyphPicker"),vy=Symbol.for("CanvasGroupPicker"),my=Symbol.for("CanvasPickerContribution"),yy={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},by=Object.keys(yy);function xy(t){return Jl.richtext(t?t.attribute:{})}xy.Text=function(t){return Object.assign({type:"rich/text"},t)},xy.Image=function(t){return Object.assign({type:"rich/image"},t)};var wy=function(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(i[n[r]]=t[n[r]])}return i};function Sy(t,e){if(at(t))return t.forEach((t=>Sy(t,e)));e.push(t)}const Ay=Po;function Ty(t){if(!t||!t.$$typeof)return t;const e=t.type,{attribute:i,children:n,stateProxy:r,id:s,name:a}=t.props,o=e({attribute:i}),h=function(t,e,i){let n,r=!1;switch(t.type){case"richtext":break;case"rich/text":n=t.attribute||{},i&&(n.text=i),t.attribute=n;break;case"rich/image":n=t.attribute||{};break;default:r=!0}return r?Object.keys(e).forEach((i=>{const n=yy[i];n&&t.on(n,e[i])})):"richtext"===t.type&&(t.attribute.textConfig=i.map((t=>Ty(t))).filter((t=>t))),n}(o,t.props,n);return h||(r&&(o.stateProxy=r),o.id=s,o.name=a,Cy(n,o),o)}function Cy(t,e){at(t)?t.forEach((t=>{if(at(t))Cy(t,e);else{const i=Ty(t);i&&i.type&&e.add(i)}})):t&&e.add(Ty(t))}const _y=(t,e)=>{const i=e.x-t.x,n=e.y-t.y;return Math.abs(i)>Math.abs(n)?i>0?"right":"left":n>0?"down":"up"},By=(t,e)=>{const i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return Math.sqrt(i*i+n*n)};var Py=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Ry=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const My=[0,0,0];let Ey=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},Vi),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},Xi),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},$i),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new ue(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new ue(1,0,0,1,0,0),this._clearMatrix=new ue(1,0,0,1,0,0),this.baseGlobalAlpha=1}reset(){this.stack.length&&wt.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new ue(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Ih.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(Ih.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(Ih.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,n){let r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,n,!1),this.scale(t,e,!1),this.translate(-i,-n,!1),r&&this.setTransformForCurrent()}setTransform(t,e,i,n,r,s){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(o*t,o*e,o*i,o*n,o*r,o*s),a&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,n,r,s){let a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,n,r,s),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),n&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,n,r,s,a){if(a=a||0,this.camera){const o=[];((t,e,i,n,r,s,a,o)=>{if(o)for(;i>e;)i-=Mt;else for(;i<e;)i+=Mt;const h=Bt/3*(i>e?1:-1);let l=e,c=l;for(;c!==i;){c=h>0?Math.min(c+h,i):Math.max(c+h,i);const e=Math.abs(c-l),o=4*Math.tan(e/4)/3,u=c<l?-1:1,d=Math.cos(l),p=Math.sin(l),f=Math.cos(c),g=Math.sin(c),v=d*s+n,m=p*a+r,y=f*s+n,b=g*a+r,x=s*o*u,w=a*o*u;t.push([v-x*p,m+w*d,y+x*g,b-w*f,y,b]),l=c}})(o,n,r,t,e,i,i,s);for(let t=0;t<o.length;++t){const e=o[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],a)}}else this.nativeContext.arc(t,e,Math.max(0,i),n,r,s)}arcTo(t,e,i,n,r){this.nativeContext.arcTo(t,e,i,n,r)}bezierCurveTo(t,e,i,n,r,s,a){if(a=a||0,this.camera){let o=a,h=a;this.modelMatrix&&(Ph(My,[t,e,a],this.modelMatrix),t=My[0],e=My[1],o=My[2],Ph(My,[i,n,a],this.modelMatrix),i=My[0],n=My[1],h=My[2],Ph(My,[r,s,a],this.modelMatrix),r=My[0],s=My[1],a=My[2]);let l=this.camera.vp(r,s,a);r=l.x,s=l.y,l=this.camera.vp(t,e,o),t=l.x,e=l.y,l=this.camera.vp(i,n,h),i=l.x,n=l.y}this.nativeContext.bezierCurveTo(t,e,i,n,r,s)}closePath(){this.nativeContext.closePath()}ellipse(t,e,i,n,r,s,a,o){null==o?this.nativeContext.ellipse(t,e,i,n,r,s,a):this.nativeContext.ellipse(t,e,i,n,r,s,a,o)}lineTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Ph(My,[t,e,i],this.modelMatrix),t=My[0],e=My[1],i=My[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Ph(My,[t,e,i],this.modelMatrix),t=My[0],e=My[1],i=My[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,i,n,r){if(r=r||0,this.camera){let s=r;this.modelMatrix&&(Ph(My,[t,e,r],this.modelMatrix),t=My[0],e=My[1],s=My[2],Ph(My,[i,n,r],this.modelMatrix),i=My[0],n=My[1],r=My[2]);let a=this.camera.vp(i,n,r);i=a.x,n=a.y,a=this.camera.vp(t,e,s),t=a.x,e=a.y}this.nativeContext.quadraticCurveTo(t,e,i,n)}rect(t,e,i,n,r){r=r||0,this.camera?(this.moveTo(t,e,r),this.lineTo(t+i,e,r),this.lineTo(t+i,e+n,r),this.lineTo(t,e+n,r),this.closePath()):this.nativeContext.rect(t,e,i,n)}createImageData(){const t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}createLinearGradient(t,e,i,n){return isFinite(t+e+i+n)||(t=0,e=0,i=0,n=0),this.nativeContext.createLinearGradient(t,e,i,n)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,i,n,r,s){return this.nativeContext.createRadialGradient(t,e,i,n,r,s)}createConicGradient(t,e,i,n){let r,s=!1;const a=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),s=!0},GetPattern(o,h,l){return s&&(l||(l=n-i),r=ih(a,this.stops,t,e,l,i,n,o,h),s=!1),r}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,n){this.nativeContext.fillRect(t,e,i,n)}clearRect(t,e,i,n){this.nativeContext.clearRect(t,e,i,n)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Ph(My,[t,e,i],this.modelMatrix),t=My[0],e=My[1],i=My[2]);const n=this.camera.vp(t,e,i);t=n.x,e=n.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(Ph(My,[t,e,i],this.modelMatrix),t=My[0],e=My[1],i=My[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(Ph(My,[e,i,n],this.modelMatrix),e=My[0],i=My[1],n=My[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,n){return this.nativeContext.getImageData(t,e,i,n)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mn.global.measureTextMethod;var i,n;if(!e||"native"===e)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=mn.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas.nativeCanvas)));const r=null!==(i=this.fontFamily)&&void 0!==i?i:$i.fontFamily,s=null!==(n=this.fontSize)&&void 0!==n?n:$i.fontSize;return this.mathTextMeasure.textSpec.fontFamily===r&&this.mathTextMeasure.textSpec.fontSize===s||(this.mathTextMeasure.textSpec.fontFamily=r,this.mathTextMeasure.textSpec.fontSize=s,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,e)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?e[0]&&i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,n){this.nativeContext.strokeRect(t,e,i,n)}strokeText(t,e,i,n){if(n=n||0,this.camera){this.modelMatrix&&(Ph(My,[e,i,n],this.modelMatrix),e=My[0],i=My[1],n=My[2]);const t=this.camera.vp(e,i,n);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}setCommonStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setCommonStyle(t,e,i,n,r[0]);const s=Object.create(r[0]);return r.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setCommonStyle(t,e,i,n,s)}return this._setCommonStyle(t,e,i,n,r)}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:a=r.fillOpacity,opacity:o=r.opacity,fill:h=r.fill}=e;s.globalAlpha=a*o*this.baseGlobalAlpha,a>1e-12&&o>1e-12&&(s.fillStyle=wn(this,h,t,i,n))}setShadowBlendStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);const n=Object.create(i[0]);return i.forEach(((t,e)=>{0!==e&&Object.assign(n,t)})),this._setShadowBlendStyle(t,e,n)}return this._setShadowBlendStyle(t,e,i)}_setShadowBlendStyle(t,e,i){const n=this.nativeContext;i||(i=this.fillAttributes);const{opacity:r=i.opacity,shadowBlur:s=i.shadowBlur,shadowColor:a=i.shadowColor,shadowOffsetX:o=i.shadowOffsetX,shadowOffsetY:h=i.shadowOffsetY,blur:l=i.blur,globalCompositeOperation:c=i.globalCompositeOperation}=e;r<=1e-12||(s||o||h?(n.shadowBlur=s*this.dpr,n.shadowColor=a,n.shadowOffsetX=o*this.dpr,n.shadowOffsetY=h*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(n.shadowBlur=0,n.shadowOffsetX=0,n.shadowOffsetY=0),l?(n.filter=`blur(${l}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(n.filter="blur(0px)",this._clearFilterStyle=!1),c?(n.globalCompositeOperation=c,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(n.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(t,e,i,n,r){if(Array.isArray(r)){if(r.length<=1)return this._setStrokeStyle(t,e,i,n,r[0]);const s=Object.create(r[0]);return r.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setStrokeStyle(t,e,i,n,s)}return this._setStrokeStyle(t,e,i,n,r)}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(s.globalAlpha=a*o*this.baseGlobalAlpha,a>1e-12&&o>1e-12){const{lineWidth:a=r.lineWidth,stroke:o=r.stroke,lineJoin:h=r.lineJoin,lineDash:l=r.lineDash,lineCap:c=r.lineCap,miterLimit:u=r.miterLimit,keepStrokeScale:d=r.keepStrokeScale}=e;s.lineWidth=d?a:xn(this,a,this.dpr),s.strokeStyle=wn(this,o,t,i,n),s.lineJoin=h,l&&s.setLineDash(l),s.lineCap=c,s.miterLimit=u}}setTextStyleWithoutAlignBaseline(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;t.font?n.font=t.font:n.font=se(t,e,r&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:s=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=s,this.fontSize=a,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){var n,r;const s=this.nativeContext;e||(e=this.textAttributes),t.font?s.font=t.font:s.font=se(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:a=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=a,this.fontSize=o,s.textAlign=null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(this._clearMatrix,t,e)}setClearMatrix(t,e,i,n,r,s){this._clearMatrix.setValue(t,e,i,n,r,s)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>Ih.free(t))),this.stack.length=0}};Ey.env="browser",Ey=Py([g(),Ry("design:paramtypes",[Object,Number])],Ey);var ky=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Oy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Iy=class extends Af{constructor(t){super(t)}init(t){const{container:e}=t;if("string"==typeof e){const t=mn.global.getElementById(e);t&&(this._container=t)}else this._container=e;this._context=new Ey(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:i=this._displayHeight,dpr:n=this._dpr,x:r=this._x,y:s=this._y}=t,{nativeCanvas:a}=this;a.width=e*n,a.height=i*n,!a.style||this.setCanvasStyle(a,r,s,e,i),t.id&&(a.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,n,r){this.controled&&(t.style.width=`${n}px`,t.style.height=`${r}px`)}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}resize(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}};function Ly(t,e){return new i((i=>{i(Un).toDynamicValue((()=>e=>new t(e))).whenTargetNamed(t.env),i(Wn).toDynamicValue((()=>(t,i)=>new e(t,i))).whenTargetNamed(e.env)}))}Iy.env="browser",Iy=ky([g(),Oy("design:paramtypes",[Object])],Iy);const Dy=Ly(Iy,Ey);var jy=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Uy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Wy=function(t,e){return function(i,n){e(i,n,t)}};let Ny=class extends t.DefaultPickService{constructor(t,e,i){super(i),this.contributions=t,this.drawContribution=e,this.pickItemInterceptorContributions=i,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(t,e){this.pickCanvas=vr.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i,n){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.beforePickItem){const r=s.beforePickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n),a=s?t:null,o={graphic:a,params:s};if(a)return o;if(this.InterceptorContributions.length)for(let r=0;r<this.InterceptorContributions.length;r++){const s=this.InterceptorContributions[r];if(s.afterPickItem){const r=s.afterPickItem(t,this,e,n,{parentMatrix:i});if(r)return r}}return o}};Ny=jy([g(),Wy(0,p(k)),Wy(0,v(my)),Wy(1,p(Gc)),Wy(2,p(k)),Wy(2,v(vp)),Uy("design:paramtypes",[Object,Object,Object])],Ny);var Gy=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Fy=class{constructor(){this.type="group",this.numberType=lo}contains(t,e,i){return!1}};Fy=Gy([g()],Fy);const zy=new i(((t,e,i,n)=>{zy.__vloaded||(zy.__vloaded=!0,t(vy).to(Fy).inSingletonScope(),t(my).toService(vy),I(t,my))}));zy.__vloaded=!1;var Hy=zy;const Vy=new i(((t,e,i,n)=>{i(Ny)||t(Ny).toSelf().inSingletonScope(),i(su)?n(su).toService(Ny):t(su).toService(Ny)}));function Yy(t){t.load(Hy),t.load(Vy)}var Xy,$y=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},qy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ky=Xy=class extends t.BaseWindowHandlerContribution{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${Xy.idprefix}_${Xy.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=mn.global,this.viewBox=new le,this.modelMatrix=new ue(1,0,0,1,0,0)}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>n)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let i;if(i="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!i)throw new Error("发生错误,containerId可能传入有误");t.offscreen?i=null:i.appendChild(e);const n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:i,id:Xy.GenerateCanvasId(),canvasControled:!0};this.canvas=new Iy(n)}createWindowByCanvas(t){var e;let i;if("string"==typeof t.canvas){if(i=this.global.getElementById(t.canvas),!i)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=t.canvas;if(!i)throw new Error("发生错误,传入的canvas不正确");let n=t.width,r=t.height;if(null==n||null==r||!t.canvasControled){const t=i.getBoundingClientRect();n=t.width,r=t.height}let s=t.dpr;null==s&&(s=null!==(e=i.getContext("2d").pixelRatio)&&void 0!==e?e:i.width/n),this.canvas=new Iy({width:n,height:r,dpr:s,nativeCanvas:i,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){var t;return null!==(t=this.canvas.nativeCanvas.style)&&void 0!==t?t:{}}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};Ky.env="browser",Ky.idprefix="visactor_window",Ky.prefix_count=0,Ky=Xy=$y([g(),qy("design:paramtypes",[])],Ky);const Zy=new i((t=>{t(Ky).toSelf(),t(xr).toDynamicValue((t=>t.container.get(Ky))).whenTargetNamed(Ky.env)}));var Jy=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Qy=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tb=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};class eb{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function ib(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.createElement("img");if(mn.global.isImageAnonymous&&(i.crossOrigin="anonymous"),e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return i.src=t,i.complete?Promise.resolve(i):new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}))}t.BrowserEnvContribution=class extends t.BaseEnvContribution{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var i,n;let r=0,s=0,a=0,o=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};r=e.clientX||0,s=e.clientY||0,a=r,o=s}else r=t.clientX||0,s=t.clientY||0,a=t.offsetX||0,o=t.offsetY||0;if(e){const t=r,i=s,a=e.getBoundingClientRect(),o=null===(n=e.getNativeHandler)||void 0===n?void 0:n.call(e).nativeCanvas;let h,l;return o&&(h=a.width/o.offsetWidth,l=a.height/o.offsetHeight),{x:(t-a.left)/(lt(h)?h:1),y:(i-a.top)/(lt(l)?l:1)}}return{x:a,y:o}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new eb(t)}return new le}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:i,height:n,style:r}=e;return r&&(st(r)?t.setAttribute("style",r):Object.keys(r).forEach((e=>{t.style[e]=r[e]}))),null!=i&&(t.style.width=`${i}px`),null!=n&&(t.style.height=`${n}px`),!0}createDom(t){const{tagName:e="div",parent:i}=t,n=document.createElement(e);if(this.updateDom(n,t),i){const t=st(i)?this.getElementById(i):i;t&&t.appendChild&&t.appendChild(n)}return n}loadImage(t){return ib(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return ib(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var i,n;const r=document.createElement("canvas");t.id&&(r.id=null!==(i=t.id)&&void 0!==i?i:e.GenAutoIncrementId().toString());const s=null!==(n=t.dpr)&&void 0!==n?n:window.devicePixelRatio;return t.width&&t.height&&(r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r.width=t.width*s,r.height=t.height*s),r}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(){}getElementTop(t,e){let i=t.offsetTop,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,n=n.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetLeft,n=n.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,n=t.offsetLeft,r=t.offsetParent;for(;null!==r;)i+=r.offsetTop,n+=r.offsetLeft,r=r.offsetParent;return{top:i,left:n}}loadFont(t,e,i){return tb(this,void 0,void 0,(function*(){return new FontFace(t,st(e)?`url(${e})`:e,i).load().then((function(t){return document.fonts.add(t),{loadState:"success"}})).catch((function(t){return console.error("Failed to load font:",t),{loadState:"fail"}}))}))}},t.BrowserEnvContribution=Jy([g(),Qy("design:paramtypes",[])],t.BrowserEnvContribution);const nb=new i((e=>{nb.isBrowserBound||(nb.isBrowserBound=!0,e(t.BrowserEnvContribution).toSelf().inSingletonScope(),e(U).toService(t.BrowserEnvContribution))}));function rb(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];rb.__loaded||(rb.__loaded=!0,t.load(nb),t.load(Dy),t.load(Zy),e&&Yy(t))}nb.isBrowserBound=!1,rb.__loaded=!1;var sb=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let ab=class extends Ey{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}getImageData(t,e,i,n){return new Promise(((r,s)=>{var a;try{tt.canvasGetImageData({canvasId:null!==(a=this.canvas.nativeCanvas.id)&&void 0!==a?a:this.canvas.id,x:t,y:e,width:i,height:n,success(t){r(t)}})}catch(t){s(t)}}))}draw(){const t=this.nativeContext;t.draw&&(this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))})))}createPattern(t,e){return null}};ab.env="feishu",ab=sb([g()],ab);var ob=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},hb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let lb=class extends Af{constructor(t){super(t)}init(){this._context=new ab(this,this._dpr)}release(){}};lb.env="feishu",lb=ob([g(),hb("design:paramtypes",[Object])],lb);const cb=Ly(lb,ab);var ub=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},db=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pb=function(t,e){return function(i,n){e(i,n,t)}};let fb=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="feishu",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new lb(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new lb({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};fb.env="feishu",fb=ub([g(),pb(0,p(W)),db("design:paramtypes",[Object])],fb);const gb=new i((t=>{t(fb).toSelf(),t(xr).toDynamicValue((t=>t.container.get(fb))).whenTargetNamed(fb.env)}));var vb=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},mb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yb=function(t,e){return function(i,n){e(i,n,t)}};let bb=class extends t.DefaultPickService{constructor(t,e){super(e),this.contributions=t,this.pickItemInterceptorContributions=e,this.global.hooks.onSetEnv.tap("math-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(e,i){this.pickContext=new t.EmptyContext2d(null,1)}pickItem(t,e,i,n){if(!1===t.attribute.pickable)return null;const r=this.pickerMap.get(t.numberType);if(!r)return null;const s=r.contains(t,e,n),a=s?t:null;return a?{graphic:a,params:s}:null}};bb=vb([g(),yb(0,p(k)),yb(0,v(Fm)),yb(1,p(k)),yb(1,v(vp)),mb("design:paramtypes",[Object,Object])],bb);const xb=new i((t=>{xb.__vloaded||(xb.__vloaded=!0,I(t,Fm))}));xb.__vloaded=!1;var wb=xb;class Sb{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;if(!this.canvasRenderer)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.getGraphicTheme();n.highPerformanceSave();let{x:s=r.x,y:a=r.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);s+=e.x,a+=e.y,n.setTransformForCurrent()}else s=0,a=0,n.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,n,s,a,{},null,((t,i,n)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,r)=>{if(o)return!0;const s=i.lineWidth||r.lineWidth,a=i.pickStrokeBuffer||r.pickStrokeBuffer,h=i.keepStrokeScale||r.keepStrokeScale;return n.lineWidth=h?s+a:xn(n,s+a,n.dpr),o=t.isPointInStroke(e.x,e.y),o})),n.highPerformanceRestore(),o}}var Ab=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Tb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cb=function(t,e){return function(i,n){e(i,n,t)}};let _b=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=ro}};_b=Ab([g(),Cb(0,p(Ac)),Tb("design:paramtypes",[Object])],_b);let Bb=!1;const Pb=new i(((t,e,i,n)=>{Bb||(Bb=!0,t(zm).to(_b).inSingletonScope(),t(Fm).toService(zm))}));var Rb=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Mb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Eb=function(t,e){return function(i,n){e(i,n,t)}};let kb=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=ao}};kb=Rb([g(),Eb(0,p(Cc)),Mb("design:paramtypes",[Object])],kb);let Ob=!1;const Ib=new i(((t,e,i,n)=>{Ob||(Ob=!0,t(Hm).to(kb).inSingletonScope(),t(Fm).toService(Hm))}));var Lb=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Db=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},jb=function(t,e){return function(i,n){e(i,n,t)}};let Ub=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=oo}};Ub=Lb([g(),jb(0,p(_c)),Db("design:paramtypes",[Object])],Ub);let Wb=!1;const Nb=new i(((t,e,i,n)=>{Wb||(Wb=!0,t(Vm).to(Ub).inSingletonScope(),t(Fm).toService(Vm))}));class Gb{constructor(){this.type="glyph",this.numberType=ho}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=null==i?void 0:i.pickerService;if(r){let n=!1;return t.getSubGraphic().forEach((t=>{if(n)return;const s=r.pickItem(t,e,null,i);n=!(!s||!s.graphic)})),n}return!1}}var Fb=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},zb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Hb=function(t,e){return function(i,n){e(i,n,t)}};let Vb=class extends Gb{constructor(t){super(),this.canvasRenderer=t}};Vb=Fb([g(),Hb(0,p(Uc)),zb("design:paramtypes",[Object])],Vb);let Yb=!1;const Xb=new i(((t,e,i,n)=>{Yb||(Yb=!0,t(Qm).to(Vb).inSingletonScope(),t(Vb).toService(Qm))}));var $b=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let qb=class{constructor(){this.type="image",this.numberType=co}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};qb=$b([g()],qb);let Kb=!1;const Zb=new i(((t,e,i,n)=>{Kb||(Kb=!0,t(Ym).to(qb).inSingletonScope(),t(qb).toService(Ym))}));var Jb=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Qb=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tx=function(t,e){return function(i,n){e(i,n,t)}};let ex=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=uo}};ex=Jb([g(),tx(0,p(Rc)),Qb("design:paramtypes",[Object])],ex);let ix=!1;const nx=new i(((t,e,i,n)=>{ix||(ix=!0,t(Xm).to(ex).inSingletonScope(),t(Fm).toService(Xm))}));var rx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},sx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ax=function(t,e){return function(i,n){e(i,n,t)}};let ox=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=fo}};ox=rx([g(),ax(0,p(Ec)),sx("design:paramtypes",[Object])],ox);let hx=!1;const lx=new i(((t,e,i,n)=>{hx||(hx=!0,t(Jm).to(ox).inSingletonScope(),t(Fm).toService(Jm))}));var cx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},ux=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dx=function(t,e){return function(i,n){e(i,n,t)}};let px=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=po}};px=cx([g(),dx(0,p(Mc)),ux("design:paramtypes",[Object])],px);let fx=!1;const gx=new i(((t,e,i,n)=>{fx||(fx=!0,t($m).to(px).inSingletonScope(),t(Fm).toService($m))})),vx=new le;class mx{constructor(){this.type="rect",this.numberType=vo}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.getGraphicTheme(),{cornerRadius:s=r.cornerRadius}=t.attribute;let{x:a=r.x,y:o=r.y}=t.attribute;n.highPerformanceSave();let h=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(r);a+=e.x,o+=e.y,n.setTransformForCurrent()}else a=0,o=0,h=!1,n.transformFromMatrix(t.transMatrix,!0);let l=!0;if(!h||t.shadowRoot||ht(s,!0)&&0!==s||at(s)&&s.some((t=>0!==t)))l=!1,this.canvasRenderer.drawShape(t,n,a,o,{},null,((t,i,n)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,r)=>{if(l)return!0;const s=i.lineWidth||r.lineWidth,a=i.pickStrokeBuffer||r.pickStrokeBuffer,o=i.keepStrokeScale||r.keepStrokeScale;return n.lineWidth=o?s+a:xn(n,s+a,n.dpr),l=t.isPointInStroke(e.x,e.y),l}));else{const{fill:i=r.fill,stroke:n=r.stroke,lineWidth:s=r.lineWidth}=t.attribute;if(i)l=!0;else if(n){const i=t.AABBBounds;vx.setValue(i.x1,i.y1,i.x2,i.y2),vx.expand(-s/2),l=!vx.containsPoint(e)}}return n.highPerformanceRestore(),l}}var yx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},bx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xx=function(t,e){return function(i,n){e(i,n,t)}};let Sx=class extends mx{constructor(t){super(),this.canvasRenderer=t}};Sx=yx([g(),xx(0,p(kc)),bx("design:paramtypes",[Object])],Sx);let Ax=!1;const Tx=new i(((t,e,i,n)=>{Ax||(Ax=!0,t(qm).to(Sx).inSingletonScope(),t(Fm).toService(qm))}));let Cx=!1;const _x=new i(((t,e,i,n)=>{Cx||(Cx=!0,t(Ym).to(qb).inSingletonScope(),t(qb).toService(Ym))}));var Bx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Px=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rx=function(t,e){return function(i,n){e(i,n,t)}};let Mx=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=bo}};Mx=Bx([g(),Rx(0,p(Ic)),Px("design:paramtypes",[Object])],Mx);let Ex=!1;const kx=new i(((t,e,i,n)=>{Ex||(Ex=!0,t(Km).to(Mx).inSingletonScope(),t(Fm).toService(Km))}));var Ox=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Ix=class{constructor(){this.type="text",this.numberType=xo}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};Ix=Ox([g()],Ix);let Lx=!1;const Dx=new i(((t,e,i,n)=>{Lx||(Lx=!0,t(Zm).to(Ix).inSingletonScope(),t(Fm).toService(Zm))})),jx=new i(((t,e,i,n)=>{i(bb)||t(bb).toSelf().inSingletonScope(),i(su)?n(su).toService(bb):t(su).toService(bb)}));function Ux(t){t.load(wb),t.load(jx),t.load(Pb),t.load(Ib),t.load(Nb),t.load(Xb),t.load(Zb),t.load(nx),t.load(lx),t.load(gx),t.load(Tx),t.load(_x),t.load(kx),t.load(Dx)}class Wx{get width(){return this._w*this.dpr}set width(t){}get height(){return this._h*this.dpr}set height(t){}get offsetWidth(){return this._w}set offsetWidth(t){}get offsetHeight(){return this._h}set offsetHeight(t){}constructor(t,e,i,n,r,s){this.nativeCanvas=t,this.ctx=e,this._w=n,this._h=r,this.id=s,t.id=s,this.dpr=i}getContext(){return this.ctx}getBoundingClientRect(){return{width:this._w,height:this._h}}}class Nx{get width(){return this._w*this.dpr}set width(t){this._w=t/this.dpr,this.nativeCanvas.width=t}get height(){return this._h*this.dpr}set height(t){this._h=t/this.dpr,this.nativeCanvas.height=t}get offsetWidth(){return this._w}set offsetWidth(t){this._w=t,this.nativeCanvas.width=t*this.dpr}get offsetHeight(){return this._h}set offsetHeight(t){this._h=t,this.nativeCanvas.height=t*this.dpr}constructor(t,e,i,n,r,s){this.nativeCanvas=t,this.ctx=e,this._w=n,this._h=r,this.id=s,t.id=s,this.dpr=i}getContext(){return this.ctx}getBoundingClientRect(){return{width:this._w,height:this._h}}}var Gx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Fx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let zx=class extends t.BaseEnvContribution{constructor(){super(),this.type="feishu",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r,s){const a=null!=s?s:tt.getSystemInfoSync().pixelRatio;e.forEach(((e,s)=>{if(i.has(e))return;const o=tt.createCanvasContext(e),h=new Wx(o.canvas||{},o,a,t.width,t.height,e);o.canvas=h,i.set(e,h),s>=n&&r.push(h)}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.pixelRatio))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return tt.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return Ts.call(t)}}getCancelAnimationFrame(){return t=>{Ts.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}};zx=Gx([g(),Fx("design:paramtypes",[])],zx);const Hx=new i((t=>{Hx.isFeishuBound||(Hx.isFeishuBound=!0,t(zx).toSelf().inSingletonScope(),t(U).toService(zx))}));function Vx(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Vx.__loaded||(Vx.__loaded=!0,t.load(Hx),t.load(cb),t.load(gb),e&&Ux(t))}Hx.isFeishuBound=!1,Vx.__loaded=!1;var Yx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Xx=class extends Ey{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;t&&i.setLineDash(t)}}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(a>1e-12&&o>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit,keepStrokeScale:f=r.keepStrokeScale}=e;s.globalAlpha=a*o*this.baseGlobalAlpha,s.lineWidth=f?h:xn(this,h,this.dpr),s.strokeStyle=wn(this,l,t,i,n),s.lineJoin=c,0===u[0]&&0===u[1]||u&&s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mn.global.measureTextMethod;return this.setTransform(1,0,0,1,0,0,!0,mn.global.devicePixelRatio),{width:super.measureText(t,e).width,fontBoundingBoxDescent:void 0,fontBoundingBoxAscent:void 0,actualBoundingBoxAscent:void 0,actualBoundingBoxDescent:void 0}}createPattern(t,e){return null}draw(){const t=this.nativeContext;t.draw&&(this.drawPromise=new Promise((e=>{t.draw(!0,(()=>{this.drawPromise=null,e(null)}))})))}};Xx.env="lynx",Xx=Yx([g()],Xx);var $x=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},qx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Kx=class extends Af{constructor(t){super(t)}init(){this._context=new Xx(this,this._dpr)}resize(t,e){this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._nativeCanvas.nativeCanvas&&(this._nativeCanvas.nativeCanvas.width=this._pixelWidth,this._nativeCanvas.nativeCanvas.height=this._pixelHeight),this._context.dpr=this._dpr}release(){}};Kx.env="lynx",Kx=$x([g(),qx("design:paramtypes",[Object])],Kx);var Zx=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Jx=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Qx=function(t,e){return function(i,n){e(i,n,t)}};let tw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="lynx",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Kx(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Kx({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};tw.env="lynx",tw=Zx([g(),Qx(0,p(W)),Jx("design:paramtypes",[Object])],tw);const ew=new i((t=>{t(tw).toSelf(),t(xr).toDynamicValue((t=>t.container.get(tw))).whenTargetNamed(tw.env)})),iw=Ly(Kx,Xx);var nw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},rw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let sw=!1;try{sw=!!lynx.createCanvasNG}catch(t){}let aw=class extends t.BaseEnvContribution{constructor(){super(),this.type="lynx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),function(t,e,i,n,r,s,a){const o=null!=a?a:SystemInfo.pixelRatio;if(e.forEach(((e,a)=>{let h;s?h=lynx.createOffscreenCanvas():(h=sw?lynx.createCanvasNG(e):lynx.createCanvas(e),sw&&h.attachToCanvasView(e)),h.width=t.width*o,h.height=t.height*o;const l=h.getContext("2d"),c=new Nx(h,l,o,t.width,t.height,e);i.set(e,c),a>n&&r.push(c)})),!r.length&&lynx.createOffscreenCanvas){const e=lynx.createOffscreenCanvas();e.width=t.width*o,e.height=t.height*o;const n=e.getContext("2d"),s=Math.random().toString(),a=new Nx(e,n,o,t.width,t.height,s);i.set(s,a),r.push(a)}}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,!!e.offscreen,e.pixelRatio))}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}loadImage(t){return function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return Promise.reject();const e=lynx.createImage(t);return new Promise(((t,i)=>{e.onload=()=>{t(e)},e.onerror=()=>{i(new Error("加载失败"))}}))}(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return SystemInfo.pixelRatio}getRequestAnimationFrame(){return function(t){return Ts.call(t)}}getCancelAnimationFrame(){return t=>{Ts.clear(t)}}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};aw=nw([g(),rw("design:paramtypes",[])],aw);const ow=new i((t=>{ow.isLynxBound||(ow.isLynxBound=!0,t(aw).toSelf().inSingletonScope(),t(U).toService(aw))}));function hw(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];hw.__loaded||(hw.__loaded=!0,t.load(ow),t.load(iw),t.load(ew),e&&Ux(t))}ow.isLynxBound=!1,hw.__loaded=!1;var lw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},cw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let uw=class extends Ey{constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new ue(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(){}};uw.env="node",uw=lw([g(),cw("design:paramtypes",[Object,Number])],uw);var dw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},pw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let fw=class extends Af{constructor(t){super(t)}init(){this._context=new uw(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(){this._nativeCanvas.release&&Z(this._nativeCanvas.release)&&this._nativeCanvas.release()}};fw.env="node",fw=dw([g(),pw("design:paramtypes",[Object])],fw);const gw=Ly(fw,uw);var vw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},mw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yw=function(t,e){return function(i,n){e(i,n,t)}};let bw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new fw(n)}createWindowByCanvas(t){const e=t.canvas;let i=t.width,n=t.height;null!=i&&null!=n&&t.canvasControled||(i=e.width,n=e.height),this.canvas=new fw({width:i,height:n,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t){}};bw.env="node",bw=vw([g(),yw(0,p(W)),mw("design:paramtypes",[Object])],bw);const xw=new i((t=>{t(bw).toSelf(),t(xr).toDynamicValue((t=>t.container.get(bw))).whenTargetNamed(bw.env)}));var ww=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Sw=class extends t.BaseEnvContribution{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return Ts.call(t)}}getCancelAnimationFrame(){return t=>{Ts.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(){}createOffscreenCanvas(t){}};Sw=ww([g()],Sw);const Aw=new i((t=>{Aw.isNodeBound||(Aw.isNodeBound=!0,t(Sw).toSelf().inSingletonScope(),t(U).toService(Sw))}));function Tw(t){Tw.__loaded||(Tw.__loaded=!0,t.load(Aw),t.load(gw),t.load(xw))}Aw.isNodeBound=!1,Tw.__loaded=!1;var Cw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let _w=class extends Ey{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.setGlobalAlpha(t),this._globalAlpha=t}draw(){this.nativeContext.draw()}strokeText(t,e,i){}_setCommonStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.fillAttributes);const{fillOpacity:a=r.fillOpacity,opacity:o=r.opacity,fill:h=r.fill}=e;a>1e-12&&o>1e-12&&(s.setGlobalAlpha(a*o),s.setFillStyle(wn(this,h,t,i,n)))}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(a>1e-12&&o>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit,keepStrokeScale:f=r.keepStrokeScale}=e;s.setGlobalAlpha(a*o),s.setLineWidth(f?h:xn(this,h,this.dpr)),s.setStrokeStyle(wn(this,l,t,i,n)),s.setLineJoin(c),u&&s.setLineDash(u),s.setLineCap(d),s.setMiterLimit(p)}}setTextStyleWithoutAlignBaseline(t,e){var i;const n=this.nativeContext;e||(e=this.textAttributes),t.font?n.font=t.font:n.font=se(t,e),n.setFontSize(null!==(i=t.fontSize)&&void 0!==i?i:e.fontSize)}setTextStyle(t,e){var i,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=se(t,e),r.setTextAlign(null!==(i=t.textAlign)&&void 0!==i?i:e.textAlign),r.setTextBaseline(null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline)}createConicGradient(t,e,i,n){return null}createPattern(t,e){return null}getImageData(t,e,i,n){const r=this.nativeContext,s=r.taro;if(r&&s)return!r.getImageData&&s.canvasGetImageData?new Promise(((r,a)=>{try{s.canvasGetImageData({canvasId:this.canvas.nativeCanvas.id,sx:t,sy:e,sw:i,sh:n,success(t){r(t)}})}catch(t){a(t)}})):void 0}createRadialGradient(t,e,i,n,r,s){return this.nativeContext.createCircularGradient&&this.nativeContext.createCircularGradient(t,e,i,n,r,s)}};_w.env="taro",_w=Cw([g()],_w);var Bw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Pw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Rw=class extends Af{constructor(t){super(t)}init(){this._context=new _w(this,this._dpr)}release(){}};Rw.env="taro",Rw=Bw([g(),Pw("design:paramtypes",[Object])],Rw);const Mw=Ly(Rw,_w);var Ew=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},kw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ow=function(t,e){return function(i,n){e(i,n,t)}};let Iw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="taro",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Rw(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Rw({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches.length>0&&(t.changedTouches.forEach(((e,i)=>{t.changedTouches[i]=Object.assign(Object.assign({},t.changedTouches[i]),{offsetX:e.x,offsetY:e.y})})),t.offsetX=t.changedTouches[0].offsetX,t.offsetY=t.changedTouches[0].offsetY),t.touches.length>0&&t.touches.forEach(((e,i)=>{t.touches[i]=Object.assign(Object.assign({},t.touches[i]),{offsetX:e.x,offsetY:e.y})})),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};Iw.env="taro",Iw=Ew([g(),Ow(0,p(W)),kw("design:paramtypes",[Object])],Iw);const Lw=new i((t=>{t(Iw).toSelf(),t(xr).toDynamicValue((t=>t.container.get(Iw))).whenTargetNamed(Iw.env)}));var Dw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},jw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Uw=class extends t.BaseEnvContribution{constructor(){super(),this.type="taro",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}getDynamicCanvasCount(){return this.freeCanvasList.length}getStaticCanvasCount(){return 9999}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}configure(t,e){var i,n,r,s,a,o,h;t.env===this.type&&(t.setActiveEnvContribution(this),i=e.domref,n=e.canvasIdLists,r=this.canvasMap,s=e.freeCanvasIdx,a=this.freeCanvasList,o=e.taro,h=e.pixelRatio,n.forEach(((t,e)=>{const n=o.createCanvasContext(t),l=new Wx(n.canvas||{},n,h,i.width,i.height,t);return n.canvas=l,r.set(t,l),e>=s&&a.push(l),l})),this.taro=e.taro,this.pixelRatio=e.pixelRatio)}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){const e=window||globalThis;if(e.DOMParser){const i=(new e.DOMParser).parseFromString(t,"image/svg+xml").children[0],n=(new XMLSerializer).serializeToString(i),r=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`;return Promise.resolve({data:r,loadState:"success"})}if(e.Blob){const i=new e.Blob([t],{type:"image/svg+xml"}),n=e.URL.createObjectURL(i);return Promise.resolve({data:n,loadState:"success"})}return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return this.pixelRatio}getRequestAnimationFrame(){return requestAnimationFrame}getCancelAnimationFrame(){return cancelAnimationFrame}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}};Uw=Dw([g(),jw("design:paramtypes",[])],Uw);const Ww=new i((t=>{Ww.isTaroBound||(Ww.isTaroBound=!0,t(Uw).toSelf().inSingletonScope(),t(U).toService(Uw))}));function Nw(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];Nw.__loaded||(Nw.__loaded=!0,t.load(Ww),t.load(Mw),t.load(Lw),e&&Ux(t))}Ww.isTaroBound=!1,Nw.__loaded=!1;var Gw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let Fw=class extends Ey{draw(){}createPattern(t,e){return null}};Fw.env="wx",Fw=Gw([g()],Fw);var zw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Hw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Vw=class extends Af{constructor(t){super(t)}init(){this._context=new Fw(this,this._dpr)}release(){}};Vw.env="wx",Vw=zw([g(),Hw("design:paramtypes",[Object])],Vw);const Yw=Ly(Vw,Fw);var Xw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},$w=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qw=function(t,e){return function(i,n){e(i,n,t)}};let Kw=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="wx",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new Vw(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new Vw({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){var e,i,n,r;const{type:s}=t;return!!this.eventManager.cache[s]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=null!==(e=t.changedTouches[0].x)&&void 0!==e?e:t.changedTouches[0].pageX,t.changedTouches[0].clientX=null!==(i=t.changedTouches[0].x)&&void 0!==i?i:t.changedTouches[0].pageX,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=null!==(n=t.changedTouches[0].y)&&void 0!==n?n:t.changedTouches[0].pageY,t.changedTouches[0].clientY=null!==(r=t.changedTouches[0].y)&&void 0!==r?r:t.changedTouches[0].pageY),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[s].listener&&this.eventManager.cache[s].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};Kw.env="wx",Kw=Xw([g(),qw(0,p(W)),$w("design:paramtypes",[Object])],Kw);const Zw=new i((t=>{t(Kw).toSelf(),t(xr).toDynamicValue((t=>t.container.get(Kw))).whenTargetNamed(Kw.env)}));var Jw=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},Qw=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},tS=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};let eS=class extends t.BaseEnvContribution{constructor(){super(),this.type="wx",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,i,n,r,s){return tS(this,void 0,void 0,(function*(){const t=wx.getSystemInfoSync().pixelRatio;for(let a=0;a<e.length;a++){const o=e[a];i.has(o)||(yield new Promise((e=>{let h=wx.createSelectorQuery();s&&(h=h.in(s)),h.select(`#${o}`).fields({node:!0,size:!0}).exec((s=>{if(!s[0])return;const h=s[0].node,l=s[0].width,c=s[0].height;h.width=l*t,h.height=c*t,i.set(o,h),a>=n&&r.push(h),e(null)}))})))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((()=>{}))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return wx.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return Ts.call(t)}}getCancelAnimationFrame(){return t=>{Ts.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}};eS=Jw([g(),Qw("design:paramtypes",[])],eS);const iS=new i((t=>{iS._isWxBound||(iS._isWxBound=!0,t(eS).toSelf().inSingletonScope(),t(U).toService(eS))}));function nS(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];nS.__loaded||(nS.__loaded=!0,t.load(iS),t.load(Yw),t.load(Zw),e&&Ux(t))}function rS(t){sS(t)}function sS(t){sS.__loaded||(sS.__loaded=!0,rb(t,!1),Vx(t,!1),hw(t,!1),Tw(t),Nw(t,!1),nS(t,!1),Yy(t),Qp.hooks.onSetEnv.tap("loadMathPicker",((e,i)=>{"browser"!==i&&Ux(t)})))}iS._isWxBound=!1,nS.__loaded=!1,sS.__loaded=!1;var aS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let oS=class extends ab{};oS.env="tt",oS=aS([g()],oS);var hS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},lS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let cS=class extends Af{constructor(t){super(t)}init(){this._context=new oS(this,this._dpr)}release(){}};cS.env="tt",cS=hS([g(),lS("design:paramtypes",[Object])],cS);const uS=Ly(cS,oS);var dS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},pS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fS=function(t,e){return function(i,n){e(i,n,t)}};let gS=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="tt",this.eventManager=new class{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}}getTitle(){return this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new cS(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}let r=t.dpr;null==r&&(r=e.width/i),this.canvas=new cS({width:i,height:n,dpr:r,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};gS.env="tt",gS=dS([g(),fS(0,p(W)),pS("design:paramtypes",[Object])],gS);const vS=new i((t=>{t(gS).toSelf(),t(xr).toDynamicValue((t=>t.container.get(gS))).whenTargetNamed(gS.env)}));var mS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},yS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},bS=function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function a(t){try{h(n.next(t))}catch(t){s(t)}}function o(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}h((n=n.apply(t,e||[])).next())}))};let xS=class extends t.BaseEnvContribution{constructor(){super(),this.type="tt",this.supportEvent=!0,this.canvasMap=new Map,this.freeCanvasList=[],this.canvasIdx=0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0}configure(t,e){if(t.env===this.type)return t.setActiveEnvContribution(this),function(t,e,i,n,r,s){return bS(this,void 0,void 0,(function*(){const t=tt.getSystemInfoSync().pixelRatio;for(let a=0;a<e.length;a++){const o=e[a];i.has(o)||(yield new Promise((e=>{let h=tt.createSelectorQuery();s&&(h=h.in(s)),h.select(`#${o}`).node().exec((s=>{const h=s[0].node,l=h.width,c=h.height;h.width=l*t,h.height=c*t,i.set(o,h),a>=n&&r.push(h),e(null)}))})))}}))}(e.domref,e.canvasIdLists,this.canvasMap,e.freeCanvasIdx,this.freeCanvasList,e.component).then((()=>{}))}loadImage(t){return Promise.resolve({data:t,loadState:"success"})}loadSvg(t){return Promise.reject()}createCanvas(t){const e=this.freeCanvasList[this.canvasIdx]||this.freeCanvasList[this.freeCanvasList.length-1];return this.canvasIdx++,e}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return tt.getSystemInfoSync().pixelRatio}getRequestAnimationFrame(){return function(t){return Ts.call(t)}}getCancelAnimationFrame(){return t=>{Ts.clear(t)}}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return this.canvasMap.get(t)}getRootElement(){return null}getDocument(){return null}release(){}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}};xS=mS([g(),yS("design:paramtypes",[])],xS);const wS=new i((t=>{wS.isTTBound||(wS.isTTBound=!0,t(xS).toSelf().inSingletonScope(),t(U).toService(xS))}));function SS(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];SS.__loaded||(SS.__loaded=!0,t.load(wS),t.load(uS),t.load(vS),e&&Ux(t))}wS.isTTBound=!1,SS.__loaded=!1;var AS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let TS=class extends Ey{get globalAlpha(){return this._globalAlpha}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha,this._globalAlpha=t*this.baseGlobalAlpha}setLineDash(t){const e=arguments,i=this.nativeContext;if(this.nativeContext.setLineDash){const t=e[0];if(0===t[0]&&0===t[1])return;t&&i.setLineDash(t)}}_setStrokeStyle(t,e,i,n,r){const s=this.nativeContext;r||(r=this.strokeAttributes);const{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity}=e;if(a>1e-12&&o>1e-12){const{lineWidth:h=r.lineWidth,stroke:l=r.stroke,lineJoin:c=r.lineJoin,lineDash:u=r.lineDash,lineCap:d=r.lineCap,miterLimit:p=r.miterLimit,keepStrokeScale:f=r.keepStrokeScale}=e;s.globalAlpha=a*o*this.baseGlobalAlpha,s.lineWidth=f?h:xn(this,h,this.dpr),s.strokeStyle=wn(this,l,t,i,n),s.lineJoin=c,0===u[0]&&0===u[1]||u&&s.setLineDash(u),s.lineCap=d,s.miterLimit=p}}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:mn.global.measureTextMethod;return this.setTransform(1,0,0,1,0,0,!0,mn.global.devicePixelRatio),super.measureText(t,e)}setTextStyleWithoutAlignBaseline(t,e,i){const n=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:r=e.scaleIn3d}=t;let s="";s=t.font?t.font:se(t,e,r&&this.camera&&this.camera.getProjectionScale(i)),n.font=(s||"").replace("px","vp");const{fontFamily:a=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=a,this.fontSize=o,n.textAlign="left",n.textBaseline="alphabetic"}setTextStyle(t,e,i){var n,r;const s=this.nativeContext;e||(e=this.textAttributes);let a="";a=t.font?t.font:se(t,e,this.camera&&this.camera.getProjectionScale(i)),s.font=(a||"").replace("px","vp");const{fontFamily:o=e.fontFamily,fontSize:h=e.fontSize}=t;this.fontFamily=o,this.fontSize=h,s.textAlign=null!==(n=t.textAlign)&&void 0!==n?n:e.textAlign,s.textBaseline=null!==(r=t.textBaseline)&&void 0!==r?r:e.textBaseline}createPattern(t,e){return null}drawImage(){const t=this.nativeContext,e=arguments;e[0].drawImage&&(e[0]=e[0].transferToImageBitmap()),3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}draw(){}};TS.env="harmony",TS=AS([g()],TS);var CS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},_S=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let BS=class extends Af{constructor(t){super(t)}init(){this._context=new TS(this,this._dpr)}resize(t,e){}release(){}};BS.env="harmony",BS=CS([g(),_S("design:paramtypes",[Object])],BS);var PS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},RS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},MS=function(t,e){return function(i,n){e(i,n,t)}};class ES{constructor(){this.cache={}}addEventListener(t,e){t&&e&&(this.cache[t]=this.cache[t]||{listener:[]},this.cache[t].listener.push(e))}removeEventListener(t,e){if(!t||!e)return;if(!this.cache[t])return;const i=this.cache[t].listener.findIndex((t=>t===e));i>=0&&this.cache[t].listener.splice(i,1)}cleanEvent(){this.cache={}}}let kS=class extends t.BaseWindowHandlerContribution{get container(){return null}constructor(t){super(),this.global=t,this.type="harmony",this.eventManager=new ES}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),n={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!1};this.canvas=new BS(n)}createWindowByCanvas(t){let e;if("string"==typeof t.canvas){if(e=this.global.getElementById(t.canvas),!e)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else e=t.canvas;let i=t.width,n=t.height;if(null==i||null==n||!t.canvasControled){const t=e.getBoundingClientRect();i=t.width,n=t.height}this.canvas=new BS({width:i,height:n,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e){this.eventManager.addEventListener(t,e)}removeEventListener(t,e){this.eventManager.removeEventListener(t,e)}dispatchEvent(t){const{type:e}=t;return!!this.eventManager.cache[e]&&(t.changedTouches&&t.changedTouches[0]&&(t.offsetX=t.changedTouches[0].x,t.changedTouches[0].offsetX=t.changedTouches[0].x,t.changedTouches[0].clientX=t.changedTouches[0].x,t.offsetY=t.changedTouches[0].y,t.changedTouches[0].offsetY=t.changedTouches[0].y,t.changedTouches[0].clientY=t.changedTouches[0].y),t.preventDefault=()=>{},t.stopPropagation=()=>{},this.eventManager.cache[e].listener&&this.eventManager.cache[e].listener.forEach((e=>{e(t)})),!0)}getStyle(){return{}}setStyle(t){}getBoundingClientRect(){const t=this.getWH();return{x:0,y:0,width:t.width,height:t.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),n=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(n,0,0,n,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}};kS.env="harmony",kS=PS([g(),MS(0,p(W)),RS("design:paramtypes",[Object])],kS);const OS=new i((t=>{t(kS).toSelf(),t(xr).toDynamicValue((t=>t.container.get(kS))).whenTargetNamed(kS.env)})),IS=Ly(BS,TS);var LS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},DS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let jS=class extends t.BaseEnvContribution{constructor(){super(),this.type="harmony",this.supportEvent=!0,this.supportsTouchEvents=!0;try{this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsPointerEvents=!1,this.supportsMouseEvents=!1}this.applyStyles=!0,this.rafSTO=new As(0)}configure(t,e){t.env===this.type&&t.setActiveEnvContribution(this)}getDynamicCanvasCount(){return 9999}getStaticCanvasCount(){return 9999}loadImage(t){}loadSvg(t){return Promise.reject()}createCanvas(t){return function(t,e,i){const n=new OffscreenCanvas(t,e),r=n.getContext("2d");return new Wx({width:t,height:e,context:r,_c:n,getBoundingClientRect:()=>({width:t,height:e}),getContext:()=>r},r,1,t,e,i)}(t.width,t.height,t.id)}createOffscreenCanvas(t){}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return t=>this.rafSTO.call(t)}getCancelAnimationFrame(){return t=>{this.rafSTO.clear(t)}}mapToCanvasPoint(t){var e;return null===(e=null==t?void 0:t.type)||void 0===e||e.startsWith("mouse"),t}addEventListener(t,e,i){return null}removeEventListener(t,e,i){return null}dispatchEvent(t){return null}getElementById(t){return null}getRootElement(){return null}getDocument(){return null}release(){}};jS=LS([g(),DS("design:paramtypes",[])],jS);const US=new i((t=>{US.isHarmonyBound||(US.isHarmonyBound=!0,t(jS).toSelf().inSingletonScope(),t(U).toService(jS))}));function WS(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];WS.__loaded||(WS.__loaded=!0,t.load(US),t.load(IS),t.load(OS),e&&Ux(t))}US.isHarmonyBound=!1,WS.__loaded=!1;var NS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},GS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},FS=function(t,e){return function(i,n){e(i,n,t)}};let zS=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=ro}};zS=NS([g(),FS(0,p(Ac)),GS("design:paramtypes",[Object])],zS);let HS=!1;const VS=new i(((t,e,i,n)=>{HS||(HS=!0,t(ty).to(zS).inSingletonScope(),t(my).toService(ty))}));var YS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},XS=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$S=function(t,e){return function(i,n){e(i,n,t)}};let qS=class extends mx{constructor(t){super(),this.canvasRenderer=t}};qS=YS([g(),$S(0,p(kc)),XS("design:paramtypes",[Object])],qS);let KS=!1;const ZS=new i(((t,e,i,n)=>{KS||(KS=!0,t(hy).to(qS).inSingletonScope(),t(my).toService(hy))}));class JS extends Fh{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:n}=null!=i?i:{};if(!n)return!1;n.highPerformanceSave();const r=t.getGraphicTheme(),s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,{},null,(t=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const r=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?r+s:xn(n,r+s,n.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,n.modelMatrix!==l&&Lh.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}}var QS=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},tA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},eA=function(t,e){return function(i,n){e(i,n,t)}};let iA=class extends JS{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=uo}};iA=QS([g(),eA(0,p(Rc)),tA("design:paramtypes",[Object])],iA);let nA=!1;const rA=new i(((t,e,i,n)=>{nA||(nA=!0,t(ay).to(iA).inSingletonScope(),t(my).toService(ay))}));var sA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},aA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},oA=function(t,e){return function(i,n){e(i,n,t)}};let hA=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=ao}};hA=sA([g(),oA(0,p(Cc)),aA("design:paramtypes",[Object])],hA);let lA=!1;const cA=new i(((t,e,i,n)=>{lA||(lA=!0,t(iy).to(hA).inSingletonScope(),t(my).toService(iy))}));class uA extends Fh{contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.getGraphicTheme();n.highPerformanceSave();const s=this.transform(t,r,n),{x:a,y:o,z:h,lastModelMatrix:l}=s;let c=e;if(n.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,n,a,o,i,null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u))),this.canvasRenderer.z=0,n.modelMatrix!==l&&Lh.free(n.modelMatrix),n.modelMatrix=l,n.highPerformanceRestore(),u}}var dA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},pA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fA=function(t,e){return function(i,n){e(i,n,t)}};let gA=class extends uA{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=bo}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.getParsedPath();if(!n.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(r.isSvg||"imprecise"===t.attribute.pickMode)return!0}n.highPerformanceSave();const s=t.getGraphicTheme(),a=this.transform(t,s,n),{x:o,y:h,z:l,lastModelMatrix:c}=a;let u=e;if(n.camera){u=e.clone();const i=t.parent.globalTransMatrix;u.x=i.a*e.x+i.c*e.y+i.e,u.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let d=!1;return this.canvasRenderer.drawShape(t,n,o,h,{},null,((t,e,i)=>!!d||(d=t.isPointInPath(u.x,u.y),d)),((t,e,i)=>{if(d)return!0;const r=e.lineWidth||i.lineWidth,s=e.pickStrokeBuffer||i.pickStrokeBuffer,a=e.keepStrokeScale||i.keepStrokeScale;return n.lineWidth=a?r+s:xn(n,r+s,n.dpr),d=t.isPointInStroke(u.x,u.y),d})),this.canvasRenderer.z=0,n.modelMatrix!==c&&Lh.free(n.modelMatrix),n.modelMatrix=c,n.highPerformanceRestore(),d}};gA=dA([g(),fA(0,p(Ic)),pA("design:paramtypes",[Object])],gA);let vA=!1;const mA=new i(((t,e,i,n)=>{vA||(vA=!0,t(cy).to(gA).inSingletonScope(),t(my).toService(cy))}));var yA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},bA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},xA=function(t,e){return function(i,n){e(i,n,t)}};let wA=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=oo}};wA=yA([g(),xA(0,p(_c)),bA("design:paramtypes",[Object])],wA);let SA=!1;const AA=new i(((t,e,i,n)=>{SA||(SA=!0,t(ny).to(wA).inSingletonScope(),t(my).toService(ny))}));var TA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},CA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_A=function(t,e){return function(i,n){e(i,n,t)}};let BA=class extends uA{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=xo}contains(t,e,i){const{pickContext:n}=null!=i?i:{};if(!n)return!1;const r=t.AABBBounds;if(!n.camera)return!!r.containsPoint(e);n.highPerformanceSave();const s=t.getGraphicTheme(),{keepDirIn3d:a=s.keepDirIn3d}=t.attribute,o=!a,h=this.transform(t,s,n,o),{x:l,y:c,z:u,lastModelMatrix:d}=h;this.canvasRenderer.z=u;let p=e;if(n.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let f=!1;return this.canvasRenderer.drawShape(t,n,l,c,{},null,((e,i,n)=>{if(f)return!0;const{fontSize:r=s.fontSize,textBaseline:a=s.textBaseline,textAlign:o=s.textAlign}=t.attribute,h=t.AABBBounds,d=h.height(),g=h.width(),v=vh(a,d,r),m=gh(o,g);return e.rect(m+l,v+c,g,d,u),f=e.isPointInPath(p.x,p.y),f}),((t,e,i)=>f)),this.canvasRenderer.z=0,n.modelMatrix!==d&&Lh.free(n.modelMatrix),n.modelMatrix=d,n.highPerformanceRestore(),f}};BA=TA([g(),_A(0,p(Lc)),CA("design:paramtypes",[Object])],BA);let PA=!1;const RA=new i(((t,e,i,n)=>{PA||(PA=!0,t(uy).to(BA).inSingletonScope(),t(my).toService(uy))}));var MA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},EA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kA=function(t,e){return function(i,n){e(i,n,t)}};let OA=class extends JS{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=po}};OA=MA([g(),kA(0,p(Mc)),EA("design:paramtypes",[Object])],OA);let IA=!1;const LA=new i(((t,e,i,n)=>{IA||(IA=!0,t(oy).to(OA).inSingletonScope(),t(my).toService(oy))}));var DA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},jA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},UA=function(t,e){return function(i,n){e(i,n,t)}};let WA=class extends Sb{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=fo}};WA=DA([g(),UA(0,p(Ec)),jA("design:paramtypes",[Object])],WA);let NA=!1;const GA=new i(((t,e,i,n)=>{NA||(NA=!0,t(dy).to(WA).inSingletonScope(),t(my).toService(dy))}));var FA=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},zA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},HA=function(t,e){return function(i,n){e(i,n,t)}};let VA=class extends Gb{constructor(t){super(),this.canvasRenderer=t}};VA=FA([g(),HA(0,p(Uc)),zA("design:paramtypes",[Object])],VA);let YA=!1;const XA=new i(((t,e,i,n)=>{YA||(YA=!0,t(gy).to(VA).inSingletonScope(),t(my).toService(gy))}));var $A=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},qA=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},KA=function(t,e){return function(i,n){e(i,n,t)}};let ZA=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=yo}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};ZA=$A([g(),KA(0,p(Dc)),qA("design:paramtypes",[Object])],ZA);let JA=!1;const QA=new i(((t,e,i,n)=>{JA||(JA=!0,t(fy).to(ZA).inSingletonScope(),t(my).toService(fy))}));var tT=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let eT=class{constructor(){this.type="image",this.numberType=co}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};eT=tT([g()],eT);let iT=!1;const nT=new i(((t,e,i,n)=>{iT||(iT=!0,t(ry).to(eT).inSingletonScope(),t(my).toService(ry))}));var rT=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},sT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},aT=function(t,e){return function(i,n){e(i,n,t)}};let oT=class extends uA{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=mo,this.themeType="rect"}};oT=rT([g(),aT(0,p(Oc)),sT("design:paramtypes",[Object])],oT);let hT=!1;const lT=new i(((t,e,i,n)=>{hT||(hT=!0,t(ly).to(oT).inSingletonScope(),t(my).toService(ly))}));var cT=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},uT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},dT=function(t,e){return function(i,n){e(i,n,t)}};let pT=class extends uA{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=so,this.themeType="arc"}};pT=cT([g(),dT(0,p(Tc)),uT("design:paramtypes",[Object])],pT);let fT=!1;const gT=new i(((t,e,i,n)=>{fT||(fT=!0,t(ey).to(pT).inSingletonScope(),t(my).toService(ey))}));var vT=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},mT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yT=function(t,e){return function(i,n){e(i,n,t)}};let bT=class extends uA{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=go,this.themeType="polygon"}};bT=vT([g(),yT(0,p(jc)),mT("design:paramtypes",[Object])],bT);let xT=!1;const wT=new i(((t,e,i,n)=>{xT||(xT=!0,t(py).to(bT).inSingletonScope(),t(my).toService(py))}));var ST={},AT={},TT={};Object.defineProperty(TT,"__esModule",{value:!0}),TT.loop=TT.conditional=TT.parse=void 0;TT.parse=function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(Array.isArray(i))i.forEach((function(i){return t(e,i,n,r)}));else if("function"==typeof i)i(e,n,r,t);else{var s=Object.keys(i)[0];Array.isArray(i[s])?(r[s]={},t(e,i[s],n,r[s])):r[s]=i[s](e,n,r,t)}return n};TT.conditional=function(t,e){return function(i,n,r,s){e(i,n,r)&&s(i,t,n,r)}};TT.loop=function(t,e){return function(i,n,r,s){for(var a=[],o=i.pos;e(i,n,r);){var h={};if(s(i,t,n,h),i.pos===o)break;o=i.pos,a.push(h)}return a}};var CT={};Object.defineProperty(CT,"__esModule",{value:!0}),CT.readBits=CT.readArray=CT.readUnsigned=CT.readString=CT.peekBytes=CT.readBytes=CT.peekByte=CT.readByte=CT.buildStream=void 0;CT.buildStream=function(t){return{data:t,pos:0}};var _T=function(){return function(t){return t.data[t.pos++]}};CT.readByte=_T;CT.peekByte=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(e){return e.data[e.pos+t]}};var BT=function(t){return function(e){return e.data.subarray(e.pos,e.pos+=t)}};CT.readBytes=BT;CT.peekBytes=function(t){return function(e){return e.data.subarray(e.pos,e.pos+t)}};CT.readString=function(t){return function(e){return Array.from(BT(t)(e)).map((function(t){return String.fromCharCode(t)})).join("")}};CT.readUnsigned=function(t){return function(e){var i=BT(2)(e);return t?(i[1]<<8)+i[0]:(i[0]<<8)+i[1]}};CT.readArray=function(t,e){return function(i,n,r){for(var s="function"==typeof e?e(i,n,r):e,a=BT(t),o=new Array(s),h=0;h<s;h++)o[h]=a(i);return o}};CT.readBits=function(t){return function(e){for(var i=function(t){return t.data[t.pos++]}(e),n=new Array(8),r=0;r<8;r++)n[7-r]=!!(i&1<<r);return Object.keys(t).reduce((function(e,i){var r=t[i];return r.length?e[i]=function(t,e,i){for(var n=0,r=0;r<i;r++)n+=t[e+r]&&Math.pow(2,i-r-1);return n}(n,r.index,r.length):e[i]=n[r.index],e}),{})}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=TT,i=CT,n={blocks:function(t){for(var e=[],n=t.data.length,r=0,s=(0,i.readByte)()(t);0!==s&&s;s=(0,i.readByte)()(t)){if(t.pos+s>=n){var a=n-t.pos;e.push((0,i.readBytes)(a)(t)),r+=a;break}e.push((0,i.readBytes)(s)(t)),r+=s}for(var o=new Uint8Array(r),h=0,l=0;l<e.length;l++)o.set(e[l],h),h+=e[l].length;return o}},r=(0,e.conditional)({gce:[{codes:(0,i.readBytes)(2)},{byteSize:(0,i.readByte)()},{extras:(0,i.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,i.readUnsigned)(!0)},{transparentColorIndex:(0,i.readByte)()},{terminator:(0,i.readByte)()}]},(function(t){var e=(0,i.peekBytes)(2)(t);return 33===e[0]&&249===e[1]})),s=(0,e.conditional)({image:[{code:(0,i.readByte)()},{descriptor:[{left:(0,i.readUnsigned)(!0)},{top:(0,i.readUnsigned)(!0)},{width:(0,i.readUnsigned)(!0)},{height:(0,i.readUnsigned)(!0)},{lct:(0,i.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,i.readArray)(3,(function(t,e,i){return Math.pow(2,i.descriptor.lct.size+1)}))},(function(t,e,i){return i.descriptor.lct.exists})),{data:[{minCodeSize:(0,i.readByte)()},n]}]},(function(t){return 44===(0,i.peekByte)()(t)})),a=(0,e.conditional)({text:[{codes:(0,i.readBytes)(2)},{blockSize:(0,i.readByte)()},{preData:function(t,e,n){return(0,i.readBytes)(n.text.blockSize)(t)}},n]},(function(t){var e=(0,i.peekBytes)(2)(t);return 33===e[0]&&1===e[1]})),o=(0,e.conditional)({application:[{codes:(0,i.readBytes)(2)},{blockSize:(0,i.readByte)()},{id:function(t,e,n){return(0,i.readString)(n.blockSize)(t)}},n]},(function(t){var e=(0,i.peekBytes)(2)(t);return 33===e[0]&&255===e[1]})),h=(0,e.conditional)({comment:[{codes:(0,i.readBytes)(2)},n]},(function(t){var e=(0,i.peekBytes)(2)(t);return 33===e[0]&&254===e[1]})),l=[{header:[{signature:(0,i.readString)(3)},{version:(0,i.readString)(3)}]},{lsd:[{width:(0,i.readUnsigned)(!0)},{height:(0,i.readUnsigned)(!0)},{gct:(0,i.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,i.readByte)()},{pixelAspectRatio:(0,i.readByte)()}]},(0,e.conditional)({gct:(0,i.readArray)(3,(function(t,e){return Math.pow(2,e.lsd.gct.size+1)}))},(function(t,e){return e.lsd.gct.exists})),{frames:(0,e.loop)([r,o,h,s,a],(function(t){var e=(0,i.peekByte)()(t);return 33===e||44===e}))}],c=l;t.default=c}(AT);var PT={};Object.defineProperty(PT,"__esModule",{value:!0}),PT.deinterlace=void 0;PT.deinterlace=function(t,e){for(var i=new Array(t.length),n=t.length/e,r=function(n,r){var s=t.slice(r*e,(r+1)*e);i.splice.apply(i,[n*e,e].concat(s))},s=[0,4,2,1],a=[8,8,4,2],o=0,h=0;h<4;h++)for(var l=s[h];l<n;l+=a[h])r(l,o),o++;return i};var RT={};Object.defineProperty(RT,"__esModule",{value:!0}),RT.lzw=void 0;RT.lzw=function(t,e,i){var n,r,s,a,o,h,l,c,u,d,p,f,g,v,m,y,b=4096,x=i,w=new Array(i),S=new Array(b),A=new Array(b),T=new Array(4097);for(o=(r=1<<(d=t))+1,n=r+2,l=-1,s=(1<<(a=d+1))-1,c=0;c<r;c++)S[c]=0,A[c]=c;for(p=f=g=v=m=y=0,u=0;u<x;){if(0===v){if(f<a){p+=e[y]<<f,f+=8,y++;continue}if(c=p&s,p>>=a,f-=a,c>n||c==o)break;if(c==r){s=(1<<(a=d+1))-1,n=r+2,l=-1;continue}if(-1==l){T[v++]=A[c],l=c,g=c;continue}for(h=c,c==n&&(T[v++]=g,c=l);c>r;)T[v++]=A[c],c=S[c];g=255&A[c],T[v++]=g,n<b&&(S[n]=l,A[n]=g,0==(++n&s)&&n<b&&(a++,s+=n)),l=h}v--,w[m++]=T[v],u++}for(u=m;u<x;u++)w[u]=0;return w},Object.defineProperty(ST,"__esModule",{value:!0});var MT,ET=ST.decompressFrames=ST.decompressFrame=jT=ST.parseGIF=void 0,kT=(MT=AT)&&MT.__esModule?MT:{default:MT},OT=TT,IT=CT,LT=PT,DT=RT;var jT=ST.parseGIF=function(t){var e=new Uint8Array(t);return(0,OT.parse)((0,IT.buildStream)(e),kT.default)},UT=function(t,e,i){if(t.image){var n=t.image,r=n.descriptor.width*n.descriptor.height,s=(0,DT.lzw)(n.data.minCodeSize,n.data.blocks,r);n.descriptor.lct.interlaced&&(s=(0,LT.deinterlace)(s,n.descriptor.width));var a={pixels:s,dims:{top:t.image.descriptor.top,left:t.image.descriptor.left,width:t.image.descriptor.width,height:t.image.descriptor.height}};return n.descriptor.lct&&n.descriptor.lct.exists?a.colorTable=n.lct:a.colorTable=e,t.gce&&(a.delay=10*(t.gce.delay||10),a.disposalType=t.gce.extras.disposal,t.gce.extras.transparentColorGiven&&(a.transparentIndex=t.gce.transparentColorIndex)),i&&(a.patch=function(t){for(var e=t.pixels.length,i=new Uint8ClampedArray(4*e),n=0;n<e;n++){var r=4*n,s=t.pixels[n],a=t.colorTable[s]||[0,0,0];i[r]=a[0],i[r+1]=a[1],i[r+2]=a[2],i[r+3]=s!==t.transparentIndex?255:0}return i}(a)),a}console.warn("gif frame does not have associated image.")};ST.decompressFrame=UT;ET=ST.decompressFrames=function(t,e){return t.frames.filter((function(t){return t.image})).map((function(i){return UT(i,t.gct,e)}))};const WT=e.GenAutoIncrementId();class NT extends zd{constructor(t){super(t),this.type="gif-image",this.numberType=WT,this.loadGif()}loadGif(){if(st(this.attribute.gifImage))Ca.GetFile(this.attribute.gifImage,"arrayBuffer").then((t=>{const e=jT(t),i=ET(e,!0);this.renderGIF(i)})).catch((t=>{console.error("Gif load error: ",t)}));else if(this.attribute.gifImage instanceof ArrayBuffer){const t=jT(this.attribute.gifImage),e=ET(t,!0);this.renderGIF(e)}}renderGIF(t){this.loadedFrames=t,this.frameIndex=0,this.tempCanvas||(this.tempCanvas=mn.global.createCanvas({}),this.tempCtx=this.tempCanvas.getContext("2d")),this.gifCanvas||(this.gifCanvas=mn.global.createCanvas({}),this.gifCtx=this.gifCanvas.getContext("2d")),this.gifCanvas.width=t[0].dims.width,this.gifCanvas.height=t[0].dims.height,this.playing=!0,this.lastTime=(new Date).getTime();const e=this.animate();this.attribute.timeline&&e.setTimeline(this.attribute.timeline),e.to({},1e3,"linear").loop(1/0)}renderFrame(t,e,i){const n=this.loadedFrames[this.frameIndex||0];2===n.disposalType&&this.gifCtx.clearRect(0,0,this.gifCanvas.width,this.gifCanvas.height),this.drawPatch(n),this.manipulate(t,e,i);const r=(new Date).getTime()-this.lastTime;n.delay<r&&(this.frameIndex++,this.lastTime=(new Date).getTime()),this.frameIndex>=this.loadedFrames.length&&(this.frameIndex=0)}drawPatch(t){const e=t.dims;this.frameImageData&&e.width===this.frameImageData.width&&e.height===this.frameImageData.height||(this.tempCanvas.width=e.width,this.tempCanvas.height=e.height,this.frameImageData=this.tempCtx.createImageData(e.width,e.height)),this.frameImageData.data.set(t.patch),this.tempCtx.putImageData(this.frameImageData,0,0),this.gifCtx.drawImage(this.tempCanvas,e.left,e.top)}manipulate(t,e,i){t.drawImage(this.gifCanvas,0,0,this.gifCanvas.width,this.gifCanvas.height,e,i,this.attribute.width,this.attribute.height)}setAttribute(t,e,i,n){super.setAttribute(t,e,i,n),"gifImage"===t&&this.loadGif()}setAttributes(t,e,i){super.setAttributes(t,e,i),t.gifImage&&this.loadGif()}}var GT=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a};let FT=class{constructor(){this.type="gif-image",this.numberType=WT}contains(t,e,i){const{pickContext:n}=null!=i?i:{};return!!n&&!!t.AABBBounds.containsPoint(e)}};FT=GT([g()],FT);let zT=!1;const HT=new i(((t,e,i,n)=>{zT||(zT=!0,t(sy).to(FT).inSingletonScope(),t(my).toService(sy))}));var VT=function(t,e,i,n){var r,s=arguments.length,a=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(a=(s<3?r(a):s>3?r(e,i,a):r(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a},YT=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},XT=function(t,e){return function(i,n){e(i,n,t)}};let $T=class extends t.DefaultCanvasImageRender{constructor(t){super(t),this.imageRenderContribitions=t,this.numberType=WT,this._renderContribitions=void 0,this.builtinContributions=[qT],this.init(t)}drawShape(t,e,i,n,r,s,a,o){const h=Or(t).image,{x:l=h.x,y:c=h.y,fillStrokeOrder:u=h.fillStrokeOrder}=t.attribute,d=this.valid(t,h,a);if(!d)return;const{fVisible:p,sVisible:f,doFill:g,doStroke:v}=d,m=()=>{g&&a&&a(e,t.attribute,h)},y=()=>{v&&(o?o(e,t.attribute,h):f&&(e.setStrokeStyle(t,t.attribute,l-i,c-n,h),e.stroke()))};u?(y(),e.save(),e.clip(),this.beforeRenderStep(t,e,i,n,g,!1,p,!1,h,r,a),m(),e.restore()):(e.save(),e.clip(),this.beforeRenderStep(t,e,i,n,g,!1,p,!1,h,r,a),m(),e.restore(),y()),this.afterRenderStep(t,e,i,n,g,!1,p,!1,h,r,a)}draw(t,e,i){const{context:n}=e.drawParams;if(!n)return;const r=Or(t).image;this._draw(t,r,!1,i)}};$T=VT([g(),XT(0,p(k)),XT(0,v(oh)),YT("design:paramtypes",[Object])],$T);const qT=new class extends ll{constructor(){super(...arguments),this.time=t.BaseRenderContributionTime.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,r,s,a,o,h,l,c,u){t.renderFrame&&t.playing&&t.renderFrame(e,i,n)}};let KT=!1;const ZT=new i((t=>{KT||(KT=!0,t($T).toSelf().inSingletonScope(),t(Bc).toService($T))})),JT=pf();function QT(){QT.__loaded||(QT.__loaded=!0,$g(),jn.load(og),jn.load(JT?VS:Pb))}QT.__loaded=!1;const tC=QT;function eC(){eC.__loaded||(eC.__loaded=!0,qg(),Rf(),Ef(),jn.load(zg),jn.load(gT))}eC.__loaded=!1;const iC=eC;function nC(){nC.__loaded||(nC.__loaded=!0,Kg(),jn.load(pg),jn.load(JT?cA:Ib))}nC.__loaded=!1;const rC=nC;function sC(){sC.__loaded||(sC.__loaded=!0,Zg(),jn.load(mg),jn.load(JT?AA:Nb))}sC.__loaded=!1;const aC=sC;function oC(){oC.__loaded||(oC.__loaded=!0,Jg(),jn.load(Bg),jn.load(JT?XA:Xb))}oC.__loaded=!1;const hC=oC;function lC(){lC.__loaded||(lC.__loaded=!0,Qg())}lC.__loaded=!1;const cC=lC;function uC(){uC.__loaded||(uC.__loaded=!0,tv(),jn.load(Ig),jn.load(JT?nT:Zb))}uC.__loaded=!1;const dC=uC;function pC(){pC.__loaded||(pC.__loaded=!0,ev(),jn.load(ug),jn.load(JT?rA:nx))}pC.__loaded=!1;const fC=pC;function gC(){gC.__loaded||(gC.__loaded=!0,iv(),jn.load(wg),jn.load(JT?LA:gx))}gC.__loaded=!1;const vC=gC;function mC(){mC.__loaded||(mC.__loaded=!0,nv(),jn.load(Ag),jn.load(JT?GA:lx))}mC.__loaded=!1;const yC=mC;function bC(){bC.__loaded||(bC.__loaded=!0,rv(),Rf(),Ef(),jn.load(Xg),jn.load(wT))}bC.__loaded=!1;const xC=bC;function wC(){wC.__loaded||(wC.__loaded=!0,sv(),jn.load(lg),jn.load(JT?ZS:Tx))}wC.__loaded=!1;const SC=wC;function AC(){AC.__loaded||(AC.__loaded=!0,av(),jn.load(Wg),jn.load(lT))}AC.__loaded=!1;const TC=AC;function CC(){CC.__loaded||(CC.__loaded=!0,ov(),jn.load(kg),jn.load(JT?QA:_x))}CC.__loaded=!1;const _C=CC;function BC(){BC.__loaded||(BC.__loaded=!0,cv())}BC.__loaded=!1;const PC=BC;function RC(){RC.__loaded||(RC.__loaded=!0,hv(),jn.load(gg),jn.load(JT?mA:kx))}RC.__loaded=!1;const MC=RC;function EC(){EC.__loaded||(EC.__loaded=!0,lv(),jn.load(bg),jn.load(JT?RA:Dx))}EC.__loaded=!1;const kC=EC;function OC(){OC.__loaded||(OC.__loaded=!0,uv())}OC.__loaded=!1;const IC=OC,LC=Gm;Jp(),pf()?rb(jn):ff()&&Tw(jn),tC(),iC(),rC(),aC(),hC(),cC(),dC(),fC(),vC(),yC(),xC(),SC(),TC(),_C(),PC(),MC(),kC(),IC(),xv(),mv(),pv(),gv(),Rf(),Ef(),t.ACustomAnimate=is,t.ARC3D_NUMBER_TYPE=so,t.ARC_NUMBER_TYPE=ro,t.AREA_NUMBER_TYPE=ao,t.Animate=rs,t.AnimateGroup=class extends is{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onStart(){this.customAnimates.forEach((t=>{t.onStart()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Qr[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.AnimateGroup1=class extends is{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((n=>{const r=n.easing,s="string"==typeof r?Qr[r]:r;e=s(e),n.onUpdate(t,e,i)})),this.updating=!1)}},t.Application=vn,t.Arc=rp,t.Arc3d=ap,t.Arc3dRender=Tc,t.ArcRender=Ac,t.ArcRenderContribution=nh,t.Area=ep,t.AreaRender=Cc,t.AreaRenderContribution=rh,t.AttributeAnimate=class extends is{constructor(t,e,i){super({},t,e,i)}getEndProps(){return this.to}onBind(){Object.keys(this.to).forEach((t=>{this.from[t]=this.target.getComputedAttribute(t)}))}onEnd(){}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this.to,this.from)}},t.AutoEnablePlugins=bp,t.BaseCanvas=Af,t.BaseRender=Fh,t.Basis=vi,t.BeforeRenderConstribution=iu,t.BoundsContext=Be,t.BoundsPicker=au,t.CIRCLE_NUMBER_TYPE=oo,t.Canvas3DDrawItemInterceptor=Zc,t.CanvasArc3dPicker=ey,t.CanvasArcPicker=ty,t.CanvasAreaPicker=iy,t.CanvasCirclePicker=ny,t.CanvasFactory=Un,t.CanvasGifImagePicker=sy,t.CanvasGlyphPicker=gy,t.CanvasGroupPicker=vy,t.CanvasImagePicker=ry,t.CanvasLinePicker=ay,t.CanvasPathPicker=oy,t.CanvasPickerContribution=my,t.CanvasPolygonPicker=dy,t.CanvasPyramid3dPicker=py,t.CanvasRect3dPicker=ly,t.CanvasRectPicker=hy,t.CanvasRichTextPicker=fy,t.CanvasSymbolPicker=cy,t.CanvasTextLayout=du,t.CanvasTextPicker=uy,t.CbAnimate=ns,t.Circle=cu,t.CircleRender=_c,t.CircleRenderContribution=sh,t.ClipAngleAnimate=class extends Ps{constructor(t,e,i,n,r){var s,a,o,h,l,c,u,d,p,f,g,v;const m=null!==(a=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==a?a:{},y=null!==(o=m.width)&&void 0!==o?o:0,b=null!==(h=m.height)&&void 0!==h?h:0,x=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",w=null!==(c=null==r?void 0:r.startAngle)&&void 0!==c?c:0,S=null!==(u=null==r?void 0:r.orient)&&void 0!==u?u:"clockwise";let A=0,T=0;"anticlockwise"===S?(T="in"===x?w+2*Math.PI:w,T=w+2*Math.PI):(A=w,T="out"===x?w+2*Math.PI:w);const C=mn.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:y/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:b/2,outerRadius:null!==(v=null==r?void 0:r.radius)&&void 0!==v?v:(y+b)/2,innerRadius:0,startAngle:A,endAngle:T,fill:!0});let _,B;"anticlockwise"===S?(_={startAngle:w+2*Math.PI},B={startAngle:w}):(_={endAngle:w},B={endAngle:w+2*Math.PI}),super("in"===x?_:B,"in"===x?B:_,i,n,{group:null==r?void 0:r.group,clipGraphic:C})}},t.ClipDirectionAnimate=class extends Ps{constructor(t,e,i,n,r){var s,a,o,h,l,c,u,d,p;const f=null!==(a=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==a?a:{},g=null!==(h=null!==(o=null==r?void 0:r.width)&&void 0!==o?o:f.width)&&void 0!==h?h:0,v=null!==(c=null!==(l=null==r?void 0:r.height)&&void 0!==l?l:f.height)&&void 0!==c?c:0,m=null!==(u=null==r?void 0:r.animationType)&&void 0!==u?u:"in",y=null!==(d=null==r?void 0:r.direction)&&void 0!==d?d:"x",b=null!==(p=null==r?void 0:r.orient)&&void 0!==p?p:"positive",x=mn.graphicService.creator.rect({x:0,y:0,width:"in"===m&&"x"===y?0:g,height:"in"===m&&"y"===y?0:v,fill:!0});let w={},S={};"y"===y?"negative"===b?(w={y:v,height:0},S={y:0,height:v}):(w={height:0},S={height:v}):"negative"===b?(w={x:g,width:0},S={x:0,width:g}):(w={width:0},S={width:g}),super("in"===m?w:S,"in"===m?S:w,i,n,{group:null==r?void 0:r.group,clipGraphic:x})}},t.ClipGraphicAnimate=Ps,t.ClipRadiusAnimate=class extends Ps{constructor(t,e,i,n,r){var s,a,o,h,l,c,u,d,p,f,g;const v=null!==(a=null===(s=null==r?void 0:r.group)||void 0===s?void 0:s.attribute)&&void 0!==a?a:{},m=null!==(o=v.width)&&void 0!==o?o:0,y=null!==(h=v.height)&&void 0!==h?h:0,b=null!==(l=null==r?void 0:r.animationType)&&void 0!==l?l:"in",x=null!==(c=null==r?void 0:r.startRadius)&&void 0!==c?c:0,w=null!==(u=null==r?void 0:r.endRadius)&&void 0!==u?u:Math.sqrt((m/2)**2+(y/2)**2),S=mn.graphicService.creator.arc({x:null!==(p=null===(d=null==r?void 0:r.center)||void 0===d?void 0:d.x)&&void 0!==p?p:m/2,y:null!==(g=null===(f=null==r?void 0:r.center)||void 0===f?void 0:f.y)&&void 0!==g?g:y/2,outerRadius:"out"===b?w:x,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:!0}),A={outerRadius:x},T={outerRadius:w};super("in"===b?A:T,"in"===b?T:A,i,n,{group:null==r?void 0:r.group,clipGraphic:S})}},t.ColorInterpolate=Qo,t.ColorStore=ia,t.CommonRenderContribution=ph,t.Container=E,t.ContainerModule=i,t.Context2dFactory=Wn,t.ContributionProvider=k,t.CurveContext=class{constructor(t){this.path=t,this._lastX=this._lastY=this._startX=this._startY=0}moveTo(t,e){return this._lastX=this._startX=t,this._lastY=this._startY=e,this}lineTo(t,e){const i=this.addLinearCurve(t,e);this.path.curves.push(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new oi(new zt(this._lastX,this._lastY),new zt(t,e))}quadraticCurveTo(t,e,i,n){throw new Error("CurveContext不支持调用quadraticCurveTo")}bezierCurveTo(t,e,i,n,r,s){const a=new si(new zt(this._lastX,this._lastY),new zt(t,e),new zt(i,n),new zt(r,s));this.path.curves.push(a),this._lastX=r,this._lastY=s}arcTo(t,e,i,n,r){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,r,s,a,o){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,r,s){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}},t.CustomEvent=Gr,t.CustomPath2D=Ni,t.CustomSymbolClass=wd,t.DEFAULT_TEXT_FONT_FAMILY=N,t.DebugDrawItemInterceptorContribution=qc,t.DefaultArcAllocate=Hf,t.DefaultArcAttribute=tn,t.DefaultArcRenderContribution=Kh,t.DefaultAreaAllocate=Yf,t.DefaultAreaAttribute=en,t.DefaultAreaTextureRenderContribution=xl,t.DefaultAttribute=Qi,t.DefaultBaseBackgroundRenderContribution=Yh,t.DefaultBaseTextureRenderContribution=$h,t.DefaultCanvasAllocate=gr,t.DefaultCircleAllocate=$f,t.DefaultCircleAttribute=nn,t.DefaultCircleRenderContribution=tl,t.DefaultConnectAttribute=Zi,t.DefaultDebugAttribute=Ji,t.DefaultFillStyle=Vi,t.DefaultGlyphAttribute=sn,t.DefaultGraphicAllocate=Gf,t.DefaultGraphicMemoryManager=rg,t.DefaultGroupAttribute=rn,t.DefaultGroupBackgroundRenderContribution=rl,t.DefaultImageAttribute=fn,t.DefaultImageRenderContribution=pl,t.DefaultLayout=zi,t.DefaultLineAllocate=Kf,t.DefaultLineAttribute=an,t.DefaultMat4Allocate=Oh,t.DefaultMatrixAllocate=kh,t.DefaultMorphingAnimateConfig=hs,t.DefaultPathAllocate=Jf,t.DefaultPathAttribute=on,t.DefaultPickStyle=qi,t.DefaultPolygonAttribute=hn,t.DefaultRect3dAttribute=cn,t.DefaultRectAllocate=Ff,t.DefaultRectAttribute=ln,t.DefaultRectRenderContribution=ll,t.DefaultRichTextAttribute=pn,t.DefaultRichTextIconAttribute=gn,t.DefaultStateAnimateConfig=os,t.DefaultStrokeStyle=Xi,t.DefaultStyle=Ki,t.DefaultSymbolAllocate=tg,t.DefaultSymbolAttribute=un,t.DefaultSymbolRenderContribution=vl,t.DefaultTextAllocate=ig,t.DefaultTextAttribute=dn,t.DefaultTextStyle=$i,t.DefaultTicker=Zr,t.DefaultTimeline=ts,t.DefaultTransform=Hi,t.DirectionalLight=Pf,t.DragNDrop=class{constructor(t){this.onPointerDown=t=>{const e=t.target,i=this.rootNode,n=e===i;if(e&&!n){let r,s=!1;function a(t){if(s||(t.type="dragstart",null==e||e.dispatchEvent(t),s=!0),t.type="drag",null==e||e.dispatchEvent(t),!n){e.attribute.pickable=!1;const n=(null==i?void 0:i.pick(t.global.x,t.global.y)).graphic;e.attribute.pickable=!0,r!==n&&(r&&(t.type="dragleave",t.target=r,r.dispatchEvent(t)),n&&(t.type="dragenter",t.target=n,n.dispatchEvent(t)),r=n,r&&(t.type="dragover",t.target=r,r.dispatchEvent(t)))}}null==i||i.addEventListener("pointermove",a);const o=function(){s&&(r&&(t.type="drop",t.target=r,r.dispatchEvent(t)),t.type="dragend",e.dispatchEvent(t),s=!1),null==i||i.removeEventListener("pointermove",a)};e.addEventListener("pointerup",o,{once:!0}),e.addEventListener("pointerupoutside",o,{once:!0})}},this.rootNode=t,this.initEvents()}initEvents(){var t;null===(t=this.rootNode)||void 0===t||t.addEventListener("pointerdown",this.onPointerDown)}removeEvents(){var t;null===(t=this.rootNode)||void 0===t||t.removeEventListener("pointerdown",this.onPointerDown)}release(){this.removeEvents(),this.rootNode=null}},t.DrawContribution=Gc,t.DrawItemInterceptor=Vc,t.DynamicLayerHandlerContribution=Lo,t.EnvContribution=U,t.EventManager=Hr,t.EventSystem=Xr,t.EventTarget=Vr,t.FORMAT_ELEMENT_COMMAND="FORMAT_ELEMENT_COMMAND",t.FORMAT_TEXT_COMMAND=Nf,t.Factory=gf,t.FadeInPlus=class extends is{constructor(t,e,i,n,r){super(t,e,i,n,r);const{direction:s=Bs.LEFT_TO_RIGHT,fill:a=!0,stroke:o=!0}=r||{};this.direction=s,this.fill=a,this.stroke=o,this.fillGradient={gradient:"linear",stops:[]},this.strokeGradient={gradient:"linear",stops:[]}}getEndProps(){return{fill:this.toFill,stroke:this.toStroke}}onBind(){this.toFill=this.target.getComputedAttribute("fill"),this.toStroke=this.target.getComputedAttribute("stroke")}onEnd(){}onUpdate(t,e,i){if(this.toFill&&this.toStroke)switch(this.direction){case Bs.RIGHT_TO_LEFT:this.rightToLeft(t,e,i);break;case Bs.TOP_TO_BOTTOM:this.topToBottom(t,e,i);break;case Bs.BOTTOM_TO_TOP:this.bottomToTop(t,e,i);break;case Bs.STROKE:this.strokePath(t,e,i);break;default:this.leftToRight(t,e,i)}}leftToRight(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=this.toStroke;this.strokeGradient.x0=0,this.strokeGradient.y0=0,this.strokeGradient.x1=1,this.strokeGradient.y1=0,this.strokeGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,6*e),color:"transparent"}],i.stroke=this.strokeGradient}}strokePath(t,e,i){if(this.fill){const t=this.toFill;this.fillGradient.x0=0,this.fillGradient.y0=0,this.fillGradient.x1=1,this.fillGradient.y1=0,this.fillGradient.stops=[{offset:0,color:t},{offset:e,color:t},{offset:Math.min(1,2*e),color:"transparent"}],i.fill=this.fillGradient}if(this.stroke){const t=300,n=e*t;i.lineDash=[n,t-n]}}rightToLeft(t,e,i){}topToBottom(t,e,i){}bottomToTop(t,e,i){}},t.FederatedEvent=jr,t.FederatedMouseEvent=Ur,t.FederatedPointerEvent=Wr,t.FederatedWheelEvent=Nr,t.FlexLayoutPlugin=bv,t.Fragment=Ay,t.GLYPH_NUMBER_TYPE=ho,t.GRAPHIC_UPDATE_TAG_KEY=Ra,t.GROUP_NUMBER_TYPE=lo,t.Generator=e,t.Gesture=class extends ${constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,n,r,s,a,o,h,l,c,u;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=t=>{this.cachedEvents=[],this.startPoints=[],this.reset(),this.startTime=Fr.now();const{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t<e.length;t++){const{x:n,y:r}=e[t],s={x:n,y:r};i[t]=s}if(1!==i.length)this.startDistance=By(i[0],i[1]),this.center=(t=>{const e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,n=0,r=0;for(;r<e;)i+=t[r].x,n+=t[r].y,r++;return{x:Math.round(i/e),y:Math.round(n/e)}})([i[0],i[1]]);else{const t=e[0];this.pressTimeout=setTimeout((()=>{t.direction="none",t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent("press",t),this.triggerEvent("press",t),this.eventType="press",this.direction="none",this.pressTimeout=null}),this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const n=t.clone(),{x:r,y:s,pointerId:a}=n;for(let t=0,e=i.length;t<e;t++)if(a===i[t].pointerId){i[t]=n;break}const o={x:r,y:s},h=i.map((t=>({x:t.x,y:t.y}))),l=Fr.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=l,this.lastMovePoint=o,1===e.length){const t=e[0],i=r-t.x,a=s-t.y,l=this.direction||_y(t,o);this.direction=l;const c=this.getEventType(o);return n.direction=l,n.deltaX=i,n.deltaY=a,n.points=h,this.triggerStartEvent(c,n),void this.triggerEvent(c,n)}const{startDistance:c}=this,u=By(h[0],h[1]);n.scale=u/c,n.center=this.center,n.points=h,this.triggerStartEvent("pinch",n),this.triggerEvent("pinch",n)},this.onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:n}=this,r=i.map((t=>({x:t.x,y:t.y})));if(e.points=r,this.triggerEndEvent(e),1===i.length){const i=Fr.now(),r=this.lastMoveTime;if(i-r<100){const t=r-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||n[0],r=this.lastMovePoint||n[0],s=By(i,r),a=s/t;if(a>this.config.swipe.velocity&&s>this.config.swipe.threshold)return e.velocity=a,e.direction=_y(i,r),this.triggerEvent("swipe",e),this.cachedEvents=[],this.startPoints=[],void this.reset()}}i-this.startTime<this.config.press.time&&(i-this.lastTapTime<this.config.tap.interval&&t.target===this.lastTapTarget?this.tapCount++:this.tapCount=1,this.lastTapTime=i,this.lastTapTarget=t.target,1===this.tapCount?this.triggerEvent("tap",e):2===this.tapCount&&(this.triggerEvent("doubletap",e),this.tapCount=0))}for(let t=0,r=i.length;t<r;t++)if(i[t].pointerId===e.pointerId){i.splice(t,1),n.splice(t,1);break}this.reset(),i.length>0&&this.onStart()},this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:null!==(n=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==n?n:251,threshold:null!==(s=null===(r=null==e?void 0:e.press)||void 0===r?void 0:r.threshold)&&void 0!==s?s:9},swipe:{threshold:null!==(o=null===(a=null==e?void 0:e.swipe)||void 0===a?void 0:a.threshold)&&void 0!==o?o:10,velocity:null!==(l=null===(h=null==e?void 0:e.swipe)||void 0===h?void 0:h.velocity)&&void 0!==l?l:.3},tap:{interval:null!==(u=null===(c=null==e?void 0:e.tap)||void 0===c?void 0:c.interval)&&void 0!==u?u:300}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){const{eventType:e,startTime:i,startPoints:n}=this;if("press"===e)return e;let r;return r=Fr.now()-i>this.config.press.time&&By(n[0],t)<this.config.press.threshold?"press":"pan",this.eventType=r,r}enable(t){this.processEvent[t]=!0}isProcess(t){return this.processEvent[t]}pushEvent(t,e){const{emitThrottles:i}=this,n={type:t,ev:e};for(let e=0,r=i.length;e<r;e++)if(i[e].type===t)return void i.splice(e,1,n);i.push(n)}clearPressTimeout(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}reset(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}triggerEvent(t,e){this.pushEvent(t,e);const{throttleTimer:i,emitThrottles:n}=this;i||(this.throttleTimer=mn.global.getRequestAnimationFrame()((()=>{mn.global.getCancelAnimationFrame()(this.throttleTimer),this.throttleTimer=null;for(let t=0,e=n.length;t<e;t++){const{type:e,ev:i}=n[t];this.emitEvent(e,i)}this.emitThrottles.length=0})))}triggerStartEvent(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent(`${t}start`,e))}triggerEndEvent(t){const e=this.processEvent;Object.keys(e).forEach((i=>{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]}))}emitEvent(t,e){if(!this.element)return;const i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let n=0,r=i.length;n<r&&!e.propagationImmediatelyStopped;n++)i[n].fn.call(i[n].context,e,t);this.emit(t,e)}},t.GifImage=NT,t.GlobalPickerService=ou,t.Glyph=Ud,t.GlyphRender=Uc,t.Graphic=La,t.GraphicAnimate=class extends is{constructor(t,e,i,n,r){super(t,e,i,n,r),this.graphic=null==r?void 0:r.graphic}onUpdate(t,e,i){this.graphic&&Object.keys(this.from).forEach((t=>{i[t]=this.from[t]+(this.to[t]-this.from[t])*e}))}},t.GraphicCreator=So,t.GraphicPicker=ru,t.GraphicRender=Bc,t.GraphicService=wo,t.GraphicUtil=ko,t.Group=Po,t.GroupFadeIn=class extends is{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:0}})}onEnd(){this.target.setTheme({common:{opacity:1}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:e}})}},t.GroupFadeOut=class extends is{getEndProps(){return{}}onBind(){this.target.setTheme({common:{opacity:1}})}onEnd(){this.target.setTheme({common:{opacity:0}})}onUpdate(t,e,i){this.target.setTheme({common:{opacity:1-e}})}},t.GroupRender=Pc,t.GroupRenderContribution=ah,t.HtmlAttributePlugin=dv,t.IMAGE_NUMBER_TYPE=co,t.Image=zd,t.ImageRender=Wc,t.ImageRenderContribution=oh,t.IncreaseCount=class extends is{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n,r,s,a,o;this.fromNumber=ht(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(i=this.from)||void 0===i?void 0:i.text),this.toNumber=ht(null===(n=this.to)||void 0===n?void 0:n.text)?null===(r=this.to)||void 0===r?void 0:r.text:Number.parseFloat(null===(s=this.to)||void 0===s?void 0:s.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(o=null===(a=this.params)||void 0===a?void 0:a.fixed)&&void 0!==o?o:Math.max(Ft(this.fromNumber),Ft(this.toNumber)))}onEnd(){}onUpdate(t,e,i){var n;!1!==this.valid&&(i.text=t?null===(n=this.to)||void 0===n?void 0:n.text:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}},t.IncrementalDrawContribution=Sc,t.InputText=class extends is{constructor(){super(...arguments),this.fromText="",this.toText=""}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,n;if(this.fromText=null!==(e=null===(t=this.from)||void 0===t?void 0:t.text)&&void 0!==e?e:"",this.toText=null!==(n=null===(i=this.to)||void 0===i?void 0:i.text)&&void 0!==n?n:"",!this.toText||at(this.toText))this.valid=!1;else{this.toText=this.toText.toString();const t=this.target.attachShadow(),e=mn.graphicService.creator.line({x:0,y:0,points:[{x:0,y:0},{x:0,y:this.target.getComputedAttribute("fontSize")}],stroke:"black",lineWidth:1});t.add(e)}}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){var n;if(!1===this.valid)return;const r=this.fromText.length,s=this.toText.length,a=Math.ceil(r+(s-r)*e);i.text=this.toText.substr(0,a);const o=null===(n=this.target.shadowRoot)||void 0===n?void 0:n.at(0),h=this.target.clipedWidth+2;o.setAttribute("x",h)}},t.InteractiveDrawItemInterceptorContribution=Kc,t.InteractiveSubRenderContribution=fh,t.LINE_NUMBER_TYPE=uo,t.Layer=Mo,t.LayerService=Oo,t.Line=Md,t.LineRender=Rc,t.Linear=di,t.LinearClosed=ki,t.ManualTickHandler=Jr,t.ManualTicker=class extends Zr{set mode(t){this.setupTickHandler()}get mode(){return this._mode}initHandler(){return this.mode="manual",null}setupTickHandler(){const t=new Jr;return this._mode="manual",this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0}tickAt(t){this.tickerHandler.tick(t-Math.max(this.lastFrameTime,0),(t=>{this.handleTick(t,{once:!0})}))}ifCanStop(){return!1}},t.Mat4Allocate=Mh,t.MathArcPicker=zm,t.MathAreaPicker=Hm,t.MathCirclePicker=Vm,t.MathGlyphPicker=Qm,t.MathImagePicker=Ym,t.MathLinePicker=Xm,t.MathPathPicker=$m,t.MathPickerContribution=Fm,t.MathPolygonPicker=Jm,t.MathRectPicker=qm,t.MathSymbolPicker=Km,t.MathTextPicker=Zm,t.MatrixAllocate=Rh,t.Meteor=class extends is{get lastPos(){return this.posList[this.posList.length-1]}constructor(t,e,i,n){super(null,null,e,i,n),this.size=t,this.posList=[]}onBind(){const e=this.target.attachShadow();this.root=e;for(let i=0;i<this.size;i++){const n=this.target.clone(),r=Math.min((this.size-i)/this.size*3,1),s=Math.min(.2+.7/this.size);n.setAttributes({x:0,y:0,dx:0,dy:0,scaleX:r,scaleY:r,opacity:s},!1,{type:t.AttributeUpdateType.ANIMATE_BIND}),e.add(n)}}onUpdate(t,e,i){if(t)return this.target.detachShadow(),void(this.posList.length=0);const n=this.target.getComputedAttribute("x"),r=this.target.getComputedAttribute("y"),s=new zt(n,r);this.posList.length?(this.target.shadowRoot.forEachChildren(((t,e)=>{const i=this.posList[Math.max(this.posList.length-e-1,0)];t.setAttributes({x:i.x-n,y:i.y-r},!1)})),this.posList.push(s)):this.posList.push(s)}},t.MonotoneX=Ai,t.MonotoneY=Ti,t.MorphingPath=ya,t.MotionPath=class extends is{constructor(t,e,i,n,r){var s;super(t,e,i,n,r),r&&(this.pathLength=r.path.getLength(),this.path=r.path,this.distance=r.distance,this.to=r.distance*this.pathLength,this.initAngle=null!==(s=r.initAngle)&&void 0!==s?s:0,this.changeAngle=!!r.changeAngle,this.cb=r.cb)}onUpdate(t,e,i){const n=this.to*e,{pos:r,angle:s}=this.path.getAttrAt(n);i.x=r.x,i.y=r.y,this.changeAngle&&(i.angle=s+this.initAngle),this.cb&&this.cb(this.from,this.to,e,this.target)}},t.MultiToOneMorphingPath=xa,t.NOWORK_ANIMATE_ATTR=Ia,t.Node=Dr,t.OrthoCamera=Mf,t.PATH_NUMBER_TYPE=po,t.POLYGON_NUMBER_TYPE=fo,t.PURE_STYLE_KEY=["stroke","opacity","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","miterLimit","fill","fillOpacity"],t.PYRAMID3D_NUMBER_TYPE=go,t.Path=Jd,t.PathRender=Mc,t.PathRenderContribution=hh,t.PickItemInterceptor=vp,t.PickerService=su,t.PluginService=xp,t.Polygon=lp,t.PolygonRender=Ec,t.PolygonRenderContribution=lh,t.Pyramid3d=up,t.Pyramid3dRender=jc,t.RAFTickHandler=qr,t.REACT_TO_CANOPUS_EVENTS=yy,t.REACT_TO_CANOPUS_EVENTS_LIST=by,t.RECT3D_NUMBER_TYPE=mo,t.RECT_NUMBER_TYPE=vo,t.RICHTEXT_NUMBER_TYPE=yo,t.RafBasedSTO=As,t.ReactAttributePlugin=fv,t.Rect=Od,t.Rect3DRender=Oc,t.Rect3d=Dd,t.RectRender=kc,t.RectRenderContribution=ch,t.ReflectSegContext=li,t.RenderSelector=Nc,t.RenderService=eu,t.ResourceLoader=Ca,t.RichText=qd,t.RichTextEditPlugin=class{constructor(){this.name="RichTextEditPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.editing=!1,this.pointerDown=!1,this.handleInput=(t,e,i,n,r)=>{const s=this.getPointByColumnIdx(i,n,r);this.hideSelection(),this.setCursor(s.x,s.y1,s.y2),this.updateCbs.forEach((t=>t("input",this)))},this.handleChange=(t,e,i,n,r)=>{const s=this.getPointByColumnIdx(i,n,r);this.curCursorIdx=i,this.selectionStartCursorIdx=i,this.setCursorAndTextArea(s.x,s.y1,s.y2,n),this.hideSelection(),this.updateCbs.forEach((t=>t("change",this)))},this.handleMove=t=>{this.isRichtext(t)&&(this.currRt=t.target,this.handleEnter(t),t.target.once("pointerleave",this.handleLeave),this.showSelection(t))},this.handlePointerDown=t=>{this.editing?this.onFocus(t):this.deFocus(t),this.applyUpdate(),this.pointerDown=!0,this.updateCbs.forEach((t=>t(this.editing?"onfocus":"defocus",this)))},this.handlePointerUp=t=>{this.pointerDown=!1},this.handleEnter=t=>{this.editing=!0,this.pluginService.stage.setCursor("text")},this.handleLeave=t=>{this.editing=!1,this.pluginService.stage.setCursor("default")},this.commandCbs=new Map,this.commandCbs.set(Nf,[this.formatTextCommandCb]),this.updateCbs=[]}getSelection(){return this.selectionStartCursorIdx&&this.curCursorIdx&&this.selectionStartCursorIdx!==this.curCursorIdx&&this.currRt?new Wf(this.selectionStartCursorIdx,this.curCursorIdx,jf(this.currRt.attribute.textConfig,this.selectionStartCursorIdx),jf(this.currRt.attribute.textConfig,this.curCursorIdx),this.currRt):null}formatTextCommandCb(t,e){const i=e.currRt;if(!i)return;const n=e.getSelection();if(!n)return;const{selectionStartCursorIdx:r,curCursorIdx:s}=n,a=i.attribute.textConfig.slice(r+1,s+1);"bold"===t?a.forEach((t=>t.fontWeight="bold")):"italic"===t?a.forEach((t=>t.fontStyle="italic")):"underline"===t?a.forEach((t=>t.underline=!0)):"lineThrough"===t?a.forEach((t=>t.lineThrough=!0)):et(t)&&a.forEach((e=>function(t){let e=-1;const i=arguments.length<=1?0:arguments.length-1;for(;++e<i;)ft(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}(e,t))),i.setAttributes(i.attribute)}dispatchCommand(t,e){const i=this.commandCbs.get(t);i&&i.forEach((t=>t(e,this))),this.updateCbs.forEach((t=>t("dispatch",this)))}registerCommand(t,e){(this.commandCbs.get(t)||[]).push(e)}registerUpdateListener(t){(this.updateCbs||[]).push(t)}activate(t){this.pluginService=t,this.editModule=new Uf,t.stage.on("pointermove",this.handleMove),t.stage.on("pointerdown",this.handlePointerDown),t.stage.on("pointerup",this.handlePointerUp),t.stage.on("pointerleave",this.handlePointerUp),this.editModule.onInput(this.handleInput),this.editModule.onChange(this.handleChange)}showSelection(t){const e=t.target.getFrameCache();if(e&&this.editBg&&this.pointerDown){let i=this.lastPoint,n=this.getEventPosition(t),r=this.getLineByPoint(e,n);const s=this.getColumnByLinePoint(r,n),a=r.top,o=r.top+r.height;let h=s.left+s.width,l=this.getColumnIndex(e,s);n.x<s.left+s.width/2&&(h=s.left,l-=1),n.x=h,n.y=(a+o)/2;let c=this.getLineByPoint(e,i);if((i.y>n.y||i.y===n.y&&i.x>n.x)&&([i,n]=[n,i],[r,c]=[c,r]),this.editBg.removeAllChild(),c===r){const t=this.getColumnByLinePoint(c,i);this.editBg.setAttributes({x:i.x,y:c.top,width:n.x-i.x,height:t.height,fill:"#336df4",fillOpacity:.2})}else{this.editBg.setAttributes({x:0,y:c.top,width:0,height:0});const t=e.lines.findIndex((t=>t===c)),s=e.lines.findIndex((t=>t===r));let a=0;for(let r=t;r<=s;r++){const o=e.lines[r];if(r===t){const t=o.paragraphs[o.paragraphs.length-1];this.editBg.add(Id({x:i.x,y:a,width:t.left+t.width-i.x,height:o.height,fill:"#336df4",fillOpacity:.2}))}else if(r===s){const t=o.paragraphs[0];this.editBg.add(Id({x:t.left,y:a,width:n.x-t.left,height:o.height,fill:"#336df4",fillOpacity:.2}))}else{const t=o.paragraphs[0],e=o.paragraphs[o.paragraphs.length-1];this.editBg.add(Id({x:t.left,y:a,width:e.left+e.width-t.left,height:o.height,fill:"#336df4",fillOpacity:.2}))}a+=o.height}}this.curCursorIdx=l,this.setCursorAndTextArea(h,a+2,o-2,t.target),this.applyUpdate(),this.updateCbs.forEach((t=>t("selection",this)))}}hideSelection(){this.editBg&&(this.editBg.removeAllChild(),this.editBg.setAttributes({fill:"transparent"}))}isRichtext(t){return!(!t.target||"richtext"!==t.target.type||!t.target.attribute.editable)}getEventPosition(t){const e=this.pluginService.stage.eventPointTransform(t),i={x:0,y:0};return t.target.globalTransMatrix.transformPoint(e,i),i}getLineByPoint(t,e){let i=t.lines[0];for(let n=0;n<t.lines.length&&!(i.top<=e.y&&i.top+i.height>=e.y);n++)i=t.lines[n+1];return i}getColumnByLinePoint(t,e){let i=t.paragraphs[0];for(let n=0;n<t.paragraphs.length&&!(i.left<=e.x&&i.left+i.width>=e.x);n++)i=t.paragraphs[n];return i}onFocus(t){this.deFocus(t);const e=t.target;this.tryUpdateRichtext(e);const i=e.attachShadow();i.setAttributes({shadowRootIdx:-1});const n=e.getFrameCache();if(!n)return;if(!this.editLine){const t=Ed({x:0,y:0,lineWidth:1,stroke:"black"});t.animate().to({opacity:1},10,"linear").wait(700).to({opacity:0},10,"linear").wait(700).loop(1/0),this.editLine=t;const e=Ro({x:0,y:0,width:0,height:0});this.editBg=e,i.add(this.editLine),i.add(this.editBg)}const r=this.getEventPosition(t),s=this.getLineByPoint(n,r);if(s){const t=this.getColumnByLinePoint(s,r);if(!t)return;let i=s.top,a=s.top+s.height,o=t.left+t.width;i+=2,a-=2;let h=this.getColumnIndex(n,t);r.x<t.left+t.width/2&&(o=t.left,h-=1),this.lastPoint={x:o,y:(i+a)/2},this.curCursorIdx=h,this.selectionStartCursorIdx=h,this.setCursorAndTextArea(o,i,a,e)}}getPointByColumnIdx(t,e,i){const n=e.getFrameCache(),{lineInfo:r,columnInfo:s}=this.getColumnByIndex(n,t);let a=r.top,o=r.top+r.height;return a+=2,o-=2,{x:s.left+("left"===i?0:s.width),y1:a,y2:o}}getColumnIndex(t,e){let i=-1;for(let n=0;n<t.lines.length;n++){const r=t.lines[n];for(let t=0;t<r.paragraphs.length;t++)if(i++,e===r.paragraphs[t])return i}return-1}getColumnByIndex(t,e){let i=-1;for(let n=0;n<t.lines.length;n++){const r=t.lines[n];for(let t=0;t<r.paragraphs.length;t++){const n=r.paragraphs[t];if(i++,i===e)return{lineInfo:r,columnInfo:n}}}return null}setCursorAndTextArea(t,e,i,n){this.editLine.setAttributes({points:[{x:t,y:e},{x:t,y:i}]});const r={x:0,y:0};n.globalTransMatrix.getInverse().transformPoint({x:t,y:e},r);const{left:s,top:a}=this.pluginService.stage.window.getBoundingClientRect();r.x+=s,r.y+=a,this.editModule.moveTo(r.x,r.y,n,this.curCursorIdx,this.selectionStartCursorIdx)}setCursor(t,e,i){this.editLine.setAttributes({points:[{x:t,y:e},{x:t,y:i}]})}applyUpdate(){this.pluginService.stage.renderNextFrame()}deFocus(t){const e=this.currRt;e&&(e.detachShadow(),this.currRt=null,this.editLine&&(this.editLine.parent.removeChild(this.editLine),this.editLine.release(),this.editLine=null,this.editBg.parent.removeChild(this.editBg),this.editBg.release(),this.editBg=null))}splitText(t){return Array.from(t)}tryUpdateRichtext(t){if(!t.getFrameCache().lines.every((t=>t.paragraphs.every((t=>!(t.text&&st(t.text)&&this.splitText(t.text).length>1)))))){const e=[];t.attribute.textConfig.forEach((t=>{const i=this.splitText(t.text.toString());if(st(t.text)&&i.length>1)for(let n=0;n<i.length;n++){const r=i[n];e.push(Object.assign(Object.assign({},t),{text:r}))}else e.push(t)})),t.setAttributes({textConfig:e}),t.doUpdateFrameCache(e)}}onSelect(){}deactivate(t){t.stage.off("pointermove",this.handleMove),t.stage.off("pointerdown",this.handlePointerDown),t.stage.off("pointerup",this.handlePointerUp),t.stage.off("pointerleave",this.handlePointerUp)}release(){this.editModule.release()}},t.RichTextRender=Dc,t.RotateBySphereAnimate=class extends is{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.getComputedAttribute("x"),n=this.target.getComputedAttribute("y"),r=this.target.getComputedAttribute("z"),s=Math.acos((n-t.y)/e);let a=Math.acos((i-t.x)/e/Math.sin(s));r-t.z<0&&(a=Mt-a),this.theta=a,this.phi=s}onBind(){}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:n,r:r,cb:s}="function"==typeof this.params?this.params():this.params,a=2*Math.PI*e,o=this.theta+a,h=this.phi,l=r*Math.sin(h)*Math.cos(o)+n.x,c=r*Math.cos(h)+n.y,u=r*Math.sin(h)*Math.sin(o)+n.z;for(i.x=l,i.y=c,i.z=u,i.alpha=o+Bt/2;i.alpha>Mt;)i.alpha-=Mt;i.alpha=Mt-i.alpha,i.zIndex=-1e4*i.z,s&&s(i)}},t.SVG_ATTRIBUTE_MAP=Ao,t.SVG_ATTRIBUTE_MAP_KEYS=To,t.SVG_PARSE_ATTRIBUTE_MAP=Co,t.SVG_PARSE_ATTRIBUTE_MAP_KEYS=_o,t.SYMBOL_NUMBER_TYPE=bo,t.SegContext=hi,t.ShadowRoot=pp,t.ShadowRootDrawItemInterceptorContribution=$c,t.Stage=mf,t.StaticLayerHandlerContribution=Io,t.Step=Ri,t.StreamLight=class extends is{constructor(t,e,i,n,r){super(t,e,i,n,r)}getEndProps(){return{}}onStart(){this.target&&("rect"===this.target.type?this.onStartRect():"line"===this.target.type?this.onStartLineOrArea("line"):"area"===this.target.type&&this.onStartLineOrArea("area"))}onStartLineOrArea(t){var e;const i=this.target.attachShadow(),n=mn.graphicService.creator[t](Object.assign({},null===(e=this.params)||void 0===e?void 0:e.attribute));this[t]=n,n.pathProxy=new Ni,i.add(n)}onStartRect(){var t,e,i;const n=this.target.attachShadow(),r=null===(e=null===(t=this.params)||void 0===t?void 0:t.isHorizontal)||void 0===e||e,s=r?"height":"width",a=r?"width":"height",o=this.target.AABBBounds[s](),h=r?0:this.target.AABBBounds.y1,l=mn.graphicService.creator.rect(Object.assign(Object.assign({[s]:o,fill:"#bcdeff",shadowBlur:30,shadowColor:"#bcdeff"},null===(i=this.params)||void 0===i?void 0:i.attribute),{x:0,y:h,[a]:0}));this.rect=l,n.add(l)}onBind(){}onEnd(){this.target.detachShadow()}onUpdate(t,e,i){return this.rect?this.onUpdateRect(t,e,i):this.line||this.area?this.onUpdateLineOrArea(t,e,i):void 0}onUpdateRect(e,i,n){var r,s,a,o,h,l,c,u,d,p,f,g,v,m,y,b;const x=null===(s=null===(r=this.params)||void 0===r?void 0:r.isHorizontal)||void 0===s||s,w=this.target.attribute;if(x){const n=null!==(o=null!==(a=w.width)&&void 0!==a?a:Math.abs(w.x1-w.x))&&void 0!==o?o:250,r=null!==(l=null===(h=this.params)||void 0===h?void 0:h.streamLength)&&void 0!==l?l:n,s=null!==(d=null===(u=null===(c=this.params)||void 0===c?void 0:c.attribute)||void 0===u?void 0:u.width)&&void 0!==d?d:60,p=-s,f=p+(r-p)*i,g=Math.max(f,0),v=Math.min(Math.min(f+s,s),r-f),m=v+g>n?Math.max(n-g,0):v;this.rect.setAttributes({x:g,width:m,dx:Math.min(w.x1-w.x,0)},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}else{const n=null!==(f=null!==(p=w.height)&&void 0!==p?p:Math.abs(w.y1-w.y))&&void 0!==f?f:250,r=null!==(v=null===(g=this.params)||void 0===g?void 0:g.streamLength)&&void 0!==v?v:n,s=null!==(b=null===(y=null===(m=this.params)||void 0===m?void 0:m.attribute)||void 0===y?void 0:y.height)&&void 0!==b?b:60,a=n-(r+s)*i;let o=Math.min(a,n);const h=Math.min(n-a,s);let l;o<=0?(l=Math.max(o+h,0),o=0):l=h,this.rect.setAttributes({y:o,height:l,dy:Math.min(w.y1-w.y,0)},!1,{type:t.AttributeUpdateType.ANIMATE_PLAY,animationState:{ratio:i,end:e}})}}onUpdateLineOrArea(t,e,i){const n=this.line||this.area;if(!n)return;const r=n.pathProxy,s=this.target;s.cache||s.cacheArea?this._onUpdateLineOrAreaWithCache(r,s,t,e,i):this._onUpdateLineWithoutCache(r,s,t,e,i);const a=s.attribute;n.setAttributes(Object.assign({stroke:a.stroke},n.attribute)),n.addUpdateBoundTag()}_onUpdateLineOrAreaWithCache(t,e,i,n,r){var s,a;if(t.clear(),"line"===e.type){let i=e.cache;Array.isArray(i)||(i=[i]);const r=i.reduce(((t,e)=>t+e.getLength()),0),s=[];return i.forEach((t=>{t.curves.forEach((t=>s.push(t)))})),this._updateCurves(t,s,r,n)}if("area"===e.type&&(null===(a=null===(s=e.cacheArea)||void 0===s?void 0:s.top)||void 0===a?void 0:a.curves)){const i=e.cacheArea,r=i.top.curves.reduce(((t,e)=>t+e.getLength()),0);return this._updateCurves(t,i.top.curves,r,n)}}_updateCurves(t,e,i,n){var r,s;const a=i*n,o=Math.min(null!==(s=a+(null===(r=this.params)||void 0===r?void 0:r.streamLength))&&void 0!==s?s:10,i);let h=0,l=!1;for(let i=0;i<e.length;i++)if(!1!==e[i].defined){const n=e[i],r=n.getLength(),s=1-(h+r-a)/r;let c,u=1-(h+r-o)/r;if(h<a&&h+r>a)if(l=!0,n.p2&&n.p3){const[e,i]=ri(n,s);t.moveTo(i.p0.x,i.p0.y),c=i}else{const e=n.getPointAt(s);t.moveTo(e.x,e.y)}if(h<o&&h+r>o){if(n.p2&&n.p3){c&&(u=(o-a)/c.getLength());const[e]=ri(c||n,u);t.bezierCurveTo(e.p1.x,e.p1.y,e.p2.x,e.p2.y,e.p3.x,e.p3.y)}else{const e=n.getPointAt(u);t.lineTo(e.x,e.y)}break}if(l)if(n.p2&&n.p3){const e=c||n;t.bezierCurveTo(e.p1.x,e.p1.y,e.p2.x,e.p2.y,e.p3.x,e.p3.y)}else t.lineTo(n.p1.x,n.p1.y);h+=r}}_onUpdateLineWithoutCache(t,e,i,n,r){var s,a;const{points:o,curveType:h}=e.attribute;if(!o||o.length<2||"linear"!==h)return;let l=0;for(let t=1;t<o.length;t++)l+=Ht.distancePP(o[t],o[t-1]);const c=l*n,u=Math.min(null!==(a=c+(null===(s=this.params)||void 0===s?void 0:s.streamLength))&&void 0!==a?a:10,l),d=[];let p=0;for(let t=1;t<o.length;t++){const e=Ht.distancePP(o[t],o[t-1]);if(p<c&&p+e>c&&d.push(Ht.pointAtPP(o[t-1],o[t],1-(p+e-c)/e)),p<u&&p+e>u){d.push(Ht.pointAtPP(o[t-1],o[t],1-(p+e-u)/e));break}d.length&&d.push(o[t]),p+=e}if(d.length&&!(d.length<2)){t.clear(),t.moveTo(d[0].x,d[0].y);for(let e=1;e<d.length;e++)t.lineTo(d[e].x,d[e].y)}}},t.SubAnimate=ss,t.Symbol=Bd,t.SymbolRender=Ic,t.SymbolRenderContribution=uh,t.TEXT_NUMBER_TYPE=xo,t.TagPointsUpdate=class extends is{constructor(t,e,i,n,r){var s,a;super(t,e,i,n,r),this.newPointAnimateType=null!==(s=null==r?void 0:r.newPointAnimateType)&&void 0!==s?s:"grow",this.clipRangeByDimension=null!==(a=null==r?void 0:r.clipRangeByDimension)&&void 0!==a?a:"x"}getPoints(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.points)return t.points;if(t.segments){const i=[];return this.segmentsCache||(this.segmentsCache=[]),t.segments.map((t=>{var n,r;t.points&&i.push(...t.points),e&&this.segmentsCache.push(null!==(r=null===(n=t.points)||void 0===n?void 0:n.length)&&void 0!==r?r:0)})),i}return[]}onBind(){const t=this.getPoints(this.from),e=this.getPoints(this.to,!0);this.fromPoints=t?Array.isArray(t)?t:[t]:[],this.toPoints=e?Array.isArray(e)?e:[e]:[];const i=new Map;this.fromPoints.forEach((t=>{t.context&&i.set(t.context,t)}));let n,r,s=1/0,a=-1/0;for(let t=0;t<this.toPoints.length;t+=1)if(i.has(this.toPoints[t].context)){s=t,n=i.get(this.toPoints[t].context);break}for(let t=this.toPoints.length-1;t>=0;t-=1)if(i.has(this.toPoints[t].context)){a=t,r=i.get(this.toPoints[t].context);break}"clip"===this.newPointAnimateType&&0!==this.toPoints.length&&(Number.isFinite(a)?(this.clipRange=this.toPoints[a][this.clipRangeByDimension]/this.toPoints[this.toPoints.length-1][this.clipRangeByDimension],1===this.clipRange&&(this.shrinkClipRange=this.toPoints[a][this.clipRangeByDimension]/this.fromPoints[this.fromPoints.length-1][this.clipRangeByDimension]),lt(this.clipRange)?this.clipRange=Ct(this.clipRange,0,1):this.clipRange=0):this.clipRange=0);let o=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const h=i.get(t.context);return h?(o=h,[h,t]):"appear"===this.newPointAnimateType||"clip"===this.newPointAnimateType?[t,t]:e<s&&n?[n,t]:e>a&&r?[r,t]:[o,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],n=new zt(e.x,e.y,e.x1,e.y1);return n.defined=i.defined,n.context=i.context,n}))}onFirstRun(){const t=this.target.attribute.clipRange;lt(t*this.clipRange)&&(this.clipRange*=t)}onUpdate(t,e,i){if(this.points=this.points.map(((t,i)=>{const n=ys(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return n.context=t.context,n})),this.clipRange){if(this.shrinkClipRange)return void(t?(i.points=this.toPoints,i.clipRange=1):(i.points=this.fromPoints,i.clipRange=this.clipRange-(this.clipRange-this.shrinkClipRange)*e));i.clipRange=this.clipRange+(1-this.clipRange)*e}if(this.segmentsCache&&this.to.segments){let t=0;i.segments=this.to.segments.map(((e,i)=>{const n=t+this.segmentsCache[i],r=this.points.slice(t,n);return t=n,Object.assign(Object.assign({},e),{points:r})}))}else i.points=this.points}},t.Text=fu,t.TextMeasureContribution=Dn,t.TextRender=Lc,t.TextRenderContribution=dh,t.Theme=Er,t.TimeOutTickHandler=Kr,t.TransformUtil=Eo,t.VArc=function(t){return Jl.arc(t?t.attribute:{})},t.VArc3d=function(t){return Jl.arc3d(t?t.attribute:{})},t.VArea=function(t){return Jl.area(t?t.attribute:{})},t.VCircle=function(t){return Jl.circle(t?t.attribute:{})},t.VGlobal=W,t.VGlyph=function(t){return Jl.glyph(t?t.attribute:{})},t.VGroup=function(t){return Jl.group(t?t.attribute:{})},t.VImage=function(t){return Jl.image(t?t.attribute:{})},t.VLine=function(t){return Jl.line(t?t.attribute:{})},t.VPath=function(t){return Jl.path(t?t.attribute:{})},t.VPolygon=function(t){return Jl.polygon(t?t.attribute:{})},t.VPyramid3d=function(t){return Jl.pyramid3d(t?t.attribute:{})},t.VRect=function(t){return Jl.rect(t?t.attribute:{})},t.VRect3d=function(t){return Jl.rect3d(t?t.attribute:{})},t.VRichText=xy,t.VSymbol=function(t){return Jl.symbol(t?t.attribute:{})},t.VText=function(t){return Jl.text(t?t.attribute:{})},t.VWindow=br,t.ViewTransform3dPlugin=vv,t.VirtualLayerHandlerContribution=Do,t.WILDCARD="*",t.WindowHandlerContribution=xr,t.WrapText=mu,t.XMLParser=Va,t._calculateLineHeight=Cs,t._interpolateColor=sa,t._registerArc=QT,t.addArcToBezierPath=Ke,t.addAttributeToPrototype=function(t,e,i){i.forEach((i=>{e.prototype[i]=t[i]}))},t.alignBezierCurves=Ds,t.alignSubpath=Ms,t.application=mn,t.applyTransformOnBezierCurves=Ws,t.arc3dCanvasPickModule=gT,t.arc3dModule=zg,t.arcCanvasPickModule=VS,t.arcMathPickModule=Pb,t.arcModule=og,t.areaCanvasPickModule=cA,t.areaMathPickModule=Ib,t.areaModule=pg,t.bezier=$e,t.bezierCurversToPath=Ns,t.binarySplitPolygon=Zs,t.bindContributionProvider=I,t.bindContributionProviderNoSingletonScope=L,t.boundStroke=qa,t.browserEnvModule=nb,t.builtInSymbolStrMap=Td,t.builtinSymbols=Sd,t.builtinSymbolsMap=Ad,t.calcLineCache=Wi,t.calculateArcCornerRadius=Ko,t.calculateLineHeight=_s,t.canvasAllocate=vr,t.centroidOfSubpath=Os,t.circleBounds=vs,t.circleCanvasPickModule=AA,t.circleMathPickModule=Nb,t.circleModule=mg,t.clock=Fr,t.cloneGraphic=Aa,t.colorEqual=function(t,e){const i=Ae.parseColorString(t),n=Ae.parseColorString(e);return!(!i||!n)&&i.r===n.r&&i.g===n.g&&i.b===n.b&&i.opacity===n.opacity},t.colorStringInterpolationToStr=da,t.container=jn,t.cornerTangents=qo,t.createArc=sp,t.createArc3d=op,t.createArea=ip,t.createCircle=uu,t.createColor=wn,t.createConicalGradient=ih,t.createGifImage=function(t){return new NT(t)},t.createGlyph=Wd,t.createGroup=Ro,t.createImage=Hd,t.createImageElement=ib,t.createLine=Ed,t.createMat4=Eh,t.createPath=Qd,t.createPolygon=cp,t.createPyramid3d=dp,t.createRect=Id,t.createRect3d=jd,t.createRectPath=ol,t.createRichText=Kd,t.createShadowRoot=fp,t.createStage=function(t){return new mf(t)},t.createSymbol=Pd,t.createText=gu,t.createWrapText=yu,t.cubicCalc=ii,t.cubicLength=ei,t.cubicPointAt=ni,t.cubicSubdivide=Rs,t.decodeReactDom=Ty,t.defaultArcAllocate=Vf,t.defaultArcBackgroundRenderContribution=Qh,t.defaultArcRenderContribution=Zh,t.defaultArcTextureRenderContribution=Jh,t.defaultAreaAllocate=Xf,t.defaultBaseBackgroundRenderContribution=Xh,t.defaultBaseTextureRenderContribution=qh,t.defaultCircleAllocate=qf,t.defaultCircleBackgroundRenderContribution=nl,t.defaultCircleRenderContribution=el,t.defaultCircleTextureRenderContribution=il,t.defaultGraphicMemoryManager=sg,t.defaultGroupBackgroundRenderContribution=sl,t.defaultImageBackgroundRenderContribution=gl,t.defaultImageRenderContribution=fl,t.defaultLineAllocate=Zf,t.defaultPathAllocate=Qf,t.defaultRectAllocate=zf,t.defaultRectBackgroundRenderContribution=dl,t.defaultRectRenderContribution=cl,t.defaultRectTextureRenderContribution=ul,t.defaultSymbolAllocate=eg,t.defaultSymbolBackgroundRenderContribution=bl,t.defaultSymbolRenderContribution=ml,t.defaultSymbolTextureRenderContribution=yl,t.defaultTextAllocate=ng,t.defaultTicker=cf,t.defaultTimeline=es,t.drawArc=qe,t.drawArcPath=Zo,t.drawAreaSegments=Ol,t.drawIncrementalAreaSegments=El,t.drawIncrementalSegments=Ml,t.drawPathProxy=Xo,t.drawSegments=Rl,t.enumCommandMap=Ee,t.feishuEnvModule=Hx,t.fillVisible=zo,t.findBestMorphingRotation=Ls,t.findNextGraphic=Dp,t.flatten_simplify=function(t,e,i){return t.length<=10||i?t:function(t,e){let i,n,r=t[0].x,s=t[0].y;const a=[t[0]];for(let o=1,h=t.length;o<h;o++)i=t[o].x-r,n=t[o].y-s,i*i+n*n>e&&(r=t[o].x,s=t[o].y,a.push(t[o]));return t[t.length-1].x===r&&t[t.length-1].y===s||a.push(t[t.length-1]),a}(t,void 0!==e?e*e:1)},t.foreach=Ip,t.foreachAsync=Lp,t.genBasisSegments=yi,t.genBasisTypeSegments=mi,t.genLinearClosedSegments=Oi,t.genLinearClosedTypeSegments=Ii,t.genLinearSegments=pi,t.genLinearTypeSegments=fi,t.genMonotoneXSegments=_i,t.genMonotoneXTypeSegments=Ci,t.genMonotoneYSegments=Pi,t.genMonotoneYTypeSegments=Bi,t.genNumberType=Za,t.genStepSegments=Mi,t.genStepTypeSegments=Ei,t.getAttributeFromDefaultAttrList=Ss,t.getConicGradientAt=eh,t.getCurrentEnv=function(){return pf()?"browser":"node"},t.getExtraModelMatrix=function(t,e,i){const{alpha:n,beta:r}=i.attribute;if(!n&&!r)return null;const{anchor3d:s=i.attribute.anchor}=i.attribute,a=[0,0];if(s){if("string"==typeof s[0]){const t=parseFloat(s[0])/100,e=i.AABBBounds;a[0]=e.x1+(e.x2-e.x1)*t}else a[0]=s[0];if("string"==typeof s[1]){const t=parseFloat(s[1])/100,e=i.AABBBounds;a[1]=e.x1+(e.x2-e.x1)*t}else a[1]=s[1]}if("text"===i.type){const{textAlign:t}=i.attribute;a[0]+=gh(t,i.clipedWidth)}a[0]+=t,a[1]+=e;const o=Lh.allocate();return Sh(o,o,[a[0],a[1],0]),r&&bh(o,o,r),n&&xh(o,o,n),Sh(o,o,[-a[0],-a[1],0]),o},t.getModelMatrix=Wh,t.getRichTextBounds=function(t){return tc||(tc=Jl.CreateGraphic("richtext",{})),tc.setAttributes(t),tc.AABBBounds},t.getScaledStroke=xn,t.getTextBounds=ec,t.getTheme=Or,t.getThemeFromGroup=Ir,t.gifImageCanvasPickModule=HT,t.gifImageModule=ZT,t.globalTheme=kr,t.glyphCanvasPickModule=XA,t.glyphMathPickModule=Xb,t.glyphModule=Bg,t.graphicCreator=Jl,t.graphicService=nf,t.graphicUtil=tf,t.harmonyEnvModule=US,t.identityMat4=yh,t.imageCanvasPickModule=nT,t.imageMathPickModule=Zb,t.imageModule=Ig,t.incrementalAddTo=function(t,e){t.incrementalAppendChild(e)},t.initAllEnv=function(){rS(jn)},t.initBrowserEnv=function(){rb(jn)},t.initFeishuEnv=function(){Vx(jn)},t.initHarmonyEnv=function(){WS(jn)},t.initLynxEnv=function(){hw(jn)},t.initNodeEnv=function(){Tw(jn)},t.initTTEnv=function(){SS(jn)},t.initTaroEnv=function(){Nw(jn)},t.initWxEnv=function(){nS(jn)},t.inject=p,t.injectable=g,t.interpolateColor=ra,t.interpolateGradientConicalColor=ha,t.interpolateGradientLinearColor=aa,t.interpolateGradientRadialColor=oa,t.interpolatePureColorArray=la,t.intersect=$o,t.isBrowserEnv=pf,t.isNodeEnv=ff,t.isSvg=Ya,t.isTransformKey=ws,t.isXML=Xa,t.jsx=function(t,e){const i=e||{},{key:n,name:r,id:s,attribute:a,stateProxy:o,animation:h,timeline:l}=i,c=wy(i,["key","name","id","attribute","stateProxy","animation","timeline"]);let u=t;st(t)&&(u=Jl[t]);const d=[];for(var p=arguments.length,f=new Array(p>2?p-2:0),g=2;g<p;g++)f[g-2]=arguments[g];f.length&&Sy(1===f.length?f[0]:f,d);const v="Group"===u.name?new u(a):u(e);if(function(t,e,i){let n,r=!1;switch(t.type){case"richtext":case"rich/image":break;case"rich/text":n=t.attribute||{},e[0]&&(n.text=e[0]);break;default:r=!0}r?(e.forEach((e=>{e&&t.add(e)})),Object.keys(i).forEach((e=>{const n=yy[e];n&&t.on(n,i[e])}))):"richtext"===t.type&&(t.attribute.textConfig=e.map((t=>t.attribute)).filter((t=>t)))}(v,d,c),o&&(v.stateProxy=o),r&&(v.name=r),at(h)){const t=v.animate();l&&t.setTimeline(l),h.forEach((e=>{t[e[0]](...e.slice(1))}))}return v},t.layerService=rf,t.lineCanvasPickModule=rA,t.lineMathPickModule=nx,t.lineModule=ug,t.loadAllEnv=rS,t.loadAllModule=sS,t.loadBrowserEnv=rb,t.loadFeishuEnv=Vx,t.loadHarmonyEnv=WS,t.loadLynxEnv=hw,t.loadNodeEnv=Tw,t.loadTTEnv=SS,t.loadTaroEnv=Nw,t.loadWxEnv=nS,t.lookAt=_h,t.lynxEnvModule=ow,t.mat3Tomat4=Ah,t.mat4Allocate=Lh,t.matrixAllocate=Ih,t.morphPath=ba,t.multiInject=f,t.multiToOneMorph=(e,i,n)=>{var r,s,a;const o=e.filter((t=>t.toCustomPath&&t.valid));o.length||__DEV__&&console.error(e," is not validate"),i.valid&&i.toCustomPath||__DEV__&&console.error(i," is not validate");const h=("clone"===(null==n?void 0:n.splitPath)?Aa:null!==(r=null==n?void 0:n.splitPath)&&void 0!==r?r:Ta)(i,o.length,!0),l=i.attribute;i.setAttribute("visible",!1);const c=o.map(((t,e)=>ga(t.toCustomPath(),h[e].toCustomPath(),{fromTransform:t.globalTransMatrix,toTransfrom:h[e].globalTransMatrix}))),u=o.map(((t,e)=>ma(t.attribute,l)));if(null==n?void 0:n.individualDelay){const r=n.onEnd;let s=o.length;const a=()=>{s--,0===s&&(i.setAttributes({visible:!0,ratio:null},!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),r&&r())};h.forEach(((t,i)=>{var r,s,h;const l=(null!==(r=n.delay)&&void 0!==r?r:0)+n.individualDelay(i,o.length,e[i],t),d=t.animate(Object.assign({},n,{onEnd:a}));d.wait(l),d.play(new ya({morphingData:c[i],saveOnEnd:!0,otherAttrs:u[i]},null!==(s=n.duration)&&void 0!==s?s:hs.duration,null!==(h=n.easing)&&void 0!==h?h:hs.easing))}))}else{const e=null==n?void 0:n.onEnd,r=n?Object.assign({},n):{};r.onEnd=()=>{i.setAttribute("visible",!0,!1,{type:t.AttributeUpdateType.ANIMATE_END}),i.detachShadow(),e&&e()};const o=i.animate(r);(null==n?void 0:n.delay)&&o.wait(n.delay),o.play(new xa({morphingData:c,otherAttrs:u},null!==(s=null==n?void 0:n.duration)&&void 0!==s?s:hs.duration,null!==(a=null==n?void 0:n.easing)&&void 0!==a?a:hs.easing))}},t.multiplyMat4Mat3=function(t,e,i){const n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],g=e[12],v=e[13],m=e[14],y=e[15];let b=i.a,x=i.b,w=0,S=0;return t[0]=b*n+x*o+w*u+S*g,t[1]=b*r+x*h+w*d+S*v,t[2]=b*s+x*l+w*p+S*m,t[3]=b*a+x*c+w*f+S*y,b=i.c,x=i.d,w=0,S=0,t[4]=b*n+x*o+w*u+S*g,t[5]=b*r+x*h+w*d+S*v,t[6]=b*s+x*l+w*p+S*m,t[7]=b*a+x*c+w*f+S*y,b=0,x=0,w=1,S=0,t[8]=b*n+x*o+w*u+S*g,t[9]=b*r+x*h+w*d+S*v,t[10]=b*s+x*l+w*p+S*m,t[11]=b*a+x*c+w*f+S*y,b=i.e,x=i.f,w=0,S=1,t[12]=b*n+x*o+w*u+S*g,t[13]=b*r+x*h+w*d+S*v,t[14]=b*s+x*l+w*p+S*m,t[15]=b*a+x*c+w*f+S*y,t},t.multiplyMat4Mat4=Ch,t.named=v,t.newThemeObj=Pr,t.nodeEnvModule=Aw,t.oneToMultiMorph=(t,e,i)=>{var n;const r=e.filter((t=>t&&t.toCustomPath&&t.valid));r.length||__DEV__&&console.error(r," is not validate"),t.valid&&t.toCustomPath||__DEV__&&console.error(t," is not validate");const s=("clone"===(null==i?void 0:i.splitPath)?Aa:null!==(n=null==i?void 0:i.splitPath)&&void 0!==n?n:Ta)(t,r.length,!1),a=null==i?void 0:i.onEnd;let o=r.length;const h=()=>{o--,0===o&&a&&a()};r.forEach(((e,n)=>{var a;const o=s[n],l=(null!==(a=null==i?void 0:i.delay)&&void 0!==a?a:0)+((null==i?void 0:i.individualDelay)?i.individualDelay(n,r.length,o,e):0);ba(o,e,Object.assign({},i,{onEnd:h,delay:l}),t.globalTransMatrix)}))},t.ortho=Bh,t.parsePadding=ps,t.parseStroke=us,t.parseSvgPath=Ue,t.pathCanvasPickModule=LA,t.pathMathPickModule=gx,t.pathModule=wg,t.pathToBezierCurves=Us,t.point=gi,t.pointEqual=ms,t.pointInterpolation=ys,t.pointInterpolationHighPerformance=function(t,e,i,n){const{x:r,y:s}=Nt(t.x,t.y,e.x,e.y,i),{x:a,y:o}=Nt(t.x1,t.y1,e.x1,e.y1,i);return n.x=r,n.y=s,n.x1=a,n.y1=o,n.defined=e.defined,n},t.pointsEqual=function(t,e){return!(!t||!e)&&(Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every(((t,i)=>ms(t,e[i]))):!Number.isNaN(t.x+t.y)&&ms(t,e))},t.pointsInterpolation=bs,t.polygonCanvasPickModule=GA,t.polygonMathPickModule=lx,t.polygonModule=Ag,t.preLoadAllModule=Jp,t.pyramid3dCanvasPickModule=wT,t.pyramid3dModule=Xg,t.rafBasedSto=Ts,t.rect3dCanvasPickModule=lT,t.rect3dModule=Wg,t.rectCanvasPickModule=ZS,t.rectFillVisible=Ho,t.rectMathPickModule=Tx,t.rectModule=lg,t.rectStrokeVisible=Yo,t.recursiveCallBinarySplit=Js,t.registerArc=tC,t.registerArc3d=iC,t.registerArc3dGraphic=qg,t.registerArcGraphic=$g,t.registerArea=rC,t.registerAreaGraphic=Kg,t.registerCircle=aC,t.registerCircleGraphic=Zg,t.registerDirectionalLight=Rf,t.registerFlexLayoutPlugin=xv,t.registerGlyph=hC,t.registerGlyphGraphic=Jg,t.registerGroup=cC,t.registerGroupGraphic=Qg,t.registerHtmlAttributePlugin=pv,t.registerImage=dC,t.registerImageGraphic=tv,t.registerLine=fC,t.registerLineGraphic=ev,t.registerOrthoCamera=Ef,t.registerPath=vC,t.registerPathGraphic=iv,t.registerPolygon=yC,t.registerPolygonGraphic=nv,t.registerPyramid3d=xC,t.registerPyramid3dGraphic=rv,t.registerReactAttributePlugin=gv,t.registerRect=SC,t.registerRect3d=TC,t.registerRect3dGraphic=av,t.registerRectGraphic=sv,t.registerRichtext=_C,t.registerRichtextGraphic=ov,t.registerShadowRoot=PC,t.registerShadowRootGraphic=cv,t.registerSymbol=MC,t.registerSymbolGraphic=hv,t.registerText=kC,t.registerTextGraphic=lv,t.registerViewTransform3dPlugin=mv,t.registerWrapText=IC,t.registerWrapTextGraphic=uv,t.renderCommandList=Je,t.rewriteProto=function(t,e){Object.setPrototypeOf(t,e)},t.richTextMathPickModule=_x,t.richtextCanvasPickModule=QA,t.richtextModule=kg,t.rotateX=bh,t.rotateY=xh,t.rotateZ=wh,t.roughModule=LC,t.runFill=Go,t.runStroke=Fo,t.scaleMat4=Th,t.segments=Xe,t.shouldUseMat4=Nh,t.snapLength=ti,t.splitArc=Hs,t.splitArea=Xs,t.splitCircle=Vs,t.splitGraphic=Ta,t.splitLine=$s,t.splitPath=ta,t.splitPolygon=Qs,t.splitRect=zs,t.splitToGrids=Fs,t.strCommandMap=["arc","arcTo","bezierCurveTo","closePath","ellipse","lineTo","moveTo","quadraticCurveTo","rect"],t.strokeVisible=Vo,t.symbolCanvasPickModule=mA,t.symbolMathPickModule=kx,t.symbolModule=gg,t.taroEnvModule=Ww,t.textAttributesToStyle=mh,t.textCanvasPickModule=RA,t.textDrawOffsetX=gh,t.textDrawOffsetY=function(t,e){return"top"===t?Math.ceil(.79*e):"middle"===t?Math.round(.3*e):"bottom"===t?Math.round(-.21*e):0},t.textLayoutOffsetY=vh,t.textMathPickModule=Dx,t.textModule=bg,t.transformKeys=xs,t.transformMat4=Ph,t.transformUtil=ef,t.translate=Sh,t.ttEnvModule=wS,t.version="0.21.15-alpha.1",t.verticalLayout=Qa,t.vglobal=Qp,t.waitForAllSubLayers=function(t){return $a(this,void 0,void 0,(function*(){const e=[],i=t.getChildren();yield new Promise((t=>{mn.global.getRequestAnimationFrame()((()=>{t(null)}))})),i.forEach((t=>{t.subLayers.size&&t.subLayers.forEach((t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise((e=>{t.drawContribution.hooks.completeDraw.tap("outWait",(()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((t=>"outWait"!==t.name)),e(null)}))})))}))})),yield Promise.all(e)}))},t.wrapCanvas=Nn,t.wrapContext=function(t,e){return jn.getNamed(Wn,mn.global.env)(t,e)},t.wxEnvModule=iS,t.xul=function(t){const e=at(t)?t[0]:t,i=[];if(!e)return i;if(!0===Xa(e)){const t=(new Va).parse(e);t.tc&&Object.keys(t.tc).forEach((e=>{"text"===e?i.push(function(t){const e={text:""};no(t,e);const i=t["#text"];return i&&(e.text=i),e}(t.tc[e])):i.push(function(t){const e={image:"",width:0,height:0};no(t,e);const i=e.image;return i&&(e.image=i.replaceAll(""",'"').replaceAll("<","<").replaceAll(">",">")),e}(t.tc[e]))}))}return i}}));
|