@visactor/vtable-plugins 1.18.2-alpha.3 → 1.18.2
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/add-row-column.d.ts +1 -0
- package/cjs/add-row-column.js +1 -1
- package/cjs/add-row-column.js.map +1 -1
- package/cjs/carousel-animation.js.map +1 -1
- package/cjs/column-series.d.ts +2 -1
- package/cjs/column-series.js +5 -4
- package/cjs/column-series.js.map +1 -1
- package/cjs/excel-edit-cell-keyboard.d.ts +1 -0
- package/cjs/excel-edit-cell-keyboard.js +3 -2
- package/cjs/excel-edit-cell-keyboard.js.map +1 -1
- package/cjs/focus-highlight.d.ts +2 -1
- package/cjs/focus-highlight.js +6 -3
- package/cjs/focus-highlight.js.map +1 -1
- package/cjs/highlight-header-when-select-cell.d.ts +2 -0
- package/cjs/highlight-header-when-select-cell.js +5 -1
- package/cjs/highlight-header-when-select-cell.js.map +1 -1
- package/cjs/rotate-table.d.ts +3 -0
- package/cjs/rotate-table.js +16 -9
- package/cjs/rotate-table.js.map +1 -1
- package/cjs/row-series.d.ts +2 -1
- package/cjs/row-series.js +5 -5
- package/cjs/row-series.js.map +1 -1
- package/cjs/table-carousel-animation.d.ts +1 -0
- package/cjs/table-carousel-animation.js +3 -2
- package/cjs/table-carousel-animation.js.map +1 -1
- package/dist/vtable-plugins.js +62 -26
- package/dist/vtable-plugins.min.js +1 -1
- package/es/add-row-column.d.ts +1 -0
- package/es/add-row-column.js +1 -1
- package/es/add-row-column.js.map +1 -1
- package/es/carousel-animation.js.map +1 -1
- package/es/column-series.d.ts +2 -1
- package/es/column-series.js +5 -4
- package/es/column-series.js.map +1 -1
- package/es/excel-edit-cell-keyboard.d.ts +1 -0
- package/es/excel-edit-cell-keyboard.js +3 -2
- package/es/excel-edit-cell-keyboard.js.map +1 -1
- package/es/focus-highlight.d.ts +2 -1
- package/es/focus-highlight.js +7 -4
- package/es/focus-highlight.js.map +1 -1
- package/es/highlight-header-when-select-cell.d.ts +2 -0
- package/es/highlight-header-when-select-cell.js +5 -1
- package/es/highlight-header-when-select-cell.js.map +1 -1
- package/es/rotate-table.d.ts +3 -0
- package/es/rotate-table.js +16 -9
- package/es/rotate-table.js.map +1 -1
- package/es/row-series.d.ts +2 -1
- package/es/row-series.js +5 -5
- package/es/row-series.js.map +1 -1
- package/es/table-carousel-animation.d.ts +1 -0
- package/es/table-carousel-animation.js +3 -2
- package/es/table-carousel-animation.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vtable")):"function"==typeof define&&define.amd?define(["exports","@visactor/vtable"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).VTable=t.VTable||{},t.VTable.plugins={}),t.VTable)}(this,(function(t,e){"use strict";function i(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}var n=i(e);function s(t){return Math.floor(t)===t}class r{static GenAutoIncrementId(){return r.auto_increment_id++}}r.auto_increment_id=0;class o{constructor(t){this.id=r.GenAutoIncrementId(),this.registry=t}}const a="named",h="inject",l="multi_inject",c="inversify:tagged",d="inversify:paramtypes";class u{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===a?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var p=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),s=new WeakMap;function r(t,e,i){let r=s.get(t);if(l(r)){if(!i)return;r=new n,s.set(t,r)}let o=r.get(e);if(l(o)){if(!i)return;o=new n,r.set(e,o)}return o}function o(t,e,i){if(a(t,e,i))return!0;const n=f(e);return!c(n)&&o(t,n,i)}function a(t,e,i){const n=r(e,i,!1);return!l(n)&&!!n.has(t)}function h(t,e,i){if(a(t,e,i))return function(t,e,i){const n=r(e,i,!1);if(!l(n))return n.get(t)}(t,e,i);const n=f(e);return c(n)?void 0:h(t,n,i)}function l(t){return void 0===t}function c(t){return null===t}function d(t){return"object"==typeof t?null!==t:"function"==typeof t}function u(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",s=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,e);if(void 0!==s){const e=s.call(t,n);if(d(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(g(e)){const i=e.call(t);if(!d(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!d(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!d(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!d(e))return e}}throw new TypeError}(t,"default"===n?"number":n)}function p(t){const e=u(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function f(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const n=t.prototype,s=n&&Object.getPrototypeOf(n);if(null==s||s===Object.prototype)return e;const r=s.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,n){if(!d(i))throw new TypeError;return s=t,o=e,void r(i,n,!0).set(s,o);var s,o})),t("hasMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return l(i)||(i=p(i)),o(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return l(i)||(i=p(i)),a(t,e,i)})),t("getMetadata",(function(t,e,i){if(!d(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 g(t,e,i,n){!function(t,e,i,n){const s=[n];let r={};p.hasOwnMetadata(t,e)&&(r=p.getMetadata(t,e));let o=r[i];void 0===o&&(o=[]),o.push(...s),r[i]=o,p.defineMetadata(t,r,e)}(c,t,i.toString(),n)}function f(t){return(e,i,n)=>{g(e,0,n,t)}}function m(t){return e=>(i,n,s)=>f(new u(t,e))(i,n,s)}const b=m(h),y=m(l);function v(){return function(t){return p.defineMetadata(d,null,t),t}}function x(t){return f(new u(a,t))}const w="Singleton",_="Transient",A="ConstantValue",C="DynamicValue",T="Factory",S="Function",B="Instance",E="Invalid";class M{constructor(t,e){this.id=r.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=E,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new M(this.serviceIdentifier,this.scope);return t.activated=t.scope===w&&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 R{getConstructorMetadata(t){return{compilerGeneratedMetadata:p.getMetadata(d,t),userGeneratedMetadata:p.getMetadata(c,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const P=(L=a,t=>{const e=e=>{if(null==e)return!1;if(e.key===L&&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===L&&i[e].value===t)return!0;return!1};return e.metaData=new u(L,t),e});var L;class O{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=w,this}inTransientScope(){return this._binding.scope=_,this}whenTargetNamed(t){return this._binding.constraint=P(t),this}}class I{constructor(t){this._binding=t}to(t){return this._binding.type=B,this._binding.implementationType=t,new O(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=C,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new O(this._binding)}toConstantValue(t){return this._binding.type=A,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=w,new O(this._binding)}toFactory(t){return this._binding.type=T,this._binding.factory=t,this._binding.scope=w,new O(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const k=Symbol("ContributionProvider");class D{constructor(t,e){this.serviceIdentifier=t,this.container=e,N.setStore(this.serviceIdentifier,this)}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}refresh(){this.caches&&(this.caches.length=0,this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier)))}}function F(t,e){t(k).toDynamicValue((t=>{let{container:i}=t;return new D(e,i)})).inSingletonScope().whenTargetNamed(e)}class N{static getStore(t){return this.store.get(t)}static setStore(t,e){this.store.set(t,e)}static refreshAllContributions(){this.store.forEach((t=>{t.refresh()}))}}N.store=new Map;class U{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 s=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(s>i)){n++;break}}this.taps[n]=t}}class j extends U{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 H=Symbol.for("EnvContribution"),z=Symbol.for("VGlobal");class G{constructor(){this._listenerMap=new Map,this._eventListenerTransformer=t=>t}setEventListenerTransformer(t){this._eventListenerTransformer=t||(t=>t)}addEventListener(t,e,i){if(!e)return;const n=t=>{const i=this._eventListenerTransformer(t);"function"==typeof e?e(i):e.handleEvent&&e.handleEvent(i)};this._listenerMap.has(t)||this._listenerMap.set(t,new Map),this._listenerMap.get(t).set(e,n),this._nativeAddEventListener(t,n,i)}removeEventListener(t,e,i){var n;if(!e)return;const s=null===(n=this._listenerMap.get(t))||void 0===n?void 0:n.get(e);s&&(this._nativeRemoveEventListener(t,s,i),this._listenerMap.get(t).delete(e),0===this._listenerMap.get(t).size&&this._listenerMap.delete(t))}dispatchEvent(t){return this._nativeDispatchEvent(t)}clearAllEventListeners(){this._listenerMap.forEach(((t,e)=>{t.forEach(((t,i)=>{this._nativeRemoveEventListener(e,t,void 0)}))})),this._listenerMap.clear()}_nativeAddEventListener(t,e,i){throw new Error("_nativeAddEventListener must be implemented by derived classes")}_nativeRemoveEventListener(t,e,i){throw new Error("_nativeRemoveEventListener must be implemented by derived classes")}_nativeDispatchEvent(t){throw new Error("_nativeDispatchEvent must be implemented by derived classes")}}var W=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},V=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Y=function(t,e){return function(i,n){e(i,n,t)}},X=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};let $=class extends G{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){super(),this.contributions=t,this._isImageAnonymous=!0,this.eventListenerTransformer=t=>t,this.id=r.GenAutoIncrementId(),this.hooks={onSetEnv:new j(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}_nativeAddEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}_nativeRemoveEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}_nativeDispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}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)}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 X(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)}isMacOS(){return this._env||this.setEnv("browser"),this.envContribution.isMacOS()}copyToClipBoard(t){return this._env||this.setEnv("browser"),this.envContribution.copyToClipBoard(t)}};var q;function K(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}$=W([v(),Y(0,b(k)),Y(0,x(H)),V("design:paramtypes",[Object])],$),function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(q||(q={}));var Z={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,s=[];if(0===this._eventsCount)return s;for(n in t=this._events)e.call(t,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},a.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 s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,s,r,o){var a=i?i+t:t;if(!this._events[a])return!1;var h,l,c=this._events[a],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),d){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,s),!0;case 5:return c.fn.call(c.context,e,n,s,r),!0;case 6:return c.fn.call(c.context,e,n,s,r,o),!0}for(l=1,h=new Array(d-1);l<d;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var u,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),d){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,s);break;default:if(!h)for(u=1,h=new Array(d-1);u<d;u++)h[u-1]=arguments[u];c[l].fn.apply(c[l].context,h)}}return!0},a.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,s){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return o(this,r),this;var a=this._events[r];if(a.fn)a.fn!==e||s&&!a.once||n&&a.context!==n||o(this,r);else{for(var h=0,l=[],c=a.length;h<c;h++)(a[h].fn!==e||s&&!a[h].once||n&&a[h].context!==n)&&l.push(a[h]);l.length?this._events[r]=1===l.length?l[0]:l:o(this,r)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(Z);var J=K(Z.exports);var Q=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var tt=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||Q(t,"Boolean")};var et=t=>"function"==typeof t;var it=t=>null==t;var nt=t=>null!=t;var st=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var rt=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||Q(t,"String")};var ot=t=>Array.isArray?Array.isArray(t):Q(t,"Array");var at=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||Q(t,"Number")};var ht=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var lt=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 ct=Object.prototype.hasOwnProperty;var dt=(t,e)=>null!=t&&ct.call(t,e);function ut(t,e){if(!ot(t)||!ot(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 pt="undefined"!=typeof console;function gt(t,e,i){const n=[e].concat([].slice.call(i));pt&&console[t].apply(console,n)}var ft;!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"}(ft||(ft={}));class mt{static getInstance(t,e){return mt._instance&&at(t)?mt._instance.level(t):mt._instance||(mt._instance=new mt(t,e)),mt._instance}static setInstance(t){return mt._instance=t}static setInstanceLevel(t){mt._instance?mt._instance.level(t):mt._instance=new mt(t)}static clearInstance(){mt._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ft.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>=ft.Info}canLogDebug(){return this._level>=ft.Debug}canLogError(){return this._level>=ft.Error}canLogWarn(){return this._level>=ft.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>=ft.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):gt(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>=ft.Warn&>(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>=ft.Info&>(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>=ft.Debug&>(this._method||"log","DEBUG",e),this}}mt._instance=null;function bt(t,e){const i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e-10,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-10)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}var yt=function(t,e,i){return t<e?e:t>i?i:t};const vt=Math.PI,xt=vt/2,wt=2*vt,_t=2*Math.PI,At=Math.abs,Ct=Math.atan2,Tt=Math.cos,St=Math.max,Bt=Math.min,Et=Math.sin,Mt=Math.sqrt,Rt=Math.pow;class Pt{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 Pt(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 at(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return at(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 Lt{static distancePP(t,e){return Mt(Rt(t.x-e.x,2)+Rt(t.y-e.y,2))}static distanceNN(t,e,i,n){return Mt(Rt(t-i,2)+Rt(e-n,2))}static distancePN(t,e,i){return Mt(Rt(e-t.x,2)+Rt(i-t.y,2))}static pointAtPP(t,e,i){return new Pt((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function Ot(t){return t*(Math.PI/180)}var It;!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(It||(It={}));const kt=(t,e,i)=>{let n=t.x1,s=t.x2,r=t.y1,o=t.y2,a=e.x1,h=e.x2,l=e.y1,c=e.y2;return i&&(n>s&&([n,s]=[s,n]),r>o&&([r,o]=[o,r]),a>h&&([a,h]=[h,a]),l>c&&([l,c]=[c,l])),{x11:n,x12:s,y11:r,y12:o,x21:a,x22:h,y21:l,y22:c}};function Dt(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:s,y11:r,y12:o,x21:a,x22:h,y21:l,y22:c}=kt(t,e,!0);return!(n>h||s<a||r>c||o<l)}return!0}function Ft(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function Nt(t,e){let{x:i,y:n}=t,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(i-s.x)*Math.cos(e)-(n-s.y)*Math.sin(e)+s.x,y:(i-s.x)*Math.sin(e)+(n-s.y)*Math.cos(e)+s.y}}function Ut(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function jt(t,e){const i=e?Ot(t.angle):t.angle,n=Ut(t);return[Nt({x:t.x1,y:t.y1},i,n),Nt({x:t.x2,y:t.y1},i,n),Nt({x:t.x2,y:t.y2},i,n),Nt({x:t.x1,y:t.y2},i,n)]}const Ht=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"};class zt{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(),nt(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=nt(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(it(this._canvas)&&(nt(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),it(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&nt(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),it(this._context)&&nt(this._canvas)){const t=this._canvas.getContext("2d");nt(t)&&(t.save(),t.font=function(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:s=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:o=e.fontSize,fontFamily:a=e.fontFamily}=t;return(n?n+" ":"")+(s?s+" ":"")+(r?r+" ":"")+o*i+"px "+(a||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!it(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:n={}}=this._option,{fontStyle:s=n.fontStyle,fontVariant:r=n.fontVariant,fontWeight:o=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:a=(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:d,textBaseline:u=(null!=d?d:"middle"),ellipsis:p,limit:g}=this._userSpec;let{lineHeight:f=a}=this._userSpec;if(rt(f)&&"%"===f[f.length-1]){const t=Number.parseFloat(f.substring(0,f.length-1))/100;f=a*t}return{fontStyle:s,fontVariant:r,fontFamily:h,fontSize:a,fontWeight:o,textAlign:c,textBaseline:u,ellipsis:p,limit:g,lineHeight:f}}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(it(t))return{width:0,height:0};if(it(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:o,limit:a,lineHeight:h}=this.textSpec;let l;try{const c=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:!!o,maxLineWidth:a||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:s}=this.textSpec;return{width:i.width,height:null!==(e=s)&&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 s=this._measureSpecialChar(n);it(s)&&zt.NUMBERS_CHAR_SET.includes(n)&&(s=this._measureNumberChar()),it(s)&&["F","W"].includes(Ht(n))&&(s=this._measureFullSizeChar()),it(s)&&(s=this._measureLetterChar()),e.width+=s.width,e.height=Math.max(e.height,s.height),!it(s.fontBoundingBoxAscent)&&(e.fontBoundingBoxAscent=s.fontBoundingBoxAscent),!it(s.fontBoundingBoxDescent)&&(e.fontBoundingBoxDescent=s.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:s}=this.textSpec;for(let e=0;e<t.length;e++){const s=t[e],r=["F","W"].includes(Ht(s))?1:.53;i.width+=r*n}return i.height=null!==(e=s)&&void 0!==e?e:n,i}_measureReduce(t,e){var i;const{fontSize:n,lineHeight:s}=this.textSpec,r={width:0,height:0};if(it(t))return r;if(ot(t)){const o=t.filter(nt).map((t=>t.toString()));return 0===o.length?r:1===o.length?e(o[0]):{width:o.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:o.length*((null!==(i=s)&&void 0!==i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(it(this._numberCharSize)){const t=this._standardMethod(zt.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/zt.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return it(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(zt.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(it(this._letterCharSize)){const t=this._standardMethod(zt.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/zt.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(t){return nt(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){nt(this._canvas)&&(this._canvas=null),nt(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}function Gt(t,e,i){const{x1:n,y1:s,x2:r,y2:o}=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*s+i.e,i.b*n+i.d*s+i.f),t.add(i.a*r+i.c*s+i.e,i.b*r+i.d*s+i.f),t.add(i.a*r+i.c*o+i.e,i.b*r+i.d*o+i.f),t.add(i.a*n+i.c*o+i.e,i.b*n+i.d*o+i.f),e)}zt.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",zt.NUMBERS_CHAR_SET="0123456789",zt.FULL_SIZE_CHAR="字";class Wt{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Wt(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 ot(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 s=this.scalePoints(t,e,i,n);return this.clear().add(s[0],s[1]).add(s[2],s[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 Gt(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:s,x2:r,y2:o}=this,a=Math.cos(t),h=Math.sin(t),l=e-e*a+i*h,c=i-e*h-i*a;return[a*n-h*s+l,h*n+a*s+c,a*n-h*o+l,h*n+a*o+c,a*r-h*s+l,h*r+a*s+c,a*r-h*o+l,h*r+a*o+c]}scalePoints(t,e,i,n){const{x1:s,y1:r,x2:o,y2:a}=this;return[t*s+(1-t)*i,e*r+(1-e)*n,t*o+(1-t)*i,e*a+(1-e)*n]}}class Vt extends Wt{}class Yt extends Wt{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=jt(t,i),s=jt(e,i),r=(t,e)=>[e.x-t.x,e.y-t.y],o=r(Ut(t),Ut(e)),a=r(n[0],n[1]),h=r(n[1],n[2]),l=r(s[0],s[1]),c=r(s[1],s[2]),d=i?Ot(t.angle):t.angle;let u=i?Ot(90-t.angle):t.angle+xt;const p=i?Ot(e.angle):e.angle;let g=i?Ot(90-e.angle):e.angle+xt;u>_t&&(u-=_t),g>_t&&(g-=_t);const f=(t,e,i,n)=>{const s=[Math.cos(e),Math.sin(e)];return t+(Ft(s,i)+Ft(s,n))/2>Ft(s,o)};return f((t.x2-t.x1)/2,d,l,c)&&f((t.y2-t.y1)/2,u,l,c)&&f((e.x2-e.x1)/2,p,a,h)&&f((e.y2-e.y1)/2,g,a,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,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return super.setValue(t,e,i,n),this.angle=s,this}clone(){return new Yt(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[Nt({x:this.x1,y:this.y1},this.angle,t),Nt({x:this.x2,y:this.y1},this.angle,t),Nt({x:this.x1,y:this.y2},this.angle,t),Nt({x:this.x2,y:this.y2},this.angle,t)]}}class Xt{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,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r}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,s,r){return!(this.e!==s||this.f!==r||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}setValue(t,e,i,n,s,r){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r,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,s=this.e,r=this.f,o=new Xt,a=t*n-e*i;return o.a=n/a,o.b=-e/a,o.c=-i/a,o.d=t/a,o.e=(i*r-n*s)/a,o.f=-(t*r-e*s)/a,o}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,s=this.b*e+this.d*i,r=this.a*-i+this.c*e,o=this.b*-i+this.d*e;return this.a=n,this.b=s,this.c=r,this.d=o,this}rotateByCenter(t,e,i){const n=Math.cos(t),s=Math.sin(t),r=(1-n)*e+s*i,o=(1-n)*i-s*e,a=n*this.a-s*this.b,h=s*this.a+n*this.b,l=n*this.c-s*this.d,c=s*this.c+n*this.d,d=n*this.e-s*this.f+r,u=s*this.e+n*this.f+o;return this.a=a,this.b=h,this.c=l,this.d=c,this.e=d,this.f=u,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,s,r){return this.multiply(t,e,i,n,s,r),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:s,f:r}=this;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=r,this.f=s,this}multiply(t,e,i,n,s,r){const o=this.a,a=this.b,h=this.c,l=this.d,c=o*t+h*e,d=a*t+l*e,u=o*i+h*n,p=a*i+l*n,g=o*s+h*r+this.e,f=a*s+l*r+this.f;return this.a=c,this.b=d,this.c=u,this.d=p,this.e=g,this.f=f,this}interpolate(t,e){const i=new Xt;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:s,d:r,e:o,f:a}=this,h=i*r-n*s,l=r/h,c=-n/h,d=-s/h,u=i/h,p=(s*a-r*o)/h,g=-(i*a-n*o)/h,{x:f,y:m}=t;e.x=f*l+m*d+p,e.y=f*c+m*u+g}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 Xt(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,s=t*n-e*i,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const o=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),r.scaleX=o,r.scaleY=s/o,r.skewX=(t*i+e*n)/s,r.skewY=0}else if(0!==i||0!==n){const o=Math.sqrt(i*i+n*n);r.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/o):-Math.acos(i/o)),r.scaleX=s/o,r.scaleY=o,r.skewX=0,r.skewY=(t*i+e*n)/s}return r.rotateDeg=180*r.rotateDeg/Math.PI,r}}function $t(t,e,i){e/=100,i/=100;const n=(1-Math.abs(2*i-1))*e,s=n*(1-Math.abs(t/60%2-1)),r=i-n/2;let o=0,a=0,h=0;return 0<=t&&t<60?(o=n,a=s,h=0):60<=t&&t<120?(o=s,a=n,h=0):120<=t&&t<180?(o=0,a=n,h=s):180<=t&&t<240?(o=0,a=s,h=n):240<=t&&t<300?(o=s,a=0,h=n):300<=t&&t<360&&(o=n,a=0,h=s),o=Math.round(255*(o+r)),a=Math.round(255*(a+r)),h=Math.round(255*(h+r)),{r:o,g:a,b:h}}function qt(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,e,i),s=Math.max(t,e,i),r=s-n;let o=0,a=0,h=0;return o=0===r?0:s===t?(e-i)/r%6:s===e?(i-t)/r+2:(t-e)/r+4,o=Math.round(60*o),o<0&&(o+=360),h=(s+n)/2,a=0===r?0:r/(1-Math.abs(2*h-1)),a=+(100*a).toFixed(1),h=+(100*h).toFixed(1),{h:o,s:a,l:h}}const Kt=/^#([0-9a-f]{3,8})$/,Zt={transparent:4294967040},Jt={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 Qt(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function te(t){return at(t)?new re(t>>16,t>>8&255,255&t,1):ot(t)?new re(t[0],t[1],t[2]):new re(255,255,255)}function ee(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function ie(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const ne=(t,e)=>{const i=Kt.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new re((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?te(t):8===e?new re(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class se{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new se(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new se(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof se?t:new se(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(nt(Zt[t]))return function(t){return at(t)?new re(t>>>24,t>>>16&255,t>>>8&255,255&t):ot(t)?new re(t[0],t[1],t[2],t[3]):new re(255,255,255,1)}(Zt[t]);if(nt(Jt[t]))return te(Jt[t]);const e=`${t}`.trim().toLowerCase(),i=ne(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 re(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=$t(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new re(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=se.parseColorString(t);this.color=e||new re(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,s=qt(this.color.r,this.color.g,this.color.b),r=$t(it(t)?s.h:yt(t,0,360),it(e)?s.s:e>=0&&e<=1?100*e:e,it(i)?s.l:i<=1&&i>=0?100*i:i);return this.color=new re(r.r,r.g,r.b,n),this}setRGB(t,e,i){return!it(t)&&(this.color.r=t),!it(e)&&(this.color.g=e),!it(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=ne(e,!0);return null!=i?i:this}setColorName(t){const e=Jt[t.toLowerCase()];return void 0!==e&&this.setHex(e),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,s,r;return n=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),s=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),r=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*s+.0722*r}clone(){return new se(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=ee(t.color.r),this.color.g=ee(t.color.g),this.color.b=ee(t.color.b),this}copyLinearToSRGB(t){return this.color.r=ie(t.color.r),this.color.g=ie(t.color.g),this.color.b=ie(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class re{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)),nt(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${Qt(this.r)+Qt(this.g)+Qt(this.b)+(1===this.opacity?"":Qt(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}=qt(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}const oe=wt-1e-8;class ae{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,s,r){if(Math.abs(s-n)>oe)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let o,a,h,l,c=1/0,d=-1/0,u=1/0,p=-1/0;function g(t){h=i*Math.cos(t),l=i*Math.sin(t),h<c&&(c=h),h>d&&(d=h),l<u&&(u=l),l>p&&(p=l)}if(g(n),g(s),s!==n)if((n%=wt)<0&&(n+=wt),(s%=wt)<0&&(s+=wt),s<n&&(r=!r,o=n,n=s,s=o),r)for(s-=wt,o=n-n%xt,a=0;a<4&&o>s;++a,o-=xt)g(o);else for(o=n-n%xt+xt,a=0;a<4&&o<s;++a,o+=xt)g(o);this.bounds.add(t+c,e+u),this.bounds.add(t+d,e+p)}arcTo(t,e,i,n,s){this.bounds.add(t,e)}bezierCurveTo(t,e,i,n,s,r){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(s,r)}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 he{constructor(){this._curves=[],this.bounds=new Vt}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const le=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,ce={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},de=0,ue=1,pe=2,ge=3,fe=4,me=5,be=6,ye=7,ve=8;let xe,we,_e,Ae,Ce,Te;var Se,Be,Ee,Me,Re,Pe,Le,Oe,Ie;function ke(t){const e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=h*r,c=-a*o,d=a*r,u=h*o,p=Math.cos(n),g=Math.sin(n),f=Math.cos(s),m=Math.sin(s),b=.5*(s-n),y=Math.sin(.5*b),v=8/3*y*y/Math.sin(b),x=e+p-v*g,w=i+g+v*p,_=e+f,A=i+m,C=_+v*m,T=A-v*f;return[l*x+c*w,d*x+u*w,l*C+c*T,d*C+u*T,l*_+c*A,d*_+u*A]}function De(t,e,i,n){const s=function(t,e,i,n,s,r,o,a,h){const l=Ot(o),c=Math.sin(l),d=Math.cos(l),u=d*(a-t)*.5+c*(h-e)*.5,p=d*(h-e)*.5-c*(a-t)*.5;let g=u*u/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);g>1&&(g=Math.sqrt(g),i*=g,n*=g);const f=d/i,m=c/i,b=-c/n,y=d/n,v=f*a+m*h,x=b*a+y*h,w=f*t+m*e,_=b*t+y*e;let A=1/((w-v)*(w-v)+(_-x)*(_-x))-.25;A<0&&(A=0);let C=Math.sqrt(A);r===s&&(C=-C);const T=.5*(v+w)-C*(_-x),S=.5*(x+_)+C*(w-v),B=Math.atan2(x-S,v-T);let E=Math.atan2(_-S,w-T)-B;E<0&&1===r?E+=wt:E>0&&0===r&&(E-=wt);const M=Math.ceil(Math.abs(E/(xt+.001))),R=[];for(let t=0;t<M;++t){const e=B+t*E/M,s=B+(t+1)*E/M;R[t]=[T,S,e,s,i,n,c,d]}return R}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<s.length;++e){const i=ke(s[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(Se||(Se={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(Be||(Be={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(Ee||(Ee={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Me||(Me={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Re||(Re={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Pe||(Pe={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Le||(Le={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(Oe||(Oe={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Ie||(Ie={}));const Fe=[(t,e,i,n,s,r,o)=>e.arc(t[1]*s+i,t[2]*r+n,t[3]*(s+r)/2,t[4],t[5],t[6],o),(t,e,i,n,s,r,o)=>e.arcTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*(s+r)/2,o),(t,e,i,n,s,r,o)=>e.bezierCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*s+i,t[6]*r+n,o),(t,e,i,n)=>e.closePath(),(t,e,i,n,s,r)=>e.ellipse(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,n,s,r,o)=>e.lineTo(t[1]*s+i,t[2]*r+n,o),(t,e,i,n,s,r,o)=>e.moveTo(t[1]*s+i,t[2]*r+n,o),(t,e,i,n,s,r,o)=>e.quadraticCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,o),(t,e,i,n,s,r,o)=>e.rect(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,o)];function Ne(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,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6?arguments[6]:void 0;for(let a=0;a<t.length;a++){const h=t[a];Fe[h[0]](h,e,i,n,s,r,o)}}class Ue{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function je(t,e){let i=0;const n=t.length;for(let s=0;s<n;s++){const r=t[s],o=e[s],a=t[(s+1)%n],h=e[(s+1)%n];i+=Lt.distanceNN(r,o,a,h)}return i/2}function He(t,e,i,n,s){const r=1-s;return r*r*r*t+3*e*s*r*r+3*i*s*s*r+n*s*s*s}function ze(t,e,i,n,s){const r=He(t.x,e.x,i.x,n.x,s),o=He(t.y,e.y,i.y,n.y,s);return new Pt(r,o)}function Ge(t,e,i,n){const s=1-n;return s*s*t+2*s*n*e+n*n*i}function We(t,e,i,n){const s=Ge(t.x,e.x,i.x,n),r=Ge(t.y,e.y,i.y,n);return new Pt(s,r)}class Ve extends Ue{constructor(t,e,i){super(),this.type=Oe.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return We(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,je([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===Le.ROW?At(this.p0.x-this.p2.x):t===Le.COLUMN?At(this.p0.y-this.p2.y):0}getAngleAt(t){const e=St(t-.01,0),i=Bt(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return Ct(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.quadraticCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i);else if(r>0){const[o]=function(t,e){const{p0:i,p1:n,p2:s}=t,r=We(i,n,s,e),o=Lt.pointAtPP(i,n,e),a=Lt.pointAtPP(n,s,e);return[new Ve(i,o,r),new Ve(r,a,s)]}(this,r);t.quadraticCurveTo(o.p1.x*n+e,o.p1.y*s+i,o.p2.x*n+e,o.p2.y*s+i)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}function Ye(t,e){const{p0:i,p1:n,p2:s,p3:r}=t,o=ze(i,n,s,r,e),a=Lt.pointAtPP(i,n,e),h=Lt.pointAtPP(n,s,e),l=Lt.pointAtPP(s,r,e),c=Lt.pointAtPP(a,h,e),d=Lt.pointAtPP(h,l,e);return[new Xe(i,a,c,o),new Xe(o,d,l,r)]}class Xe extends Ue{constructor(t,e,i,n){super(),this.type=Oe.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=n}_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 ze(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,n=this.p3,je([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])):60;var t,e,i,n}calcProjLength(t){return t===Le.ROW?At(this.p0.x-this.p3.x):t===Le.COLUMN?At(this.p0.y-this.p3.y):0}getAngleAt(t){const e=St(t-.01,0),i=Bt(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return Ct(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.bezierCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i,this.p3.x*n+e,this.p3.y*s+i);else if(r>0){const[o]=Ye(this,r);t.bezierCurveTo(o.p1.x*n+e,o.p1.y*s+i,o.p2.x*n+e,o.p2.y*s+i,o.p3.x*n+e,o.p3.y*s+i)}}includeX(t){const e=Bt(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=St(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){const e=Bt(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(St(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}function $e(t,e){const{p0:i,p1:n}=t,s=Lt.pointAtPP(i,n,e);return[new qe(i,s),new qe(s,n)]}class qe extends Ue{constructor(t,e){super(),this.type=Oe.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return Lt.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=Ct(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()?Lt.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Le.ROW?At(this.p0.x-this.p1.x):t===Le.COLUMN?At(this.p0.y-this.p1.y):0}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.lineTo(this.p1.x*n+e,this.p1.y*s+i);else if(r>0){const o=this.getPointAt(r);t.lineTo(o.x*n+e,o.y*s+i)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,i=this.p1;this.p0.x>this.p1.x&&(e=this.p1,i=this.p0);const n=(t-e.x)/(i.x-e.x);return e.y+n*(i.y-e.y)}return 1/0}}class Ke{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,s,r,o,a){const h=new Xe(new Pt(this._lastX,this._lastY),new Pt(t,e),new Pt(i,n),new Pt(s,r));h.originP1=this._lastOriginP,h.originP2=a,h.defined=o,this.curves.push(h),this._lastX=s,this._lastY=r,this._lastOriginP=a}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 s=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(s),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,s){const r=new qe(new Pt(this._lastX,this._lastY),new Pt(t,e));return r.originP1=n,r.originP2=s,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Le.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],n=null!==(e=i.p3)&&void 0!==e?e:i.p1;return At(t.p0.y-n.y)}if(t===Le.ROW){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 At(t.p0.x-n.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Ze extends Ke{bezierCurveTo(t,e,i,n,s,r,o,a){return super.bezierCurveTo(e,t,n,i,r,s,o,a)}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 Je(t,e){let i=!1;for(let n=0,s=e.length;n<=s;n++)n>=s===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function Qe(t,e,i){const n=null!=e?e:At(i[i.length-1].x-i[0].x)>At(i[i.length-1].y-i[0].y)?Le.ROW:Le.COLUMN;return"monotoneY"===t?new Ze(t,n):new Ke(t,n)}class ti{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 ei(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 s=Qe("linear",i,t);return function(t,e){Je(t,e)}(new ti(s,n),t),s}function ii(t,e,i,n,s){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 ni{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&&ii(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:ii(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 si(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 ei(t,e);const s=Qe("basis",i,t);return function(t,e){Je(t,e)}(new ni(s,n),t),s}function ri(t){return t<0?-1:1}function oi(t,e,i){const n=t._x1-t._x0,s=e-t._x1,r=(t._y1-t._y0)/(n||Number(s<0&&-0)),o=(i-t._y1)/(s||Number(n<0&&-0)),a=(r*s+o*n)/(n+s);return(ri(r)+ri(o))*Math.min(Math.abs(r),Math.abs(o),.5*Math.abs(a))||0}function ai(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function hi(t,e,i,n,s){const r=t._x0,o=t._y0,a=t._x1,h=t._y1,l=(a-r)/3;t.context.bezierCurveTo(r+l,o+l*e,a-l,h-l*i,a,h,n,t.lastPoint1)}class li{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:hi(this,this._t0,ai(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,hi(this,ai(this,e=oi(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:hi(this,this._t0,e=oi(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 ci extends li{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function di(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 ei(t,e);const s=Qe("monotoneX",i,t);return function(t,e){Je(t,e)}(new li(s,n),t),s}function ui(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 ei(t,e);const s=Qe("monotoneY",i,t);return function(t,e){Je(t,e)}(new ci(s,n),t),s}let pi=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()}};class gi extends pi{lineEnd(){this.context.closePath()}}function fi(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new Ke("step",null!=n?n:At(t[t.length-1].x-t[0].x)>At(t[t.length-1].y-t[0].y)?Le.ROW:Le.COLUMN);return mi(new pi(r,e,s),t),r}function mi(t,e){return Je(t,e)}class bi extends ti{lineEnd(){this.context.closePath()}}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;const s=Qe("linear",i,t);return function(t,e){Je(t,e)}(new bi(s,n),t),s}function vi(t,e,i,n,s){let r=t._x1,o=t._y1,a=t._x2,h=t._y2;if(t._l01_a>1e-12){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);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>1e-12){const n=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*n+t._x1*t._l23_2a-e*t._l12_2a)/s,h=(h*n+t._y1*t._l23_2a-i*t._l12_2a)/s}t.context.bezierCurveTo(r,o,a,h,t._x2,t._y2,n,t.lastPoint1)}function xi(t,e){return function(i,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:o}=s;if(i.length<2-Number(!!o))return null;if(i.length<3-Number(!!o))return ei(i,s);const a=Qe(t,r,i);return Je(new e(a,n,o),i),a}}const wi=xi("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:vi(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 _i=xi("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:vi(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()}});class Ai{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.addCurve(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new qe(new Pt(this._lastX,this._lastY),new Pt(t,e))}quadraticCurveTo(t,e,i,n){const s=new Ve(new Pt(this._lastX,this._lastY),new Pt(t,e),new Pt(i,n));this.path.addCurve(s),this._lastX=i,this._lastY=n}bezierCurveTo(t,e,i,n,s,r){const o=new Xe(new Pt(this._lastX,this._lastY),new Pt(t,e),new Pt(i,n),new Pt(s,r));this.path.addCurve(o),this._lastX=s,this._lastY=r}arcTo(t,e,i,n,s){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,s,r,o,a){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,s,r){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function Ci(t,e,i){var n,s;switch(e){case"linear":default:return ei(t,i);case"basis":return si(t,i);case"monotoneX":return di(t,i);case"monotoneY":return ui(t,i);case"step":return fi(t,.5,i);case"stepClosed":return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new Ke("step",null!=n?n:At(t[t.length-1].x-t[0].x)>At(t[t.length-1].y-t[0].y)?Le.ROW:Le.COLUMN);return mi(new gi(r,e,s),t),r}(t,.5,i);case"stepBefore":return fi(t,0,i);case"stepAfter":return fi(t,1,i);case"catmullRom":return wi(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return _i(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"linearClosed":return yi(t,i)}}class Ti extends he{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new ae(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([be,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([me,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([ye,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,s,r){return this.commandList.push([pe,t,e,i,n,s,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,s,r),this}arcTo(t,e,i,n,s){return this.commandList.push([ue,t,e,i,n,s]),this._ctx&&this._ctx.arcTo(t,e,i,n,s),this}ellipse(t,e,i,n,s,r,o,a){return this.commandList.push([fe,t,e,i,n,s,r,o,a]),this._ctx&&this._ctx.ellipse(t,e,i,n,s,r,o,a),this}rect(t,e,i,n){return this.commandList.push([ve,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,s,r){return this.commandList.push([de,t,e,i,n,s,r]),this._ctx&&this._ctx.arc(t,e,i,n,s,r),this}closePath(){return this.commandList.push([ge]),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()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new Ai(this);Ne(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[be]=t=>`M${t[1]} ${t[2]}`,t[me]=t=>`L${t[1]} ${t[2]}`,t[ye]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[pe]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[de]=t=>{const e=[];((t,e,i,n,s,r,o)=>{const a=Math.abs(i-e),h=a>.5*Math.PI?Math.ceil(2*a/Math.PI):1,l=(i-e)/h;for(let i=0;i<h;i++){const a=e+l*i,h=e+l*(i+1),c=4*Math.tan(Math.abs(l)/4)/3,d=h<a?-1:1,u=Math.cos(a),p=Math.sin(a),g=Math.cos(h),f=Math.sin(h),m=u*r+n,b=p*o+s,y=g*r+n,v=f*o+s,x=r*c*d,w=o*c*d;t.push(m-x*p,b+w*u,y+x*f,v-w*g,y,v)}})(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[ve]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[ge]=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,s){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const s=[];for(let t=0,r=e.length;t<r;t++)if(xe=e[t],we=xe.slice(1),_e=xe[0],i=[_e],n=we.match(le),null!==n){for(let t=0,e=n.length;t<e;t++)Ae=n[t],Ce=parseFloat(Ae),Number.isNaN(Ce)||i.push(Ce);if(Te=ce[_e],i.length-1>Te){let t,e=_e;for(let n=1,r=i.length;n<r;n+=Te){t=[e];for(let e=n,s=n+Te;e<s;e++)t.push(i[e]);s.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else s.push(i)}else s.push(i);return s}(t);return this._runCommandStrList(r,e,i,n,s),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:n}=t.attribute;if(!e)return;const s=Ci(e,i);"x"===n?this.direction=Le.ROW:"y"===n?this.direction=Le.COLUMN:"auto"===n&&(this.direction=s.direction),this._curves=s.curves}fromCustomPath2D(t,e,i,n,s){return this.clear(),this._runCommandList(t.commandList,e,i,n,s),this._updateBounds(),this}transform(t,e,i,n){const s=this.commandList;if(!this.transformCbList){const t=[];t[be]=this.moveToTransform,t[me]=this.lineToTransform,t[ye]=this.quadraticCurveToTransform,t[pe]=this.bezierCurveToTransform,t[ue]=this.arcToTransform,t[fe]=this.ellipseTransform,t[ve]=this.rectTransform,t[de]=this.arcTransform,t[ge]=this.closePathTransform,this.transformCbList=t}s.forEach((s=>{this.transformCbList[s[0]](s,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}lineToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}quadraticCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i}bezierCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*n+e,t[6]=t[6]*s+i}arcToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*(n+s)/2}ellipseTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}rectTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}arcTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*(n+s)/2}closePathTransform(){}_runCommandStrList(t){let e,i,n,s,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=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,d=0,u=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(e=t[f],1===h&&1===l||(e=Bi(e,h,l)),e[0]){case"l":d+=e[1],u+=e[2],this.lineTo(d+o,u+a);break;case"L":d=e[1],u=e[2],this.lineTo(d+o,u+a);break;case"h":d+=e[1],this.lineTo(d+o,u+a);break;case"H":d=e[1],this.lineTo(d+o,u+a);break;case"v":u+=e[1],this.lineTo(d+o,u+a);break;case"V":u=e[1],this.lineTo(d+o,u+a);break;case"m":d+=e[1],u+=e[2],this.moveTo(d+o,u+a);break;case"M":d=e[1],u=e[2],this.moveTo(d+o,u+a);break;case"c":i=d+e[5],n=u+e[6],p=d+e[3],g=u+e[4],this.bezierCurveTo(d+e[1]+o,u+e[2]+a,p+o,g+a,i+o,n+a),d=i,u=n;break;case"C":d=e[5],u=e[6],p=e[3],g=e[4],this.bezierCurveTo(e[1]+o,e[2]+a,p+o,g+a,d+o,u+a);break;case"s":i=d+e[3],n=u+e[4],null===c[0].match(/[CcSs]/)?(p=d,g=u):(p=2*d-p,g=2*u-g),s=d+e[1],r=u+e[2],this.bezierCurveTo(p+o,g+a,s+o,r+a,i+o,n+a),p=s,g=r,d=i,u=n;break;case"S":i=e[3],n=e[4],null===c[0].match(/[CcSs]/)?(p=d,g=u):(p=2*d-p,g=2*u-g),s=e[1],r=e[2],this.bezierCurveTo(p+o,g+a,s+o,r+a,i+o,n+a),p=s,g=r,d=i,u=n;break;case"q":i=d+e[3],n=u+e[4],p=d+e[1],g=u+e[2],this.quadraticCurveTo(p+o,g+a,i+o,n+a),d=i,u=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+o,e[2]+a,i+o,n+a),d=i,u=n,p=e[1],g=e[2];break;case"t":i=d+e[1],n=u+e[2],null===c[0].match(/[QqTt]/)?(p=d,g=u):"t"===c[0]?(p=2*d-s,g=2*u-r):"q"===c[0]&&(p=2*d-p,g=2*u-g),s=p,r=g,this.quadraticCurveTo(p+o,g+a,i+o,n+a),d=i,u=n,p=d+e[1],g=u+e[2];break;case"T":i=e[1],n=e[2],p=2*d-p,g=2*u-g,this.quadraticCurveTo(p+o,g+a,i+o,n+a),d=i,u=n;break;case"a":De(this,d+o,u+a,[e[1],e[2],e[3],e[4],e[5],e[6]+d+o,e[7]+u+a]),d+=e[6],u+=e[7];break;case"A":De(this,d+o,u+a,[e[1],e[2],e[3],e[4],e[5],e[6]+o,e[7]+a]),d=e[6],u=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,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==s)for(let r=0,o=t.length;r<o;++r){const o=t[r].slice();switch(o[0]){case me:this.lineToTransform(o,e,i,n,s);break;case be:this.moveToTransform(o,e,i,n,s);break;case pe:this.bezierCurveToTransform(o,e,i,n,s);break;case ye:this.quadraticCurveToTransform(o,e,i,n,s);break;case de:this.arcToTransform(o,e,i,n,s);break;case fe:this.ellipseTransform(o,e,i,n,s);break;case ve:this.rectTransform(o,e,i,n,s);break;case ue:this.arcToTransform(o,e,i,n,s);break;case ge:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Ne(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Le.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return At(t.p0.y-e.p1.y)}if(this.direction===Le.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return At(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const i=this.curves[e];if(i.includeX(t))return i.getYAt(t)}return 1/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 s=e.getLength(this.direction);if(i+s>=t)break;i+=s}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}drawWithClipRange(t,e,i,n,s){this.tryBuildCurves();const r=this.getLength()*s;let o=0;for(let s=0;s<this._curves.length;s++){const a=this._curves[s],h=a.getLength(this.direction);if(!(o+h<=r)){const s=1-(o+h-r)/h;a.draw(t,i,n,e,e,s);break}a.draw(t,i,n,e,e,1),o+=h}}}const Si=["l",0,0,0,0,0,0,0];function Bi(t,e,i){const n=Si[0]=t[0];if("a"===n||"A"===n)Si[1]=e*t[1],Si[2]=i*t[2],Si[3]=t[3],Si[4]=t[4],Si[5]=t[5],Si[6]=e*t[6],Si[7]=i*t[7];else if("h"===n||"H"===n)Si[1]=e*t[1];else if("v"===n||"V"===n)Si[1]=i*t[1];else for(let n=1,s=t.length;n<s;++n)Si[n]=(n%2==1?e:i)*t[n];return Si}const Ei={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 Xt},Mi={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Ri=Object.assign({outerBorder:Object.assign(Object.assign({},Mi),{distance:0}),innerBorder:Object.assign(Object.assign({},Mi),{distance:0})},Mi),Pi={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:q.fontBounding,keepCenterInLine:!1},Li=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Ri),{alignSelf:"auto"}),{pickStrokeBuffer:0}),Oi={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Ii=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,clipConfig:null},{_debug_bounds:!1}),Li),Ei),ki=Object.assign(Object.assign({},Ii),{startAngle:0,endAngle:_t,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Di=Object.assign(Object.assign(Object.assign({},Ii),Oi),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Fi=Object.assign(Object.assign({},Ii),{radius:1,startAngle:0,endAngle:_t}),Ni=Object.assign(Object.assign({},Ii),{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,cornerType:"round"}),Ui=Object.assign(Object.assign({},Ii),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),ji=Object.assign(Object.assign(Object.assign({},Ii),Oi),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Hi=Object.assign(Object.assign({},Ii),{path:new Ti,fillStrokeOrder:1,clipRange:1,customPath:()=>{mt.getInstance().warn("空函数")}}),zi=Object.assign(Object.assign({},Ii),{points:[],cornerRadius:0,closePath:!0}),Gi=Object.assign(Object.assign({},Ii),{width:100,height:100,spikes:5,thickness:.5}),Wi=Object.assign(Object.assign({},Ii),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},Ii),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const Vi=Object.assign(Object.assign({},Ii),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),Yi=Object.assign(Object.assign(Object.assign({},Ii),Pi),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Xi=Object.assign(Object.assign(Object.assign({},Ii),Pi),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",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}),$i=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},Ii),{fill:!0,cornerRadius:0,cornerType:"round"}),qi=Object.assign(Object.assign({},$i),{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});const Ki=new class{},Zi=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 s("linear",t.linearGradient,r)||s("radial",t.radialGradient,a)||s("conic",t.conicGradient,o)}function s(e,n,s){return function(n,r){const o=b(n);if(o){b(t.startCall)||i("Missing (");const n=function(n){const r=s();return r&&(b(t.comma)||i("Missing comma before color stops")),{type:e,orientation:r,colorStops:u(p)}}();return b(t.endCall)||i("Missing )"),n}}(n)}function r(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function o(){return m("angular",t.fromAngleValue,1)}function a(){let i,n,s=h();return s&&(i=[],i.push(s),n=e,b(t.comma)&&(s=h(),s?i.push(s):e=n)),i}function h(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=f()||l()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=g()||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=d();e&&(t={type:"default-radial",at:e})}}return t}function l(){return m("extent-keyword",t.extentKeywords,1)}function c(){if(m("position",/^at/,0)){const t=d();return t||i("Missing positioning value"),t}}function d(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function u(e){let n=e();const s=[];if(n)for(s.push(n);b(t.comma);)n=e(),n?s.push(n):i("One extra comma");return s}function p(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||f()}function f(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,i){const n=b(e);if(n)return{type:t,value:n[i]}}function b(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=u(n);return e.length>0&&i("Invalid input not EOF"),t}()}}();class Ji{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Ji.IsGradientStr(t))try{const e=Zi(t)[0];if(e){if("linear"===e.type)return Ji.ParseLinear(e);if("radial"===e.type)return Ji.ParseRadial(e);if("conic"===e.type)return Ji.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,n=vt/2,s=parseFloat(e.value)/180*vt-n;return{gradient:"conical",x:.5,y:.5,startAngle:s,endAngle:s+_t,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=vt/2;let s="angular"===e.type?parseFloat(e.value)/180*vt:0;for(;s<0;)s+=_t;for(;s>=_t;)s-=_t;let r=0,o=0,a=0,h=0;return s<n?(r=0,o=1,a=Math.sin(s),h=o-Math.cos(s)):s<vt?(r=0,o=0,a=Math.cos(s-n),h=Math.sin(s-n)):s<vt+n?(r=1,o=0,a=r-Math.sin(s-vt),h=Math.cos(s-vt)):(r=1,a=r-Math.cos(s-n-vt),h-=Math.sin(s-n-vt)),{gradient:"linear",x0:r,y0:o,x1:a,y1:h,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Qi(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var r,o,a,h;if(!e||!0===e)return"black";let l,c;if(ot(e))for(let t=0;t<e.length&&(c=e[t],!c);t++);else c=e;if(c=Ji.Parse(c),"string"==typeof c)return c;if(i.AABBBounds&&(!i.attribute||0!==i.attribute.scaleX||0!==i.attribute.scaleY)){const e=i.AABBBounds;let d=e.x2-e.x1,u=e.y2-e.y1,p=e.x1-n,g=e.y1-s;if(i.attribute){const{scaleX:t=1,scaleY:e=1,angle:n=0}=i.attribute;d/=t,u/=e,p/=t,g/=e,(n||1!==t||1!==e)&&(p=null!==(r=i.x1WithoutTransform)&&void 0!==r?r:0,g=null!==(o=i.y1WithoutTransform)&&void 0!==o?o:0,d=null!==(a=i.widthWithoutTransform)&&void 0!==a?a:d,u=null!==(h=i.heightWithoutTransform)&&void 0!==h?h:u)}"linear"===c.gradient?l=function(t,e,i,n,s,r){var o,a,h,l;const c=t.createLinearGradient(i+(null!==(o=e.x0)&&void 0!==o?o:0)*s,n+(null!==(a=e.y0)&&void 0!==a?a:0)*r,i+(null!==(h=e.x1)&&void 0!==h?h:1)*s,n+(null!==(l=e.y1)&&void 0!==l?l:0)*r);return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c}(t,c,p,g,d,u):"conical"===c.gradient?l=function(t,e,i,n,s,r){var o,a;const h=t.createConicGradient(i+(null!==(o=e.x)&&void 0!==o?o:0)*s,n+(null!==(a=e.y)&&void 0!==a?a:0)*r,e.startAngle,e.endAngle);return e.stops.forEach((t=>{h.addColorStop(t.offset,t.color)})),h.GetPattern?h.GetPattern(s+i,r+n,void 0):h}(t,c,p,g,d,u):"radial"===c.gradient&&(l=function(t,e,i,n,s,r){var o,a,h,l,c,d;const u=t.createRadialGradient(i+(null!==(o=e.x0)&&void 0!==o?o:.5)*s,n+(null!==(a=e.y0)&&void 0!==a?a:.5)*r,Math.max(s,r)*(null!==(h=e.r0)&&void 0!==h?h:0),i+(null!==(l=e.x1)&&void 0!==l?l:.5)*s,n+(null!==(c=e.y1)&&void 0!==c?c:.5)*r,Math.max(s,r)*(null!==(d=e.r1)&&void 0!==d?d:.5));return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,c,p,g,d,u))}return l||"orange"}const tn=/\w|\(|\)|-/,en=/[.?!,;:/,。?!、;:]/;function nn(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e;for(;tn.test(t[n-1])&&tn.test(t[n])||en.test(t[n]);)if(n--,n<=0)return i?sn(t,e):e;return n}function sn(t,e){let i=e;for(;tn.test(t[i+1])&&tn.test(t[i])||en.test(t[i]);)if(i++,i>=t.length)return i;return i+1}var rn=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};let on=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=Yi.fontSize}=e,n=0,s=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?n++:s++;return{width:~~(.8*n*i+s*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:Pi.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:Pi.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:Pi.fontSize;return{ascent:.79*i,descent:.21*i}}measureTextBoundLeftRightEstimate(t){var e;const i=null!==(e=t.fontSize)&&void 0!==e?e:Pi.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(t,e,i){if(!this.context)return Object.assign(Object.assign({},this.measureTextBoundADscentEstimate(e)),{width:this.estimate(t,e).width});const n=this._measureTextWithoutAlignBaseline(t,e,!0);if(i===q.actualBounding)return{ascent:n.actualBoundingBoxAscent,descent:n.actualBoundingBoxDescent,width:n.width};if(i===q.estimate)return Object.assign(Object.assign({},this.measureTextBoundADscentEstimate(e)),{width:n.width});if(i===q.fontBounding){let t=n.fontBoundingBoxAscent,e=n.fontBoundingBoxDescent;if(n.actualBoundingBoxDescent&&e<n.actualBoundingBoxDescent){const i=n.actualBoundingBoxDescent-e;e+=i,t-=i}else if(n.actualBoundingBoxAscent&&t<n.actualBoundingBoxAscent){const i=n.actualBoundingBoxAscent-t;t+=i,e-=i}return{ascent:t,descent:e,width:n.width}}return{ascent:n.actualBoundingBoxAscent,descent:n.actualBoundingBoxDescent,width:n.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:s=12}=e;t.forEach((t=>{t.width=0===t.direction?s:this.measureTextWidth(t.text,e)}));const r=[];let o=0,a=0;for(;a<t.length&&o+t[a].width<i;a++)o+=t[a].width,r.push(t[a]);if(t[a]&&t[a].text.length>1){const s=this._clipText(t[a].text,e,i-o,0,t[a].text.length-1,"end",!1);if(n&&s.str!==t[a].text){let i="",n=0;for(let e=0;e<a;e++){const s=t[e];i+=s.text,n+=s.text.length}i+=t[a].text;let r=nn(i,n+s.str.length);r-=n,r!==s.str.length-1&&(s.str=s.str.substring(0,r),s.width=this.measureTextWidth(s.str,e))}r.push(Object.assign(Object.assign({},t[a]),{text:s.str,width:s.width})),o+=s.width}return{verticalList:r,width:o}}clipText(t,e,i,n,s){if(0===t.length)return{str:"",width:0};let r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};if(r=this.measureTextWidth(t[0],e),r>i)return{str:"",width:0};const o=this._clipText(t,e,i,0,t.length-1,"end",!1);if(n&&o.str!==t){let i=nn(t,o.str.length,s);i!==o.str.length&&(i>o.str.length&&(o.wordBreaked=i,i=o.str.length),o.str=t.substring(0,i),o.width=this.measureTextWidth(o.str,e))}return o}_clipText(t,e,i,n,s,r,o){let a;if("start"===r)a=this._clipTextStart(t,e,i,n,s),o&&(a.result=o+a.str);else if("middle"===r){const n=this._clipTextMiddle(t,e,i,"","",0,0,1);a={str:"none",width:n.width,result:n.left+o+n.right}}else a=this._clipTextEnd(t,e,i,n,s),o&&(a.result=a.str+o);return a}_clipTextEnd(t,e,i,n,s){if(n===s){mt.getInstance().warn(`【_clipTextEnd】不应该走到这里${t}, ${n}, ${s}`);const i=t.substring(0,s+1);return{str:i,width:this.measureTextWidth(i,e)}}const r=Math.floor((n+s)/2),o=t.substring(0,r+1),a=this.measureTextWidth(o,e);let h;if(a>i){if(o.length<=1)return{str:"",width:0};const s=t.substring(0,r);return h=this.measureTextWidth(s,e),h<=i?{str:s,width:h}:this._clipTextEnd(t,e,i,n,r)}if(a<i){if(r>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(0,r+2);return h=this.measureTextWidth(n,e),h>=i?{str:o,width:a}:this._clipTextEnd(t,e,i,r,s)}return{str:o,width:a}}_clipTextStart(t,e,i,n,s){const r=Math.ceil((n+s)/2),o=t.substring(r-1,t.length),a=this.measureTextWidth(o,e);let h;if(a>i){if(o.length<=1)return{str:"",width:0};const n=t.substring(r,t.length);return h=this.measureTextWidth(n,e),h<=i?{str:n,width:h}:this._clipTextStart(t,e,i,r,t.length)}if(a<i){if(r<=0)return{str:t,width:this.measureTextWidth(t,e)};const s=t.substring(r-2,t.length);return h=this.measureTextWidth(s,e),h>=i?{str:o,width:a}:this._clipTextStart(t,e,i,n,r)}return{str:o,width:a}}_clipTextMiddle(t,e,i,n,s,r,o,a){const h=t.substring(0,a),l=this.measureTextWidth(h,e);if(l+o>i)return{left:n,right:s,width:r+o};const c=t.substring(t.length-a,t.length),d=this.measureTextWidth(c,e);return l+d>i?{left:h,right:s,width:l+o}:this._clipTextMiddle(t,e,i,h,c,l,d,a+1)}clipTextWithSuffixVertical(t,e,i,n,s,r){if(""===n)return this.clipTextVertical(t,e,i,s);if(0===t.length)return{verticalList:t,width:0};const o=this.clipTextVertical(t,e,i,s);if(o.verticalList.length===t.length&&o.verticalList[o.verticalList.length-1].width===t[t.length-1].width)return o;const a=this.measureTextWidth(n,e);if(a>i)return o;let h;if(i-=a,"start"===r){const r=this.revertVerticalList(t);h=this.clipTextVertical(r,e,i,s);const o=this.revertVerticalList(h.verticalList);o.unshift({text:n,direction:1,width:a}),h.verticalList=o}else if("middle"===r){const r=this.clipTextVertical(t,e,i/2,s),o=this.revertVerticalList(t),l=this.clipTextVertical(o,e,i/2,s);r.verticalList.push({text:n,direction:1,width:a}),this.revertVerticalList(l.verticalList).forEach((t=>r.verticalList.push(t))),h={verticalList:r.verticalList,width:r.width+l.width}}else h=this.clipTextVertical(t,e,i,s),h.verticalList.push({text:n,direction:1,width:a});return h.width+=a,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,s,r){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(""===n)return this.clipText(t,e,i,s);if(0===t.length)return{str:"",width:0};const a=this.measureTextWidth(t,e);if(!o&&a<=i)return{str:t,width:a};const h=this.measureTextWidth(n,e);if(h>i)return{str:"",width:0};if(o&&a+h<=i)return{str:t+n,width:a+h};i-=h;const l=this._clipText(t,e,i,0,t.length-1,r,n);if(s&&l.str!==t){const i=nn(t,l.str.length);i!==l.str.length&&(l.result=t.substring(0,i),l.width=this.measureTextWidth(l.str,e))}else o&&l.str===t&&(l.result=t+n);return l.str=l.result,l.width+=h,l}};on=rn([v()],on);var an=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};const hn=Symbol.for("TextMeasureContribution");let ln=class extends on{};ln=an([v()],ln);const cn=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||_,this.options=e,this.id=r.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new R}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,a,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new M(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new I(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),s=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:s(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),s=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const r={inject:n[h],multiInject:n[l]},o=r.inject||r.multiInject,a={serviceIdentifier:o,constructorArgsMetadata:e},c=(this._bindingDictionary.get(o)||[]).filter((t=>t.constraint(a)));if(c.length){const t={injectIdentifier:o,metadata:e,bindings:c};s.push(t)}}return s}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case A:case S:e=t.cache;break;case B: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===w&&(t.cache=e,t.activated=!0)}},dn=Symbol.for("CanvasFactory");function un(t){return cn.getNamed(dn,Ki.global.env)(t)}function pn(t){return"number"==typeof t&&Number.isFinite(t)}const gn=new class{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=un(Object.assign({nativeCanvas:Ki.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=un(Object.assign({nativeCanvas:Ki.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=[]}};var fn=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},mn=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const bn=Symbol.for("VWindow"),yn=Symbol.for("WindowHandlerContribution");let vn=class extends G{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(){super(),this.hooks={onChange:new j(["x","y","width","height"])},this.active=()=>{const t=this.global;t.env&&!this.actived&&(cn.getNamed(yn,t.env).configure(this,t),this.actived=!0)},this._uid=r.GenAutoIncrementId(),this.global=Ki.global,this.postInit()}_nativeAddEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}_nativeRemoveEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}_nativeDispatchEvent(t){return this._handler.dispatchEvent(t)}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.clearAllEventListeners(),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}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,s,r){this._handler.setViewBoxTransform(t,e,i,n,s,r)}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&&bt(this.width,t.width())&&bt(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)}};vn=fn([v(),mn("design:paramtypes",[])],vn);var xn=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},wn=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_n=function(t,e){return function(i,n){e(i,n,t)}};let An=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=Ki.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=gn.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 s=this.global.measureTextMethod;this.global.measureTextMethod=i;const r={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:Pi.fontSize};return this.global.measureTextMethod=s,r}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new zt(Object.assign({defaultFontParams:{fontFamily:Pi.fontFamily,fontSize:Pi.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+zt.ALPHABET_CHAR_SET+zt.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const n=cn.get(bn),s=t.AABBBounds,r=s.width(),o=s.height(),a=-s.x1,h=-s.y1;n.create({viewBox:{x1:a,y1:h,x2:s.x2,y2:s.y2},width:r,height:o,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}};var Cn;An=xn([v(),_n(0,b(k)),_n(0,x(hn)),wn("design:paramtypes",[Object])],An),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(Cn||(Cn={}));const Tn=new Xt;let Sn=class{constructor(){this.matrix=new Xt}init(t){return this.mode=Cn.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=Cn.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(Tn.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){const{x:n,y:s}=i;this.outTargetMatrix.translate(n,s),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-n,-s)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Tn.a,Tn.b,Tn.c,Tn.d,Tn.e,Tn.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(Tn.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(Tn.a,Tn.b,Tn.c,Tn.d,Tn.e,Tn.f),this}scale(t,e,i){return this.mode===Cn.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===Cn.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return Tn.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Tn.a,Tn.b,Tn.c,Tn.d,Tn.e,Tn.f),this}translate(t,e){return this.mode===Cn.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===Cn.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};Sn=xn([v(),wn("design:paramtypes",[])],Sn);const Bn={arc:ki,area:Di,circle:Fi,line:ji,path:Hi,symbol:Vi,text:Yi,rect:Wi,polygon:zi,star:Gi,richtext:Xi,richtextIcon:qi,image:$i,group:Ni,glyph:Ui},En=Object.keys(Bn);function Mn(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Rn={arc:Object.assign({},Bn.arc),area:Object.assign({},Bn.area),circle:Object.assign({},Bn.circle),line:Object.assign({},Bn.line),path:Object.assign({},Bn.path),symbol:Object.assign({},Bn.symbol),text:Object.assign({},Bn.text),rect:Object.assign({},Bn.rect),polygon:Object.assign({},Bn.polygon),star:Object.assign({},Bn.star),richtext:Object.assign({},Bn.richtext),richtextIcon:Object.assign({},Bn.richtextIcon),image:Object.assign({},Bn.image),group:Object.assign({},Bn.group),glyph:Object.assign({},Bn.glyph)};class Pn{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},En.forEach((t=>{this._defaultTheme[t]=Object.create(Rn[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,mt.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;En.forEach((n=>{const s=Object.create(Rn[n]);t&&t[n]&&Mn(s,t[n]),i[n]&&Mn(s,i[n]),e[n]&&Mn(s,e[n]),this.combinedTheme[n]=s})),e.common&&En.forEach((t=>{Mn(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 Ln=new Pn;function On(t,e){return t.glyphHost?On(t.glyphHost):e?(t.isContainer,e):function(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)):Ln.getTheme()}return null}(t)||t.attachedThemeGraphic&&On(t.attachedThemeGraphic)||Ln.getTheme()}var In=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};class kn extends J{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=r.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 In(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 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&&mt.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=tt(i,!0)&&i||st(i)&&i.capture,s=st(i)&&i.once,r=et(e)?void 0:e;return t=n?`${t}capture`:t,e=et(e)?e:e.handleEvent,s?super.once(t,e,r):super.on(t,e,r),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=tt(i,!0)&&i||st(i)&&i.capture,s=et(e)?void 0:e;t=n?`${t}capture`:t,e=et(e)?e:e.handleEvent;const r=st(i)&&i.once;return super.off(t,e,s,r),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return st(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 Dn{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=Dn.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=t.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&&et(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&&et(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Fn extends Dn{constructor(t,e){super(),this.type=t,this.detail=e}}const Nn={dispatchEvent(t){var e;if(!(t instanceof Dn))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 Fn(t,e))}};class Un{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-Un.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Un.bounceIn(2*t):.5*Un.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/_t*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*_t/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/_t*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*_t/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/_t*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*_t/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*_t/e)*.5+1}}static registerFunc(t,e){Un[t]=e}}function jn(t,e){const i=1/e;let n=1;for(;t>i;)t-=i,n*=-1;const s=n*t/i;return s>0?s:1+s}Un.quadIn=Un.getPowIn(2),Un.quadOut=Un.getPowOut(2),Un.quadInOut=Un.getPowInOut(2),Un.cubicIn=Un.getPowIn(3),Un.cubicOut=Un.getPowOut(3),Un.cubicInOut=Un.getPowInOut(3),Un.quartIn=Un.getPowIn(4),Un.quartOut=Un.getPowOut(4),Un.quartInOut=Un.getPowInOut(4),Un.quintIn=Un.getPowIn(5),Un.quintOut=Un.getPowOut(5),Un.quintInOut=Un.getPowInOut(5),Un.backIn=Un.getBackIn(1.7),Un.backOut=Un.getBackOut(1.7),Un.backInOut=Un.getBackInOut(1.7),Un.elasticIn=Un.getElasticIn(1,.3),Un.elasticOut=Un.getElasticOut(1,.3),Un.elasticInOut=Un.getElasticInOut(1,.3*1.5),Un.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),Un.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},Un.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)Un[`flicker${t}`]=e=>jn(e,t);for(let t=2;t<10;t++)Un[`aIn${t}`]=e=>t*e*e+(1-t)*e;const Hn=new class{constructor(){this.id=r.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(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Me.END?this.removeAnimate(e):e.status===Me.RUNNING||e.status===Me.INITIAL?(this.animateCount++,e.advance(t)):e.status===Me.PAUSED&&this.animateCount++,e=e.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()}};class zn{constructor(t,e,i,n,s){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=s,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 Gn extends zn{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Wn{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hn,i=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e||Hn,this.status=Me.INITIAL,this.tailAnimate=new Vn(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=i}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=St(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Wn.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(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wn.mode;t&&e&Re.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Ee.ANIMATE_PLAY})}runCb(t){const e=new Gn((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,s,r){const o=Wn.interpolateMap.get(t)||Wn.interpolateMap.get("");return!!o&&o(t,e,i,n,s,r)}pause(){this.status===Me.RUNNING&&(this.status=Me.PAUSED)}resume(){this.status===Me.PAUSED&&(this.status=Me.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 Vn(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(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===Me.INITIAL&&(this.status=Me.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Me.RUNNING&&(this.status=Me.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const n=this.rawPosition,s=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const r=t>=s;if(r&&(t=s),t===n)return r;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),r}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=Me.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()}}Wn.mode=Re.NORMAL,Wn.interpolateMap=new Map;class Vn{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 Yn(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(t){let e=t.duration;(null==e||e<0)&&(e=0);const i=t.easing,n="string"==typeof i?Un[i]:i,s=this._addStep(e,null,n);return s.type=Pe.customAnimate,this._appendProps(t.getEndProps(),s,!1),this._appendCustomAnimate(t,s),this}to(t,e,i,n){(null==e||e<0)&&(e=0);const s="string"==typeof i?Un[i]:i,r=this._addStep(e,null,s);return r.type=Pe.to,this._appendProps(t,r,!!n&&n.tempProps),r.propKeys||(r.propKeys=Object.keys(r.props)),n&&n.noPreventAttrs||this.target.animates&&this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(r.propKeys)})),this}from(t,e,i,n){this.to(t,0,i,n);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,e,i,n),this.stepTail.type=Pe.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(t){if(t>0){const e=this._addStep(+t,null);e.type=Pe.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){const n=new Yn(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 s=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===s[t]&&(s[t]=n.props[t])}))),e.propKeys=Object.keys(e.props),n=n.prev;const r=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(s)),e.propKeys.forEach((t=>{if(void 0===r[t]){const e=this.animate.getStartProps();r[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,s=this.rawPosition;let r,o,a=!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&&(a=!0,i<0))return a;if(r=Math.floor(t/i),o=t-r*i,a=t>=n*i+i,a&&(o=i,r=n,t=o*r+i),t===s)return a;const l=!this.reversed!=!(this.bounce&&r%2);return l&&(o=i-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+h,this.updatePosition(a,l),a}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,s=this.duration;if(this.target&&i){let r=i.next;for(;r&&r.position<=n;)i=r,r=i.next;let o=t?0===s?1:n/s:(n-i.position)/i.duration;i.easing&&(o=i.easing(o)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,o,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,o)))}}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 mt.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 Yn{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 Xn=200,$n="cubicOut";var qn;!function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(qn||(qn={}));const Kn=[0,0,0,0];function Zn(t,e){if(ot(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}var Jn;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Jn||(Jn={}));class Qn{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jn.Color1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===Jn.Color1){const e=Qn.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const n=se.parseColorString(t);if(n){const e=[n.r/255,n.g/255,n.b/255,n.opacity];Qn.store1[t]=e,Qn.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const n=Qn.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;const s=se.parseColorString(t);return s&&(Qn.store1[t]=[s.r/255,s.g/255,s.b/255,s.opacity],Qn.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=s.r,i[1]=s.g,i[2]=s.b,i[3]=s.opacity),i}static Set(t,e,i){if(e===Jn.Color1){if(Qn.store1[t])return;Qn.store1[t]=i,Qn.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Qn.store255[t])return;Qn.store255[t]=i,Qn.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function ts(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&at(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 es(t,e,i,n,s){return Array.isArray(t)&&!at(t[0])||Array.isArray(e)&&!at(e[0])?new Array(4).fill(0).map(((s,r)=>is(ot(t)?t[r]:t,ot(e)?e[r]:e,i,n))):is(t,e,i,n,s)}function is(t,e,i,n,s){if(!t||!e)return t&&ts(t)||e&&ts(e)||!1;let r,o,a=!1,h=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=Qn.Get(t,Jn.Color255):a=!0,Array.isArray(e)?o=e:"string"==typeof e?o=Qn.Get(e,Jn.Color255):h=!0,a!==h){const r=a?t:e,o=a?e:t,h=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:ts(o)})))});return a?es(r,h,i,n,s):es(h,r,i,n,s)}if(a){if(t.gradient===e.gradient){const n=t,s=e,r=n.stops,o=s.stops;if(r.length!==o.length)return!1;if("linear"===n.gradient)return function(t,e,i){const n=t.stops,s=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:rs(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("radial"===n.gradient)return function(t,e,i){const n=t.stops,s=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:rs(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("conical"===n.gradient)return function(t,e,i){const n=t.stops,s=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:rs(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i)}return!1}return s&&s(r,o),ts(function(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]}(r,o,i),n)}Qn.store255={},Qn.store1={};const ns=[0,0,0,0],ss=[0,0,0,0];function rs(t,e,i){return Qn.Get(t,Jn.Color255,ns),Qn.Get(e,Jn.Color255,ss),`rgba(${Math.round(ns[0]+(ss[0]-ns[0])*i)},${Math.round(ns[1]+(ss[1]-ns[1])*i)},${Math.round(ns[2]+(ss[2]-ns[2])*i)},${ns[3]+(ss[3]-ns[3])*i})`}class os{static GetImage(t,e){var i;const n=os.cache.get(t);n?"fail"===n.loadState?Ki.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):os.loadImage(t,e)}static GetSvg(t,e){var i;let n=os.cache.get(t);n?"fail"===n.loadState?Ki.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"},os.cache.set(t,n),n.dataPromise=Ki.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,s)=>{(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=os.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"},os.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=Ki.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=Ki.global.loadBlob(t):"json"===e&&(i.dataPromise=Ki.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!os.isLoading&&os.toLoadAueue.length){os.isLoading=!0;const t=os.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,s={type:"image",loadState:"init"};if(os.cache.set(i,s),s.dataPromise=Ki.global.loadImage(i),s.dataPromise){s.waitingMark=n;const t=s.dataPromise.then((t=>{var e;s.loadState=(null==t?void 0:t.data)?"success":"fail",s.data=null==t?void 0:t.data,null===(e=s.waitingMark)||void 0===e||e.map(((e,n)=>{(null==t?void 0:t.data)?(s.loadState="success",s.data=t.data,e.imageLoadSuccess(i,t.data)):(s.loadState="fail",e.imageLoadFail(i))})),s.waitingMark&&(s.waitingMark=[])}));e.push(t)}else s.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{os.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),os.loading()})).catch((t=>{os.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),os.loading()}))}}),0)}static loadImage(t,e){const i=as(t,os.toLoadAueue);if(-1!==i)return os.toLoadAueue[i].marks.push(e),void os.loading();os.toLoadAueue.push({url:t,marks:[e]}),os.loading()}static improveImageLoading(t){const e=as(t,os.toLoadAueue);if(-1!==e){const t=os.toLoadAueue.splice(e,1);os.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function as(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}os.cache=new Map,os.isLoading=!1,os.toLoadAueue=[],os.onLoadSuccessCb=[];class hs{bounds(t,e){if(at(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 at(t)?t:Math.min(t[0],t[1])}}function ls(t,e,i,n,s){return s?t.arc(i,n,e,0,wt,!1,s):t.arc(i,n,e,0,wt),!1}var cs=new class extends hs{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,s){return ls(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return ls(t,this.parseSize(e)/2+s,i,n,r)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 -${2*s},0`}};var ds=new class extends hs{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,s){return function(t,e,i,n,s){return t.moveTo(-3*e+i,-e+n,s),t.lineTo(-e+i,-e+n,s),t.lineTo(-e+i,-3*e+n,s),t.lineTo(e+i,-3*e+n,s),t.lineTo(e+i,-e+n,s),t.lineTo(3*e+i,-e+n,s),t.lineTo(3*e+i,e+n,s),t.lineTo(e+i,e+n,s),t.lineTo(e+i,3*e+n,s),t.lineTo(-e+i,3*e+n,s),t.lineTo(-e+i,e+n,s),t.lineTo(-3*e+i,e+n,s),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s)}drawOffset(t,e,i,n,s,r){return function(t,e,i,n,s,r){return t.moveTo(-3*e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-3*e+n-s,r),t.lineTo(e+i+s,-3*e+n-s,r),t.lineTo(e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,e+n+s,r),t.lineTo(e+i+s,e+n+s,r),t.lineTo(e+i+s,3*e+n+s,r),t.lineTo(-e+i-s,3*e+n+s,r),t.lineTo(-e+i-s,e+n+s,r),t.lineTo(-3*e+i-s,e+n+s,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s,r)}};function us(t,e,i,n,s){return t.moveTo(i,n-e,s),t.lineTo(e+i,n,s),t.lineTo(i,n+e,s),t.lineTo(i-e,n,s),t.closePath(),!0}var ps=new class extends hs{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,s){return us(t,this.parseSize(e)/2,i,n,s)}drawFitDir(t,e,i,n,s){return us(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return us(t,this.parseSize(e)/2+s,i,n,r)}};function gs(t,e,i,n){const s=2*e;return t.rect(i-e,n-e,s,s),!1}var fs=new class extends hs{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return gs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return gs(t,this.parseSize(e)/2+s,i,n)}};function ms(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i+e+2*s,e+n+s),t.lineTo(i-e-2*s,e+n+s),t.lineTo(i,n-e-2*s),t.closePath(),!0}class bs extends hs{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 ms(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ms(t,this.parseSize(e)/2,i,n,s)}}var ys=new bs;var vs=new class extends bs{constructor(){super(...arguments),this.type="triangle"}};const xs=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ws=Math.sin(wt/10)*xs,_s=-Math.cos(wt/10)*xs;function As(t,e,i,n){const s=ws*e,r=_s*e;t.moveTo(i,-e+n),t.lineTo(s+i,r+n);for(let o=1;o<5;++o){const a=wt*o/5,h=Math.cos(a),l=Math.sin(a);t.lineTo(l*e+i,-h*e+n),t.lineTo(h*s-l*r+i,l*s+h*r+n)}return t.closePath(),!0}var Cs=new class extends hs{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 As(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return As(t,this.parseSize(e)/2+s,i,n)}};const Ts=Mt(3);function Ss(t,e,i,n){const s=e,r=s/Ts,o=r/5,a=e;return t.moveTo(0+i,-s+n),t.lineTo(r/2+i,n),t.lineTo(o/2+i,n),t.lineTo(o/2+i,a+n),t.lineTo(-o/2+i,a+n),t.lineTo(-o/2+i,n),t.lineTo(-r/2+i,n),t.closePath(),!0}var Bs=new class extends hs{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 Ss(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Ss(t,this.parseSize(e)/2+s,i,n)}};function Es(t,e,i,n){const s=2*e;return t.moveTo(i,-e+n),t.lineTo(s/3/2+i,e+n),t.lineTo(-s/3/2+i,e+n),t.closePath(),!0}var Ms=new class extends hs{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return Es(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Es(t,this.parseSize(e)/2+s,i,n)}};function Rs(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Ps=new class extends hs{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return Rs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Rs(t,this.parseSize(e)/2+s,i,n)}};const Ls=-.5,Os=Mt(3)/2,Is=1/Mt(12);function ks(t,e,i,n){const s=e/2,r=e*Is,o=s,a=e*Is+e,h=-o,l=a;return t.moveTo(s+i,r+n),t.lineTo(o+i,a+n),t.lineTo(h+i,l+n),t.lineTo(Ls*s-Os*r+i,Os*s+Ls*r+n),t.lineTo(Ls*o-Os*a+i,Os*o+Ls*a+n),t.lineTo(Ls*h-Os*l+i,Os*h+Ls*l+n),t.lineTo(Ls*s+Os*r+i,Ls*r-Os*s+n),t.lineTo(Ls*o+Os*a+i,Ls*a-Os*o+n),t.lineTo(Ls*h+Os*l+i,Ls*l-Os*h+n),t.closePath(),!1}var Ds=new class extends hs{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 ks(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ks(t,this.parseSize(e)/2+s,i,n)}};function Fs(t,e,i,n,s){return t.moveTo(-e+i-2*s,n),t.lineTo(e+i+s,e+n+2*s),t.lineTo(e+i+s,n-e-2*s),t.closePath(),!0}var Ns=new class extends hs{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 Fs(t,this.parseSize(e)/2,i,n,0)}drawOffset(t,e,i,n,s){return Fs(t,this.parseSize(e)/2,i,n,s)}};function Us(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-s,e+n+2*s),t.lineTo(e+i+2*s,n),t.lineTo(i-e-s,n-e-2*s),t.closePath(),!0}var js=new class extends hs{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 Us(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Us(t,this.parseSize(e)/2,i,n,s)}};function Hs(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-2*s,n-e-s),t.lineTo(i+e+2*s,n-e-s),t.lineTo(i,n+e+2*s),t.closePath(),!0}var zs=new class extends hs{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 Hs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Hs(t,this.parseSize(e)/2,i,n,s)}};const Gs=Mt(3);function Ws(t,e,i,n){const s=e*Gs;return t.moveTo(i,n+-s/3*2),t.lineTo(e+i,n+s),t.lineTo(i-e,n+s),t.closePath(),!0}var Vs=new class extends hs{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return Ws(t,this.parseSize(e)/2/Gs,i,n)}drawOffset(t,e,i,n,s){return Ws(t,this.parseSize(e)/2/Gs+s,i,n)}};function Ys(t,e,i,n){const s=2*e;return t.moveTo(e+i,n-s),t.lineTo(i-e,n),t.lineTo(e+i,s+n),!0}var Xs=new class extends hs{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 Ys(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ys(t,this.parseSize(e)/4+s,i,n)}};function $s(t,e,i,n){const s=2*e;return t.moveTo(i-e,n-s),t.lineTo(i+e,n),t.lineTo(i-e,s+n),!0}var qs=new class extends hs{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 $s(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return $s(t,this.parseSize(e)/4+s,i,n)}};function Ks(t,e,i,n){const s=2*e;return t.moveTo(i-s,n+e),t.lineTo(i,n-e),t.lineTo(i+s,n+e),!0}var Zs=new class extends hs{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 Ks(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ks(t,this.parseSize(e)/4+s,i,n)}};function Js(t,e,i,n){const s=2*e;return t.moveTo(i-s,n-e),t.lineTo(i,n+e),t.lineTo(i+s,n-e),!0}var Qs=new class extends hs{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 Js(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Js(t,this.parseSize(e)/4+s,i,n)}};function tr(t,e,i,n,s){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var er=new class extends hs{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,s){return tr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return tr(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e}, ${i-s} L ${e},${i+s}`}};function ir(t,e,i,n,s){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var nr=new class extends hs{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,s){return ir(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return ir(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} L ${e+s},${i}`}};function sr(t,e,i,n,s){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 rr=new class extends hs{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,s){return sr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return sr(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i-s} L ${e+s},${i+s} M ${e+s}, ${i-s} L ${e-s},${i+s}`}};function or(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function ar(t,e,i,n){const s=e,r=e/2;return t.rect(i-s/2,n-r/2,s,r),!1}var hr=new class extends hs{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 at(e)?ar(t,e,i,n):or(t,e,i,n)}drawWithClipRange(t,e,i,n,s,r,o){at(e)&&(e=[e,e/2]);const a=2*(e[0]+e[1])*s,h=[{x:i+e[0]/2,y:n-e[1]/2},{x:i+e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n-e[1]/2}];let l=0,c=h[3];t.moveTo(c.x,c.y);for(let e=0;e<h.length;e++){const i=h[e],n=Math.sqrt((i.x-c.x)*(i.x-c.x)+(i.y-c.y)*(i.y-c.y));if(l+n>a){const e=(i.x-c.x)*(a-l)/n,s=(i.y-c.y)*(a-l)/n;t.lineTo(c.x+e,c.y+s);break}t.lineTo(i.x,i.y),c=i,l+=n}return!1}drawOffset(t,e,i,n,s){return at(e)?ar(t,e+2*s,i,n):or(t,[e[0]+2*s,e[1]+2*s],i,n)}};const lr=new Vt;class cr{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,ot(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,s,r,o){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{t.beginPath(),Ne(s.path.commandList,t,i,n,e,e),o&&o(s.path,s.attribute)})),!1):(Ne(this.path.commandList,t,i,n,e+s,e+s),!1)}draw(t,e,i,n,s,r){return e=this.parseSize(e),this.drawOffset(t,e,i,n,0,s,r)}parseSize(t){return at(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,n,s,r,o){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{r.path.drawWithClipRange(t,e,i,n,s),o&&o(r.path,r.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,n,s),!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;lr.x1=n.bounds.x1*t,lr.y1=n.bounds.y1*t,lr.x2=n.bounds.x2*t,lr.y2=n.bounds.y2*t,e.union(lr)}))}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 dr={};[cs,ds,ps,fs,Vs,vs,Cs,Bs,Ms,Ps,Ds,Ns,js,ys,zs,Xs,qs,Zs,Qs,hr,er,nr,rr].forEach((t=>{dr[t.type]=t}));const ur={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"};class pr{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 gr(t,e,i,n){const s=t.indexOf(e,i);if(-1===s)throw new Error(n);return s+e.length-1}function fr(t,e,i){const n=function(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",s="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:r};if(t[r+1]===n[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!n)return;let s=n.data;const r=n.index,o=s.search(/\s/);let a=s,h=!0;-1!==o&&(a=s.substr(0,o).replace(/\s\s*$/,""),s=s.substr(o+1));const l=a;if(i){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),h=a!==n.data.substr(t+1))}return{tagName:a,tagExp:s,closeIndex:r,attrExpPresent:h,rawTagName:l}}const mr=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class br{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 s=function(t,e){const i=[];let n=e.exec(t);for(;n;){const s=[];s.startIndex=e.lastIndex-n[0].length;const r=n.length;for(let t=0;t<r;t++)s.push(n[t]);i.push(s),n=e.exec(t)}return i}(t,mr),r=s.length;for(let t=0;t<r;t++){const e=s[t][1],i=s[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 pr("!xml");let i=e,n="",s="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=gr(t,">",r,"Closing Tag is not closed."),o=s.lastIndexOf(".");s=s.substring(0,o),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",r=e}else if("?"===t[r+1])r=fr(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=gr(t,"--\x3e",r+4,"Comment is not closed.");else{const o=fr(t,r,!1);let a=o.tagName,h=o.tagExp;const l=o.attrExpPresent,c=o.closeIndex;if(a!==e.tagname&&(s+=s?"."+a:a),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),h=a):h=h.substr(0,h.length-1);const t=new pr(a);a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,s,a)),this.addChild(i,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new pr(a);this.tagsNodeStack.push(i),a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,s,a)),this.addChild(i,t,s),i=t}n="",r=c}else n+=t[r];return e.child}}function yr(t,e){return vr(t)}function vr(t,e){const i={};for(let e=0;e<t.length;e++){const s=t[e],r=xr(s);if(void 0!==r&&s[r]){const t=vr(s[r]);n=t,Object.keys(n).length,s[":@"]&&wr(t,s[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}var n;return i}function xr(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function wr(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let s=0;s<n;s++){const n=i[s];t[n]=e[n]}}}class _r{constructor(t){this.options=Object.assign({},_r.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return yr(new br(this.options).parseXml(t),this.options)}}function Ar(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}_r.defaultOptions={};let Cr=0;function Tr(){return Cr++}var Sr;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Sr||(Sr={}));const Br=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Br.set(t,!0)));const Er=new Map;[""].forEach((t=>Er.set(t,!0))),Tr();const Mr=Tr(),Rr=Tr();Tr(),Tr();const Pr=Tr();Tr();const Lr=Tr();Tr(),Tr(),Tr();const Or=Tr();Tr(),Tr(),Tr();const Ir=Tr();Tr();const kr=Symbol.for("GraphicService"),Dr=Symbol.for("GraphicCreator"),Fr={"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"},Nr=Object.keys(Fr),Ur=new Vt,jr=new Xt;new Vt;const Hr=["lineWidth","scaleX","scaleY","angle","anchor","visible"],zr=["x","y"],Gr=["scaleX","scaleY"],Wr=["angle"],Vr=new Pt,Yr={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 Xr extends kn{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(Xr.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new Vt,this._updateTag=Se.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.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:s=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;Vr.x=s+(null!==(i=t.scrollX)&&void 0!==i?i:0),Vr.y=r+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else Vr.x=s,Vr.y=r;return Vr}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Ki.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return Ki.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new Yt),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}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let i=this.clipPathMap.get(e)||null;return i||(this.clipPathMap.size>10&&this.clipPathMap.clear(),i=this.parsePath(e),i&&this.clipPathMap.set(e,i)),i}parsePath(t){if(!t)return null;let e=dr[t];if(e)return e;if(e=Xr.userSymbolMap[t],e)return e;if(!0===((i=t=ur[t]||t).startsWith("<svg")||i.startsWith("<?xml"))){const e=new _r,{svg:i}=e.parse(t);if(!i)return null;const n=ot(i.path)?i.path:[i.path];Ur.clear();const s=[];n.forEach((t=>{const e=(new Ti).fromString(t.d),i={};Nr.forEach((e=>{t[e]&&(i[Fr[e]]=t[e])})),s.push({path:e,attribute:i}),Ur.union(e.bounds)}));const r=Ur.width(),o=Ur.height(),a=1/St(r,o);s.forEach((t=>t.path.transform(0,0,a,a)));const h=new cr(t,s,!0);return Xr.userSymbolMap[t]=h,h}var i;const n=(new Ti).fromString(t),s=n.bounds.width(),r=n.bounds.height(),o=1/St(s,r);n.transform(0,0,o,o);const a=new cr(t,n);return Xr.userSymbolMap[t]=a,a}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,n=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:s=e.boundsPadding}=i,r=(o=s)?ot(o)?0===o.length?0:1===o.length?o[0]:2===o.length?(Kn[0]=o[0],Kn[2]=o[0],Kn[1]=o[1],Kn[3]=o[1],Kn):o:o:0;var o;return r&&n.expand(r),this.clearUpdateBoundTag(),n}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new ae(t);return Ne(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 Xt),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&Se.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&Ki.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&Se.UPDATE_BOUNDS)&&Ki.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&Se.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&Se.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&Se.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&Se.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=Se.CLEAR_SHAPE}containsPoint(t,e,i,n){if(!n)return!1;if(i===Be.GLOBAL){const i=new Pt(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return n.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}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 s;const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);r?this._setAttributes(r,i,n):it(null===(s=this.normalAttrs)||void 0===s?void 0:s[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]:Hr;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]:Hr;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Ee.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=Se.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,n;if(0===t&&0===e)return this;const s={type:Ee.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,zr,s);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const o=this.attribute,a=o.postMatrix;return a?Ki.transformUtil.fromMatrix(a,a).translate(t,e):(o.x=(null!==(i=o.x)&&void 0!==i?i:Ei.x)+t,o.y=(null!==(n=o.y)&&void 0!==n?n:Ei.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const n={type:Ee.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,zr,n);return s?(this._setAttributes(s,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}scale(t,e,i){var n,s;if(1===t&&1===e)return this;const r={type:Ee.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,Gr,r);o&&(t=o.scaleX,e=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));const a=this.attribute;if(i){let{postMatrix:n}=this.attribute;n||(n=new Xt,a.postMatrix=n),Ki.transformUtil.fromMatrix(n,n).scale(t,e,i)}else a.scaleX=(null!==(n=a.scaleX)&&void 0!==n?n:Ei.scaleX)*t,a.scaleY=(null!==(s=a.scaleY)&&void 0!==s?s:Ei.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const n={type:Ee.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Gr,n);return s?(this._setAttributes(s,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}rotate(t,e){var i;if(0===t)return this;const n={type:Ee.ROTATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Wr,n);s&&(delete s.angle,this._setAttributes(s,!1,n));const r=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new Xt,r.postMatrix=i),Ki.transformUtil.fromMatrix(i,i).rotate(t,e)}else r.angle=(null!==(i=r.angle)&&void 0!==i?i:Ei.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Ee.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Wr,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}animate(t){var e;this.animates||(this.animates=new Map);const i=new Wn(null==t?void 0:t.id,null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(i.bind(this),t){const{onStart:e,onFrame:n,onEnd:s,onRemove:r}=t;null!=e&&i.onStart(e),null!=n&&i.onFrame(n),null!=s&&i.onEnd(s),null!=r&&i.onRemove(r),i.interpolateFunc=t.interpolate}return this.animates.set(i.id,i),i.onRemove((()=>{i.stop(),this.animates.delete(i.id)})),i}onAttributeUpdate(t){t&&t.skipUpdateCallback||(Ki.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!it(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,n){var s,r,o,a;if(i){const i=Object.keys(t),h=this.getNoWorkAnimateAttr(),l={};let c;i.forEach((e=>{h[e]?(c||(c={}),c[e]=t[e]):l[e]=n&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const d=this.animate({slience:!0});d.stateNames=e,d.to(l,null!==(r=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==r?r:Xn,null!==(a=null===(o=this.stateAnimateConfig)||void 0===o?void 0:o.easing)&&void 0!==a?a:$n),c&&this.setAttributes(c,!1,{type:Ee.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Ee.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();dt(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){const i=ot(t)?e=>!t.includes(e):e=>e!==t,n=this.currentStates.filter(i);n.length!==this.currentStates.length&&this.useStates(n,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 s=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(s,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 s=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];s&&Object.assign(n,s)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=Se.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=Se.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=Se.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&Se.UPDATE_SHAPE_AND_BOUNDS)===Se.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=Se.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Se.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Se.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=Se.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=Se.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=Se.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=Se.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&Se.UPDATE_LAYOUT)}getAnchor(t,e,i){const n=[0,0],s=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,i&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,i=s();n[0]=i.x1+(i.x2-i.x1)*e}else n[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,i=s();n[1]=i.y1+(i.y2-i.y1)*e}else n[1]=t[1];return n}doUpdateLocalMatrix(){const{x:t=Ei.x,y:e=Ei.y,scaleX:i=Ei.scaleX,scaleY:n=Ei.scaleY,angle:s=Ei.angle,scaleCenter:r,anchor:o,postMatrix:a}=this.attribute;let h=[0,0];const l={};if(o&&s&&(h=this.getAnchor(o,l)),!r||1===i&&1===n)!function(t,e,i,n,s,r,o,a){const h=e.a,l=e.b,c=e.c,d=e.d,u=e.e,p=e.f,g=Tt(o),f=Et(o);let m,b;a?(m=a[0],b=a[1]):(m=i,b=n);const y=m-i,v=b-n,x=h*g+c*f,w=l*g+d*f,_=c*g-h*f,A=d*g-l*f;t.a=s*x,t.b=s*w,t.c=r*_,t.d=r*A,t.e=u+h*m+c*b-x*y-_*v,t.f=p+l*m+d*b-w*y-A*v}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,s,o&&h);else{const o=this._transMatrix;o.reset(),o.translate(h[0],h[1]),o.rotate(s),o.translate(-h[0],-h[1]),o.translate(t,e),h=this.getAnchor(r,l,!0),Ki.transformUtil.fromMatrix(o,o).scale(i,n,{x:h[0],y:h[1]})}const c=this.getOffsetXY(Ei);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,a){const t=jr.setValue(a.a,a.b,a.c,a.d,a.e,a.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.timeline===Hn&&t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Ki.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Ee.ANIMATE_END})}onStep(t,e,i,n,s){const r={};if(i.customAnimate)i.customAnimate.update(s,n,r);else{const o=i.props,a=i.parsedProps,h=i.propKeys;this.stepInterpolate(t,e,r,i,n,s,o,void 0,a,h)}this.setAttributes(r,!1,{type:Ee.ANIMATE_UPDATE,animationState:{ratio:n,end:s,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,s,r,o,a,h,l){l||(l=Object.keys(o),n.propKeys=l),r?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=o[t])})):l.forEach((r=>{var l;if(!e.validAttr(r))return;const c=o[r],d=null!==(l=a&&a[r])&&void 0!==l?l:t.getLastPropByName(r,n);if(null==c||null==d||c===d)return void(i[r]=c);let u;u=e.interpolateFunc&&e.interpolateFunc(r,s,d,c,i),u||(u=e.customInterpolate(r,s,d,c,this,i),u||this.defaultInterpolate(c,d,r,i,h,s)||this._interpolate(r,s,d,c,i))})),n.parsedProps=h}defaultInterpolate(t,e,i,n,s,r){if(Number.isFinite(t)&&Number.isFinite(e))return n[i]=e+(t-e)*r,!0;if("fill"===i){s||(s={});const o=s.fillColorArray,a=es(e,null!=o?o:t,r,!1,((t,e)=>{s.fillColorArray=e}));return a&&(n[i]=a),!0}if("stroke"===i){s||(s={});const o=s.strokeColorArray,a=es(e,null!=o?o:t,r,!1,((t,e)=>{s.strokeColorArray=e}));return a&&(n[i]=a),!0}if("shadowColor"===i){s||(s={});const o=s.shadowColorArray,a=es(e,null!=o?o:t,r,!0,((t,e)=>{s.shadowColorArray=e}));return a&&(n[i]=a),!0}if(Array.isArray(t)&&t.length===e.length){const s=[];let o=!0;for(let i=0;i<t.length;i++){const n=e[i],a=n+(t[i]-n)*r;if(!Number.isFinite(a)){o=!1;break}s.push(a)}o&&(n[i]=s)}return!1}_interpolate(t,e,i,n,s){}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:Ki.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),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 rt(t,!0)?this.pathProxy=(new Ti).fromString(t):this.pathProxy=new Ti,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")?(os.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(ht(t)||t.includes("/")||lt(t))&&(os.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):st(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",this.stopAnimates(),Ki.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const s=new Fn(t,e);s.bubbles=!1,s.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(s)}}}var $r;Xr.userSymbolMap={},Xr.mixin(Nn),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}($r||($r={}));class qr extends Xr{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Pr,this._childUpdateTag=Se.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 Pn),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Pn)}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(t,e,i){if(i===Be.GLOBAL){const i=new Pt(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&Se.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Ki.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Ki.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=Ei.x,y:e=Ei.y,dx:i=Ei.dx,dy:n=Ei.dy,scaleX:s=Ei.scaleX,scaleY:r=Ei.scaleY,angle:o=Ei.angle,postMatrix:a}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==s||1!==r||0!==o||a)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return On(this).group}updateAABBBounds(t,e,i){const n=i;i=i.clone();const{width:s,height:r,path:o,clip:a=e.clip}=t;if(o&&o.length?o.forEach((t=>{i.union(t.AABBBounds)})):null!=s&&null!=r&&i.set(0,0,Math.max(0,s),Math.max(0,r)),!a){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:n=0}=t;i.translate(e,n)}return Ki.graphicService.updateTempAABBBounds(i),Ki.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&=Se.CLEAR_BOUNDS,this._childUpdateTag&=Se.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=Se.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&Se.UPDATE_BOUNDS||(this._childUpdateTag|=Se.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(),Ki.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Ki.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,Ki.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{Ki.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),Ki.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&Se.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=Ki.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new qr(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return qr.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}}qr.NOWORK_ANIMATE_ATTR=Yr;class Kr extends qr{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 s;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!==(s=n.zIndex)&&void 0!==s?s:0}),this.layer=this,this.subLayers=new Map,this.theme=new Pn,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=>{Ki.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=>{Ki.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 Zr=Symbol.for("TransformUtil"),Jr=Symbol.for("GraphicUtil"),Qr=Symbol.for("LayerService"),to=Symbol.for("StaticLayerHandlerContribution"),eo=Symbol.for("DynamicLayerHandlerContribution"),io=Symbol.for("VirtualLayerHandlerContribution");var no,so=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},ro=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let oo=no=class{static GenerateLayerId(){return`${no.idprefix}_${no.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=Ki.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?cn.get(to):"dynamic"===t?cn.get(eo):cn.get(io),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 s=this.getLayerHandler(n),r=new Kr(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:n,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:no.GenerateLayerId(),layerHandler:s})),o=this.layerMap.get(t)||[];return o.push(r),this.layerMap.set(t,o),this.staticLayerCountInEnv--,r}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)}};oo.idprefix="visactor_layer",oo.prefix_count=0,oo=no=so([v(),ro("design:paramtypes",[])],oo);var ao=new o((t=>{t(z).to($).inSingletonScope(),t(bn).to(vn),t(Jr).to(An).inSingletonScope(),t(Zr).to(Sn).inSingletonScope(),t(Qr).to(oo).inSingletonScope()}));function ho(t,e){return!(!t&&!e)}function lo(t,e){let i;return i=ot(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function co(t,e,i){return i&&t*e>0}function uo(t,e){return t*e>0}const po=Symbol.for("AreaRenderContribution"),go=Symbol.for("GroupRenderContribution"),fo=Symbol.for("InteractiveSubRenderContribution");function mo(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 bo(t,e,i){const n=i[0],s=i[1],r=i[2];let o,a,h,l,c,d,u,p,g,f,m,b;return e===t?(t[12]=e[0]*n+e[4]*s+e[8]*r+e[12],t[13]=e[1]*n+e[5]*s+e[9]*r+e[13],t[14]=e[2]*n+e[6]*s+e[10]*r+e[14],t[15]=e[3]*n+e[7]*s+e[11]*r+e[15]):(o=e[0],a=e[1],h=e[2],l=e[3],c=e[4],d=e[5],u=e[6],p=e[7],g=e[8],f=e[9],m=e[10],b=e[11],t[0]=o,t[1]=a,t[2]=h,t[3]=l,t[4]=c,t[5]=d,t[6]=u,t[7]=p,t[8]=g,t[9]=f,t[10]=m,t[11]=b,t[12]=o*n+c*s+g*r+e[12],t[13]=a*n+d*s+f*r+e[13],t[14]=h*n+u*s+m*r+e[14],t[15]=l*n+p*s+b*r+e[15]),t}function yo(t,e,i){const n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],d=e[8],u=e[9],p=e[10],g=e[11],f=e[12],m=e[13],b=e[14],y=e[15];let v=i[0],x=i[1],w=i[2],_=i[3];return t[0]=v*n+x*a+w*d+_*f,t[1]=v*s+x*h+w*u+_*m,t[2]=v*r+x*l+w*p+_*b,t[3]=v*o+x*c+w*g+_*y,v=i[4],x=i[5],w=i[6],_=i[7],t[4]=v*n+x*a+w*d+_*f,t[5]=v*s+x*h+w*u+_*m,t[6]=v*r+x*l+w*p+_*b,t[7]=v*o+x*c+w*g+_*y,v=i[8],x=i[9],w=i[10],_=i[11],t[8]=v*n+x*a+w*d+_*f,t[9]=v*s+x*h+w*u+_*m,t[10]=v*r+x*l+w*p+_*b,t[11]=v*o+x*c+w*g+_*y,v=i[12],x=i[13],w=i[14],_=i[15],t[12]=v*n+x*a+w*d+_*f,t[13]=v*s+x*h+w*u+_*m,t[14]=v*r+x*l+w*p+_*b,t[15]=v*o+x*c+w*g+_*y,t}class vo{constructor(){this.pools=[]}static identity(t){return mo(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 vo.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 xo=new class{constructor(){this.pools=[]}allocate(t,e,i,n,s,r){if(!this.pools.length)return new Xt(t,e,i,n,s,r);const o=this.pools.pop();return o.a=t,o.b=e,o.c=i,o.d=n,o.e=s,o.f=r,o}allocateByObj(t){if(!this.pools.length)return new Xt(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=[]}},wo=new vo;var _o=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Ao=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Co=function(t,e){return function(i,n){e(i,n,t)}};function To(t,e,i){var n;const{x:s=i.x,y:r=i.y,z:o=i.z,dx:a=i.dx,dy:h=i.dy,dz:l=i.dz,scaleX:c=i.scaleX,scaleY:d=i.scaleY,scaleZ:u=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:f=i.angle,anchor3d:m=e.attribute.anchor,anchor:b}=e.attribute,y=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;y[0]=i.x1+(i.x2-i.x1)*t}else y[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;y[1]=i.x1+(i.x2-i.x1)*t}else y[1]=m[1];y[2]=null!==(n=m[2])&&void 0!==n?n:0}if(mo(t),bo(t,t,[s+a,r+h,o+l]),bo(t,t,[y[0],y[1],y[2]]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[4],o=e[5],a=e[6],h=e[7],l=e[8],c=e[9],d=e[10],u=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=r*s+l*n,t[5]=o*s+c*n,t[6]=a*s+d*n,t[7]=h*s+u*n,t[8]=l*s-r*n,t[9]=c*s-o*n,t[10]=d*s-a*n,t[11]=u*s-h*n}(t,t,g),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],o=e[1],a=e[2],h=e[3],l=e[8],c=e[9],d=e[10],u=e[11];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]=r*s-l*n,t[1]=o*s-c*n,t[2]=a*s-d*n,t[3]=h*s-u*n,t[8]=r*n+l*s,t[9]=o*n+c*s,t[10]=a*n+d*s,t[11]=h*n+u*s}(t,t,p),bo(t,t,[-y[0],-y[1],y[2]]),function(t,e,i){const n=i[0],s=i[1],r=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,d,u]),f){const i=wo.allocate(),n=[0,0];if(b){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=m[1]}bo(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],o=e[1],a=e[2],h=e[3],l=e[4],c=e[5],d=e[6],u=e[7];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]=r*s+l*n,t[1]=o*s+c*n,t[2]=a*s+d*n,t[3]=h*s+u*n,t[4]=l*s-r*n,t[5]=c*s-o*n,t[6]=d*s-a*n,t[7]=u*s-h*n}(i,i,f),bo(i,i,[-n[0],-n[1],0]),yo(t,t,i)}}let So=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 Vt,this.tempAABBBounds2=new Vt}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,s){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,s)}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 ae(t);return Ne(i.commandList,n,0,0),!0}updateHTMLTextAABBBounds(t,e,i,n){const{textAlign:s,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=at(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=function(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)}(r,e,e);i.set(i.x1,n,i.x2,n+e)}if(null!=t.forceBoundsWidth){const e=at(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=function(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}(s,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,s){if(!e.empty()){const{scaleX:s=i.scaleX,scaleY:r=i.scaleY,stroke:o=i.stroke,shadowBlur:a=i.shadowBlur,lineWidth:h=i.lineWidth,pickStrokeBuffer:l=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,d=this.tempAABBBounds1,u=this.tempAABBBounds2;if(o&&h){Ar(d,(h+l)/Math.abs(s+r),n,c),e.union(d),d.setValue(u.x1,u.y1,u.x2,u.y2)}if(a){const{shadowOffsetX:n=i.shadowOffsetX,shadowOffsetY:o=i.shadowOffsetY}=t;Ar(d,a/Math.abs(s+r)*2,!1,c+1),d.translate(n,o),e.union(d)}}if(this.combindShadowAABBBounds(e,s),e.empty())return;let r=!0;const o=s.transMatrix;s&&s.isContainer&&(r=!(1===o.a&&0===o.b&&0===o.c&&1===o.d&&0===o.e&&0===o.f)),r&&Gt(e,e,o)}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:s=e.visible}=t;return!(!n.valid||!s)||(i.empty()||(n.parent&&i.transformWithMatrix(n.parent.globalTransMatrix),Ki.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}}};So=_o([v(),Co(0,b(Dr)),Ao("design:paramtypes",[Object])],So);const Bo=["symbolType","size",...Hr];let Eo=class t extends Xr{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=Ir}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(){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]:1,n=null;try{n=new Path2D}catch(t){return null}const s=this.getParsedPath();if(!s)return null;s.draw(n,i,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return ot(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return On(this).symbol}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=Ki.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(n){const t=e.outerBorder,{distance:o=t.distance,lineWidth:a=t.lineWidth}=n;Ar(i,o+(s+a)/2,!0,r)}})(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,this.x1WithoutTransform=i.x1,this.y1WithoutTransform=i.y1;const{lineJoin:o=e.lineJoin}=t;return Ki.graphicService.transformAABBBounds(t,i,e,"miter"===o,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:n=e.size}=t;if(ot(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,Bo)}needUpdateTag(t){return super.needUpdateTag(t,Bo)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=ot(e)?e:[e,e];return t.path?(new Ti).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Ti).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};Eo.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Yr);const Mo=["width","x1","y1","height","cornerRadius",...Hr];class Ro extends Xr{constructor(t){super(t),this.type="rect",this.numberType=Or}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return On(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:n}=t;const{x1:s,y1:r,x:o,y:a}=t;e=null!=e?e:s-o,n=null!=n?n:r-a,(isFinite(e)||isFinite(n)||isFinite(o)||isFinite(a))&&i.set(0,0,e||0,n||0)}const{tb1:n,tb2:s}=Ki.graphicService.updateTempAABBBounds(i);return((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur}=t;if(n){const t=e.outerBorder,{distance:r=t.distance,lineWidth:o=t.lineWidth}=n;i.expand(r+(s+o)/2)}})(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Ki.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,Mo)}needUpdateTag(t){return super.needUpdateTag(t,Mo)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:n,height:s}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=it(t.width)?t.x1-t.x:t.width,i=it(t.height)?t.y1-t.y:t.height,n=0,s=0;return e<0?(n=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(s=i,i=-i):Number.isNaN(i)&&(i=0),{x:n,y:s,width:e,height:i}})(t),r=new Ti;return r.moveTo(e,i),r.rect(e,i,n,s),r}clone(){return new Ro(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ro.NOWORK_ANIMATE_ATTR}}function Po(t){return new Ro(t)}Ro.NOWORK_ANIMATE_ATTR=Yr;const Lo=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}};var Oo=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Io=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ko=function(t,e){return function(i,n){e(i,n,t)}};class Do{constructor(){this.time=Ie.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,o,a,h,l,c,d,u){var p;const{background:g,backgroundOpacity:f=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:h.backgroundOpacity),opacity:m=h.opacity,backgroundMode:b=h.backgroundMode,backgroundFit:y=h.backgroundFit,backgroundKeepAspectRatio:v=h.backgroundKeepAspectRatio,backgroundScale:x=h.backgroundScale,backgroundOffsetX:w=h.backgroundOffsetX,backgroundOffsetY:_=h.backgroundOffsetY,backgroundClip:A=h.backgroundClip}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const s=t.resources.get(g);if("success"!==s.state||!s.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=On(t.parent).group,{scrollX:n=i.scrollX,scrollY:s=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,s)}A&&e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,h),e.globalAlpha=f*m,this.doDrawImage(e,s.data,r,{backgroundMode:b,backgroundFit:y,backgroundKeepAspectRatio:v,backgroundScale:x,backgroundOffsetX:w,backgroundOffsetY:_}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.globalAlpha=f*m,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n){const{backgroundMode:s,backgroundFit:r,backgroundKeepAspectRatio:o,backgroundScale:a=1,backgroundOffsetX:h=0,backgroundOffsetY:l=0}=n,c=i.width(),d=i.height();let u=c,p=d;if("no-repeat"===s)if(r)if(o){const n=Math.max(c/e.width,d/e.height);t.drawImage(e,i.x1+h,i.y1+l,e.width*n*a,e.height*n*a)}else t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const n=e.width*a,s=e.height*a;t.drawImage(e,i.x1+h,i.y1+l,n,s)}else{if(r&&"repeat"!==s&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===s?(u=i*(d/n),p=d):"repeat-y"===s&&(p=n*(c/i),u=c);const r=t.dpr,o=gn.allocate({width:u,height:p,dpr:r}),a=o.getContext("2d");a&&(a.inuse=!0,a.clearMatrix(),a.setTransformForCurrent(!0),a.clearRect(0,0,u,p),a.drawImage(e,0,0,u,p),e=o.nativeCanvas),gn.free(o)}const n=t.dpr,o=t.createPattern(e,s);o.setTransform&&o.setTransform(new DOMMatrix([1/n,0,0,1/n,0,0])),t.fillStyle=o,t.translate(i.x1,i.y1),t.fillRect(0,0,c,d),t.translate(-i.x1,-i.y1)}}}const Fo=new Do;let No=class{constructor(t){this.subRenderContribitions=t,this.time=Ie.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,o,a,h,l,c,d,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,s,r,o,a,h,l,c,d,u)}))}};No=Oo([v(),ko(0,b(k)),ko(0,x(fo)),Io("design:paramtypes",[Object])],No);const Uo=new class{constructor(){this.time=Ie.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,o,a,h,l,c,d,u){var p,g;const{clipConfig:f}=t.attribute;if(!f)return;const m=t.getClipPath();if(!m)return;const b=!(c||d),y=t.AABBBounds,v=null!==(p=t.attribute.width)&&void 0!==p?p:y.width(),x=null!==(g=t.attribute.height)&&void 0!==g?g:y.height();b&&e.save(),e.beginPath(),!1===m.draw(e,[v,x],i+v/2,n+x/2,0)&&e.closePath(),c&&c(e,t.attribute,h,!0),b&&e.clip()}};const jo=new class{constructor(){this.time=Ie.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,o,a,h,l,c,d,u){const{clipConfig:p}=t.attribute;p&&t.getClipPath()&&(c||d||e.restore())}};class Ho{constructor(){this.time=Ie.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,i,n,s){const r=(t-2*e)/2,o=n.dpr,a=gn.allocate({width:t,height:t,dpr:o}),h=a.getContext("2d");if(!h)return null;h.inuse=!0,h.clearMatrix(),h.setTransformForCurrent(!0),h.clearRect(0,0,t,t),s(r,h);const l=n.createPattern(a.nativeCanvas,"repeat");return l.setTransform&&l.setTransform(new DOMMatrix([1/o,0,0,1/o,0,0])),gn.free(a),l}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,_t),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const s=t/2,r=s;n.fillStyle=i,n.moveTo(s,r-e),n.lineTo(e+s,r),n.lineTo(s,r+e),n.lineTo(s-e,r),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(r,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(0,r,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 s=t/2,r=-s;n.moveTo(s,r),n.lineTo(s+t,r+t),n.moveTo(-s,-r),n.lineTo(-s+t,-r+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 s=t/2,r=s;n.moveTo(t+s,r),n.lineTo(s,r+t),n.moveTo(t-s,-r),n.lineTo(-s,-r+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,t,t),n.fillRect(s+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,s,r,o,a,h,l,c,d,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:g=h.textureColor,textureSize:f=h.textureSize,texturePadding:m=h.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,h,g,f,m)}drawTexture(t,e,i,n,s,r,o,a,h){var l;const{textureRatio:c=r.textureRatio,textureOptions:d=null}=e.attribute;let u=this.textureMap.get(t);if(!u)switch(t){case"circle":u=this.createCirclePattern(a,h,o,i);break;case"diamond":u=this.createDiamondPattern(a,h,o,i);break;case"rect":u=this.createRectPattern(a,h,o,i);break;case"vertical-line":u=this.createVerticalLinePattern(a,h,o,i);break;case"horizontal-line":u=this.createHorizontalLinePattern(a,h,o,i);break;case"bias-lr":u=this.createBiasLRLinePattern(a,h,o,i);break;case"bias-rl":u=this.createBiasRLLinePattern(a,h,o,i);break;case"grid":u=this.createGridPattern(a,h,o,i)}if(d&&d.dynamicTexture){const{gridConfig:u={},useNewCanvas:p}=d,g=e.AABBBounds;n=g.x1,s=g.y1;const f=i;let m;if(p){m=gn.allocate({width:g.width(),height:g.height(),dpr:i.dpr});const t=m.getContext("2d");t.clearRect(0,0,g.width(),g.height()),n=0,s=0,i=t}if(f.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:i=0}=e.parent.attribute;f.setTransformFromMatrix(e.parent.globalTransMatrix),f.translate(t,i,!0)}f.setCommonStyle(e,e.attribute,n,s,r),f.clip();const b=g.width(),y=g.height(),v=h,x=a,w=u.columns?u.columns:Math.ceil(b/x),_=u.rows?u.rows:Math.ceil(y/x),A=u.gutterColumn?u.gutterColumn:2*v,C=u.gutterRow?u.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=new Eo({}));const T=u.columns?b/u.columns:x,S=u.rows?y/u.rows:x;this._tempSymbolGraphic.setAttributes({size:[T-A,S-C],symbolType:t});const B=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<_;t++)for(let r=0;r<w;r++){const a=n+x/2+r*x,h=s+x/2+t*x;null===(l=d.beforeDynamicTexture)||void 0===l||l.call(d,i,t,r,_,w,c,e,g.width(),g.height()),i.beginPath(),!1===B.draw(i,Math.min(T-A,S-C),a,h,0)&&i.closePath(),i.fillStyle=o,d.dynamicTexture(i,t,r,_,w,c,e,g.width(),g.height())}p&&(f.globalAlpha=1,f.drawImage(m.nativeCanvas,0,0,m.nativeCanvas.width,m.nativeCanvas.height,g.x1,g.y1,g.width()*f.dpr,g.height()*f.dpr)),f.restore()}else if(u)i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,s,r),i.fillStyle=u,i.fill(),i.highPerformanceRestore();else if("wave"===t){i.save(),i.setCommonStyle(e,e.attribute,n,s,r),i.clip();const t=e.AABBBounds;(function(t,e,i,n,s,r,o){const{fill:a="orange",percent:h=.6,frequency:l=4,opacity:c,phi:d=0}=s;let{amplitude:u=10}=s;u*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const p=n*(1-h),g=i,f=Math.max(Math.round(g/70),2);t.beginPath(),t.moveTo(0+r,n+o),t.lineTo(0+r,p+o);const m=g/l*e,b=g/Math.PI/(2*l);for(let e=0;e<g;e+=f){const i=u*Math.sin((e+m+d)/b+d);t.lineTo(e+r,p+i+o)}t.lineTo(g+r,n+o),t.closePath(),t.fillStyle=a,isFinite(c)&&(t.globalAlpha=c),t.fill()})(i,c,t.width(),t.height(),Object.assign(Object.assign({},d||{}),{fill:o}),n+t.x1-n,s+t.y1-s),i.restore()}}}new Ho;const zo=new class extends Do{constructor(){super(...arguments),this.time=Ie.beforeFillStroke}drawShape(t,e,i,n,s,r,o,a,h,l,c,d){const{background:u,backgroundMode:p=h.backgroundMode,backgroundFit:g=h.backgroundFit,backgroundKeepAspectRatio:f=h.backgroundKeepAspectRatio,backgroundScale:m=h.backgroundScale,backgroundOffsetX:b=h.backgroundOffsetX,backgroundOffsetY:y=h.backgroundOffsetY}=t.attribute;if(u)if(t.backgroundImg&&t.resources){const i=t.resources.get(u);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,{backgroundMode:p,backgroundFit:g,backgroundKeepAspectRatio:f,backgroundScale:m,backgroundOffsetX:b,backgroundOffsetY:y}),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=u,e.fill(),e.highPerformanceRestore()}},Go=vt/2;const Wo={x:0,y:0,z:0,lastModelMatrix:null};class Vo{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(Uo),this.builtinContributions.push(jo),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((t=>t.time===Ie.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Ie.afterFillStroke)))}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,i,n,s,r,o,a,h,l,c,d,u){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,s,r,o,a,h,l,c,d,u)}))}afterRenderStep(t,e,i,n,s,r,o,a,h,l,c,d,u){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,s,r,o,a,h,l,c,d,u)}))}drawPathProxy(t,e,i,n,s,r,o,a){if(!t.pathProxy)return!1;const h=On(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:l=h.fill,stroke:c=h.stroke,opacity:d=h.opacity,fillOpacity:u=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:g=h.strokeOpacity,visible:f=h.visible,x:m=h.x,y:b=h.y}=t.attribute,y=co(d,u,l),v=uo(d,g),x=ho(l),w=lo(c,p);if(!f)return!0;if(!x&&!w)return!0;if(!(y||v||o||a))return!0;e.beginPath();return Ne(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,x,w,y,v,h,s,o,a),w&&(a?a(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,i-m,n-b,h),e.stroke())),x&&(o?o(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,i-m,n-b,h),e.fill())),this.afterRenderStep(t,e,i,n,x,w,y,v,h,s,o,a),!0}valid(t,e,i,n){const{fill:s=e.fill,background:r,stroke:o=e.stroke,opacity:a=e.opacity,fillOpacity:h=e.fillOpacity,lineWidth:l=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:d=e.visible}=t.attribute,u=co(a,h,s),p=uo(a,c),g=ho(s,r),f=lo(o,l);return!(!t.valid||!d)&&!(!g&&!f)&&!!(u||p||i||n||r)&&{fVisible:u,sVisible:p,doFill:g,doStroke:f}}transform(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:s=e.x,y:r=e.y,z:o=e.z,scaleX:a=e.scaleX,scaleY:h=e.scaleY,angle:l=e.angle,postMatrix:c}=t.attribute,d=i.modelMatrix,u=i.camera;Wo.x=s,Wo.y=r,Wo.z=o,Wo.lastModelMatrix=d;const p=u&&(n||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!c:1===a&&1===h&&0===l&&!c;if(p){const n=wo.allocate(),s=wo.allocate();To(s,t,e),yo(n,d||n,s),Wo.x=0,Wo.y=0,Wo.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),wo.free(s)}if(g&&!d){const n=t.getOffsetXY(e);Wo.x+=n.x,Wo.y+=n.y,Wo.z=o,i.setTransformForCurrent()}else if(p)Wo.x=0,Wo.y=0,Wo.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const n=t.getOffsetXY(e);Wo.x+=n.x,Wo.y+=n.y,this.transformWithoutTranslate(i,Wo.x,Wo.y,Wo.z,a,h,l)}else i.transformFromMatrix(t.transMatrix,!0),Wo.x=0,Wo.y=0,Wo.z=0;return Wo}transformUseContext2d(t,e,i,n){const s=n.camera;if(this.camera=s,s){const e=t.AABBBounds,s=e.x2-e.x1,r=e.y2-e.y1,o=n.project(0,0,i),a=n.project(s,0,i),h=n.project(s,r,i),l={x:0,y:0},c={x:s,y:0},d={x:s,y:r};n.camera=null;const u=1/(l.x*(d.y-c.y)-c.x*d.y+d.x*c.y+(c.x-d.x)*l.y),p=-(l.y*(h.x-a.x)-c.y*h.x+d.y*a.x+(c.y-d.y)*o.x)*u,g=(c.y*h.y+l.y*(a.y-h.y)-d.y*a.y+(d.y-c.y)*o.y)*u,f=(l.x*(h.x-a.x)-c.x*h.x+d.x*a.x+(c.x-d.x)*o.x)*u,m=-(c.x*h.y+l.x*(a.y-h.y)-d.x*a.y+(d.x-c.x)*o.y)*u,b=(l.x*(d.y*a.x-c.y*h.x)+l.y*(c.x*h.x-d.x*a.x)+(d.x*c.y-c.x*d.y)*o.x)*u,y=(l.x*(d.y*a.y-c.y*h.y)+l.y*(c.x*h.y-d.x*a.y)+(d.x*c.y-c.x*d.y)*o.y)*u;n.setTransform(p,g,f,m,b,y,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,s,r,o){const a=t.project(e,i,n);t.translate(a.x,a.y,!1),t.scale(s,r,!1),t.rotate(o,!1),t.translate(-a.x,-a.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,s){const{context:r}=n;if(!r)return;const{renderable:o}=t.attribute;if(!1===o)return;r.highPerformanceSave();const a=this.transform(t,e,r,i),{x:h,y:l,z:c,lastModelMatrix:d}=a;this.z=c,this.drawPathProxy(t,r,h,l,n,s)||(this.drawShape(t,r,h,l,n,s),this.z=0,r.modelMatrix!==d&&wo.free(r.modelMatrix),r.modelMatrix=d),r.highPerformanceRestore()}}function Yo(t,e,i,n){if(!e.p1)return;const{offsetX:s=0,offsetY:r=0,offsetZ:o=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,r+e.p1.y,s+e.p2.x,r+e.p2.y,s+e.p3.x,r+e.p3.y,o):t.lineTo(s+e.p1.x,r+e.p1.y,o);else if(e.p2&&e.p3){const[n]=Ye(e,i);t.bezierCurveTo(s+n.p1.x,r+n.p1.y,s+n.p2.x,r+n.p2.y,s+n.p3.x,r+n.p3.y,o)}else{const n=e.getPointAt(i);t.lineTo(s+n.x,r+n.y,o)}}function Xo(t,e,i,n,s,r,o){var a;let h=e.p0,l=n;if(i&&i.originP1===i.originP2&&(h=i.p0),e.defined)n||(t.lineTo(h.x+s,h.y+r,o),l=!n);else{const{originP1:c,originP2:d}=e;let u;if(c&&!1!==c.defined&&!i?u=h:c&&!1!==d.defined&&(u=null!==(a=e.p3)&&void 0!==a?a:e.p1),n){l=!n;const i=u?u.x:e.p0.x,a=u?u.y:e.p0.y;t.moveTo(i+s,a+r,o)}else u&&(l=!n,t.lineTo(u.x+s,u.y+r,o))}return l}function $o(t,e,i,n,s){const{offsetX:r=0,offsetY:o=0,offsetZ:a=0,mode:h="none",drawConnect:l=!1}=s||{};if(l&&"none"===h)return;if(!e)return;let c=!0;const{curves:d}=e;if(i>=1){if(l){let e,i=!0;d.forEach(((n,s)=>{n.originP1!==n.originP2?(i=Xo(t,n,e,i,r,o,a),e=n):e=n}))}else d.forEach((e=>{e.defined?(c&&t.moveTo(e.p0.x+r,e.p0.y+o,a),Yo(t,e,1,s),c=!1):c=!0}));return}if(i<=0)return;let u;"x"===n?u=Le.ROW:"y"===n?u=Le.COLUMN:"auto"===n&&(u=e.direction);const p=i*e.tryUpdateLength(u);let g=0,f=!0,m=null;for(let e=0,i=d.length;e<i;e++){const i=d[e],n=i.getLength(u),h=(p-g)/n;if(g+=n,h<0)break;if(l){if(i.originP1===i.originP2){m=i;continue}f=Xo(t,i,m,f,r,o,a),m=i}else{if(!i.defined){c=!0;continue}c&&t.moveTo(i.p0.x+r,i.p0.y+o,a),Yo(t,i,Bt(h,1),s),c=!1}}}var qo=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};let Ko=class extends Vo{constructor(){super(...arguments),this.numberType=Lr}draw(t,e,i,n){const s=On(t,null==n?void 0:n.theme).line;this._draw(t,s,!1,i,n)}drawSegmentItem(t,e,i,n,s,r,o,a,h,l,c,d,u,p,g){var f;if(!e)return;t.beginPath();const m=null!==(f=this.z)&&void 0!==f?f:0;$o(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:d,offsetZ:m}),u.cache&&!ot(u.cache)&&u.cache.curves.every((t=>t.defined))&&u.attribute.curveType&&u.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,o,a);const{x:b=0,x:y=0}=o;return!1!==i&&(p?p(t,o,a):s&&(t.setCommonStyle(u,o,b-c,y-d,a),t.fill())),!1!==n&&(g?g(t,o,a):r&&(t.setStrokeStyle(u,o,b-c,y-d,a),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,n,s,r,o,a,h,l,c,d,u){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+o,m.y+a,g);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+o,i.y+a,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h);const{x:b=0,x:y=0}=t.attribute;!1!==i&&(d?d(e,t.attribute,h):s&&(e.setCommonStyle(t,t.attribute,b-o,y-a,h),e.fill())),!1!==n&&(u?u(e,t.attribute,h):r&&(e.setStrokeStyle(t,t.attribute,b-o,y-a,h),e.stroke()))}drawShape(t,e,i,n,s,r,o,a){const h=On(t,null==r?void 0:r.theme).line,{fill:l=h.fill,stroke:c=h.stroke,fillOpacity:d=h.fillOpacity,strokeOpacity:u=h.strokeOpacity,segments:p,points:g,closePath:f,curveTension:m=h.curveTension,connectedType:b=h.connectedType}=t.attribute;if(!this.valid(t,h,o,a))return;let{curveType:y=h.curveType}=t.attribute;f&&"linear"===y&&(y="linearClosed");const{clipRange:v=h.clipRange,clipRangeByDimension:x=h.clipRangeByDimension}=t.attribute;if(1===v&&!p&&!g.some((t=>!1===t.defined))&&"linear"===y)return this.drawLinearLineHighPerformance(t,e,!!l,!!c,d,u,i,n,h,s,r,o,a);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 s=Ci(w(t.points,b),y,{startPoint:e,curveTension:m});return n=s,s})).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=Ci(w(n,b),y,{curveTension:m})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===v){let r=!1;t.cache.forEach(((p,g)=>{r||(r=this.drawSegmentItem(e,p,!!l,!!c,d,u,s[g],[h,t.attribute],v,x,i,n,t,o,a))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=v*r;let g=0,f=!1;t.cache.forEach(((r,m)=>{if(f)return;const b=r.getLength(),y=(p-g)/b;g+=b,y>0&&(f=this.drawSegmentItem(e,r,!!l,!!c,d,u,s[m],[h,t.attribute],Bt(y,1),x,i,n,t,o,a))}))}}else this.drawSegmentItem(e,t.cache,!!l,!!c,d,u,t.attribute,h,v,x,i,n,t,o,a)}};function Zo(t,e,i,n){const{offsetX:s=0,offsetY:r=0,offsetZ:o=0}=n||{};let a=!0;e.forEach((e=>{e.defined?(a&&t.moveTo(e.p0.x+s,e.p0.y+r,o),Yo(t,e,1,n),a=!1):a=!0})),a=!0;for(let e=i.length-1;e>=0;e--){const h=i[e];h.defined?(a&&t.lineTo(h.p0.x+s,h.p0.y+r,o),Yo(t,h,1,n),a=!1):a=!0}t.closePath()}Ko=qo([v()],Ko);const Jo=new class extends Ho{constructor(){super(...arguments),this.time=Ie.afterFillStroke}drawShape(t,e,i,n,s,r,o,a,h,l,c,d,u){var p,g,f,m;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:b=t.attribute}=u||{},{texture:y=(null!==(p=t.attribute.texture)&&void 0!==p?p:Zn(h,"texture")),textureColor:v=(null!==(g=t.attribute.textureColor)&&void 0!==g?g:Zn(h,"textureColor")),textureSize:x=(null!==(f=t.attribute.textureSize)&&void 0!==f?f:Zn(h,"textureSize")),texturePadding:w=(null!==(m=t.attribute.texturePadding)&&void 0!==m?m:Zn(h,"texturePadding"))}=b;y&&this.drawTexture(y,t,e,i,n,h,v,x,w)}},Qo=Fo;var ta=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},ea=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ia=function(t,e){return function(i,n){e(i,n,t)}};let na=class extends Vo{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Rr,this.builtinContributions=[Jo,Qo],this.init(t)}drawLinearAreaHighPerformance(t,e,i,n,s,r,o,a,h,l,c,d,u){var p,g,f;const{points:m}=t.attribute;if(m.length<2)return;e.beginPath();const b=null!==(p=this.z)&&void 0!==p?p:0,y=m[0];e.moveTo(y.x+o,y.y+a,b);for(let t=1;t<m.length;t++){const i=m[t];e.lineTo(i.x+o,i.y+a,b)}for(let t=m.length-1;t>=0;t--){const i=m[t];e.lineTo((null!==(g=i.x1)&&void 0!==g?g:i.x)+o,(null!==(f=i.y1)&&void 0!==f?f:i.y)+a,b)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,o,a,!!s,!1,i,!1,h,l,d,null,{attribute:t.attribute});const{x:v=0,x:x=0}=t.attribute;!1!==i&&(d?d(e,t.attribute,h):s&&(e.setCommonStyle(t,t.attribute,v-o,x-a,h),e.fill())),this.afterRenderStep(t,e,o,a,!!s,!1,i,!1,h,l,d,null,{attribute:t.attribute}),(()=>{var i,s;if(n){const{stroke:n=h&&h.stroke}=t.attribute;if(ot(n)&&(n[0]||n[2])&&!1===n[1])if(e.beginPath(),n[0]){e.moveTo(y.x+o,y.y+a,b);for(let t=1;t<m.length;t++){const i=m[t];e.lineTo(i.x+o,i.y+a,b)}}else if(n[2]){const t=m[m.length-1];e.moveTo(t.x+o,t.y+a,b);for(let t=m.length-2;t>=0;t--){const n=m[t];e.lineTo((null!==(i=n.x1)&&void 0!==i?i:n.x)+o,(null!==(s=n.y1)&&void 0!==s?s:n.y)+a,b)}}u?u(e,t.attribute,h):(e.setStrokeStyle(t,t.attribute,v-o,x-a,h),e.stroke())}})()}drawShape(t,e,i,n,s,r,o,a){var h,l,c,d,u,p;const g=On(t,null==r?void 0:r.theme).area,{fill:f=g.fill,stroke:m=g.stroke,fillOpacity:b=g.fillOpacity,z:y=g.z,strokeOpacity:v=g.strokeOpacity,curveTension:x=g.curveTension,connectedType:w=g.connectedType}=t.attribute,_=this.valid(t,g,o,a);if(!_)return;const{doFill:A}=_,C=_.doStroke&&_.sVisible,{clipRange:T=g.clipRange,closePath:S,points:B,segments:E}=t.attribute;let{curveType:M=g.curveType}=t.attribute;function R(t,e){return"connect"!==e?t:t.filter((t=>!1!==t.defined))}if(S&&"linear"===M&&(M="linearClosed"),1===T&&!E&&!B.some((t=>!1===t.defined))&&"linear"===M)return this.drawLinearAreaHighPerformance(t,e,!!f,C,b,v,i,n,g,s,r,o,a);if(t.shouldUpdateShape()){if(E&&E.length){let e,i;const n=E.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 s=Ci(R(t.points,w),M,{startPoint:e,curveTension:x});return i=s,s})).filter((t=>!!t));let s;const r=[];for(let t=E.length-1;t>=0;t--){const e=E[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=E[t-1].points,n=e[e.length-1];n&&i.push({x:null!==(c=n.x1)&&void 0!==c?c:n.x,y:null!==(d=n.y1)&&void 0!==d?d:n.y})}i.length>1&&(s=Ci(R(i,w),"stepBefore"===M?"stepAfter":"stepAfter"===M?"stepBefore":M,{curveTension:x}),r.unshift(s))}t.cacheArea=r.map(((t,e)=>({top:n[e],bottom:t})))}else{if(!B||!B.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=R(B,w),i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(u=e[t].x1)&&void 0!==u?u:e[t].x,y:null!==(p=e[t].y1)&&void 0!==p?p:e[t].y});const n=Ci(e,M,{curveTension:x}),s=Ci(i,"stepBefore"===M?"stepAfter":"stepAfter"===M?"stepBefore":M,{curveTension:x});t.cacheArea={top:n,bottom:s}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===T){let h=!1;t.cacheArea.forEach(((l,c)=>{h||(h=this.drawSegmentItem(e,l,A,b,C,v,r[c],[g,t.attribute],T,i,n,y,t,s,o,a))}))}else{const h=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),l=T*h;let c=0,d=!1;t.cacheArea.forEach(((h,u)=>{if(d)return;const p=h.top.getLength(),f=(l-c)/p;c+=p,f>0&&(d=this.drawSegmentItem(e,h,A,b,C,v,r[u],[g,t.attribute],Bt(f,1),i,n,y,t,s,o,a))}))}}else this.drawSegmentItem(e,t.cacheArea,A,b,C,v,t.attribute,g,T,i,n,y,t,s,o,a)}draw(t,e,i,n){const s=On(t,null==n?void 0:n.theme).area;this._draw(t,s,!1,i,n)}drawSegmentItem(t,e,i,n,s,r,o,a,h,l,c,d,u,p,g,f){return this._drawSegmentItem(t,e,i,n,s,r,o,a,h,l,c,d,u,p,g,f)}_drawSegmentItem(t,e,i,n,s,r,o,a,h,l,c,d,u,p,g,f){if(!(e&&e.top&&e.bottom&&e.top.curves&&e.top.curves.length&&e.bottom.curves&&e.bottom.curves.length))return;t.beginPath();const{points:m,segments:b}=u.attribute;let y,v,x=Le.ROW;if(b){const t=b[b.length-1];v=b[0].points[0],y=t.points[t.points.length-1]}else v=m[0],y=m[m.length-1];const w=At(y.x-v.x),_=At(y.y-v.y);x=null==y.x1?Le.ROW:null==y.y1?Le.COLUMN:Number.isFinite(w+_)?w>_?Le.ROW:Le.COLUMN:Le.ROW,function(t,e,i,n){var s;const{top:r,bottom:o}=e;if(r.curves.length!==o.curves.length)return;if(i>=1){const e=[],i=[];let s=!0;for(let a=0,h=r.curves.length;a<h;a++){const l=r.curves[a];s!==l.defined?(s?(Zo(t,e,i,n),e.length=0,i.length=0):(e.push(l),i.push(o.curves[h-a-1])),s=!s):s&&(e.push(l),i.push(o.curves[h-a-1]))}return void Zo(t,e,i,n)}if(i<=0)return;let{direction:a}=n||{};const{curves:h}=r,l=null!==(s=h[h.length-1].p3)&&void 0!==s?s:h[h.length-1].p1,c=At(l.x-h[0].p0.x),d=At(l.y-h[0].p0.y);a=null!=a?a:c>d?Le.ROW:Le.COLUMN,Number.isFinite(c)||(a=Le.COLUMN),Number.isFinite(d)||(a=Le.ROW);const u=i*(a===Le.ROW?c:d);let p=0,g=!0;const f=[],m=[];for(let e=0,i=r.curves.length;e<i;e++){const s=r.curves[e],h=s.getLength(a),l=(u-p)/h;if(l<0)break;p+=h;let c=null,d=null;g!==s.defined?(g?(Zo(t,f,m,n),f.length=0,m.length=0):(c=s,d=o.curves[i-e-1]),g=!g):g&&(c=s,d=o.curves[i-e-1]),c&&d&&(l<1&&(c=c.p2&&c.p3?Ye(c,l)[0]:$e(c,l)[0],d=d.p2&&d.p3?Ye(d,1-l)[1]:$e(d,1-l)[1]),c.defined=g,d.defined=g,f.push(c),m.push(d)),c=null,d=null}Zo(t,f,m,n)}(t.camera?t:t.nativeContext,e,h,{offsetX:l,offsetY:c,offsetZ:d,direction:x}),this.beforeRenderStep(u,t,l,c,!!n,!1,i,!1,a,p,g,null,{attribute:o}),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,o,a);const{x:A=0,x:C=0}=o;return!1!==i&&(g?g(t,o,a):n&&(t.setCommonStyle(u,o,A-l,C-c,a),t.fill())),this.afterRenderStep(u,t,l,c,!!n,!1,i,!1,a,p,g,null,{attribute:o}),(()=>{if(!1!==s)if(f)f(t,o,a);else{const{stroke:i=a&&a[1]&&a[1].stroke}=o;ot(i)&&(i[0]||i[2])&&!1===i[1]&&(t.beginPath(),$o(t.camera?t:t.nativeContext,i[0]?e.top:e.bottom,h,x===Le.ROW?"x":"y",{offsetX:l,offsetY:c,offsetZ:d})),t.setStrokeStyle(u,o,A-l,C-c,a),t.stroke()}})(),!1}};na=ta([v(),ia(0,b(k)),ia(0,x(po)),ea("design:paramtypes",[Object])],na);const sa=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Vt)}allocate(t,e,i,n){if(!this.pools.length)return(new Vt).setValue(t,e,i,n);const s=this.pools.pop();return s.x1=t,s.y1=e,s.x2=i,s.y2=n,s}allocateByObj(t){if(!this.pools.length)return new Vt(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=[]}};var ra=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},oa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},aa=function(t,e){return function(i,n){e(i,n,t)}};let ha=class{constructor(t){this.groupRenderContribitions=t,this.numberType=Pr}reInit(){this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(zo)}drawShape(t,e,i,n,s,r,o,a){const h=On(t,null==r?void 0:r.theme).group,{fill:l=h.fill,background:c,stroke:d=h.stroke,opacity:u=h.opacity,width:p=h.width,height:g=h.height,clip:f=h.clip,fillOpacity:m=h.fillOpacity,strokeOpacity:b=h.strokeOpacity,cornerRadius:y=h.cornerRadius,path:v=h.path,lineWidth:x=h.lineWidth,visible:w=h.visible,fillStrokeOrder:_=h.fillStrokeOrder,cornerType:A=h.cornerType,x:C=h.x,y:T=h.y}=t.attribute,S=function(t,e,i,n,s){return s&&t*e>0&&0!==i&&0!==n}(u,m,p,g,l),B=function(t,e,i,n){return t*e>0&&0!==i&&0!==n}(u,b,p,g),E=ho(l,c),M=lo(d,x);if(!t.valid||!w)return;if(!f){if(!E&&!M)return;if(!(S||B||o||a||c))return}if(v&&v.length&&s.drawContribution){const t=e.disableFill,i=e.disableStroke,n=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,v.forEach((t=>{s.drawContribution.getRenderContribution(t).draw(t,s.renderService,s,r)})),e.disableFill=t,e.disableStroke=i,e.disableBeginPath=n}else 0===y||ot(y)&&y.every((t=>0===t))?(e.beginPath(),e.rect(i,n,p,g)):(e.beginPath(),function(t,e,i,n,s,r){let o,a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],h=arguments.length>7?arguments[7]:void 0;if(Array.isArray(a)&&(h=a,a=!0),n<0&&(e+=n,n=-n),s<0&&(i+=s,s=-s),at(r,!0))o=[r=At(r),r,r,r];else if(Array.isArray(r)){const t=r;let e,i;switch(t.length){case 0:o=[0,0,0,0];break;case 1:e=At(t[0]),o=[e,e,e,e];break;case 2:case 3:e=At(t[0]),i=At(t[1]),o=[e,i,e,i];break;default:o=t,o[0]=At(o[0]),o[1]=At(o[1]),o[2]=At(o[2]),o[3]=At(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,s);const[l,c,d,u]=[[e,i],[e+n,i],[e+n,i+s],[e,i+s]],p=Math.min(n/2,s/2),g=[Math.min(p,o[0]),Math.min(p,o[1]),Math.min(p,o[2]),Math.min(p,o[3])],f=[l[0]+g[0],l[1]],m=[l[0],l[1]+g[0]],b=[c[0]-g[1],c[1]],y=[c[0],c[1]+g[1]],v=[d[0]-g[2],d[1]],x=[d[0],d[1]-g[2]],w=[u[0]+g[3],u[1]],_=[u[0],u[1]-g[3]];if(t.moveTo(f[0],f[1]),a){if(h&&h[0]?h[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),!ut(b,y)){h&&h[0]&&t.moveTo(b[0],b[1]);const e=b[0],i=b[1]+g[1];t.arc(e,i,g[1],-Go,0,!1)}if(h&&h[1]?h[1](y[0],y[1],x[0],x[1]):t.lineTo(x[0],x[1]),!ut(v,x)){const e=x[0]-g[2],i=x[1];h&&h[1]&&t.moveTo(x[0],x[1]),t.arc(e,i,g[2],0,Go,!1)}if(h&&h[2]?h[2](v[0],v[1],w[0],w[1]):t.lineTo(w[0],w[1]),!ut(w,_)){const e=w[0],i=w[1]-g[3];h&&h[2]&&t.moveTo(w[0],w[1]),t.arc(e,i,g[3],Go,vt,!1)}if(h&&h[3]?h[3](_[0],_[1],m[0],m[1]):t.lineTo(m[0],m[1]),!ut(f,m)){const e=f[0],i=f[1]+g[0];h&&h[3]&&t.moveTo(m[0],m[1]),t.arc(e,i,g[0],vt,vt+Go,!1)}}else h&&h[0]?h[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),h&&h[1]?h[1](b[0],b[1],v[0],v[1]):t.lineTo(v[0],v[1]),h&&h[2]?h[2](v[0],v[1],w[0],w[1]):t.lineTo(w[0],w[1]),h&&h[2]?h[2](w[0],w[1],f[0],f[1]):t.lineTo(f[0],f[1]);!h&&t.closePath()}(e,i,n,p,g,y,"bevel"!==A));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(zo));const R={doFill:E,doStroke:M};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this._groupRenderContribitions.forEach((r=>{r.time===Ie.beforeFillStroke&&r.drawShape(t,e,i,n,E,M,S,B,h,s,o,a,R)})),f&&e.clip();const P=()=>{R.doFill&&(o?o(e,t.attribute,h):S&&(e.setCommonStyle(t,t.attribute,C-i,T-n,h),e.fill()))},L=()=>{R.doStroke&&(a?a(e,t.attribute,h):B&&(e.setStrokeStyle(t,t.attribute,C-i,T-n,h),e.stroke()))};_?(L(),P()):(P(),L()),this._groupRenderContribitions.forEach((r=>{r.time===Ie.afterFillStroke&&r.drawShape(t,e,i,n,E,M,S,B,h,s,o,a)}))}draw(t,e,i,n){const{context:s}=i;if(!s)return;const{clip:r,baseOpacity:o=1,drawMode:a,x:h,y:l,width:c,height:d}=t.attribute,u=s.nativeContext,p=s.canvas.nativeCanvas;if(a>0){const t=s.canvas,e=xh.createCanvas({width:t.width,height:t.height,dpr:1}),i=e.getContext("2d"),n=s.nativeContext.getTransform();i.setTransform(n.a,n.b,n.c,n.d,n.e,n.f),1===a&&(i.save(),i.clearRect(0,0,t.width,t.height),i.beginPath(),i.rect(h,l,c,d),i.clip(),i.drawImage(t.nativeCanvas,0,0,t.width,t.height,0,0,t.displayWidth,t.displayHeight),i.restore()),s.nativeContext=i,t.nativeCanvas=e}r?s.save():s.highPerformanceSave();const g=s.baseGlobalAlpha;s.baseGlobalAlpha*=o;const f=On(t,null==n?void 0:n.theme).group,m=s.modelMatrix;if(s.camera){const e=wo.allocate(),i=wo.allocate();To(i,t,f),yo(e,m||e,i),s.modelMatrix=e,wo.free(i),s.setTransform(1,0,0,1,0,0,!0)}else s.transformFromMatrix(t.transMatrix,!0);s.beginPath(),n.skipDraw?this.drawShape(t,s,0,0,i,n,(()=>!1),(()=>!1)):this.drawShape(t,s,0,0,i);const{scrollX:b=f.scrollX,scrollY:y=f.scrollY}=t.attribute;let v;if((b||y)&&s.translate(b,y),n&&n.drawingCb&&(v=n.drawingCb()),s.modelMatrix!==m&&wo.free(s.modelMatrix),s.modelMatrix=m,s.baseGlobalAlpha=g,a>0){const t=s.nativeContext,e=s.canvas.nativeCanvas;u.save(),u.setTransform(s.dpr,0,0,s.dpr,0,0,!0),1===a&&t.rect(h,l,c,d),u.drawImage(e,0,0,e.width,e.height,0,0,s.canvas.displayWidth,s.canvas.displayHeight);const i=t.getTransform();u.setTransform(i.a,i.b,i.c,i.d,i.e,i.f),s.nativeContext=u,s.canvas.nativeCanvas=p,u.restore()}v&&v.then?v.then((()=>{r?s.restore():s.highPerformanceRestore()})):r?s.restore():s.highPerformanceRestore()}};ha=ra([v(),aa(0,b(k)),aa(0,x(go)),oa("design:paramtypes",[Object])],ha);const la=Symbol.for("IncrementalDrawContribution"),ca=Symbol.for("GraphicRender"),da=Symbol.for("GroupRender"),ua=Symbol.for("DrawContribution"),pa=(t,e,i,n)=>{let s,r=!1,o=!1;if(e.forEachChildren((t=>(r=t.numberType===Mr,!r))),e.forEachChildren((t=>(o=!!t.findFace,!o))),r){const t=e.getChildren(),a=[...t];a.sort(((t,e)=>{var i,n,s,r;let o=(null!==(n=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==n?n:0)/2,a=(null!==(r=null!==(s=e.attribute.startAngle)&&void 0!==s?s:0+e.attribute.endAngle)&&void 0!==r?r:0)/2;for(;o<0;)o+=_t;for(;a<0;)a+=_t;return a-o})),a.forEach((t=>{t._next=null,t._prev=null})),e.removeAllChild(),e.update(),a.forEach((t=>{e.appendChild(t)})),n.hack_pieFace="outside",s=i(r,o),s&&s.graphic||(n.hack_pieFace="inside",s=i(r,o)),s&&s.graphic||(n.hack_pieFace="top",s=i(r,o)),e.removeAllChild(),t.forEach((t=>{t._next=null,t._prev=null})),t.forEach((t=>{e.appendChild(t)}))}else if(o){const n=e.getChildren(),a=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})));a.sort(((t,e)=>e.ave_z-t.ave_z)),e.removeAllChild(),a.forEach((t=>{t.g._next=null,t.g._prev=null})),e.update(),a.forEach((t=>{e.add(t.g)})),s=i(r,o),e.removeAllChild(),n.forEach((t=>{t._next=null,t._prev=null})),e.update(),n.forEach((t=>{e.add(t)}))}else s=i(r,o);return s};var ga=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},fa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const ma=Symbol.for("DrawItemInterceptor"),ba=new Vt,ya=new Vt;class va{constructor(){this.order=1}afterDrawItem(t,e,i,n,s){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,s),!1}beforeDrawItem(t,e,i,n,s){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,s),!1}drawItem(t,e,i,n,s){if(!t.shadowRoot)return!1;const{context:r}=i;if(r.highPerformanceSave(),r.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){ba.copy(n.dirtyBounds),ya.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,xo.allocate(1,0,0,1,0,0)),r.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&(n.dirtyBounds.copy(ba),n.backupDirtyBounds.copy(ya)),!0}}class xa{constructor(){this.order=1}afterDrawItem(t,e,i,n,s){return t.attribute._debug_bounds&&this.drawItem(t,e,i,n,s),!1}drawItem(t,e,i,n,s){if(!t.attribute._debug_bounds)return!1;const{context:r}=i;r.highPerformanceSave(),t.parent&&r.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&r.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const o=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(r,t),r.strokeRect(o.x1,o.y1,o.width(),o.height()),r.highPerformanceRestore(),!0}}let wa=class{constructor(){this.order=1,this.interceptors=[new va,new Aa,new _a,new xa]}afterDrawItem(t,e,i,n,s){for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].afterDrawItem&&this.interceptors[r].afterDrawItem(t,e,i,n,s))return!0;return!1}beforeDrawItem(t,e,i,n,s){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].beforeDrawItem&&this.interceptors[r].beforeDrawItem(t,e,i,n,s))return!0;return!1}};wa=ga([v(),fa("design:paramtypes",[])],wa);class _a{constructor(){this.order=1}beforeDrawItem(t,e,i,n,s){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,n,s):this.beforeSetInteractive(t,e,i,n,s))}beforeSetInteractive(t,e,i,n,s){let r=t.interactiveGraphic;if(t.attribute.globalZIndex){r||(r=t.clone(),t.interactiveGraphic=r,r.baseGraphic=t),r.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(r),!0}if(r){i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(r),t.interactiveGraphic=null,r.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,n,s){const r=t.baseGraphic;let o=!!r.stage,a=r.parent;for(;o&&a&&a.stage!==a;)o=!!a.stage,a=a.parent;if(!o){const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).removeChild(t),!0}if(r){this.processing=!0;const{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(r.parent.globalTransMatrix,!0),r.isContainer?n.renderGroup(r,i,r.parent.globalTransMatrix):n.renderItem(r,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=Lo.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class Aa{constructor(){this.order=1}beforeDrawItem(t,e,i,n,s){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:r,stage:o}=e.drawParams;r.canvas,r.save(),this.initCanvasCtx(r),r.camera=o.camera;const a=r.currentMatrix;a.a/=r.dpr,a.b/=r.dpr,a.c/=r.dpr,a.d/=r.dpr,a.e/=r.dpr,a.f/=r.dpr;const h=wo.allocate();var l,c;c=a,(l=h)[0]=c.a,l[1]=c.b,l[2]=0,l[3]=0,l[4]=c.c,l[5]=c.d,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=1,l[11]=0,l[12]=c.e,l[13]=c.f,l[14]=0,l[15]=1;const d=r.modelMatrix;if(d){if(h){const t=wo.allocate();r.modelMatrix=yo(t,d,h)}}else r.modelMatrix=h;return r.setTransform(1,0,0,1,0,0,!0),t.isContainer?pa(r,t,((e,s)=>n.renderGroup(t,i,t.parent.globalTransMatrix,!e&&s)),i):n.renderItem(t,i),r.camera=null,r.restore(),r.modelMatrix!==d&&wo.free(r.modelMatrix),r.modelMatrix=d,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var Ca=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Ta=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sa=function(t,e){return function(i,n){e(i,n,t)}};const Ba=Symbol.for("RenderService");let Ea=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))}reInit(){this.drawContribution.reInit()}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}};Ea=Ca([v(),Sa(0,b(ua)),Ta("design:paramtypes",[Object])],Ea);var Ma=new o((t=>{t(Ba).to(Ea)}));const Ra=Symbol.for("PickerService"),Pa=Symbol.for("GlobalPickerService"),La=Symbol.for("PickItemInterceptor"),Oa=Symbol.for("PickServiceInterceptor");var Ia=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};let ka=class{constructor(){this.order=1}afterPickItem(t,e,i,n,s){if(t.graphic){let e=t.graphic;for(;e.parent;)e=e.parent;e.shadowHost&&(t.params={shadowTarget:t.graphic},t.graphic=e.shadowHost)}return t}};ka=Ia([v()],ka);let Da=class{constructor(){this.order=1}afterPickItem(t,e,i,n,s){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,s):null}beforePickItem(t,e,i,n,s){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,s):null}_pickItem(t,e,i,n,s){var r;if(!t.shadowRoot)return null;const{parentMatrix:o}=s||{};if(!o)return null;const a=e.pickContext;a.highPerformanceSave();const h=null===(r=On(t))||void 0===r?void 0:r[t.type],{shadowPickMode:l=(null==h?void 0:h.shadowPickMode)}=t.attribute,c=t.shadowRoot,d=xo.allocateByObj(o),u=new Pt(d.a*i.x+d.c*i.y+d.e,d.b*i.x+d.d*i.y+d.f),p=e.pickGroup(c,u,d,n);return a.highPerformanceRestore(),!p.graphic&&p.group&&"full"===l&&(p.graphic=p.group),p}};Da=Ia([v()],Da);let Fa=class{constructor(){this.order=1}beforePickItem(t,e,i,n,s){const r=t.baseGraphic;if(r&&r.parent){const t=new Pt(i.x,i.y),s=e.pickContext;s.highPerformanceSave();const o=r.parent.globalTransMatrix;o.transformPoint(t,t);const a=r.isContainer?e.pickGroup(r,t.clone(),o,n):e.pickItem(r,t.clone(),o,n);return s.highPerformanceRestore(),a}return null}};Fa=Ia([v()],Fa);let Na=class{constructor(){this.order=1}beforePickItem(t,e,i,n,s){if(!t.in3dMode||n.in3dInterceptor)return null;const r=e.pickContext,o=t.stage;if(!r||!o)return null;if(n.in3dInterceptor=!0,r.save(),this.initCanvasCtx(r),r.camera=o.camera,t.isContainer){const o=pa(r,t,(()=>e.pickGroup(t,i,s.parentMatrix,n)),n);return r.camera=null,n.in3dInterceptor=!1,r.restore(),o}return r.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};Na=Ia([v()],Na);var Ua=new o(((t,e,i)=>{i(Ra)||(t(Pa).toSelf(),t(Ra).toService(Pa)),t(Na).toSelf().inSingletonScope(),t(La).toService(Na),t(Da).toSelf().inSingletonScope(),t(La).toService(Da),t(Fa).toSelf().inSingletonScope(),t(La).toService(Fa),F(t,La),t(ka).toSelf().inSingletonScope(),t(Oa).toService(ka),F(t,Oa)})),ja=new o((t=>{t(kr).to(So).inSingletonScope(),t(Dr).toConstantValue(Lo)}));const Ha=Symbol.for("AutoEnablePlugins"),za=Symbol.for("PluginService");var Ga=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Wa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Va=function(t,e){return function(i,n){e(i,n,t)}};let Ya=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&&cn.isBound(Ha)&&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=[]}};Ya=Ga([v(),Va(0,b(k)),Va(0,x(Ha)),Wa("design:paramtypes",[Object])],Ya);var Xa=new o((t=>{t(za).to(Ya),function(t,e){t(k).toDynamicValue((t=>{let{container:i}=t;return new D(e,i)})).whenTargetNamed(e)}(t,Ha)})),$a=new o((t=>{F(t,H)})),qa=new o((t=>{t(hn).to(ln).inSingletonScope(),F(t,hn)})),Ka=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Za=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ja=class{constructor(){this.type="static",this.offscreen=!1,this.global=Ki.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,s=un({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});s.applyPosition(),this.canvas=s,this.context=s.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 s=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:s},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};Ja=Ka([v(),Za("design:paramtypes",[])],Ja);var Qa=new o((t=>{t(Ja).toSelf(),t(to).toService(Ja)}));var th=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};function eh(t,e,i){const n={},s=[];return t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;n[i]?n[i].push(t):(n[i]=[t],s.push(i))}),i),s.sort(((t,e)=>i?e-t:t-e)),{childMap:n,zIdxArray:s}}function ih(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return th(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,n)}))}function nh(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(void 0!==n)return s=!0,!0;return!1}),n);let r=null,o=!1;if(s){const{childMap:s,zIdxArray:a}=eh(t,i,n);let h=!1;for(let t=0;t<a.length&&!h;t++){const i=s[a[t]];for(let t=0;t<i.length;t++){if(o){h=!0,r=i[t];break}i[t]._uid!==e||(o=!0)}}}else t.forEachChildren((t=>o?(r=t,!0):(t._uid===e&&(o=!0),!1)),n);return r}var sh=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},rh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},oh=function(t,e){return function(i,n){e(i,n,t)}};let ah=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 Wt,this.backupDirtyBounds=new Wt,this.global=Ki.global,this.layerService=Ki.layerService,ot(this.contributions)||(this.contributions=[this.contributions]),this.init()}reInit(){this.init(),this.contributions.forEach((t=>{t.reInit()}))}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:s,transMatrix:r}=e;if(!i)return;const o=this.dirtyBounds.setValue(0,0,s.width(),s.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:s,y11:r,y12:o,x21:a,x22:h,y21:l,y22:c}=kt(t,e,i);return n>=h||s<=a||r>=c||o<=l?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(n,a),y1:Math.max(r,l),x2:Math.min(s,h),y2:Math.min(o,c)}}(o,n.dirtyBounds,!1);o.x1=Math.floor(t.x1),o.y1=Math.floor(t.y1),o.x2=Math.ceil(t.x2),o.y2=Math.ceil(t.y2)}const a=i.dpr%1;(a||.5!==a)&&(o.x1=Math.floor(o.x1*i.dpr)/i.dpr,o.y1=Math.floor(o.y1*i.dpr)/i.dpr,o.x2=Math.ceil(o.x2*i.dpr)/i.dpr,o.y2=Math.ceil(o.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(o),i.inuse=!0,i.setClearMatrix(r.a,r.b,r.c,r.d,r.e,r.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(s.x1,s.y1,!0),i.beginPath(),i.rect(o.x1,o.y1,o.width(),o.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:Ii.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Ii.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,e,xo.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=nh(e,i,Ii.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&&!Dt(t.AABBBounds,this.dirtyBounds,!1)&&"empty"!==t.attribute.boundsMode)return;let s,r=i;if(this.useDirtyBounds){s=sa.allocateByObj(this.dirtyBounds);const e=t.transMatrix;r=xo.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r.getInverse())}this.renderItem(t,e,{drawingCb:()=>{var i;n?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))})):function(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=!1;if(s)r=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:s=e}=t.attribute;if(0===n)i=s;else if(i!==s)return r=!0,!0;return!1}),n)}if(r){const{childMap:r,zIdxArray:o}=eh(t,e,n);let a=!1;for(let t=0;t<o.length&&!a;t++){const e=r[o[t]];s&&e.sort(((t,e)=>{var i,s;return(n?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(s=t.attribute.z)&&void 0!==s?s:0))}));for(let t=0;t<e.length;t++)if(i(e[t],t)){a=!0;break}}}else t.forEachChildren(i,n)}(t,Ii.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(s),sa.free(s),xo.free(r))}_increaseRender(t,e){const{layer:i,stage:n}=e,{subLayers:s}=i;let r=s.get(t._uid);r||(r={layer:this.layerService.createLayer(n),zIndex:s.size,group:t},s.set(t._uid,r));const o=r.layer.getNativeHandler().getContext(),a=r.drawContribution||cn.get(la);a.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:r.layer,context:o,startAtId:t._uid,break:!1})),r.drawContribution=a;const h=this._findNextGraphic(t);if(h)if(h.isContainer&&h.incremental)this._increaseRender(h,e);else{let t=s.get(h._uid);t||(t={layer:this.layerService.createLayer(n),zIndex:s.size},s.set(h._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,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 s=this.InterceptorContributions[n];if(s.beforeDrawItem&&s.beforeDrawItem(t,this.currentRenderService,e,this,i))return}const n=this.getRenderContribution(t);if(!n)return;let s,r=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)&&(r=!0,this.scrollMatrix||(this.scrollMatrix=xo.allocate(1,0,0,1,0,0)),this.scrollMatrix.translate(-e,-i))}if(r&&(s=this.dirtyBounds.clone().transformWithMatrix(this.scrollMatrix)),this.useDirtyBounds&&!t.isContainer&&"empty"!==t.attribute.boundsMode&&!Dt(t.AABBBounds,null!=s?s:this.dirtyBounds,!1)){if(r&&t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;this.scrollMatrix&&this.scrollMatrix.translate(e,i)}return}const o=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=o),o?t.isContainer&&n.draw(t,this.currentRenderService,e,i):n.draw(t,this.currentRenderService,e,i),r&&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 mt.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,s;const{clear:r,viewBox:o}=i,a=o.width(),h=o.height();if(r){e.clearRect(0,0,a,h);const i=null===(n=t.drawParams)||void 0===n?void 0:n.stage;if(i&&(e.globalAlpha=null!==(s=i.attribute.opacity)&&void 0!==s?s:1),i&&i.backgroundImg&&i.resources){const t=i.resources.get(r);t&&"success"===t.state&&t.data&&e.drawImage(t.data,0,0,a,h)}else e.fillStyle=Qi(e,r,{AABBBounds:{x1:0,y1:0,x2:0+a,y2:0+h}},0,0),e.fillRect(0,0,a,h)}}afterDraw(t,e){}};ah=sh([v(),oh(0,y(ca)),oh(1,b(k)),oh(1,x(ma)),rh("design:paramtypes",[Array,Object])],ah);var hh=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};let lh=class extends Ko{constructor(){super(...arguments),this.numberType=Lr}drawShape(t,e,i,n,s,r,o,a){if(t.incremental&&s.multiGraphicOptions){const{startAtIdx:e,length:r}=s.multiGraphicOptions,{segments:h=[]}=t.attribute;if(e>h.length)return;const l=On(t).line,{fill:c=l.fill,stroke:d=l.stroke,opacity:u=l.opacity,fillOpacity:p=l.fillOpacity,strokeOpacity:g=l.strokeOpacity,lineWidth:f=l.lineWidth,visible:m=l.visible}=t.attribute,b=co(u,p,c),y=uo(u,g),v=ho(c),x=lo(d,f);if(!t.valid||!m)return;if(!v&&!x)return;if(!(b||y||o||a))return;const{context:w}=s;for(let s=e;s<e+r;s++)this.drawIncreaseSegment(t,w,h[s-1],h[s],t.attribute.segments[s],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,s,r,o,a)}drawIncreaseSegment(t,e,i,n,s,r,o,a){n&&(e.beginPath(),function(t,e,i,n){const{offsetX:s=0,offsetY:r=0}=n||{},o=e?e.points[e.points.length-1]:i.points[0];t.moveTo(o.x+s,o.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+s,e.y+r):t.moveTo(e.x+s,e.y+r)}))}(e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,s,r),e.setStrokeStyle(t,s,o,a,r),e.stroke())}};lh=hh([v()],lh);var ch=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};let dh=class extends na{constructor(){super(...arguments),this.numberType=Rr}drawShape(t,e,i,n,s,r,o){if(t.incremental&&s.multiGraphicOptions){const{startAtIdx:r,length:a}=s.multiGraphicOptions,{segments:h=[]}=t.attribute;if(r>h.length)return;const l=On(t).area,{fill:c=l.fill,fillOpacity:d=l.fillOpacity,opacity:u=l.opacity,visible:p=l.visible}=t.attribute,g=co(u,d,c),f=ho(c);if(!t.valid||!p)return;if(!f)return;if(!g&&!o)return;for(let s=r;s<r+a;s++)this.drawIncreaseSegment(t,e,h[s-1],h[s],t.attribute.segments[s],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,s,r,o)}drawIncreaseSegment(t,e,i,n,s,r,o,a){n&&(e.beginPath(),function(t,e,i,n){const{offsetX:s=0,offsetY:r=0}=n||{},{points:o}=i,a=[];for(let t=0;t<o.length;t++)o[t].defined;a.push(o),a.forEach(((i,n)=>{var o,a,h,l;const c=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(c.x+s,c.y+r),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+s,e.y+r):t.moveTo(e.x+s,e.y+r)}));for(let e=i.length-1;e>=0;e--){const n=i[e];t.lineTo(null!==(o=n.x1)&&void 0!==o?o:n.x,null!==(a=n.y1)&&void 0!==a?a: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()}))}(e.camera?e:e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,s,r),e.setCommonStyle(t,s,o,a,r),e.fill())}};dh=ch([v()],dh);var uh,ph=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},gh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fh=function(t,e){return function(i,n){e(i,n,t)}},mh=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(uh||(uh={}));let bh=class extends ah{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=uh.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 mh(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:s}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(s.x1,s.y1,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Ii.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Ii.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 mh(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return mh(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>mh(this,void 0,void 0,(function*(){if(2!==t.count)yield ih(t,Ii.zIndex,((i,n)=>{if(this.status===uh.STOP)return!0;if(i.isContainer)return!1;if(n<this.currentIdx)return!1;const s=this.currFrameStartAt+t.incremental;return n<s&&(this.currentIdx=n+1,this.renderItem(i,e)),n===s-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 mh(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return mh(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return mh(this,void 0,void 0,(function*(){this.rendering&&(this.status=uh.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=uh.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 mh(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:()=>mh(this,void 0,void 0,(function*(){yield ih(t,Ii.zIndex,(t=>mh(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};bh=ph([v(),fh(0,y(ca)),fh(1,b(lh)),fh(2,b(dh)),fh(3,b(k)),fh(3,x(ma)),gh("design:paramtypes",[Array,Object,Object,Object])],bh);var yh=new o((t=>{t(Do).toSelf().inSingletonScope(),t(Ho).toSelf().inSingletonScope(),t(ua).to(ah),t(la).to(bh),t(da).to(ha).inSingletonScope(),t(ca).toService(da),F(t,go),t(No).toSelf().inSingletonScope(),F(t,fo),F(t,ca),t(wa).toSelf().inSingletonScope(),t(ma).toService(wa),F(t,ma)}));function vh(){vh.__loaded||(vh.__loaded=!0,cn.load(ao),cn.load(ja),cn.load(Ma),cn.load(Ua),cn.load(Xa),function(t){t.load($a),t.load(qa),t.load(Qa)}(cn),function(t){t.load(yh)}(cn))}vh.__loaded=!1,vh();const xh=cn.get(z);Ki.global=xh;const wh=cn.get(Jr);Ki.graphicUtil=wh;const _h=cn.get(Zr);Ki.transformUtil=_h;const Ah=cn.get(kr);Ki.graphicService=Ah;const Ch=cn.get(Qr);function Th(t,e,i,n){return t=>{if(!(t instanceof MouseEvent||t instanceof TouchEvent||t instanceof PointerEvent))return t;const s=e();if(1===(r=s).a&&0===r.b&&0===r.c&&1===r.d&&0===r.e&&0===r.f)return t;var r;const o=i(),a=new t.constructor(t.type,t);if(Object.defineProperties(a,{target:{value:t.target},currentTarget:{value:t.currentTarget}}),t instanceof MouseEvent||t instanceof PointerEvent)n(t.clientX,t.clientY,s,o,a);else if(t instanceof TouchEvent){if(t.touches.length>0){const t=a.touches[0];n(t.clientX,t.clientY,s,o,t)}if(t.changedTouches.length>0){const t=a.changedTouches[0];n(t.clientX,t.clientY,s,o,t)}}return a}}function Sh(t,e,i,n,s){const r=Th(0,i,n,s);t.setEventListenerTransformer(r)}function Bh(t,e,i,n,s){const r=Th(0,i,n,s);t.setEventListenerTransformer(r)}function Eh(t,e,i,n,s){const r={x:t,y:e};i.transformPoint(r,r),Object.defineProperties(s,{_canvasX:{value:r.x},_canvasY:{value:r.y}})}function Mh(t){var e;if(pn(t._canvasX)&&pn(t._canvasY))return{x:t._canvasX,y:t._canvasY};if(t.changedTouches){const i=null!==(e=t.changedTouches[0])&&void 0!==e?e:{};return{x:i._canvasX,y:i._canvasY}}return{x:t._canvasX||0,y:t._canvasY||0}}function Rh(t,e){var i,n,s,r,o,a,h,l;return!t&&!e||!(!t||!e)&&(null===(i=t.start)||void 0===i?void 0:i.col)===(null===(n=e.start)||void 0===n?void 0:n.col)&&(null===(s=t.start)||void 0===s?void 0:s.row)===(null===(r=e.start)||void 0===r?void 0:r.row)&&(null===(o=t.end)||void 0===o?void 0:o.col)===(null===(a=e.end)||void 0===a?void 0:a.col)&&(null===(h=t.end)||void 0===h?void 0:h.row)===(null===(l=e.end)||void 0===l?void 0:l.row)}Ki.layerService=Ch;const Ph="undefined"==typeof window||void 0===window.window;function Lh(t,e,i){return t.start.col<=e&&e<=t.end.col&&t.start.row<=i&&i<=t.end.row||t.end.col<=e&&e<=t.start.col&&t.end.row<=i&&i<=t.start.row||t.end.col<=e&&e<=t.start.col&&t.start.row<=i&&i<=t.end.row||t.start.col<=e&&e<=t.end.col&&t.end.row<=i&&i<=t.start.row}!function(){if(Ph)return{IE:!1,Edge:!1,Chrome:!1,Firefox:!1,Safari:!1};const t=window.navigator.userAgent.toLowerCase();/(msie|trident)/.exec(t),t.indexOf("edge"),t.indexOf("chrome")>-1&&t.indexOf("edge"),t.indexOf("firefox"),t.indexOf("safari")>-1&&t.indexOf("edge")}();function Oh(t,e){return void 0===t&&void 0===e||void 0!==t&&void 0!==e&&(t.start.col===e.start.col&&t.start.row===e.start.row&&t.end.col===e.end.col&&t.end.row===e.end.row)}function Ih(t,e){return void 0===t&&void 0===e||void 0!==t&&void 0!==e&&(t.start.col===e.start.col&&t.start.row===e.start.row&&t.end.col===e.end.col&&t.end.row===e.end.row)}function kh(t){return Math.floor(t)===t}function Dh(t){this.rotateDegree=90;const e=Math.min(t.clientWidth,t.clientHeight)/2,i=this.getElement().getBoundingClientRect(),n=i.left,s=i.top,r=i.right,o=i.bottom;t.style.transform="rotate(90deg)",t.style.transformOrigin=`${e}px ${e}px`;const a=()=>({x1:n,y1:s,x2:r,y2:o}),h=()=>{const i=t.getBoundingClientRect(),n=this.getElement().getBoundingClientRect(),s=n.top,r=i.width-n.right,o=xo.allocate(1,0,0,1,0,0);o.translate(s,r);const a=e-s,h=e-r;return o.translate(a,h),o.rotate(Math.PI/2),o.translate(-a,-h),o};Bh(xh,this.getElement(),h,a,Eh),Sh(this.scenegraph.stage.window,this.getElement(),h,a,Eh),this.vglobal_mapToCanvasPoint=xh.mapToCanvasPoint,xh.mapToCanvasPoint=Mh}function Fh(t){this.rotateDegree=0,t.style.transform="none",t.style.transformOrigin="none";const e=this.getElement().getBoundingClientRect(),i=e.left,n=e.top,s=e.right,r=e.bottom,o=()=>({x1:i,y1:n,x2:s,y2:r}),a=()=>{const t=xo.allocate(1,0,0,1,0,0);return t.translate(i,n),t};Bh(xh,this.getElement(),a,o,Eh),Sh(this.scenegraph.stage.window,this.getElement(),a,o,Eh),xh.mapToCanvasPoint=this.vglobal_mapToCanvasPoint}t.AddRowColumnPlugin=class{id="add-row-column";runTime=[n.TABLE_EVENT_TYPE.MOUSEENTER_CELL,n.TABLE_EVENT_TYPE.MOUSELEAVE_CELL,n.TABLE_EVENT_TYPE.MOUSELEAVE_TABLE];pluginOptions;table;hoverCell;hideAllTimeoutId_addColumn;hideAllTimeoutId_addRow;leftDotForAddColumn;rightDotForAddColumn;addIconForAddColumn;addLineForAddColumn;topDotForAddRow;bottomDotForAddRow;addIconForAddRow;addLineForAddRow;constructor(t={addColumnEnable:!0,addRowEnable:!0}){this.pluginOptions=t,this.pluginOptions.addColumnEnable=this.pluginOptions.addColumnEnable??!0,this.pluginOptions.addRowEnable=this.pluginOptions.addRowEnable??!0,this.pluginOptions.addColumnEnable&&(this.initAddColumnDomElement(),this.bindEventForAddColumn()),this.pluginOptions.addRowEnable&&(this.initAddRowDomElement(),this.bindEventForAddRow())}run(...t){const e=t[0],i=t[1],s=t[2];if(this.table=s,i===n.TABLE_EVENT_TYPE.MOUSEENTER_CELL){clearTimeout(this.hideAllTimeoutId_addColumn),clearTimeout(this.hideAllTimeoutId_addRow);const t=s.canvas.getBoundingClientRect(),i=s.getCellAtRelativePosition(e.event.clientX-t.left,e.event.clientY-t.top);this.hoverCell=i;const n=s.getCellRelativeRect(i.col,i.row);if(this.pluginOptions.addColumnEnable){const e=s.isSeriesNumber(i.col,0);this.showDotForAddColumn(t.top-6,n.left+t.left,n.right+t.left,!e)}if(this.pluginOptions.addRowEnable){const e=s.isHeader(i.col,i.row);this.showDotForAddRow(n.top+t.top,t.left-6,n.bottom+t.top,!e,!e)}}else i===n.TABLE_EVENT_TYPE.MOUSELEAVE_CELL||i===n.TABLE_EVENT_TYPE.MOUSELEAVE_TABLE&&(this.pluginOptions.addColumnEnable&&this.delayHideAllForAddColumn(),this.pluginOptions.addRowEnable&&this.delayHideAllForAddRow())}initAddColumnDomElement(){this.leftDotForAddColumn=document.createElement("div"),this.leftDotForAddColumn.style.width="6px",this.leftDotForAddColumn.style.height="6px",this.leftDotForAddColumn.style.backgroundColor="#4A90E2",this.leftDotForAddColumn.style.position="absolute",this.leftDotForAddColumn.style.cursor="pointer",this.leftDotForAddColumn.style.zIndex="1000",this.leftDotForAddColumn.style.borderRadius="50%",this.leftDotForAddColumn.style.border="1px solid white",this.leftDotForAddColumn.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.leftDotForAddColumn),this.rightDotForAddColumn=document.createElement("div"),this.rightDotForAddColumn.style.width="6px",this.rightDotForAddColumn.style.height="6px",this.rightDotForAddColumn.style.backgroundColor="#4A90E2",this.rightDotForAddColumn.style.position="absolute",this.rightDotForAddColumn.style.cursor="pointer",this.rightDotForAddColumn.style.zIndex="1000",this.rightDotForAddColumn.style.borderRadius="50%",this.rightDotForAddColumn.style.border="1px solid white",this.rightDotForAddColumn.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.rightDotForAddColumn),this.addIconForAddColumn=document.createElement("div"),this.addIconForAddColumn.style.width="18px",this.addIconForAddColumn.style.height="18px",this.addIconForAddColumn.style.backgroundColor="#4A90E2",this.addIconForAddColumn.style.position="absolute",this.addIconForAddColumn.style.zIndex="1001",this.addIconForAddColumn.style.display="none",this.addIconForAddColumn.style.borderRadius="50%",this.addIconForAddColumn.style.boxShadow="0 2px 5px rgba(0,0,0,0.2)",this.addIconForAddColumn.style.display="flex",this.addIconForAddColumn.style.justifyContent="center",this.addIconForAddColumn.style.alignItems="center",this.addIconForAddColumn.style.border="1px solid white",document.body.appendChild(this.addIconForAddColumn);const t=document.createElement("div");t.textContent="+",t.style.color="white",t.style.fontSize="18px",t.style.fontWeight="bold",t.style.lineHeight="15px",t.style.userSelect="none",t.style.cursor="pointer",t.style.verticalAlign="top",t.style.textAlign="center",this.addIconForAddColumn.appendChild(t),this.addLineForAddColumn=document.createElement("div"),this.addLineForAddColumn.style.width="2px",this.addLineForAddColumn.style.height="10px",this.addLineForAddColumn.style.backgroundColor="#4A90E2",this.addLineForAddColumn.style.position="absolute",this.addLineForAddColumn.style.zIndex="1001",this.addLineForAddColumn.style.display="none",document.body.appendChild(this.addLineForAddColumn)}bindEventForAddColumn(){this.leftDotForAddColumn.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addColumn),this.addIconForAddColumn.style.display="block";const t=this.leftDotForAddColumn.offsetWidth,e=this.leftDotForAddColumn.offsetHeight;this.showAddIconForAddColumn(this.leftDotForAddColumn.offsetLeft+t/2,this.leftDotForAddColumn.offsetTop+e/2,!0),this.showSplitLineForAddColumn(this.leftDotForAddColumn.offsetLeft+t/2-1,this.leftDotForAddColumn.offsetTop+e/2+2,this.table.getDrawRange().height)})),this.rightDotForAddColumn.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addColumn),this.addIconForAddColumn.style.display="block";const t=this.rightDotForAddColumn.offsetWidth,e=this.rightDotForAddColumn.offsetHeight;this.showAddIconForAddColumn(this.rightDotForAddColumn.offsetLeft+t/2,this.rightDotForAddColumn.offsetTop+e/2,!1),this.showSplitLineForAddColumn(this.rightDotForAddColumn.offsetLeft+t/2-1,this.rightDotForAddColumn.offsetTop+e/2+2,this.table.getDrawRange().height)})),this.addIconForAddColumn.addEventListener("mouseleave",(()=>{this.addIconForAddColumn.style.display="none",this.addLineForAddColumn.style.display="none",this.delayHideAllForAddColumn()})),this.addIconForAddColumn.addEventListener("click",(t=>{const e="left"===this.addIconForAddColumn.dataset.addIconType,i=this.table.options.columns,n=this.hoverCell.col,s=e?n:n+1;this.pluginOptions.addColumnCallback?this.pluginOptions.addColumnCallback(s):(i.splice(s,0,{field:"",title:`New Column ${n}`,width:100}),this.table.updateColumns(i)),this.delayHideAllForAddColumn(0)}))}showDotForAddColumn(t,e,i,n=!0,s=!0){const r=this.leftDotForAddColumn.offsetWidth,o=this.leftDotForAddColumn.offsetHeight;this.leftDotForAddColumn.style.left=e-r/2+"px",this.leftDotForAddColumn.style.top=t-o/2+"px",this.rightDotForAddColumn.style.left=i-r/2+"px",this.rightDotForAddColumn.style.top=t-o/2+"px",this.leftDotForAddColumn.style.display=n?"block":"none",this.rightDotForAddColumn.style.display=s?"block":"none"}showAddIconForAddColumn(t,e,i){const n=this.addIconForAddColumn.offsetWidth,s=this.addIconForAddColumn.offsetHeight,r=this.leftDotForAddColumn.offsetHeight;this.addIconForAddColumn.style.left=t-n/2+"px",this.addIconForAddColumn.style.top=e-s/2-r/2+"px",this.addIconForAddColumn.dataset.addIconType=i?"left":"right"}showSplitLineForAddColumn(t,e,i){this.addLineForAddColumn.style.left=`${t}px`,this.addLineForAddColumn.style.top=`${e}px`,this.addLineForAddColumn.style.height=`${i}px`,this.addLineForAddColumn.style.display="block"}delayHideAllForAddColumn(t=1e3){this.hideAllTimeoutId_addColumn=setTimeout((()=>{this.addIconForAddColumn.style.display="none",this.addLineForAddColumn.style.display="none",this.leftDotForAddColumn.style.display="none",this.rightDotForAddColumn.style.display="none"}),t)}initAddRowDomElement(){this.topDotForAddRow=document.createElement("div"),this.topDotForAddRow.style.width="6px",this.topDotForAddRow.style.height="6px",this.topDotForAddRow.style.backgroundColor="#4A90E2",this.topDotForAddRow.style.position="absolute",this.topDotForAddRow.style.cursor="pointer",this.topDotForAddRow.style.zIndex="1000",this.topDotForAddRow.style.borderRadius="50%",this.topDotForAddRow.style.border="1px solid white",this.topDotForAddRow.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.topDotForAddRow),this.bottomDotForAddRow=document.createElement("div"),this.bottomDotForAddRow.style.width="6px",this.bottomDotForAddRow.style.height="6px",this.bottomDotForAddRow.style.backgroundColor="#4A90E2",this.bottomDotForAddRow.style.position="absolute",this.bottomDotForAddRow.style.cursor="pointer",this.bottomDotForAddRow.style.zIndex="1000",this.bottomDotForAddRow.style.borderRadius="50%",this.bottomDotForAddRow.style.border="1px solid white",this.bottomDotForAddRow.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.bottomDotForAddRow),this.addIconForAddRow=document.createElement("div"),this.addIconForAddRow.style.width="18px",this.addIconForAddRow.style.height="18px",this.addIconForAddRow.style.backgroundColor="#4A90E2",this.addIconForAddRow.style.position="absolute",this.addIconForAddRow.style.zIndex="1001",this.addIconForAddRow.style.display="none",this.addIconForAddRow.style.borderRadius="50%",this.addIconForAddRow.style.boxShadow="0 2px 5px rgba(0,0,0,0.2)",this.addIconForAddRow.style.display="flex",this.addIconForAddRow.style.justifyContent="center",this.addIconForAddRow.style.alignItems="center",this.addIconForAddRow.style.border="1px solid white",document.body.appendChild(this.addIconForAddRow);const t=document.createElement("div");t.textContent="+",t.style.color="white",t.style.fontSize="18px",t.style.fontWeight="bold",t.style.lineHeight="15px",t.style.userSelect="none",t.style.cursor="pointer",t.style.verticalAlign="top",t.style.textAlign="center",this.addIconForAddRow.appendChild(t),this.addLineForAddRow=document.createElement("div"),this.addLineForAddRow.style.width="10px",this.addLineForAddRow.style.height="2px",this.addLineForAddRow.style.backgroundColor="#4A90E2",this.addLineForAddRow.style.position="absolute",this.addLineForAddRow.style.zIndex="1001",this.addLineForAddRow.style.display="none",document.body.appendChild(this.addLineForAddRow)}bindEventForAddRow(){this.topDotForAddRow.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addRow),this.addIconForAddRow.style.display="block";const t=this.topDotForAddRow.offsetWidth,e=this.topDotForAddRow.offsetHeight;this.showAddIconForAddRow(this.topDotForAddRow.offsetLeft+t/2,this.topDotForAddRow.offsetTop+e/2,!0),this.showSplitLineForAddRow(this.topDotForAddRow.offsetLeft+t+2,this.topDotForAddRow.offsetTop+e/2-1,this.table.getDrawRange().width)})),this.bottomDotForAddRow.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addRow),this.addIconForAddRow.style.display="block";const t=this.bottomDotForAddRow.offsetWidth,e=this.bottomDotForAddRow.offsetHeight;this.showAddIconForAddRow(this.bottomDotForAddRow.offsetLeft+t/2,this.bottomDotForAddRow.offsetTop+e/2,!1),this.showSplitLineForAddRow(this.bottomDotForAddRow.offsetLeft+t+2,this.bottomDotForAddRow.offsetTop+e/2-1,this.table.getDrawRange().height)})),this.addIconForAddRow.addEventListener("mouseleave",(()=>{this.addIconForAddRow.style.display="none",this.addLineForAddRow.style.display="none",this.delayHideAllForAddRow()})),this.addIconForAddRow.addEventListener("click",(t=>{const e="top"===this.addIconForAddRow.dataset.addIconType,i=this.hoverCell.row,n=e?i:i+1;if(this.pluginOptions.addRowCallback)this.pluginOptions.addRowCallback(n);else{const t=this.table.getRecordIndexByCell(0,n);this.table.addRecord({},t)}this.delayHideAllForAddRow(0)}))}showDotForAddRow(t,e,i,n=!0,s=!0){const r=this.topDotForAddRow.offsetWidth,o=this.topDotForAddRow.offsetHeight;this.topDotForAddRow.style.left=e-r/2+"px",this.topDotForAddRow.style.top=t-o/2+"px",this.bottomDotForAddRow.style.left=e-r/2+"px",this.bottomDotForAddRow.style.top=i-o/2+"px",this.topDotForAddRow.style.display=n?"block":"none",this.bottomDotForAddRow.style.display=s?"block":"none"}showAddIconForAddRow(t,e,i){const n=this.addIconForAddRow.offsetWidth,s=this.addIconForAddRow.offsetHeight,r=this.topDotForAddRow.offsetWidth;this.addIconForAddRow.style.left=t-n/2-r/2+"px",this.addIconForAddRow.style.top=e-s/2+"px",this.addIconForAddRow.dataset.addIconType=i?"top":"bottom"}showSplitLineForAddRow(t,e,i){this.addLineForAddRow.style.left=`${t}px`,this.addLineForAddRow.style.top=`${e}px`,this.addLineForAddRow.style.width=`${i}px`,this.addLineForAddRow.style.display="block"}delayHideAllForAddRow(t=1e3){this.hideAllTimeoutId_addRow=setTimeout((()=>{this.addIconForAddRow.style.display="none",this.addLineForAddRow.style.display="none",this.topDotForAddRow.style.display="none",this.bottomDotForAddRow.style.display="none"}),t)}release(){this.leftDotForAddColumn.remove(),this.rightDotForAddColumn.remove(),this.addIconForAddColumn.remove(),this.addLineForAddColumn.remove(),this.topDotForAddRow.remove(),this.bottomDotForAddRow.remove(),this.addIconForAddRow.remove(),this.addLineForAddRow.remove()}},t.CarouselAnimationPlugin=class{table;rowCount;colCount;animationDuration;animationDelay;animationEasing;replaceScrollAction;playing;row;col;willUpdateRow=!1;willUpdateCol=!1;customDistRowFunction;customDistColFunction;constructor(t,e){this.table=t,this.rowCount=e?.rowCount??void 0,this.colCount=e?.colCount??void 0,this.animationDuration=e?.animationDuration??500,this.animationDelay=e?.animationDelay??1e3,this.animationEasing=e?.animationEasing??"linear",this.replaceScrollAction=e?.replaceScrollAction??!1,this.customDistColFunction=e.customDistColFunction,this.customDistRowFunction=e.customDistRowFunction,this.reset(),this.init()}init(){this.replaceScrollAction&&(this.table.disableScroll(),this.table.scenegraph.stage.addEventListener("wheel",this.onScrollEnd.bind(this)))}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}onScrollEnd(t){this.rowCount?(t.deltaY>0?(this.row+=this.rowCount,this.row=Math.min(this.row,this.table.rowCount-this.table.frozenRowCount)):t.deltaY<0&&(this.row-=this.rowCount,this.row=Math.max(this.row,this.table.frozenRowCount)),this.table.scrollToRow(this.row,{duration:this.animationDuration,easing:this.animationEasing})):this.colCount&&(t.deltaX>0?(this.col+=this.colCount,this.col=Math.min(this.col,this.table.colCount-this.table.frozenColCount)):t.deltaX<0&&(this.col-=this.colCount,this.col=Math.max(this.col,this.table.frozenColCount)),this.table.scrollToCol(this.col,{duration:this.animationDuration,easing:this.animationEasing}))}play(){this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistRowFunction&&this.customDistRowFunction(this.row,this.table);e?(this.row=e.distRow,t=e.animation??!0):s(this.row)&&this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):s(this.row)||this.table.scenegraph.proxy.screenTopRow===Math.floor(this.row)?this.row+=this.rowCount:(this.row=this.table.frozenRowCount,t=!1),this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout((()=>{this.willUpdateRow=!1,this.updateRow()}),this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistColFunction&&this.customDistColFunction(this.col,this.table);e?(this.col=e.distCol,t=e.animation??!0):s(this.col)&&this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):s(this.col)||this.table.scenegraph.proxy.screenLeftCol===Math.floor(this.col)?this.col+=this.colCount:(this.col=this.table.frozenColCount,t=!1),this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout((()=>{this.willUpdateCol=!1,this.updateCol()}),this.animationDuration+this.animationDelay)}},t.ColumnSeriesPlugin=class{id="column-series";runTime=[n.TABLE_EVENT_TYPE.BEFORE_INIT,n.TABLE_EVENT_TYPE.BEFORE_KEYDOWN];pluginOptions;table;columns=[];constructor(t){this.pluginOptions=Object.assign({columnCount:100,autoExtendColumn:!0},t)}run(...t){if(t[1]===n.TABLE_EVENT_TYPE.BEFORE_INIT){const e=t[0],i=t[2];this.table=i;const n=e.options;this.columns=this.generateColumns(this.pluginOptions.columnCount),n.columns=this.columns}else if(t[1]===n.TABLE_EVENT_TYPE.BEFORE_KEYDOWN){"ArrowRight"===t[0].event.key&&this.pluginOptions.autoExtendColumn&&this.table.stateManager.select.cellPos.col===this.table.colCount-1&&this.table.addColumn(this.generateColumn(this.table.colCount-1))}}generateColumns(t){const e=[];for(let i=0;i<t;i++)e.push(this.generateColumn(i));return e}generateColumn(t){return{title:this.pluginOptions.generateColumnTitle?this.pluginOptions.generateColumnTitle(t):this.generateColumnField(t)}}generateColumnField(t){if(t<26)return String.fromCharCode(65+t);const e=[];for(t++;t>0;)t--,e.unshift(String.fromCharCode(65+t%26)),t=Math.floor(t/26);return e.join("")}resetColumnCount(t){this.pluginOptions.columnCount=t,this.columns=this.generateColumns(t),this.table.updateColumns(this.columns)}},t.ExcelEditCellKeyboardPlugin=class{id="excel-edit-cell-keyboard";runTime=[n.TABLE_EVENT_TYPE.INITIALIZED];table;pluginOptions;constructor(t){this.pluginOptions=t,this.bindEvent()}run(...t){const e=t[2];this.table=e}bindEvent(){document.addEventListener("keydown",this.handleKeyDown.bind(this),!0)}handleKeyDown(t){if(this.table.editorManager)if("keydown"===this.table.editorManager.beginTriggerEditCellMode){if(this.table.editorManager.editingEditor&&this.isExcelShortcutKey(t)){const{col:e,row:i}=this.table.editorManager.editCell;this.table.editorManager.completeEdit(),this.table.getElement().focus(),t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key?this.table.selectCell(e,i+1):"Tab"===t.key?this.table.selectCell(e+1,i):"ArrowLeft"===t.key?this.table.selectCell(e-1,i):"ArrowRight"===t.key?this.table.selectCell(e+1,i):"ArrowDown"===t.key?this.table.selectCell(e,i+1):"ArrowUp"===t.key&&this.table.selectCell(e,i-1),t.stopPropagation(),t.preventDefault())}}else{const{col:e,row:i}=this.table.stateManager.select.cellPos;if(!this.table.editorManager.editingEditor||"Enter"!==t.key&&"Tab"!==t.key){if("Delete"===t.key){const e=this.table.getSelectedCellInfos();e?.length>0&&function(t,e){for(let i=0;i<t.length;i++)for(let n=0;n<t[i].length;n++)e.changeCellValue(t[i][n].col,t[i][n].row,"")}(e,this.table),t.stopPropagation(),t.preventDefault()}}else this.table.editorManager.completeEdit(),this.table.getElement().focus(),"Enter"===t.key?this.table.selectCell(e,i+1):"Tab"===t.key&&this.table.selectCell(e+1,i),t.stopPropagation(),t.preventDefault()}}isExcelShortcutKey(t){return"Enter"===t.key||"Tab"===t.key||"ArrowLeft"===t.key||"ArrowRight"===t.key||"ArrowDown"===t.key||"ArrowUp"===t.key}release(){document.removeEventListener("keydown",this.handleKeyDown,!0)}},t.FocusHighlightPlugin=class{id="focus-highlight";name="Focus Highlight";runTime=[e.TABLE_EVENT_TYPE.INITIALIZED,e.TABLE_EVENT_TYPE.SELECTED_CELL,e.TABLE_EVENT_TYPE.SELECTED_CLEAR];table;range;pluginOptions;constructor(t={fill:"#000",opacity:.5,highlightRange:void 0}){this.pluginOptions=Object.assign({fill:"#000",opacity:.5},t)}run(...t){if(this.table||(this.table=t[2]),t[1]===e.TABLE_EVENT_TYPE.INITIALIZED)this.pluginOptions.highlightRange&&this.setFocusHighlightRange(this.pluginOptions.highlightRange);else if(t[1]===e.TABLE_EVENT_TYPE.SELECTED_CELL){const t=this.table.stateManager.select.cellPos;if(this.table.isHeader(t.col,t.row))this.setFocusHighlightRange(void 0);else{const t=this.table.stateManager.select.ranges,e=0,i=this.table.colCount-1,n=Math.min(t[0].start.row,t[0].end.row),s=Math.max(t[0].start.row,t[0].end.row);this.setFocusHighlightRange({start:{col:e,row:n},end:{col:i,row:s}})}}else t[1]===e.TABLE_EVENT_TYPE.SELECTED_CLEAR&&this.setFocusHighlightRange(void 0)}setFocusHighlightRange(t){let e;t&&"start"in t&&"end"in t?e=t:t&&(e={start:t,end:t}),Rh(this.range,e)||(this.range=e,t?this.updateCellGroupShadow():this.deleteAllCellGroupShadow(),this.table.scenegraph.updateNextFrame())}deleteAllCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup)}updateCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup,this.range)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.range,this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup,this.range)}updateCellGroupShadowInContainer(t,e){let i;e&&"start"in e&&"end"in e?i=e:e&&(i={start:e,end:e}),t.forEachChildrenSkipChild((t=>{const e=t;"column"===e.role&&e.forEachChildrenSkipChild((t=>{const e=t;if("cell"!==e.role)return;e.attachShadow(e.shadowRoot);const n=e.shadowRoot;if(i){if(Lh(i,e.col,e.row))n.removeAllChild();else if(!n.firstChild){const t=Po({x:0,y:0,width:e.attribute.width,height:e.attribute.height,fill:this.pluginOptions.fill,opacity:this.pluginOptions.opacity});t.name="shadow-rect",n.appendChild(t)}}else n.removeAllChild()}))}))}},t.HeaderHighlightPlugin=class{table;options;colHeaderRange;rowHeaderRange;constructor(t,e){this.table=t,this.options=e,this.registerStyle(),this.bindEvent()}registerStyle(){this.table.registerCustomCellStyle("col-highlight",{bgColor:this.options?.colHighlightBGColor??"#82b2f5",color:this.options?.colHighlightColor??"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:this.options?.rowHighlightBGColor??"#82b2f5",color:this.options?.rowHighlightColor??"#FFF"})}bindEvent(){this.table.on("selected_cell",(()=>{this.updateHighlight()})),this.table.on("selected_clear",(()=>{this.clearHighlight()})),this.table.on("mousemove_table",(()=>{this.table.stateManager.select.selecting&&this.updateHighlight()}))}clearHighlight(){this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0,!0),this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0,!0),this.colHeaderRange=void 0,this.rowHeaderRange=void 0}updateHighlight(){if(!1===this.options?.colHighlight&&!1===this.options?.rowHighlight)return;const t=this.table.getSelectedCellRanges();if(0===t.length)return void this.clearHighlight();const e=t[0],i=[e.start.row,e.end.row];i.sort(((t,e)=>t-e));const n=[e.start.col,e.end.col];let s,r;n.sort(((t,e)=>t-e)),this.table.isPivotTable()?(s={start:{col:n[0],row:0},end:{col:n[1],row:this.table.columnHeaderLevelCount-1}},r={start:{col:0,row:i[0]},end:{col:this.table.rowHeaderLevelCount-1,row:i[1]}}):this.table.internalProps.transpose?r={start:{col:0,row:i[0]},end:{col:this.table.rowHeaderLevelCount-1,row:i[1]}}:(s={start:{col:n[0],row:0},end:{col:n[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(r={start:{col:0,row:i[0]},end:{col:0,row:i[1]}})),!1===this.options?.colHighlight||Oh(this.colHeaderRange,s)||(this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),s&&this.table.arrangeCustomCellStyle({range:s},"col-highlight"),this.colHeaderRange=s),!1===this.options?.rowHighlight||Oh(this.rowHeaderRange,r)||(this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),r&&this.table.arrangeCustomCellStyle({range:r},"row-highlight"),this.rowHeaderRange=r)}},t.HighlightHeaderWhenSelectCellPlugin=class{id="highlight-header-when-select-cell";runTime=[e.TABLE_EVENT_TYPE.INITIALIZED,e.TABLE_EVENT_TYPE.SELECTED_CLEAR,e.TABLE_EVENT_TYPE.SELECTED_CELL,e.TABLE_EVENT_TYPE.MOUSEMOVE_TABLE];table;pluginOptions;colHeaderRanges=[];rowHeaderRanges=[];constructor(t){this.pluginOptions=t}run(...t){const i=t[1],n=t[2];this.table=n,i===e.TABLE_EVENT_TYPE.SELECTED_CLEAR?this.clearHighlight():i===e.TABLE_EVENT_TYPE.SELECTED_CELL||i===e.TABLE_EVENT_TYPE.MOUSEMOVE_TABLE?this.updateHighlight():i===e.TABLE_EVENT_TYPE.INITIALIZED&&this.registerStyle()}registerStyle(){this.table.registerCustomCellStyle("col-highlight",{bgColor:this.pluginOptions?.colHighlightBGColor??"#82b2f5",color:this.pluginOptions?.colHighlightColor??"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:this.pluginOptions?.rowHighlightBGColor??"#82b2f5",color:this.pluginOptions?.rowHighlightColor??"yellow"})}clearHighlight(){this.colHeaderRanges&&this.colHeaderRanges.forEach((t=>{this.table.arrangeCustomCellStyle({range:t},void 0)})),this.rowHeaderRanges&&this.rowHeaderRanges.forEach((t=>{this.table.arrangeCustomCellStyle({range:t},void 0)})),this.colHeaderRanges=[],this.rowHeaderRanges=[]}updateHighlight(){if(!1===this.pluginOptions?.colHighlight&&!1===this.pluginOptions?.rowHighlight)return;const t=this.table.getSelectedCellRanges();t.length<2&&this.clearHighlight();for(let e=0;e<t.length;e++){const i=t[e],n=[i.start.row,i.end.row];n.sort(((t,e)=>t-e));const s=[i.start.col,i.end.col];let r,o;s.sort(((t,e)=>t-e)),this.table.isPivotTable()?(r={start:{col:s[0],row:0},end:{col:s[1],row:this.table.columnHeaderLevelCount-1}},o={start:{col:0,row:n[0]},end:{col:this.table.rowHeaderLevelCount-1,row:n[1]}}):this.table.internalProps.transpose?o={start:{col:0,row:n[0]},end:{col:this.table.rowHeaderLevelCount-1,row:n[1]}}:(r={start:{col:s[0],row:0},end:{col:s[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(o={start:{col:0,row:n[0]},end:{col:0,row:n[1]}})),!1===this.pluginOptions?.colHighlight||this.colHeaderRanges.find((t=>Ih(t,r)))||(r&&this.table.arrangeCustomCellStyle({range:r},"col-highlight"),this.colHeaderRanges.push(r)),!1===this.pluginOptions?.rowHighlight||this.rowHeaderRanges.find((t=>Ih(t,o)))||(o&&this.table.arrangeCustomCellStyle({range:o},"row-highlight"),this.rowHeaderRanges.push(o))}}release(){this.rowHeaderRanges=[],this.colHeaderRanges=[]}},t.InvertHighlightPlugin=class{table;range;_fill;_opacity;constructor(t,e){this.table=t,this._fill=e?.fill??"#000",this._opacity=e?.opacity??.5}setInvertHighlightRange(t){Rh(this.range,t)||(this.range=t,t?this.updateCellGroupShadow():this.deleteAllCellGroupShadow(),this.table.scenegraph.updateNextFrame())}deleteAllCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup)}updateCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup,this.range)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.range,this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup,this.range)}updateCellGroupShadowInContainer(t,e){t.forEachChildrenSkipChild((t=>{const i=t;"column"===i.role&&i.forEachChildrenSkipChild((t=>{const i=t;if("cell"!==i.role)return;i.attachShadow(i.shadowRoot);const n=i.shadowRoot;if(e){if(Lh(e,i.col,i.row))n.removeAllChild();else if(!n.firstChild){const t=Po({x:0,y:0,width:i.attribute.width,height:i.attribute.height,fill:this._fill,opacity:this._opacity});t.name="shadow-rect",n.appendChild(t)}}else n.removeAllChild()}))}))}},t.RotateTablePlugin=class{id="rotate-table";runTime=[n.TABLE_EVENT_TYPE.INITIALIZED];table;vglobal_mapToCanvasPoint;constructor(){}run(...t){const e=t[2];this.table=e,this.table.rotate90WithTransform=Dh.bind(this.table),this.table.cancelTransform=Fh.bind(this.table)}release(){}},t.RowSeriesPlugin=class{id="row-series";runTime=[e.TABLE_EVENT_TYPE.BEFORE_INIT,e.TABLE_EVENT_TYPE.BEFORE_KEYDOWN];pluginOptions;table;constructor(t){this.pluginOptions=Object.assign({rowCount:100,autoExtendRow:!0},t)}run(...t){if(t[1]===e.TABLE_EVENT_TYPE.BEFORE_INIT){const e=t[0],i=t[2];this.table=i;const n=e.options,s=n.records??[];for(let t=s.length;t<this.pluginOptions.rowCount;t++)s.push(this.pluginOptions.fillRowRecord?this.pluginOptions.fillRowRecord(t):{});n.records=s,this.pluginOptions.rowSeriesNumber?(n.rowSeriesNumber=this.pluginOptions.rowSeriesNumber,this.pluginOptions.rowSeriesNumber.width||(n.rowSeriesNumber.width="auto")):n.rowSeriesNumber||(n.rowSeriesNumber={width:"auto"})}else if(t[1]===e.TABLE_EVENT_TYPE.BEFORE_KEYDOWN){"ArrowDown"===t[0].event.key&&this.pluginOptions.autoExtendRow&&this.table.stateManager.select.cellPos.row===this.table.rowCount-1&&this.table.addRecord(this.pluginOptions.fillRowRecord?this.pluginOptions.fillRowRecord(this.table.rowCount-this.table.columnHeaderLevelCount):{})}}},t.TableCarouselAnimationPlugin=class{id="table-carousel-animation";runTime=[e.TABLE_EVENT_TYPE.INITIALIZED];table;rowCount;colCount;animationDuration;animationDelay;animationEasing;playing;row;col;willUpdateRow=!1;willUpdateCol=!1;autoPlay;autoPlayDelay;customDistRowFunction;customDistColFunction;constructor(t={}){this.rowCount=t?.rowCount??void 0,this.colCount=t?.colCount??void 0,this.animationDuration=t?.animationDuration??500,this.animationDelay=t?.animationDelay??1e3,this.animationEasing=t?.animationEasing??"linear",this.autoPlay=t?.autoPlay??!1,this.autoPlayDelay=t?.autoPlayDelay??0,this.customDistColFunction=t.customDistColFunction,this.customDistRowFunction=t.customDistRowFunction}run(...t){this.table||(this.table=t[2]),this.reset(),this.autoPlay&&setTimeout((()=>{this.play()}),this.autoPlayDelay)}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}play(){if(!this.table)throw new Error("table is not initialized");this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistRowFunction&&this.customDistRowFunction(this.row,this.table);e?(this.row=e.distRow,t=e.animation??!0):kh(this.row)&&this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):kh(this.row)||this.table.scenegraph.proxy.screenTopRow===Math.floor(this.row)?this.row+=this.rowCount:(this.row=this.table.frozenRowCount,t=!1),this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout((()=>{this.willUpdateRow=!1,this.updateRow()}),this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistColFunction&&this.customDistColFunction(this.col,this.table);e?(this.col=e.distCol,t=e.animation??!0):kh(this.col)&&this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):kh(this.col)||this.table.scenegraph.proxy.screenLeftCol===Math.floor(this.col)?this.col+=this.colCount:(this.col=this.table.frozenColCount,t=!1),this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout((()=>{this.willUpdateCol=!1,this.updateCol()}),this.animationDuration+this.animationDelay)}release(){}},t.cancelTransform=Fh,t.rotate90WithTransform=Dh}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vtable")):"function"==typeof define&&define.amd?define(["exports","@visactor/vtable"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).VTable=t.VTable||{},t.VTable.plugins={}),t.VTable)}(this,(function(t,e){"use strict";function i(t){var e=Object.create(null);return t&&Object.keys(t).forEach((function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}})),e.default=t,Object.freeze(e)}var n=i(e);function s(t){return Math.floor(t)===t}class r{static GenAutoIncrementId(){return r.auto_increment_id++}}r.auto_increment_id=0;class o{constructor(t){this.id=r.GenAutoIncrementId(),this.registry=t}}const a="named",h="inject",l="multi_inject",c="inversify:tagged",d="inversify:paramtypes";class u{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===a?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var p=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),s=new WeakMap;function r(t,e,i){let r=s.get(t);if(l(r)){if(!i)return;r=new n,s.set(t,r)}let o=r.get(e);if(l(o)){if(!i)return;o=new n,r.set(e,o)}return o}function o(t,e,i){if(a(t,e,i))return!0;const n=f(e);return!c(n)&&o(t,n,i)}function a(t,e,i){const n=r(e,i,!1);return!l(n)&&!!n.has(t)}function h(t,e,i){if(a(t,e,i))return function(t,e,i){const n=r(e,i,!1);if(!l(n))return n.get(t)}(t,e,i);const n=f(e);return c(n)?void 0:h(t,n,i)}function l(t){return void 0===t}function c(t){return null===t}function d(t){return"object"==typeof t?null!==t:"function"==typeof t}function u(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",s=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,e);if(void 0!==s){const e=s.call(t,n);if(d(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(g(e)){const i=e.call(t);if(!d(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!d(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!d(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!d(e))return e}}throw new TypeError}(t,"default"===n?"number":n)}function p(t){const e=u(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function f(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===i)return e;if(e!==i)return e;const n=t.prototype,s=n&&Object.getPrototypeOf(n);if(null==s||s===Object.prototype)return e;const r=s.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,n){if(!d(i))throw new TypeError;return s=t,o=e,void r(i,n,!0).set(s,o);var s,o})),t("hasMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return l(i)||(i=p(i)),o(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!d(e))throw new TypeError;return l(i)||(i=p(i)),a(t,e,i)})),t("getMetadata",(function(t,e,i){if(!d(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 g(t,e,i,n){!function(t,e,i,n){const s=[n];let r={};p.hasOwnMetadata(t,e)&&(r=p.getMetadata(t,e));let o=r[i];void 0===o&&(o=[]),o.push(...s),r[i]=o,p.defineMetadata(t,r,e)}(c,t,i.toString(),n)}function f(t){return(e,i,n)=>{g(e,0,n,t)}}function m(t){return e=>(i,n,s)=>f(new u(t,e))(i,n,s)}const b=m(h),y=m(l);function v(){return function(t){return p.defineMetadata(d,null,t),t}}function x(t){return f(new u(a,t))}const w="Singleton",_="Transient",A="ConstantValue",C="DynamicValue",T="Factory",S="Function",B="Instance",E="Invalid";class M{constructor(t,e){this.id=r.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=E,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new M(this.serviceIdentifier,this.scope);return t.activated=t.scope===w&&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 R{getConstructorMetadata(t){return{compilerGeneratedMetadata:p.getMetadata(d,t),userGeneratedMetadata:p.getMetadata(c,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const P=(L=a,t=>{const e=e=>{if(null==e)return!1;if(e.key===L&&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===L&&i[e].value===t)return!0;return!1};return e.metaData=new u(L,t),e});var L;class O{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=w,this}inTransientScope(){return this._binding.scope=_,this}whenTargetNamed(t){return this._binding.constraint=P(t),this}}class I{constructor(t){this._binding=t}to(t){return this._binding.type=B,this._binding.implementationType=t,new O(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=C,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new O(this._binding)}toConstantValue(t){return this._binding.type=A,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=w,new O(this._binding)}toFactory(t){return this._binding.type=T,this._binding.factory=t,this._binding.scope=w,new O(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const k=Symbol("ContributionProvider");class D{constructor(t,e){this.serviceIdentifier=t,this.container=e,N.setStore(this.serviceIdentifier,this)}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}refresh(){this.caches&&(this.caches.length=0,this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier)))}}function F(t,e){t(k).toDynamicValue((t=>{let{container:i}=t;return new D(e,i)})).inSingletonScope().whenTargetNamed(e)}class N{static getStore(t){return this.store.get(t)}static setStore(t,e){this.store.set(t,e)}static refreshAllContributions(){this.store.forEach((t=>{t.refresh()}))}}N.store=new Map;class U{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 s=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(s>i)){n++;break}}this.taps[n]=t}}class j extends U{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 H=Symbol.for("EnvContribution"),z=Symbol.for("VGlobal");class G{constructor(){this._listenerMap=new Map,this._eventListenerTransformer=t=>t}setEventListenerTransformer(t){this._eventListenerTransformer=t||(t=>t)}addEventListener(t,e,i){if(!e)return;const n=t=>{const i=this._eventListenerTransformer(t);"function"==typeof e?e(i):e.handleEvent&&e.handleEvent(i)};this._listenerMap.has(t)||this._listenerMap.set(t,new Map),this._listenerMap.get(t).set(e,n),this._nativeAddEventListener(t,n,i)}removeEventListener(t,e,i){var n;if(!e)return;const s=null===(n=this._listenerMap.get(t))||void 0===n?void 0:n.get(e);s&&(this._nativeRemoveEventListener(t,s,i),this._listenerMap.get(t).delete(e),0===this._listenerMap.get(t).size&&this._listenerMap.delete(t))}dispatchEvent(t){return this._nativeDispatchEvent(t)}clearAllEventListeners(){this._listenerMap.forEach(((t,e)=>{t.forEach(((t,i)=>{this._nativeRemoveEventListener(e,t,void 0)}))})),this._listenerMap.clear()}_nativeAddEventListener(t,e,i){throw new Error("_nativeAddEventListener must be implemented by derived classes")}_nativeRemoveEventListener(t,e,i){throw new Error("_nativeRemoveEventListener must be implemented by derived classes")}_nativeDispatchEvent(t){throw new Error("_nativeDispatchEvent must be implemented by derived classes")}}var W=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},V=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Y=function(t,e){return function(i,n){e(i,n,t)}},X=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};let $=class extends G{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){super(),this.contributions=t,this._isImageAnonymous=!0,this.eventListenerTransformer=t=>t,this.id=r.GenAutoIncrementId(),this.hooks={onSetEnv:new j(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}_nativeAddEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}_nativeRemoveEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}_nativeDispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}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)}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 X(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)}isMacOS(){return this._env||this.setEnv("browser"),this.envContribution.isMacOS()}copyToClipBoard(t){return this._env||this.setEnv("browser"),this.envContribution.copyToClipBoard(t)}};var q;function K(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}$=W([v(),Y(0,b(k)),Y(0,x(H)),V("design:paramtypes",[Object])],$),function(t){t[t.estimate=0]="estimate",t[t.actualBounding=1]="actualBounding",t[t.fontBounding=2]="fontBounding"}(q||(q={}));var Z={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function n(){}function s(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,n,r,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new s(n,r||t,o),h=i?i+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var t,n,s=[];if(0===this._eventsCount)return s;for(n in t=this._events)e.call(t,n)&&s.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(t)):s},a.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 s=0,r=n.length,o=new Array(r);s<r;s++)o[s]=n[s].fn;return o},a.prototype.listenerCount=function(t){var e=i?i+t:t,n=this._events[e];return n?n.fn?1:n.length:0},a.prototype.emit=function(t,e,n,s,r,o){var a=i?i+t:t;if(!this._events[a])return!1;var h,l,c=this._events[a],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),d){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,s),!0;case 5:return c.fn.call(c.context,e,n,s,r),!0;case 6:return c.fn.call(c.context,e,n,s,r,o),!0}for(l=1,h=new Array(d-1);l<d;l++)h[l-1]=arguments[l];c.fn.apply(c.context,h)}else{var u,p=c.length;for(l=0;l<p;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),d){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,s);break;default:if(!h)for(u=1,h=new Array(d-1);u<d;u++)h[u-1]=arguments[u];c[l].fn.apply(c[l].context,h)}}return!0},a.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},a.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},a.prototype.removeListener=function(t,e,n,s){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return o(this,r),this;var a=this._events[r];if(a.fn)a.fn!==e||s&&!a.once||n&&a.context!==n||o(this,r);else{for(var h=0,l=[],c=a.length;h<c;h++)(a[h].fn!==e||s&&!a[h].once||n&&a[h].context!==n)&&l.push(a[h]);l.length?this._events[r]=1===l.length?l[0]:l:o(this,r)}return this},a.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&o(this,e)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,t.exports=a}(Z);var J=K(Z.exports);var Q=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var tt=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||Q(t,"Boolean")};var et=t=>"function"==typeof t;var it=t=>null==t;var nt=t=>null!=t;var st=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var rt=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||Q(t,"String")};var ot=t=>Array.isArray?Array.isArray(t):Q(t,"Array");var at=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||Q(t,"Number")};var ht=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t);var lt=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 ct=Object.prototype.hasOwnProperty;var dt=(t,e)=>null!=t&&ct.call(t,e);function ut(t,e){if(!ot(t)||!ot(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 pt="undefined"!=typeof console;function gt(t,e,i){const n=[e].concat([].slice.call(i));pt&&console[t].apply(console,n)}var ft;!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"}(ft||(ft={}));class mt{static getInstance(t,e){return mt._instance&&at(t)?mt._instance.level(t):mt._instance||(mt._instance=new mt(t,e)),mt._instance}static setInstance(t){return mt._instance=t}static setInstanceLevel(t){mt._instance?mt._instance.level(t):mt._instance=new mt(t)}static clearInstance(){mt._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ft.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>=ft.Info}canLogDebug(){return this._level>=ft.Debug}canLogError(){return this._level>=ft.Error}canLogWarn(){return this._level>=ft.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>=ft.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):gt(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>=ft.Warn&>(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>=ft.Info&>(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>=ft.Debug&>(this._method||"log","DEBUG",e),this}}mt._instance=null;function bt(t,e){const i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1e-10,n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-10)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,n)}var yt=function(t,e,i){return t<e?e:t>i?i:t};const vt=Math.PI,xt=vt/2,wt=2*vt,_t=2*Math.PI,At=Math.abs,Ct=Math.atan2,Tt=Math.cos,St=Math.max,Bt=Math.min,Et=Math.sin,Mt=Math.sqrt,Rt=Math.pow;class Pt{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 Pt(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 at(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return at(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 Lt{static distancePP(t,e){return Mt(Rt(t.x-e.x,2)+Rt(t.y-e.y,2))}static distanceNN(t,e,i,n){return Mt(Rt(t-i,2)+Rt(e-n,2))}static distancePN(t,e,i){return Mt(Rt(e-t.x,2)+Rt(i-t.y,2))}static pointAtPP(t,e,i){return new Pt((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function Ot(t){return t*(Math.PI/180)}var It;!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(It||(It={}));const kt=(t,e,i)=>{let n=t.x1,s=t.x2,r=t.y1,o=t.y2,a=e.x1,h=e.x2,l=e.y1,c=e.y2;return i&&(n>s&&([n,s]=[s,n]),r>o&&([r,o]=[o,r]),a>h&&([a,h]=[h,a]),l>c&&([l,c]=[c,l])),{x11:n,x12:s,y11:r,y12:o,x21:a,x22:h,y21:l,y22:c}};function Dt(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:s,y11:r,y12:o,x21:a,x22:h,y21:l,y22:c}=kt(t,e,!0);return!(n>h||s<a||r>c||o<l)}return!0}function Ft(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function Nt(t,e){let{x:i,y:n}=t,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(i-s.x)*Math.cos(e)-(n-s.y)*Math.sin(e)+s.x,y:(i-s.x)*Math.sin(e)+(n-s.y)*Math.cos(e)+s.y}}function Ut(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function jt(t,e){const i=e?Ot(t.angle):t.angle,n=Ut(t);return[Nt({x:t.x1,y:t.y1},i,n),Nt({x:t.x2,y:t.y1},i,n),Nt({x:t.x2,y:t.y2},i,n),Nt({x:t.x1,y:t.y2},i,n)]}const Ht=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"};class zt{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(),nt(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=nt(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(it(this._canvas)&&(nt(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),it(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&nt(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),it(this._context)&&nt(this._canvas)){const t=this._canvas.getContext("2d");nt(t)&&(t.save(),t.font=function(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:s=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:o=e.fontSize,fontFamily:a=e.fontFamily}=t;return(n?n+" ":"")+(s?s+" ":"")+(r?r+" ":"")+o*i+"px "+(a||"sans-serif")}(this.textSpec),this._contextSaved=!0,this._context=t)}return!it(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:n={}}=this._option,{fontStyle:s=n.fontStyle,fontVariant:r=n.fontVariant,fontWeight:o=(null!==(t=n.fontWeight)&&void 0!==t?t:"normal"),fontSize:a=(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:d,textBaseline:u=(null!=d?d:"middle"),ellipsis:p,limit:g}=this._userSpec;let{lineHeight:f=a}=this._userSpec;if(rt(f)&&"%"===f[f.length-1]){const t=Number.parseFloat(f.substring(0,f.length-1))/100;f=a*t}return{fontStyle:s,fontVariant:r,fontFamily:h,fontSize:a,fontWeight:o,textAlign:c,textBaseline:u,ellipsis:p,limit:g,lineHeight:f}}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(it(t))return{width:0,height:0};if(it(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:o,limit:a,lineHeight:h}=this.textSpec;let l;try{const c=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:n,textAlign:s,textBaseline:r,ellipsis:!!o,maxLineWidth:a||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:s}=this.textSpec;return{width:i.width,height:null!==(e=s)&&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 s=this._measureSpecialChar(n);it(s)&&zt.NUMBERS_CHAR_SET.includes(n)&&(s=this._measureNumberChar()),it(s)&&["F","W"].includes(Ht(n))&&(s=this._measureFullSizeChar()),it(s)&&(s=this._measureLetterChar()),e.width+=s.width,e.height=Math.max(e.height,s.height),!it(s.fontBoundingBoxAscent)&&(e.fontBoundingBoxAscent=s.fontBoundingBoxAscent),!it(s.fontBoundingBoxDescent)&&(e.fontBoundingBoxDescent=s.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:s}=this.textSpec;for(let e=0;e<t.length;e++){const s=t[e],r=["F","W"].includes(Ht(s))?1:.53;i.width+=r*n}return i.height=null!==(e=s)&&void 0!==e?e:n,i}_measureReduce(t,e){var i;const{fontSize:n,lineHeight:s}=this.textSpec,r={width:0,height:0};if(it(t))return r;if(ot(t)){const o=t.filter(nt).map((t=>t.toString()));return 0===o.length?r:1===o.length?e(o[0]):{width:o.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:o.length*((null!==(i=s)&&void 0!==i?i:n)+1)+1}}return e(t.toString())}_measureNumberChar(){if(it(this._numberCharSize)){const t=this._standardMethod(zt.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/zt.NUMBERS_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._numberCharSize}_measureFullSizeChar(){return it(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(zt.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(it(this._letterCharSize)){const t=this._standardMethod(zt.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/zt.ALPHABET_CHAR_SET.length,height:t.height,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent}}return this._letterCharSize}_measureSpecialChar(t){return nt(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){nt(this._canvas)&&(this._canvas=null),nt(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}function Gt(t,e,i){const{x1:n,y1:s,x2:r,y2:o}=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*s+i.e,i.b*n+i.d*s+i.f),t.add(i.a*r+i.c*s+i.e,i.b*r+i.d*s+i.f),t.add(i.a*r+i.c*o+i.e,i.b*r+i.d*o+i.f),t.add(i.a*n+i.c*o+i.e,i.b*n+i.d*o+i.f),e)}zt.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",zt.NUMBERS_CHAR_SET="0123456789",zt.FULL_SIZE_CHAR="字";class Wt{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Wt(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 ot(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 s=this.scalePoints(t,e,i,n);return this.clear().add(s[0],s[1]).add(s[2],s[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 Gt(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:s,x2:r,y2:o}=this,a=Math.cos(t),h=Math.sin(t),l=e-e*a+i*h,c=i-e*h-i*a;return[a*n-h*s+l,h*n+a*s+c,a*n-h*o+l,h*n+a*o+c,a*r-h*s+l,h*r+a*s+c,a*r-h*o+l,h*r+a*o+c]}scalePoints(t,e,i,n){const{x1:s,y1:r,x2:o,y2:a}=this;return[t*s+(1-t)*i,e*r+(1-e)*n,t*o+(1-t)*i,e*a+(1-e)*n]}}class Vt extends Wt{}class Yt extends Wt{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=jt(t,i),s=jt(e,i),r=(t,e)=>[e.x-t.x,e.y-t.y],o=r(Ut(t),Ut(e)),a=r(n[0],n[1]),h=r(n[1],n[2]),l=r(s[0],s[1]),c=r(s[1],s[2]),d=i?Ot(t.angle):t.angle;let u=i?Ot(90-t.angle):t.angle+xt;const p=i?Ot(e.angle):e.angle;let g=i?Ot(90-e.angle):e.angle+xt;u>_t&&(u-=_t),g>_t&&(g-=_t);const f=(t,e,i,n)=>{const s=[Math.cos(e),Math.sin(e)];return t+(Ft(s,i)+Ft(s,n))/2>Ft(s,o)};return f((t.x2-t.x1)/2,d,l,c)&&f((t.y2-t.y1)/2,u,l,c)&&f((e.x2-e.x1)/2,p,a,h)&&f((e.y2-e.y1)/2,g,a,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,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return super.setValue(t,e,i,n),this.angle=s,this}clone(){return new Yt(this)}getRotatedCorners(){const t={x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2};return[Nt({x:this.x1,y:this.y1},this.angle,t),Nt({x:this.x2,y:this.y1},this.angle,t),Nt({x:this.x1,y:this.y2},this.angle,t),Nt({x:this.x2,y:this.y2},this.angle,t)]}}class Xt{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,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r}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,s,r){return!(this.e!==s||this.f!==r||this.a!==t||this.d!==n||this.b!==e||this.c!==i)}setValue(t,e,i,n,s,r){return this.a=t,this.b=e,this.c=i,this.d=n,this.e=s,this.f=r,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,s=this.e,r=this.f,o=new Xt,a=t*n-e*i;return o.a=n/a,o.b=-e/a,o.c=-i/a,o.d=t/a,o.e=(i*r-n*s)/a,o.f=-(t*r-e*s)/a,o}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a*e+this.c*i,s=this.b*e+this.d*i,r=this.a*-i+this.c*e,o=this.b*-i+this.d*e;return this.a=n,this.b=s,this.c=r,this.d=o,this}rotateByCenter(t,e,i){const n=Math.cos(t),s=Math.sin(t),r=(1-n)*e+s*i,o=(1-n)*i-s*e,a=n*this.a-s*this.b,h=s*this.a+n*this.b,l=n*this.c-s*this.d,c=s*this.c+n*this.d,d=n*this.e-s*this.f+r,u=s*this.e+n*this.f+o;return this.a=a,this.b=h,this.c=l,this.d=c,this.e=d,this.f=u,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,s,r){return this.multiply(t,e,i,n,s,r),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:s,f:r}=this;return this.a=e,this.b=t,this.c=n,this.d=i,this.e=r,this.f=s,this}multiply(t,e,i,n,s,r){const o=this.a,a=this.b,h=this.c,l=this.d,c=o*t+h*e,d=a*t+l*e,u=o*i+h*n,p=a*i+l*n,g=o*s+h*r+this.e,f=a*s+l*r+this.f;return this.a=c,this.b=d,this.c=u,this.d=p,this.e=g,this.f=f,this}interpolate(t,e){const i=new Xt;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:s,d:r,e:o,f:a}=this,h=i*r-n*s,l=r/h,c=-n/h,d=-s/h,u=i/h,p=(s*a-r*o)/h,g=-(i*a-n*o)/h,{x:f,y:m}=t;e.x=f*l+m*d+p,e.y=f*c+m*u+g}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 Xt(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,s=t*n-e*i,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const o=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/o):-Math.acos(t/o),r.scaleX=o,r.scaleY=s/o,r.skewX=(t*i+e*n)/s,r.skewY=0}else if(0!==i||0!==n){const o=Math.sqrt(i*i+n*n);r.rotateDeg=Math.PI/2-(n>0?Math.acos(-i/o):-Math.acos(i/o)),r.scaleX=s/o,r.scaleY=o,r.skewX=0,r.skewY=(t*i+e*n)/s}return r.rotateDeg=180*r.rotateDeg/Math.PI,r}}function $t(t,e,i){e/=100,i/=100;const n=(1-Math.abs(2*i-1))*e,s=n*(1-Math.abs(t/60%2-1)),r=i-n/2;let o=0,a=0,h=0;return 0<=t&&t<60?(o=n,a=s,h=0):60<=t&&t<120?(o=s,a=n,h=0):120<=t&&t<180?(o=0,a=n,h=s):180<=t&&t<240?(o=0,a=s,h=n):240<=t&&t<300?(o=s,a=0,h=n):300<=t&&t<360&&(o=n,a=0,h=s),o=Math.round(255*(o+r)),a=Math.round(255*(a+r)),h=Math.round(255*(h+r)),{r:o,g:a,b:h}}function qt(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,e,i),s=Math.max(t,e,i),r=s-n;let o=0,a=0,h=0;return o=0===r?0:s===t?(e-i)/r%6:s===e?(i-t)/r+2:(t-e)/r+4,o=Math.round(60*o),o<0&&(o+=360),h=(s+n)/2,a=0===r?0:r/(1-Math.abs(2*h-1)),a=+(100*a).toFixed(1),h=+(100*h).toFixed(1),{h:o,s:a,l:h}}const Kt=/^#([0-9a-f]{3,8})$/,Zt={transparent:4294967040},Jt={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 Qt(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function te(t){return at(t)?new re(t>>16,t>>8&255,255&t,1):ot(t)?new re(t[0],t[1],t[2]):new re(255,255,255)}function ee(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function ie(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const ne=(t,e)=>{const i=Kt.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new re((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?te(t):8===e?new re(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class se{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new se(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new se(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof se?t:new se(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(nt(Zt[t]))return function(t){return at(t)?new re(t>>>24,t>>>16&255,t>>>8&255,255&t):ot(t)?new re(t[0],t[1],t[2],t[3]):new re(255,255,255,1)}(Zt[t]);if(nt(Jt[t]))return te(Jt[t]);const e=`${t}`.trim().toLowerCase(),i=ne(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 re(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=$t(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new re(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=se.parseColorString(t);this.color=e||new re(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,s=qt(this.color.r,this.color.g,this.color.b),r=$t(it(t)?s.h:yt(t,0,360),it(e)?s.s:e>=0&&e<=1?100*e:e,it(i)?s.l:i<=1&&i>=0?100*i:i);return this.color=new re(r.r,r.g,r.b,n),this}setRGB(t,e,i){return!it(t)&&(this.color.r=t),!it(e)&&(this.color.g=e),!it(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=ne(e,!0);return null!=i?i:this}setColorName(t){const e=Jt[t.toLowerCase()];return void 0!==e&&this.setHex(e),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,s,r;return n=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),s=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),r=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),.2126*n+.7152*s+.0722*r}clone(){return new se(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=ee(t.color.r),this.color.g=ee(t.color.g),this.color.b=ee(t.color.b),this}copyLinearToSRGB(t){return this.color.r=ie(t.color.r),this.color.g=ie(t.color.g),this.color.b=ie(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class re{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)),nt(n)?this.opacity=isNaN(+n)?1:Math.max(0,Math.min(1,+n)):this.opacity=1}formatHex(){return`#${Qt(this.r)+Qt(this.g)+Qt(this.b)+(1===this.opacity?"":Qt(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}=qt(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${n}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}const oe=wt-1e-8;class ae{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,n,s,r){if(Math.abs(s-n)>oe)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let o,a,h,l,c=1/0,d=-1/0,u=1/0,p=-1/0;function g(t){h=i*Math.cos(t),l=i*Math.sin(t),h<c&&(c=h),h>d&&(d=h),l<u&&(u=l),l>p&&(p=l)}if(g(n),g(s),s!==n)if((n%=wt)<0&&(n+=wt),(s%=wt)<0&&(s+=wt),s<n&&(r=!r,o=n,n=s,s=o),r)for(s-=wt,o=n-n%xt,a=0;a<4&&o>s;++a,o-=xt)g(o);else for(o=n-n%xt+xt,a=0;a<4&&o<s;++a,o+=xt)g(o);this.bounds.add(t+c,e+u),this.bounds.add(t+d,e+p)}arcTo(t,e,i,n,s){this.bounds.add(t,e)}bezierCurveTo(t,e,i,n,s,r){this.bounds.add(t,e),this.bounds.add(i,n),this.bounds.add(s,r)}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 he{constructor(){this._curves=[],this.bounds=new Vt}get curves(){return this._curves}getCurveLengths(){return this._curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const le=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,ce={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},de=0,ue=1,pe=2,ge=3,fe=4,me=5,be=6,ye=7,ve=8;let xe,we,_e,Ae,Ce,Te;var Se,Be,Ee,Me,Re,Pe,Le,Oe,Ie;function ke(t){const e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=h*r,c=-a*o,d=a*r,u=h*o,p=Math.cos(n),g=Math.sin(n),f=Math.cos(s),m=Math.sin(s),b=.5*(s-n),y=Math.sin(.5*b),v=8/3*y*y/Math.sin(b),x=e+p-v*g,w=i+g+v*p,_=e+f,A=i+m,C=_+v*m,T=A-v*f;return[l*x+c*w,d*x+u*w,l*C+c*T,d*C+u*T,l*_+c*A,d*_+u*A]}function De(t,e,i,n){const s=function(t,e,i,n,s,r,o,a,h){const l=Ot(o),c=Math.sin(l),d=Math.cos(l),u=d*(a-t)*.5+c*(h-e)*.5,p=d*(h-e)*.5-c*(a-t)*.5;let g=u*u/((i=Math.abs(i))*i)+p*p/((n=Math.abs(n))*n);g>1&&(g=Math.sqrt(g),i*=g,n*=g);const f=d/i,m=c/i,b=-c/n,y=d/n,v=f*a+m*h,x=b*a+y*h,w=f*t+m*e,_=b*t+y*e;let A=1/((w-v)*(w-v)+(_-x)*(_-x))-.25;A<0&&(A=0);let C=Math.sqrt(A);r===s&&(C=-C);const T=.5*(v+w)-C*(_-x),S=.5*(x+_)+C*(w-v),B=Math.atan2(x-S,v-T);let E=Math.atan2(_-S,w-T)-B;E<0&&1===r?E+=wt:E>0&&0===r&&(E-=wt);const M=Math.ceil(Math.abs(E/(xt+.001))),R=[];for(let t=0;t<M;++t){const e=B+t*E/M,s=B+(t+1)*E/M;R[t]=[T,S,e,s,i,n,c,d]}return R}(n[5],n[6],n[0],n[1],n[3],n[4],n[2],e,i);for(let e=0;e<s.length;++e){const i=ke(s[e]);t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])}}!function(t){t[t.NONE=0]="NONE",t[t.UPDATE_BOUNDS=1]="UPDATE_BOUNDS",t[t.UPDATE_SHAPE=2]="UPDATE_SHAPE",t[t.CLEAR_SHAPE=253]="CLEAR_SHAPE",t[t.UPDATE_SHAPE_AND_BOUNDS=3]="UPDATE_SHAPE_AND_BOUNDS",t[t.INIT=179]="INIT",t[t.CLEAR_BOUNDS=254]="CLEAR_BOUNDS",t[t.UPDATE_GLOBAL_MATRIX=32]="UPDATE_GLOBAL_MATRIX",t[t.CLEAR_GLOBAL_MATRIX=223]="CLEAR_GLOBAL_MATRIX",t[t.UPDATE_LOCAL_MATRIX=16]="UPDATE_LOCAL_MATRIX",t[t.CLEAR_LOCAL_MATRIX=239]="CLEAR_LOCAL_MATRIX",t[t.UPDATE_GLOBAL_LOCAL_MATRIX=48]="UPDATE_GLOBAL_LOCAL_MATRIX",t[t.UPDATE_LAYOUT=128]="UPDATE_LAYOUT",t[t.CLEAR_LAYOUT=127]="CLEAR_LAYOUT"}(Se||(Se={})),function(t){t[t.GLOBAL=1]="GLOBAL",t[t.LOCAL=16]="LOCAL",t[t.GLOBAL_ACCURATE=3]="GLOBAL_ACCURATE",t[t.LOCAL_ACCURATE=48]="LOCAL_ACCURATE"}(Be||(Be={})),function(t){t[t.INIT=0]="INIT",t[t.DEFAULT=1]="DEFAULT",t[t.STATE=2]="STATE",t[t.ANIMATE_BIND=10]="ANIMATE_BIND",t[t.ANIMATE_PLAY=11]="ANIMATE_PLAY",t[t.ANIMATE_START=12]="ANIMATE_START",t[t.ANIMATE_UPDATE=13]="ANIMATE_UPDATE",t[t.ANIMATE_END=14]="ANIMATE_END",t[t.TRANSLATE=20]="TRANSLATE",t[t.TRANSLATE_TO=21]="TRANSLATE_TO",t[t.SCALE=22]="SCALE",t[t.SCALE_TO=23]="SCALE_TO",t[t.ROTATE=24]="ROTATE",t[t.ROTATE_TO=25]="ROTATE_TO"}(Ee||(Ee={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(Me||(Me={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(Re||(Re={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(Pe||(Pe={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(Le||(Le={})),function(t){t[t.CubicBezierCurve=0]="CubicBezierCurve",t[t.QuadraticBezierCurve=1]="QuadraticBezierCurve",t[t.ArcCurve=2]="ArcCurve",t[t.LineCurve=3]="LineCurve",t[t.EllipseCurve=4]="EllipseCurve",t[t.MoveCurve=5]="MoveCurve"}(Oe||(Oe={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Ie||(Ie={}));const Fe=[(t,e,i,n,s,r,o)=>e.arc(t[1]*s+i,t[2]*r+n,t[3]*(s+r)/2,t[4],t[5],t[6],o),(t,e,i,n,s,r,o)=>e.arcTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*(s+r)/2,o),(t,e,i,n,s,r,o)=>e.bezierCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,t[5]*s+i,t[6]*r+n,o),(t,e,i,n)=>e.closePath(),(t,e,i,n,s,r)=>e.ellipse(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,n,s,r,o)=>e.lineTo(t[1]*s+i,t[2]*r+n,o),(t,e,i,n,s,r,o)=>e.moveTo(t[1]*s+i,t[2]*r+n,o),(t,e,i,n,s,r,o)=>e.quadraticCurveTo(t[1]*s+i,t[2]*r+n,t[3]*s+i,t[4]*r+n,o),(t,e,i,n,s,r,o)=>e.rect(t[1]*s+i,t[2]*r+n,t[3]*s,t[4]*r,o)];function Ne(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,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6?arguments[6]:void 0;for(let a=0;a<t.length;a++){const h=t[a];Fe[h[0]](h,e,i,n,s,r,o)}}class Ue{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function je(t,e){let i=0;const n=t.length;for(let s=0;s<n;s++){const r=t[s],o=e[s],a=t[(s+1)%n],h=e[(s+1)%n];i+=Lt.distanceNN(r,o,a,h)}return i/2}function He(t,e,i,n,s){const r=1-s;return r*r*r*t+3*e*s*r*r+3*i*s*s*r+n*s*s*s}function ze(t,e,i,n,s){const r=He(t.x,e.x,i.x,n.x,s),o=He(t.y,e.y,i.y,n.y,s);return new Pt(r,o)}function Ge(t,e,i,n){const s=1-n;return s*s*t+2*s*n*e+n*n*i}function We(t,e,i,n){const s=Ge(t.x,e.x,i.x,n),r=Ge(t.y,e.y,i.y,n);return new Pt(s,r)}class Ve extends Ue{constructor(t,e,i){super(),this.type=Oe.QuadraticBezierCurve,this.p0=t,this.p1=e,this.p2=i}_validPoint(){return Number.isFinite(this.p0.x+this.p0.y+this.p1.x+this.p1.y+this.p2.x+this.p2.y)}getPointAt(t){if(!1!==this.defined)return We(this.p0,this.p1,this.p2,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,je([t.x,e.x,i.x],[t.y,e.y,i.y])):60;var t,e,i}calcProjLength(t){return t===Le.ROW?At(this.p0.x-this.p2.x):t===Le.COLUMN?At(this.p0.y-this.p2.y):0}getAngleAt(t){const e=St(t-.01,0),i=Bt(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return Ct(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.quadraticCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i);else if(r>0){const[o]=function(t,e){const{p0:i,p1:n,p2:s}=t,r=We(i,n,s,e),o=Lt.pointAtPP(i,n,e),a=Lt.pointAtPP(n,s,e);return[new Ve(i,o,r),new Ve(r,a,s)]}(this,r);t.quadraticCurveTo(o.p1.x*n+e,o.p1.y*s+i,o.p2.x*n+e,o.p2.y*s+i)}}getYAt(t){throw new Error("QuadraticBezierCurve暂不支持getYAt")}includeX(t){throw new Error("QuadraticBezierCurve暂不支持includeX")}}function Ye(t,e){const{p0:i,p1:n,p2:s,p3:r}=t,o=ze(i,n,s,r,e),a=Lt.pointAtPP(i,n,e),h=Lt.pointAtPP(n,s,e),l=Lt.pointAtPP(s,r,e),c=Lt.pointAtPP(a,h,e),d=Lt.pointAtPP(h,l,e);return[new Xe(i,a,c,o),new Xe(o,d,l,r)]}class Xe extends Ue{constructor(t,e,i,n){super(),this.type=Oe.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=n}_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 ze(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?(t=this.p0,e=this.p1,i=this.p2,n=this.p3,je([t.x,e.x,i.x,n.x],[t.y,e.y,i.y,n.y])):60;var t,e,i,n}calcProjLength(t){return t===Le.ROW?At(this.p0.x-this.p3.x):t===Le.COLUMN?At(this.p0.y-this.p3.y):0}getAngleAt(t){const e=St(t-.01,0),i=Bt(t+.01,1),n=this.getPointAt(e),s=this.getPointAt(i);return Ct(s.y-n.y,s.x-n.x)}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.bezierCurveTo(this.p1.x*n+e,this.p1.y*s+i,this.p2.x*n+e,this.p2.y*s+i,this.p3.x*n+e,this.p3.y*s+i);else if(r>0){const[o]=Ye(this,r);t.bezierCurveTo(o.p1.x*n+e,o.p1.y*s+i,o.p2.x*n+e,o.p2.y*s+i,o.p3.x*n+e,o.p3.y*s+i)}}includeX(t){const e=Bt(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=St(this.p0.x,this.p1.x,this.p2.x,this.p3.x);return t>=e&&t<=i}getYAt(t){const e=Bt(this.p0.x,this.p1.x,this.p2.x,this.p3.x),i=(t-e)/(St(this.p0.x,this.p1.x,this.p2.x,this.p3.x)-e);return this.getPointAt(i).y}}function $e(t,e){const{p0:i,p1:n}=t,s=Lt.pointAtPP(i,n,e);return[new qe(i,s),new qe(s,n)]}class qe extends Ue{constructor(t,e){super(),this.type=Oe.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return Lt.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=Ct(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()?Lt.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===Le.ROW?At(this.p0.x-this.p1.x):t===Le.COLUMN?At(this.p0.y-this.p1.y):0}draw(t,e,i,n,s,r){if(t.moveTo(this.p0.x*n+e,this.p0.y*s+i),r>=1)t.lineTo(this.p1.x*n+e,this.p1.y*s+i);else if(r>0){const o=this.getPointAt(r);t.lineTo(o.x*n+e,o.y*s+i)}}includeX(t){return t>=this.p0.x&&t<=this.p1.x||t>=this.p1.x&&t<=this.p0.x}getYAt(t){if(this.includeX(t)){let e=this.p0,i=this.p1;this.p0.x>this.p1.x&&(e=this.p1,i=this.p0);const n=(t-e.x)/(i.x-e.x);return e.y+n*(i.y-e.y)}return 1/0}}class Ke{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,s,r,o,a){const h=new Xe(new Pt(this._lastX,this._lastY),new Pt(t,e),new Pt(i,n),new Pt(s,r));h.originP1=this._lastOriginP,h.originP2=a,h.defined=o,this.curves.push(h),this._lastX=s,this._lastY=r,this._lastOriginP=a}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 s=this.addLinearCurve(t,e,i,this._lastOriginP,n);this.curves.push(s),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,s){const r=new qe(new Pt(this._lastX,this._lastY),new Pt(t,e));return r.originP1=n,r.originP2=s,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===Le.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],n=null!==(e=i.p3)&&void 0!==e?e:i.p1;return At(t.p0.y-n.y)}if(t===Le.ROW){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 At(t.p0.x-n.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Ze extends Ke{bezierCurveTo(t,e,i,n,s,r,o,a){return super.bezierCurveTo(e,t,n,i,r,s,o,a)}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 Je(t,e){let i=!1;for(let n=0,s=e.length;n<=s;n++)n>=s===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[n])}function Qe(t,e,i){const n=null!=e?e:At(i[i.length-1].x-i[0].x)>At(i[i.length-1].y-i[0].y)?Le.ROW:Le.COLUMN;return"monotoneY"===t?new Ze(t,n):new Ke(t,n)}class ti{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 ei(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 s=Qe("linear",i,t);return function(t,e){Je(t,e)}(new ti(s,n),t),s}function ii(t,e,i,n,s){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 ni{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&&ii(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:ii(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 si(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 ei(t,e);const s=Qe("basis",i,t);return function(t,e){Je(t,e)}(new ni(s,n),t),s}function ri(t){return t<0?-1:1}function oi(t,e,i){const n=t._x1-t._x0,s=e-t._x1,r=(t._y1-t._y0)/(n||Number(s<0&&-0)),o=(i-t._y1)/(s||Number(n<0&&-0)),a=(r*s+o*n)/(n+s);return(ri(r)+ri(o))*Math.min(Math.abs(r),Math.abs(o),.5*Math.abs(a))||0}function ai(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function hi(t,e,i,n,s){const r=t._x0,o=t._y0,a=t._x1,h=t._y1,l=(a-r)/3;t.context.bezierCurveTo(r+l,o+l*e,a-l,h-l*i,a,h,n,t.lastPoint1)}class li{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:hi(this,this._t0,ai(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,hi(this,ai(this,e=oi(this,i,n)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:hi(this,this._t0,e=oi(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 ci extends li{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function di(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 ei(t,e);const s=Qe("monotoneX",i,t);return function(t,e){Je(t,e)}(new li(s,n),t),s}function ui(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 ei(t,e);const s=Qe("monotoneY",i,t);return function(t,e){Je(t,e)}(new ci(s,n),t),s}let pi=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()}};class gi extends pi{lineEnd(){this.context.closePath()}}function fi(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new Ke("step",null!=n?n:At(t[t.length-1].x-t[0].x)>At(t[t.length-1].y-t[0].y)?Le.ROW:Le.COLUMN);return mi(new pi(r,e,s),t),r}function mi(t,e){return Je(t,e)}class bi extends ti{lineEnd(){this.context.closePath()}}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;const s=Qe("linear",i,t);return function(t,e){Je(t,e)}(new bi(s,n),t),s}function vi(t,e,i,n,s){let r=t._x1,o=t._y1,a=t._x2,h=t._y2;if(t._l01_a>1e-12){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);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,o=(o*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>1e-12){const n=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*n+t._x1*t._l23_2a-e*t._l12_2a)/s,h=(h*n+t._y1*t._l23_2a-i*t._l12_2a)/s}t.context.bezierCurveTo(r,o,a,h,t._x2,t._y2,n,t.lastPoint1)}function xi(t,e){return function(i,n){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:o}=s;if(i.length<2-Number(!!o))return null;if(i.length<3-Number(!!o))return ei(i,s);const a=Qe(t,r,i);return Je(new e(a,n,o),i),a}}const wi=xi("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:vi(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 _i=xi("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:vi(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()}});class Ai{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.addCurve(i),this._lastX=t,this._lastY=e}addLinearCurve(t,e){return new qe(new Pt(this._lastX,this._lastY),new Pt(t,e))}quadraticCurveTo(t,e,i,n){const s=new Ve(new Pt(this._lastX,this._lastY),new Pt(t,e),new Pt(i,n));this.path.addCurve(s),this._lastX=i,this._lastY=n}bezierCurveTo(t,e,i,n,s,r){const o=new Xe(new Pt(this._lastX,this._lastY),new Pt(t,e),new Pt(i,n),new Pt(s,r));this.path.addCurve(o),this._lastX=s,this._lastY=r}arcTo(t,e,i,n,s){throw new Error("CurveContext不支持调用arcTo")}ellipse(t,e,i,n,s,r,o,a){throw new Error("CurveContext不支持调用ellipse")}rect(t,e,i,n){throw new Error("CurveContext不支持调用rect")}arc(t,e,i,n,s,r){throw new Error("CurveContext不支持调用arc")}closePath(){this.path.curves.length<2||this.lineTo(this._startX,this._startY)}}function Ci(t,e,i){var n,s;switch(e){case"linear":default:return ei(t,i);case"basis":return si(t,i);case"monotoneX":return di(t,i);case"monotoneY":return ui(t,i);case"step":return fi(t,.5,i);case"stepClosed":return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:n,startPoint:s}=i;if(t.length<2-Number(!!s))return null;const r=new Ke("step",null!=n?n:At(t[t.length-1].x-t[0].x)>At(t[t.length-1].y-t[0].y)?Le.ROW:Le.COLUMN);return mi(new gi(r,e,s),t),r}(t,.5,i);case"stepBefore":return fi(t,0,i);case"stepAfter":return fi(t,1,i);case"catmullRom":return wi(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"catmullRomClosed":return _i(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"linearClosed":return yi(t,i)}}class Ti extends he{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new ae(this.bounds)}get curves(){return this.tryBuildCurves()}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([be,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([me,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.commandList.push([ye,t,e,i,n]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,s,r){return this.commandList.push([pe,t,e,i,n,s,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,n,s,r),this}arcTo(t,e,i,n,s){return this.commandList.push([ue,t,e,i,n,s]),this._ctx&&this._ctx.arcTo(t,e,i,n,s),this}ellipse(t,e,i,n,s,r,o,a){return this.commandList.push([fe,t,e,i,n,s,r,o,a]),this._ctx&&this._ctx.ellipse(t,e,i,n,s,r,o,a),this}rect(t,e,i,n){return this.commandList.push([ve,t,e,i,n]),this._ctx&&this._ctx.rect(t,e,i,n),this}arc(t,e,i,n,s,r){return this.commandList.push([de,t,e,i,n,s,r]),this._ctx&&this._ctx.arc(t,e,i,n,s,r),this}closePath(){return this.commandList.push([ge]),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()}tryBuildCurves(){if(!this._curves||!this._curves.length){const t=new Ai(this);Ne(this.commandList,t,0,0,1,1)}return this._curves}toString(){if(!this.toStringCbList){const t=[];t[be]=t=>`M${t[1]} ${t[2]}`,t[me]=t=>`L${t[1]} ${t[2]}`,t[ye]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[pe]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[de]=t=>{const e=[];((t,e,i,n,s,r,o)=>{const a=Math.abs(i-e),h=a>.5*Math.PI?Math.ceil(2*a/Math.PI):1,l=(i-e)/h;for(let i=0;i<h;i++){const a=e+l*i,h=e+l*(i+1),c=4*Math.tan(Math.abs(l)/4)/3,d=h<a?-1:1,u=Math.cos(a),p=Math.sin(a),g=Math.cos(h),f=Math.sin(h),m=u*r+n,b=p*o+s,y=g*r+n,v=f*o+s,x=r*c*d,w=o*c*d;t.push(m-x*p,b+w*u,y+x*f,v-w*g,y,v)}})(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[ve]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[ge]=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,s){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,n;const s=[];for(let t=0,r=e.length;t<r;t++)if(xe=e[t],we=xe.slice(1),_e=xe[0],i=[_e],n=we.match(le),null!==n){for(let t=0,e=n.length;t<e;t++)Ae=n[t],Ce=parseFloat(Ae),Number.isNaN(Ce)||i.push(Ce);if(Te=ce[_e],i.length-1>Te){let t,e=_e;for(let n=1,r=i.length;n<r;n+=Te){t=[e];for(let e=n,s=n+Te;e<s;e++)t.push(i[e]);s.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else s.push(i)}else s.push(i);return s}(t);return this._runCommandStrList(r,e,i,n,s),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:n}=t.attribute;if(!e)return;const s=Ci(e,i);"x"===n?this.direction=Le.ROW:"y"===n?this.direction=Le.COLUMN:"auto"===n&&(this.direction=s.direction),this._curves=s.curves}fromCustomPath2D(t,e,i,n,s){return this.clear(),this._runCommandList(t.commandList,e,i,n,s),this._updateBounds(),this}transform(t,e,i,n){const s=this.commandList;if(!this.transformCbList){const t=[];t[be]=this.moveToTransform,t[me]=this.lineToTransform,t[ye]=this.quadraticCurveToTransform,t[pe]=this.bezierCurveToTransform,t[ue]=this.arcToTransform,t[fe]=this.ellipseTransform,t[ve]=this.rectTransform,t[de]=this.arcTransform,t[ge]=this.closePathTransform,this.transformCbList=t}s.forEach((s=>{this.transformCbList[s[0]](s,t,e,i,n)})),this._updateBounds()}moveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}lineToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i}quadraticCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i}bezierCurveToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*n+e,t[6]=t[6]*s+i}arcToTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n+e,t[4]=t[4]*s+i,t[5]=t[5]*(n+s)/2}ellipseTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}rectTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*n,t[4]=t[4]*s}arcTransform(t,e,i,n,s){t[1]=t[1]*n+e,t[2]=t[2]*s+i,t[3]=t[3]*(n+s)/2}closePathTransform(){}_runCommandStrList(t){let e,i,n,s,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=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,d=0,u=0,p=0,g=0;for(let f=0,m=t.length;f<m;++f){switch(e=t[f],1===h&&1===l||(e=Bi(e,h,l)),e[0]){case"l":d+=e[1],u+=e[2],this.lineTo(d+o,u+a);break;case"L":d=e[1],u=e[2],this.lineTo(d+o,u+a);break;case"h":d+=e[1],this.lineTo(d+o,u+a);break;case"H":d=e[1],this.lineTo(d+o,u+a);break;case"v":u+=e[1],this.lineTo(d+o,u+a);break;case"V":u=e[1],this.lineTo(d+o,u+a);break;case"m":d+=e[1],u+=e[2],this.moveTo(d+o,u+a);break;case"M":d=e[1],u=e[2],this.moveTo(d+o,u+a);break;case"c":i=d+e[5],n=u+e[6],p=d+e[3],g=u+e[4],this.bezierCurveTo(d+e[1]+o,u+e[2]+a,p+o,g+a,i+o,n+a),d=i,u=n;break;case"C":d=e[5],u=e[6],p=e[3],g=e[4],this.bezierCurveTo(e[1]+o,e[2]+a,p+o,g+a,d+o,u+a);break;case"s":i=d+e[3],n=u+e[4],null===c[0].match(/[CcSs]/)?(p=d,g=u):(p=2*d-p,g=2*u-g),s=d+e[1],r=u+e[2],this.bezierCurveTo(p+o,g+a,s+o,r+a,i+o,n+a),p=s,g=r,d=i,u=n;break;case"S":i=e[3],n=e[4],null===c[0].match(/[CcSs]/)?(p=d,g=u):(p=2*d-p,g=2*u-g),s=e[1],r=e[2],this.bezierCurveTo(p+o,g+a,s+o,r+a,i+o,n+a),p=s,g=r,d=i,u=n;break;case"q":i=d+e[3],n=u+e[4],p=d+e[1],g=u+e[2],this.quadraticCurveTo(p+o,g+a,i+o,n+a),d=i,u=n;break;case"Q":i=e[3],n=e[4],this.quadraticCurveTo(e[1]+o,e[2]+a,i+o,n+a),d=i,u=n,p=e[1],g=e[2];break;case"t":i=d+e[1],n=u+e[2],null===c[0].match(/[QqTt]/)?(p=d,g=u):"t"===c[0]?(p=2*d-s,g=2*u-r):"q"===c[0]&&(p=2*d-p,g=2*u-g),s=p,r=g,this.quadraticCurveTo(p+o,g+a,i+o,n+a),d=i,u=n,p=d+e[1],g=u+e[2];break;case"T":i=e[1],n=e[2],p=2*d-p,g=2*u-g,this.quadraticCurveTo(p+o,g+a,i+o,n+a),d=i,u=n;break;case"a":De(this,d+o,u+a,[e[1],e[2],e[3],e[4],e[5],e[6]+d+o,e[7]+u+a]),d+=e[6],u+=e[7];break;case"A":De(this,d+o,u+a,[e[1],e[2],e[3],e[4],e[5],e[6]+o,e[7]+a]),d=e[6],u=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,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==n||1!==s)for(let r=0,o=t.length;r<o;++r){const o=t[r].slice();switch(o[0]){case me:this.lineToTransform(o,e,i,n,s);break;case be:this.moveToTransform(o,e,i,n,s);break;case pe:this.bezierCurveToTransform(o,e,i,n,s);break;case ye:this.quadraticCurveToTransform(o,e,i,n,s);break;case de:this.arcToTransform(o,e,i,n,s);break;case fe:this.ellipseTransform(o,e,i,n,s);break;case ve:this.rectTransform(o,e,i,n,s);break;case ue:this.arcToTransform(o,e,i,n,s);break;case ge:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Ne(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Le.COLUMN){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return At(t.p0.y-e.p1.y)}if(this.direction===Le.ROW){if(!this._curves.length)return 0;const t=this._curves[0],e=this._curves[this._curves.length-1];return At(t.p0.x-e.p1.x)}return this._curves.reduce(((t,e)=>t+e.getLength()),0)}getYAt(t){if(!this.curves)return 1/0;for(let e=0;e<this.curves.length;e++){const i=this.curves[e];if(i.includeX(t))return i.getYAt(t)}return 1/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 s=e.getLength(this.direction);if(i+s>=t)break;i+=s}const n=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(n),angle:e.getAngleAt(n)}}drawWithClipRange(t,e,i,n,s){this.tryBuildCurves();const r=this.getLength()*s;let o=0;for(let s=0;s<this._curves.length;s++){const a=this._curves[s],h=a.getLength(this.direction);if(!(o+h<=r)){const s=1-(o+h-r)/h;a.draw(t,i,n,e,e,s);break}a.draw(t,i,n,e,e,1),o+=h}}}const Si=["l",0,0,0,0,0,0,0];function Bi(t,e,i){const n=Si[0]=t[0];if("a"===n||"A"===n)Si[1]=e*t[1],Si[2]=i*t[2],Si[3]=t[3],Si[4]=t[4],Si[5]=t[5],Si[6]=e*t[6],Si[7]=i*t[7];else if("h"===n||"H"===n)Si[1]=e*t[1];else if("v"===n||"V"===n)Si[1]=i*t[1];else for(let n=1,s=t.length;n<s;++n)Si[n]=(n%2==1?e:i)*t[n];return Si}const Ei={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 Xt},Mi={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},Ri=Object.assign({outerBorder:Object.assign(Object.assign({},Mi),{distance:0}),innerBorder:Object.assign(Object.assign({},Mi),{distance:0})},Mi),Pi={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:q.fontBounding,keepCenterInLine:!1},Li=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,autoAnimateTexture:!1,textureRatio:1,textureOptions:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,backgroundKeepAspectRatio:!1,backgroundClip:!0,backgroundScale:1,backgroundOffsetX:0,backgroundOffsetY:0,blur:0,filter:"",cursor:null,html:null,react:null,vue:null},{fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0}),Ri),{alignSelf:"auto"}),{pickStrokeBuffer:0}),Oi={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},Ii=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,clipConfig:null},{_debug_bounds:!1}),Li),Ei),ki=Object.assign(Object.assign({},Ii),{startAngle:0,endAngle:_t,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),Di=Object.assign(Object.assign(Object.assign({},Ii),Oi),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),Fi=Object.assign(Object.assign({},Ii),{radius:1,startAngle:0,endAngle:_t}),Ni=Object.assign(Object.assign({},Ii),{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,cornerType:"round"}),Ui=Object.assign(Object.assign({},Ii),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),ji=Object.assign(Object.assign(Object.assign({},Ii),Oi),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Hi=Object.assign(Object.assign({},Ii),{path:new Ti,fillStrokeOrder:1,clipRange:1,customPath:()=>{mt.getInstance().warn("空函数")}}),zi=Object.assign(Object.assign({},Ii),{points:[],cornerRadius:0,closePath:!0}),Gi=Object.assign(Object.assign({},Ii),{width:100,height:100,spikes:5,thickness:.5}),Wi=Object.assign(Object.assign({},Ii),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0,cornerType:"round"});Object.assign(Object.assign({},Ii),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0,cornerType:"round"});const Vi=Object.assign(Object.assign({},Ii),{symbolType:"circle",size:10,keepDirIn3d:!0,clipRange:1}),Yi=Object.assign(Object.assign(Object.assign({},Ii),Pi),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Xi=Object.assign(Object.assign(Object.assign({},Ii),Pi),{upgradeAttrs:null,editable:!1,editOptions:null,ascentDescentMode:"actual",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}),$i=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0,maxWidth:500,maxHeight:500},Ii),{fill:!0,cornerRadius:0,cornerType:"round"}),qi=Object.assign(Object.assign({},$i),{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});const Ki=new class{},Zi=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 s("linear",t.linearGradient,r)||s("radial",t.radialGradient,a)||s("conic",t.conicGradient,o)}function s(e,n,s){return function(n,r){const o=b(n);if(o){b(t.startCall)||i("Missing (");const n=function(n){const r=s();return r&&(b(t.comma)||i("Missing comma before color stops")),{type:e,orientation:r,colorStops:u(p)}}();return b(t.endCall)||i("Missing )"),n}}(n)}function r(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function o(){return m("angular",t.fromAngleValue,1)}function a(){let i,n,s=h();return s&&(i=[],i.push(s),n=e,b(t.comma)&&(s=h(),s?i.push(s):e=n)),i}function h(){let t=function(){const t=m("shape",/^(circle)/i,0);return t&&(t.style=f()||l()),t}()||function(){const t=m("shape",/^(ellipse)/i,0);return t&&(t.style=g()||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=d();e&&(t={type:"default-radial",at:e})}}return t}function l(){return m("extent-keyword",t.extentKeywords,1)}function c(){if(m("position",/^at/,0)){const t=d();return t||i("Missing positioning value"),t}}function d(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function u(e){let n=e();const s=[];if(n)for(s.push(n);b(t.comma);)n=e(),n?s.push(n):i("One extra comma");return s}function p(){const e=m("hex",t.hexColor,1)||m("rgba",t.rgbaColor,1)||m("rgb",t.rgbColor,1)||m("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||f()}function f(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,i){const n=b(e);if(n)return{type:t,value:n[i]}}function b(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=u(n);return e.length>0&&i("Invalid input not EOF"),t}()}}();class Ji{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Ji.IsGradientStr(t))try{const e=Zi(t)[0];if(e){if("linear"===e.type)return Ji.ParseLinear(e);if("radial"===e.type)return Ji.ParseRadial(e);if("conic"===e.type)return Ji.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,n=vt/2,s=parseFloat(e.value)/180*vt-n;return{gradient:"conical",x:.5,y:.5,startAngle:s,endAngle:s+_t,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=vt/2;let s="angular"===e.type?parseFloat(e.value)/180*vt:0;for(;s<0;)s+=_t;for(;s>=_t;)s-=_t;let r=0,o=0,a=0,h=0;return s<n?(r=0,o=1,a=Math.sin(s),h=o-Math.cos(s)):s<vt?(r=0,o=0,a=Math.cos(s-n),h=Math.sin(s-n)):s<vt+n?(r=1,o=0,a=r-Math.sin(s-vt),h=Math.cos(s-vt)):(r=1,a=r-Math.cos(s-n-vt),h-=Math.sin(s-n-vt)),{gradient:"linear",x0:r,y0:o,x1:a,y1:h,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Qi(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;var r,o,a,h;if(!e||!0===e)return"black";let l,c;if(ot(e))for(let t=0;t<e.length&&(c=e[t],!c);t++);else c=e;if(c=Ji.Parse(c),"string"==typeof c)return c;if(i.AABBBounds&&(!i.attribute||0!==i.attribute.scaleX||0!==i.attribute.scaleY)){const e=i.AABBBounds;let d=e.x2-e.x1,u=e.y2-e.y1,p=e.x1-n,g=e.y1-s;if(i.attribute){const{scaleX:t=1,scaleY:e=1,angle:n=0}=i.attribute;d/=t,u/=e,p/=t,g/=e,(n||1!==t||1!==e)&&(p=null!==(r=i.x1WithoutTransform)&&void 0!==r?r:0,g=null!==(o=i.y1WithoutTransform)&&void 0!==o?o:0,d=null!==(a=i.widthWithoutTransform)&&void 0!==a?a:d,u=null!==(h=i.heightWithoutTransform)&&void 0!==h?h:u)}"linear"===c.gradient?l=function(t,e,i,n,s,r){var o,a,h,l;const c=t.createLinearGradient(i+(null!==(o=e.x0)&&void 0!==o?o:0)*s,n+(null!==(a=e.y0)&&void 0!==a?a:0)*r,i+(null!==(h=e.x1)&&void 0!==h?h:1)*s,n+(null!==(l=e.y1)&&void 0!==l?l:0)*r);return e.stops.forEach((t=>{c.addColorStop(t.offset,t.color)})),c}(t,c,p,g,d,u):"conical"===c.gradient?l=function(t,e,i,n,s,r){var o,a;const h=t.createConicGradient(i+(null!==(o=e.x)&&void 0!==o?o:0)*s,n+(null!==(a=e.y)&&void 0!==a?a:0)*r,e.startAngle,e.endAngle);return e.stops.forEach((t=>{h.addColorStop(t.offset,t.color)})),h.GetPattern?h.GetPattern(s+i,r+n,void 0):h}(t,c,p,g,d,u):"radial"===c.gradient&&(l=function(t,e,i,n,s,r){var o,a,h,l,c,d;const u=t.createRadialGradient(i+(null!==(o=e.x0)&&void 0!==o?o:.5)*s,n+(null!==(a=e.y0)&&void 0!==a?a:.5)*r,Math.max(s,r)*(null!==(h=e.r0)&&void 0!==h?h:0),i+(null!==(l=e.x1)&&void 0!==l?l:.5)*s,n+(null!==(c=e.y1)&&void 0!==c?c:.5)*r,Math.max(s,r)*(null!==(d=e.r1)&&void 0!==d?d:.5));return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,c,p,g,d,u))}return l||"orange"}const tn=/\w|\(|\)|-/,en=/[.?!,;:/,。?!、;:]/;function nn(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e;for(;tn.test(t[n-1])&&tn.test(t[n])||en.test(t[n]);)if(n--,n<=0)return i?sn(t,e):e;return n}function sn(t,e){let i=e;for(;tn.test(t[i+1])&&tn.test(t[i])||en.test(t[i]);)if(i++,i>=t.length)return i;return i+1}var rn=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};let on=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=Yi.fontSize}=e,n=0,s=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?n++:s++;return{width:~~(.8*n*i+s*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:Pi.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:Pi.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:Pi.fontSize;return{ascent:.79*i,descent:.21*i}}measureTextBoundLeftRightEstimate(t){var e;const i=null!==(e=t.fontSize)&&void 0!==e?e:Pi.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(t,e,i){if(!this.context)return Object.assign(Object.assign({},this.measureTextBoundADscentEstimate(e)),{width:this.estimate(t,e).width});const n=this._measureTextWithoutAlignBaseline(t,e,!0);if(i===q.actualBounding)return{ascent:n.actualBoundingBoxAscent,descent:n.actualBoundingBoxDescent,width:n.width};if(i===q.estimate)return Object.assign(Object.assign({},this.measureTextBoundADscentEstimate(e)),{width:n.width});if(i===q.fontBounding){let t=n.fontBoundingBoxAscent,e=n.fontBoundingBoxDescent;if(n.actualBoundingBoxDescent&&e<n.actualBoundingBoxDescent){const i=n.actualBoundingBoxDescent-e;e+=i,t-=i}else if(n.actualBoundingBoxAscent&&t<n.actualBoundingBoxAscent){const i=n.actualBoundingBoxAscent-t;t+=i,e-=i}return{ascent:t,descent:e,width:n.width}}return{ascent:n.actualBoundingBoxAscent,descent:n.actualBoundingBoxDescent,width:n.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:s=12}=e;t.forEach((t=>{t.width=0===t.direction?s:this.measureTextWidth(t.text,e)}));const r=[];let o=0,a=0;for(;a<t.length&&o+t[a].width<i;a++)o+=t[a].width,r.push(t[a]);if(t[a]&&t[a].text.length>1){const s=this._clipText(t[a].text,e,i-o,0,t[a].text.length-1,"end",!1);if(n&&s.str!==t[a].text){let i="",n=0;for(let e=0;e<a;e++){const s=t[e];i+=s.text,n+=s.text.length}i+=t[a].text;let r=nn(i,n+s.str.length);r-=n,r!==s.str.length-1&&(s.str=s.str.substring(0,r),s.width=this.measureTextWidth(s.str,e))}r.push(Object.assign(Object.assign({},t[a]),{text:s.str,width:s.width})),o+=s.width}return{verticalList:r,width:o}}clipText(t,e,i,n,s){if(0===t.length)return{str:"",width:0};let r=this.measureTextWidth(t,e);if(r<=i)return{str:t,width:r};if(r=this.measureTextWidth(t[0],e),r>i)return{str:"",width:0};const o=this._clipText(t,e,i,0,t.length-1,"end",!1);if(n&&o.str!==t){let i=nn(t,o.str.length,s);i!==o.str.length&&(i>o.str.length&&(o.wordBreaked=i,i=o.str.length),o.str=t.substring(0,i),o.width=this.measureTextWidth(o.str,e))}return o}_clipText(t,e,i,n,s,r,o){let a;if("start"===r)a=this._clipTextStart(t,e,i,n,s),o&&(a.result=o+a.str);else if("middle"===r){const n=this._clipTextMiddle(t,e,i,"","",0,0,1);a={str:"none",width:n.width,result:n.left+o+n.right}}else a=this._clipTextEnd(t,e,i,n,s),o&&(a.result=a.str+o);return a}_clipTextEnd(t,e,i,n,s){if(n===s){mt.getInstance().warn(`【_clipTextEnd】不应该走到这里${t}, ${n}, ${s}`);const i=t.substring(0,s+1);return{str:i,width:this.measureTextWidth(i,e)}}const r=Math.floor((n+s)/2),o=t.substring(0,r+1),a=this.measureTextWidth(o,e);let h;if(a>i){if(o.length<=1)return{str:"",width:0};const s=t.substring(0,r);return h=this.measureTextWidth(s,e),h<=i?{str:s,width:h}:this._clipTextEnd(t,e,i,n,r)}if(a<i){if(r>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(0,r+2);return h=this.measureTextWidth(n,e),h>=i?{str:o,width:a}:this._clipTextEnd(t,e,i,r,s)}return{str:o,width:a}}_clipTextStart(t,e,i,n,s){const r=Math.ceil((n+s)/2),o=t.substring(r-1,t.length),a=this.measureTextWidth(o,e);let h;if(a>i){if(o.length<=1)return{str:"",width:0};const n=t.substring(r,t.length);return h=this.measureTextWidth(n,e),h<=i?{str:n,width:h}:this._clipTextStart(t,e,i,r,t.length)}if(a<i){if(r<=0)return{str:t,width:this.measureTextWidth(t,e)};const s=t.substring(r-2,t.length);return h=this.measureTextWidth(s,e),h>=i?{str:o,width:a}:this._clipTextStart(t,e,i,n,r)}return{str:o,width:a}}_clipTextMiddle(t,e,i,n,s,r,o,a){const h=t.substring(0,a),l=this.measureTextWidth(h,e);if(l+o>i)return{left:n,right:s,width:r+o};const c=t.substring(t.length-a,t.length),d=this.measureTextWidth(c,e);return l+d>i?{left:h,right:s,width:l+o}:this._clipTextMiddle(t,e,i,h,c,l,d,a+1)}clipTextWithSuffixVertical(t,e,i,n,s,r){if(""===n)return this.clipTextVertical(t,e,i,s);if(0===t.length)return{verticalList:t,width:0};const o=this.clipTextVertical(t,e,i,s);if(o.verticalList.length===t.length&&o.verticalList[o.verticalList.length-1].width===t[t.length-1].width)return o;const a=this.measureTextWidth(n,e);if(a>i)return o;let h;if(i-=a,"start"===r){const r=this.revertVerticalList(t);h=this.clipTextVertical(r,e,i,s);const o=this.revertVerticalList(h.verticalList);o.unshift({text:n,direction:1,width:a}),h.verticalList=o}else if("middle"===r){const r=this.clipTextVertical(t,e,i/2,s),o=this.revertVerticalList(t),l=this.clipTextVertical(o,e,i/2,s);r.verticalList.push({text:n,direction:1,width:a}),this.revertVerticalList(l.verticalList).forEach((t=>r.verticalList.push(t))),h={verticalList:r.verticalList,width:r.width+l.width}}else h=this.clipTextVertical(t,e,i,s),h.verticalList.push({text:n,direction:1,width:a});return h.width+=a,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,s,r){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(""===n)return this.clipText(t,e,i,s);if(0===t.length)return{str:"",width:0};const a=this.measureTextWidth(t,e);if(!o&&a<=i)return{str:t,width:a};const h=this.measureTextWidth(n,e);if(h>i)return{str:"",width:0};if(o&&a+h<=i)return{str:t+n,width:a+h};i-=h;const l=this._clipText(t,e,i,0,t.length-1,r,n);if(s&&l.str!==t){const i=nn(t,l.str.length);i!==l.str.length&&(l.result=t.substring(0,i),l.width=this.measureTextWidth(l.str,e))}else o&&l.str===t&&(l.result=t+n);return l.str=l.result,l.width+=h,l}};on=rn([v()],on);var an=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};const hn=Symbol.for("TextMeasureContribution");let ln=class extends on{};ln=an([v()],ln);const cn=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||_,this.options=e,this.id=r.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new R}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,a,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new M(t,e),n=this._bindingDictionary.get(t)||[];return n.push(i),this._bindingDictionary.set(t,n),new I(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),s=e=>i=>{const n=this.rebind(i);return t(n,e),n};return t=>({bindFunction:e(t),isboundFunction:n(),rebindFunction:s(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),s=[];for(let t=0;t<n.length;t++){const e=i[t],n={};e.forEach((t=>{n[t.key]=t.value}));const r={inject:n[h],multiInject:n[l]},o=r.inject||r.multiInject,a={serviceIdentifier:o,constructorArgsMetadata:e},c=(this._bindingDictionary.get(o)||[]).filter((t=>t.constraint(a)));if(c.length){const t={injectIdentifier:o,metadata:e,bindings:c};s.push(t)}}return s}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case A:case S:e=t.cache;break;case B: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===w&&(t.cache=e,t.activated=!0)}},dn=Symbol.for("CanvasFactory");function un(t){return cn.getNamed(dn,Ki.global.env)(t)}function pn(t){return"number"==typeof t&&Number.isFinite(t)}const gn=new class{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=un(Object.assign({nativeCanvas:Ki.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=un(Object.assign({nativeCanvas:Ki.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=[]}};var fn=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},mn=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const bn=Symbol.for("VWindow"),yn=Symbol.for("WindowHandlerContribution");let vn=class extends G{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(){super(),this.hooks={onChange:new j(["x","y","width","height"])},this.active=()=>{const t=this.global;t.env&&!this.actived&&(cn.getNamed(yn,t.env).configure(this,t),this.actived=!0)},this._uid=r.GenAutoIncrementId(),this.global=Ki.global,this.postInit()}_nativeAddEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}_nativeRemoveEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}_nativeDispatchEvent(t){return this._handler.dispatchEvent(t)}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.clearAllEventListeners(),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}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,s,r){this._handler.setViewBoxTransform(t,e,i,n,s,r)}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&&bt(this.width,t.width())&&bt(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)}};vn=fn([v(),mn("design:paramtypes",[])],vn);var xn=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},wn=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_n=function(t,e){return function(i,n){e(i,n,t)}};let An=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=Ki.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=gn.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 s=this.global.measureTextMethod;this.global.measureTextMethod=i;const r={width:this._textMeasure.measureTextWidth(t,e),height:null!==(n=e.fontSize)&&void 0!==n?n:Pi.fontSize};return this.global.measureTextMethod=s,r}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new zt(Object.assign({defaultFontParams:{fontFamily:Pi.fontFamily,fontSize:Pi.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+zt.ALPHABET_CHAR_SET+zt.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const n=cn.get(bn),s=t.AABBBounds,r=s.width(),o=s.height(),a=-s.x1,h=-s.y1;n.create({viewBox:{x1:a,y1:h,x2:s.x2,y2:s.y2},width:r,height:o,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}};var Cn;An=xn([v(),_n(0,b(k)),_n(0,x(hn)),wn("design:paramtypes",[Object])],An),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(Cn||(Cn={}));const Tn=new Xt;let Sn=class{constructor(){this.matrix=new Xt}init(t){return this.mode=Cn.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=Cn.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const n=this.outSourceMatrix;if(Tn.setValue(n.a,n.b,n.c,n.d,n.e,n.f),this.outTargetMatrix.reset(),i){const{x:n,y:s}=i;this.outTargetMatrix.translate(n,s),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-n,-s)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Tn.a,Tn.b,Tn.c,Tn.d,Tn.e,Tn.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(Tn.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(Tn.a,Tn.b,Tn.c,Tn.d,Tn.e,Tn.f),this}scale(t,e,i){return this.mode===Cn.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===Cn.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return Tn.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Tn.a,Tn.b,Tn.c,Tn.d,Tn.e,Tn.f),this}translate(t,e){return this.mode===Cn.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===Cn.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};Sn=xn([v(),wn("design:paramtypes",[])],Sn);const Bn={arc:ki,area:Di,circle:Fi,line:ji,path:Hi,symbol:Vi,text:Yi,rect:Wi,polygon:zi,star:Gi,richtext:Xi,richtextIcon:qi,image:$i,group:Ni,glyph:Ui},En=Object.keys(Bn);function Mn(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const Rn={arc:Object.assign({},Bn.arc),area:Object.assign({},Bn.area),circle:Object.assign({},Bn.circle),line:Object.assign({},Bn.line),path:Object.assign({},Bn.path),symbol:Object.assign({},Bn.symbol),text:Object.assign({},Bn.text),rect:Object.assign({},Bn.rect),polygon:Object.assign({},Bn.polygon),star:Object.assign({},Bn.star),richtext:Object.assign({},Bn.richtext),richtextIcon:Object.assign({},Bn.richtextIcon),image:Object.assign({},Bn.image),group:Object.assign({},Bn.group),glyph:Object.assign({},Bn.glyph)};class Pn{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},En.forEach((t=>{this._defaultTheme[t]=Object.create(Rn[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,mt.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;En.forEach((n=>{const s=Object.create(Rn[n]);t&&t[n]&&Mn(s,t[n]),i[n]&&Mn(s,i[n]),e[n]&&Mn(s,e[n]),this.combinedTheme[n]=s})),e.common&&En.forEach((t=>{Mn(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 Ln=new Pn;function On(t,e){return t.glyphHost?On(t.glyphHost):e?(t.isContainer,e):function(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)):Ln.getTheme()}return null}(t)||t.attachedThemeGraphic&&On(t.attachedThemeGraphic)||Ln.getTheme()}var In=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};class kn extends J{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=r.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 In(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 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&&mt.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=tt(i,!0)&&i||st(i)&&i.capture,s=st(i)&&i.once,r=et(e)?void 0:e;return t=n?`${t}capture`:t,e=et(e)?e:e.handleEvent,s?super.once(t,e,r):super.on(t,e,r),this}on(t,e,i){return this.addEventListener(t,e,i)}removeEventListener(t,e,i){const n=tt(i,!0)&&i||st(i)&&i.capture,s=et(e)?void 0:e;t=n?`${t}capture`:t,e=et(e)?e:e.handleEvent;const r=st(i)&&i.once;return super.off(t,e,s,r),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return st(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 Dn{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=Dn.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=t.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&&et(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&&et(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Fn extends Dn{constructor(t,e){super(),this.type=t,this.detail=e}}const Nn={dispatchEvent(t){var e;if(!(t instanceof Dn))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 Fn(t,e))}};class Un{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-Un.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Un.bounceIn(2*t):.5*Un.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const n=e/_t*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*_t/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const n=e/_t*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-n)*_t/e)+1}}static getElasticInOut(t,e){return function(i){const n=e/_t*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-n)*_t/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-n)*_t/e)*.5+1}}static registerFunc(t,e){Un[t]=e}}function jn(t,e){const i=1/e;let n=1;for(;t>i;)t-=i,n*=-1;const s=n*t/i;return s>0?s:1+s}Un.quadIn=Un.getPowIn(2),Un.quadOut=Un.getPowOut(2),Un.quadInOut=Un.getPowInOut(2),Un.cubicIn=Un.getPowIn(3),Un.cubicOut=Un.getPowOut(3),Un.cubicInOut=Un.getPowInOut(3),Un.quartIn=Un.getPowIn(4),Un.quartOut=Un.getPowOut(4),Un.quartInOut=Un.getPowInOut(4),Un.quintIn=Un.getPowIn(5),Un.quintOut=Un.getPowOut(5),Un.quintInOut=Un.getPowInOut(5),Un.backIn=Un.getBackIn(1.7),Un.backOut=Un.getBackOut(1.7),Un.backInOut=Un.getBackInOut(1.7),Un.elasticIn=Un.getElasticIn(1,.3),Un.elasticOut=Un.getElasticOut(1,.3),Un.elasticInOut=Un.getElasticInOut(1,.3*1.5),Un.easeInOutQuad=t=>(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2),Un.easeOutElastic=t=>{const e=2*Math.PI/3;return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin((10*t-.75)*e)+1},Un.easeInOutElastic=t=>{const e=2*Math.PI/4.5;return 0===t?0:1===t?1:t<.5?-Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*e)/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*e)/2+1};for(let t=0;t<10;t++)Un[`flicker${t}`]=e=>jn(e,t);for(let t=2;t<10;t++)Un[`aIn${t}`]=e=>t*e*e+(1-t)*e;const Hn=new class{constructor(){this.id=r.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(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Me.END?this.removeAnimate(e):e.status===Me.RUNNING||e.status===Me.INITIAL?(this.animateCount++,e.advance(t)):e.status===Me.PAUSED&&this.animateCount++,e=e.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()}};class zn{constructor(t,e,i,n,s){this.from=t,this.to=e,this.duration=i,this.easing=n,this.params=s,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 Gn extends zn{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Wn{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.GenAutoIncrementId(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Hn,i=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=e||Hn,this.status=Me.INITIAL,this.tailAnimate=new Vn(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=i}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=St(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Wn.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(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wn.mode;t&&e&Re.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Ee.ANIMATE_PLAY})}runCb(t){const e=new Gn((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,n,s,r){const o=Wn.interpolateMap.get(t)||Wn.interpolateMap.get("");return!!o&&o(t,e,i,n,s,r)}pause(){this.status===Me.RUNNING&&(this.status=Me.PAUSED)}resume(){this.status===Me.PAUSED&&(this.status=Me.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 Vn(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(t){if(this._duringTime<this._startTime){if(this._duringTime+t*this.timeScale<this._startTime)return void(this._duringTime+=t*this.timeScale);t=this._duringTime+t*this.timeScale-this._startTime,this._duringTime=this._startTime}this.status===Me.INITIAL&&(this.status=Me.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Me.RUNNING&&(this.status=Me.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const n=this.rawPosition,s=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const r=t>=s;if(r&&(t=s),t===n)return r;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),r}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=Me.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()}}Wn.mode=Re.NORMAL,Wn.interpolateMap=new Map;class Vn{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 Yn(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(t){let e=t.duration;(null==e||e<0)&&(e=0);const i=t.easing,n="string"==typeof i?Un[i]:i,s=this._addStep(e,null,n);return s.type=Pe.customAnimate,this._appendProps(t.getEndProps(),s,!1),this._appendCustomAnimate(t,s),this}to(t,e,i,n){(null==e||e<0)&&(e=0);const s="string"==typeof i?Un[i]:i,r=this._addStep(e,null,s);return r.type=Pe.to,this._appendProps(t,r,!!n&&n.tempProps),r.propKeys||(r.propKeys=Object.keys(r.props)),n&&n.noPreventAttrs||this.target.animates&&this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(r.propKeys)})),this}from(t,e,i,n){this.to(t,0,i,n);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,e,i,n),this.stepTail.type=Pe.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(t){if(t>0){const e=this._addStep(+t,null);e.type=Pe.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){const n=new Yn(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 s=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===s[t]&&(s[t]=n.props[t])}))),e.propKeys=Object.keys(e.props),n=n.prev;const r=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(s)),e.propKeys.forEach((t=>{if(void 0===r[t]){const e=this.animate.getStartProps();r[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,s=this.rawPosition;let r,o,a=!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&&(a=!0,i<0))return a;if(r=Math.floor(t/i),o=t-r*i,a=t>=n*i+i,a&&(o=i,r=n,t=o*r+i),t===s)return a;const l=!this.reversed!=!(this.bounce&&r%2);return l&&(o=i-o),this._deltaPosition=o-this.position,this.position=o,this.rawPosition=t+h,this.updatePosition(a,l),a}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const n=this.position,s=this.duration;if(this.target&&i){let r=i.next;for(;r&&r.position<=n;)i=r,r=i.next;let o=t?0===s?1:n/s:(n-i.position)/i.duration;i.easing&&(o=i.easing(o)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,o,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,o)))}}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 mt.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 Yn{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 Xn=200,$n="cubicOut";var qn;!function(t){t[t.Top=1]="Top",t[t.Right=2]="Right",t[t.Bottom=4]="Bottom",t[t.Left=8]="Left",t[t.ALL=15]="ALL"}(qn||(qn={}));const Kn=[0,0,0,0];function Zn(t,e){if(ot(t)){let i;for(let n=0;n<t.length&&void 0===i;n++)i=t[n][e];return i}return t[e]}var Jn;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Jn||(Jn={}));class Qn{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Jn.Color1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===Jn.Color1){const e=Qn.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const n=se.parseColorString(t);if(n){const e=[n.r/255,n.g/255,n.b/255,n.opacity];Qn.store1[t]=e,Qn.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const n=Qn.store255[t];if(n)return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i;const s=se.parseColorString(t);return s&&(Qn.store1[t]=[s.r/255,s.g/255,s.b/255,s.opacity],Qn.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=s.r,i[1]=s.g,i[2]=s.b,i[3]=s.opacity),i}static Set(t,e,i){if(e===Jn.Color1){if(Qn.store1[t])return;Qn.store1[t]=i,Qn.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Qn.store255[t])return;Qn.store255[t]=i,Qn.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function ts(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&at(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 es(t,e,i,n,s){return Array.isArray(t)&&!at(t[0])||Array.isArray(e)&&!at(e[0])?new Array(4).fill(0).map(((s,r)=>is(ot(t)?t[r]:t,ot(e)?e[r]:e,i,n))):is(t,e,i,n,s)}function is(t,e,i,n,s){if(!t||!e)return t&&ts(t)||e&&ts(e)||!1;let r,o,a=!1,h=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=Qn.Get(t,Jn.Color255):a=!0,Array.isArray(e)?o=e:"string"==typeof e?o=Qn.Get(e,Jn.Color255):h=!0,a!==h){const r=a?t:e,o=a?e:t,h=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:ts(o)})))});return a?es(r,h,i,n,s):es(h,r,i,n,s)}if(a){if(t.gradient===e.gradient){const n=t,s=e,r=n.stops,o=s.stops;if(r.length!==o.length)return!1;if("linear"===n.gradient)return function(t,e,i){const n=t.stops,s=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:rs(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("radial"===n.gradient)return function(t,e,i){const n=t.stops,s=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:rs(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i);if("conical"===n.gradient)return function(t,e,i){const n=t.stops,s=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:rs(n[e].color,s[e].color,i),offset:n[e].offset+(s[e].offset-n[e].offset)*i})))}}(n,s,i)}return!1}return s&&s(r,o),ts(function(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]}(r,o,i),n)}Qn.store255={},Qn.store1={};const ns=[0,0,0,0],ss=[0,0,0,0];function rs(t,e,i){return Qn.Get(t,Jn.Color255,ns),Qn.Get(e,Jn.Color255,ss),`rgba(${Math.round(ns[0]+(ss[0]-ns[0])*i)},${Math.round(ns[1]+(ss[1]-ns[1])*i)},${Math.round(ns[2]+(ss[2]-ns[2])*i)},${ns[3]+(ss[3]-ns[3])*i})`}class os{static GetImage(t,e){var i;const n=os.cache.get(t);n?"fail"===n.loadState?Ki.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):os.loadImage(t,e)}static GetSvg(t,e){var i;let n=os.cache.get(t);n?"fail"===n.loadState?Ki.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"},os.cache.set(t,n),n.dataPromise=Ki.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,s)=>{(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=os.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"},os.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=Ki.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=Ki.global.loadBlob(t):"json"===e&&(i.dataPromise=Ki.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!os.isLoading&&os.toLoadAueue.length){os.isLoading=!0;const t=os.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:n}=t,s={type:"image",loadState:"init"};if(os.cache.set(i,s),s.dataPromise=Ki.global.loadImage(i),s.dataPromise){s.waitingMark=n;const t=s.dataPromise.then((t=>{var e;s.loadState=(null==t?void 0:t.data)?"success":"fail",s.data=null==t?void 0:t.data,null===(e=s.waitingMark)||void 0===e||e.map(((e,n)=>{(null==t?void 0:t.data)?(s.loadState="success",s.data=t.data,e.imageLoadSuccess(i,t.data)):(s.loadState="fail",e.imageLoadFail(i))})),s.waitingMark&&(s.waitingMark=[])}));e.push(t)}else s.loadState="fail",n.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{os.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),os.loading()})).catch((t=>{os.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),os.loading()}))}}),0)}static loadImage(t,e){const i=as(t,os.toLoadAueue);if(-1!==i)return os.toLoadAueue[i].marks.push(e),void os.loading();os.toLoadAueue.push({url:t,marks:[e]}),os.loading()}static improveImageLoading(t){const e=as(t,os.toLoadAueue);if(-1!==e){const t=os.toLoadAueue.splice(e,1);os.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function as(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}os.cache=new Map,os.isLoading=!1,os.toLoadAueue=[],os.onLoadSuccessCb=[];class hs{bounds(t,e){if(at(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 at(t)?t:Math.min(t[0],t[1])}}function ls(t,e,i,n,s){return s?t.arc(i,n,e,0,wt,!1,s):t.arc(i,n,e,0,wt),!1}var cs=new class extends hs{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,s){return ls(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return ls(t,this.parseSize(e)/2+s,i,n,r)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} a ${s},${s} 0 1,0 ${2*s},0 a ${s},${s} 0 1,0 -${2*s},0`}};var ds=new class extends hs{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,s){return function(t,e,i,n,s){return t.moveTo(-3*e+i,-e+n,s),t.lineTo(-e+i,-e+n,s),t.lineTo(-e+i,-3*e+n,s),t.lineTo(e+i,-3*e+n,s),t.lineTo(e+i,-e+n,s),t.lineTo(3*e+i,-e+n,s),t.lineTo(3*e+i,e+n,s),t.lineTo(e+i,e+n,s),t.lineTo(e+i,3*e+n,s),t.lineTo(-e+i,3*e+n,s),t.lineTo(-e+i,e+n,s),t.lineTo(-3*e+i,e+n,s),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s)}drawOffset(t,e,i,n,s,r){return function(t,e,i,n,s,r){return t.moveTo(-3*e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-e+n-s,r),t.lineTo(-e+i-s,-3*e+n-s,r),t.lineTo(e+i+s,-3*e+n-s,r),t.lineTo(e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,-e+n-s,r),t.lineTo(3*e+i+s,e+n+s,r),t.lineTo(e+i+s,e+n+s,r),t.lineTo(e+i+s,3*e+n+s,r),t.lineTo(-e+i-s,3*e+n+s,r),t.lineTo(-e+i-s,e+n+s,r),t.lineTo(-3*e+i-s,e+n+s,r),t.closePath(),!0}(t,this.parseSize(e)/6,i,n,s,r)}};function us(t,e,i,n,s){return t.moveTo(i,n-e,s),t.lineTo(e+i,n,s),t.lineTo(i,n+e,s),t.lineTo(i-e,n,s),t.closePath(),!0}var ps=new class extends hs{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,n,s){return us(t,this.parseSize(e)/2,i,n,s)}drawFitDir(t,e,i,n,s){return us(t,this.parseSize(e)/2,i,n,s)}drawOffset(t,e,i,n,s,r){return us(t,this.parseSize(e)/2+s,i,n,r)}};function gs(t,e,i,n){const s=2*e;return t.rect(i-e,n-e,s,s),!1}var fs=new class extends hs{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,n){return gs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return gs(t,this.parseSize(e)/2+s,i,n)}};function ms(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i+e+2*s,e+n+s),t.lineTo(i-e-2*s,e+n+s),t.lineTo(i,n-e-2*s),t.closePath(),!0}class bs extends hs{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 ms(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ms(t,this.parseSize(e)/2,i,n,s)}}var ys=new bs;var vs=new class extends bs{constructor(){super(...arguments),this.type="triangle"}};const xs=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ws=Math.sin(wt/10)*xs,_s=-Math.cos(wt/10)*xs;function As(t,e,i,n){const s=ws*e,r=_s*e;t.moveTo(i,-e+n),t.lineTo(s+i,r+n);for(let o=1;o<5;++o){const a=wt*o/5,h=Math.cos(a),l=Math.sin(a);t.lineTo(l*e+i,-h*e+n),t.lineTo(h*s-l*r+i,l*s+h*r+n)}return t.closePath(),!0}var Cs=new class extends hs{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 As(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return As(t,this.parseSize(e)/2+s,i,n)}};const Ts=Mt(3);function Ss(t,e,i,n){const s=e,r=s/Ts,o=r/5,a=e;return t.moveTo(0+i,-s+n),t.lineTo(r/2+i,n),t.lineTo(o/2+i,n),t.lineTo(o/2+i,a+n),t.lineTo(-o/2+i,a+n),t.lineTo(-o/2+i,n),t.lineTo(-r/2+i,n),t.closePath(),!0}var Bs=new class extends hs{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 Ss(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Ss(t,this.parseSize(e)/2+s,i,n)}};function Es(t,e,i,n){const s=2*e;return t.moveTo(i,-e+n),t.lineTo(s/3/2+i,e+n),t.lineTo(-s/3/2+i,e+n),t.closePath(),!0}var Ms=new class extends hs{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,n){return Es(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Es(t,this.parseSize(e)/2+s,i,n)}};function Rs(t,e,i,n){return t.moveTo(-e+i,n),t.lineTo(i,e+n),!1}var Ps=new class extends hs{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,n){return Rs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Rs(t,this.parseSize(e)/2+s,i,n)}};const Ls=-.5,Os=Mt(3)/2,Is=1/Mt(12);function ks(t,e,i,n){const s=e/2,r=e*Is,o=s,a=e*Is+e,h=-o,l=a;return t.moveTo(s+i,r+n),t.lineTo(o+i,a+n),t.lineTo(h+i,l+n),t.lineTo(Ls*s-Os*r+i,Os*s+Ls*r+n),t.lineTo(Ls*o-Os*a+i,Os*o+Ls*a+n),t.lineTo(Ls*h-Os*l+i,Os*h+Ls*l+n),t.lineTo(Ls*s+Os*r+i,Ls*r-Os*s+n),t.lineTo(Ls*o+Os*a+i,Ls*a-Os*o+n),t.lineTo(Ls*h+Os*l+i,Ls*l-Os*h+n),t.closePath(),!1}var Ds=new class extends hs{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 ks(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return ks(t,this.parseSize(e)/2+s,i,n)}};function Fs(t,e,i,n,s){return t.moveTo(-e+i-2*s,n),t.lineTo(e+i+s,e+n+2*s),t.lineTo(e+i+s,n-e-2*s),t.closePath(),!0}var Ns=new class extends hs{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 Fs(t,this.parseSize(e)/2,i,n,0)}drawOffset(t,e,i,n,s){return Fs(t,this.parseSize(e)/2,i,n,s)}};function Us(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-s,e+n+2*s),t.lineTo(e+i+2*s,n),t.lineTo(i-e-s,n-e-2*s),t.closePath(),!0}var js=new class extends hs{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 Us(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Us(t,this.parseSize(e)/2,i,n,s)}};function Hs(t,e,i,n){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-2*s,n-e-s),t.lineTo(i+e+2*s,n-e-s),t.lineTo(i,n+e+2*s),t.closePath(),!0}var zs=new class extends hs{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 Hs(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s){return Hs(t,this.parseSize(e)/2,i,n,s)}};const Gs=Mt(3);function Ws(t,e,i,n){const s=e*Gs;return t.moveTo(i,n+-s/3*2),t.lineTo(e+i,n+s),t.lineTo(i-e,n+s),t.closePath(),!0}var Vs=new class extends hs{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,n){return Ws(t,this.parseSize(e)/2/Gs,i,n)}drawOffset(t,e,i,n,s){return Ws(t,this.parseSize(e)/2/Gs+s,i,n)}};function Ys(t,e,i,n){const s=2*e;return t.moveTo(e+i,n-s),t.lineTo(i-e,n),t.lineTo(e+i,s+n),!0}var Xs=new class extends hs{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 Ys(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ys(t,this.parseSize(e)/4+s,i,n)}};function $s(t,e,i,n){const s=2*e;return t.moveTo(i-e,n-s),t.lineTo(i+e,n),t.lineTo(i-e,s+n),!0}var qs=new class extends hs{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 $s(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return $s(t,this.parseSize(e)/4+s,i,n)}};function Ks(t,e,i,n){const s=2*e;return t.moveTo(i-s,n+e),t.lineTo(i,n-e),t.lineTo(i+s,n+e),!0}var Zs=new class extends hs{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 Ks(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Ks(t,this.parseSize(e)/4+s,i,n)}};function Js(t,e,i,n){const s=2*e;return t.moveTo(i-s,n-e),t.lineTo(i,n+e),t.lineTo(i+s,n-e),!0}var Qs=new class extends hs{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 Js(t,this.parseSize(e)/4,i,n)}drawOffset(t,e,i,n,s){return Js(t,this.parseSize(e)/4+s,i,n)}};function tr(t,e,i,n,s){return t.moveTo(i,n-e),t.lineTo(i,n+e),!0}var er=new class extends hs{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,n,s){return tr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return tr(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e}, ${i-s} L ${e},${i+s}`}};function ir(t,e,i,n,s){return t.moveTo(i-e,n),t.lineTo(i+e,n),!0}var nr=new class extends hs{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,n,s){return ir(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return ir(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i} L ${e+s},${i}`}};function sr(t,e,i,n,s){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 rr=new class extends hs{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,s){return sr(t,this.parseSize(e)/2,i,n)}drawOffset(t,e,i,n,s,r){return sr(t,this.parseSize(e)/2+s,i,n)}drawToSvgPath(t,e,i,n){const s=this.parseSize(t)/2;return`M ${e-s}, ${i-s} L ${e+s},${i+s} M ${e+s}, ${i-s} L ${e-s},${i+s}`}};function or(t,e,i,n){return t.rect(i-e[0]/2,n-e[1]/2,e[0],e[1]),!1}function ar(t,e,i,n){const s=e,r=e/2;return t.rect(i-s/2,n-r/2,s,r),!1}var hr=new class extends hs{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 at(e)?ar(t,e,i,n):or(t,e,i,n)}drawWithClipRange(t,e,i,n,s,r,o){at(e)&&(e=[e,e/2]);const a=2*(e[0]+e[1])*s,h=[{x:i+e[0]/2,y:n-e[1]/2},{x:i+e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n+e[1]/2},{x:i-e[0]/2,y:n-e[1]/2}];let l=0,c=h[3];t.moveTo(c.x,c.y);for(let e=0;e<h.length;e++){const i=h[e],n=Math.sqrt((i.x-c.x)*(i.x-c.x)+(i.y-c.y)*(i.y-c.y));if(l+n>a){const e=(i.x-c.x)*(a-l)/n,s=(i.y-c.y)*(a-l)/n;t.lineTo(c.x+e,c.y+s);break}t.lineTo(i.x,i.y),c=i,l+=n}return!1}drawOffset(t,e,i,n,s){return at(e)?ar(t,e+2*s,i,n):or(t,[e[0]+2*s,e[1]+2*s],i,n)}};const lr=new Vt;class cr{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,ot(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,n,s,r,o){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((s=>{t.beginPath(),Ne(s.path.commandList,t,i,n,e,e),o&&o(s.path,s.attribute)})),!1):(Ne(this.path.commandList,t,i,n,e+s,e+s),!1)}draw(t,e,i,n,s,r){return e=this.parseSize(e),this.drawOffset(t,e,i,n,0,s,r)}parseSize(t){return at(t)?t:Math.min(t[0],t[1])}drawWithClipRange(t,e,i,n,s,r,o){return e=this.parseSize(e),this.isSvg?!!this.svgCache&&(this.svgCache.forEach((r=>{r.path.drawWithClipRange(t,e,i,n,s),o&&o(r.path,r.attribute)})),!1):(this.path.drawWithClipRange(t,e,i,n,s),!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;lr.x1=n.bounds.x1*t,lr.y1=n.bounds.y1*t,lr.x2=n.bounds.x2*t,lr.y2=n.bounds.y2*t,e.union(lr)}))}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 dr={};[cs,ds,ps,fs,Vs,vs,Cs,Bs,Ms,Ps,Ds,Ns,js,ys,zs,Xs,qs,Zs,Qs,hr,er,nr,rr].forEach((t=>{dr[t.type]=t}));const ur={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"};class pr{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 gr(t,e,i,n){const s=t.indexOf(e,i);if(-1===s)throw new Error(n);return s+e.length-1}function fr(t,e,i){const n=function(t,e){let i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",s="";for(let r=e;r<t.length;r++){let e=t[r];if(i)e===i&&(i="");else if('"'===e||"'"===e)i=e;else if(e===n[0]){if(!n[1])return{data:s,index:r};if(t[r+1]===n[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!n)return;let s=n.data;const r=n.index,o=s.search(/\s/);let a=s,h=!0;-1!==o&&(a=s.substr(0,o).replace(/\s\s*$/,""),s=s.substr(o+1));const l=a;if(i){const t=a.indexOf(":");-1!==t&&(a=a.substr(t+1),h=a!==n.data.substr(t+1))}return{tagName:a,tagExp:s,closeIndex:r,attrExpPresent:h,rawTagName:l}}const mr=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class br{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 s=function(t,e){const i=[];let n=e.exec(t);for(;n;){const s=[];s.startIndex=e.lastIndex-n[0].length;const r=n.length;for(let t=0;t<r;t++)s.push(n[t]);i.push(s),n=e.exec(t)}return i}(t,mr),r=s.length;for(let t=0;t<r;t++){const e=s[t][1],i=s[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 pr("!xml");let i=e,n="",s="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=gr(t,">",r,"Closing Tag is not closed."),o=s.lastIndexOf(".");s=s.substring(0,o),i=this.tagsNodeStack.pop(),i&&i.child&&n&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=n),n="",r=e}else if("?"===t[r+1])r=fr(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=gr(t,"--\x3e",r+4,"Comment is not closed.");else{const o=fr(t,r,!1);let a=o.tagName,h=o.tagExp;const l=o.attrExpPresent,c=o.closeIndex;if(a!==e.tagname&&(s+=s?"."+a:a),h.length>0&&h.lastIndexOf("/")===h.length-1){"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),h=a):h=h.substr(0,h.length-1);const t=new pr(a);a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,s,a)),this.addChild(i,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new pr(a);this.tagsNodeStack.push(i),a!==h&&l&&(t[":@"]=this.buildAttributesMap(h,s,a)),this.addChild(i,t,s),i=t}n="",r=c}else n+=t[r];return e.child}}function yr(t,e){return vr(t)}function vr(t,e){const i={};for(let e=0;e<t.length;e++){const s=t[e],r=xr(s);if(void 0!==r&&s[r]){const t=vr(s[r]);n=t,Object.keys(n).length,s[":@"]&&wr(t,s[":@"]),void 0!==i[r]&&i.hasOwnProperty(r)?(Array.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t)):i[r]=t}}var n;return i}function xr(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function wr(t,e,i){if(e){const i=Object.keys(e),n=i.length;for(let s=0;s<n;s++){const n=i[s];t[n]=e[n]}}}class _r{constructor(t){this.options=Object.assign({},_r.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return yr(new br(this.options).parseXml(t),this.options)}}function Ar(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}_r.defaultOptions={};let Cr=0;function Tr(){return Cr++}var Sr;!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Sr||(Sr={}));const Br=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Br.set(t,!0)));const Er=new Map;[""].forEach((t=>Er.set(t,!0))),Tr();const Mr=Tr(),Rr=Tr();Tr(),Tr();const Pr=Tr();Tr();const Lr=Tr();Tr(),Tr(),Tr();const Or=Tr();Tr(),Tr(),Tr();const Ir=Tr();Tr();const kr=Symbol.for("GraphicService"),Dr=Symbol.for("GraphicCreator"),Fr={"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"},Nr=Object.keys(Fr),Ur=new Vt,jr=new Xt;new Vt;const Hr=["lineWidth","scaleX","scaleY","angle","anchor","visible"],zr=["x","y"],Gr=["scaleX","scaleY"],Wr=["angle"],Vr=new Pt,Yr={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 Xr extends kn{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const n=e[i];Object.defineProperty(Xr.prototype,n,Object.getOwnPropertyDescriptor(t,n))}}get AABBBounds(){return this.tryUpdateAABBBounds()}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new Vt,this._updateTag=Se.INIT,this.attribute=t,this.valid=this.isValid(),this.updateAABBBoundsStamp=0,t.background?this.loadImage(null!==(e=t.background.background)&&void 0!==e?e:t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.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:s=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;Vr.x=s+(null!==(i=t.scrollX)&&void 0!==i?i:0),Vr.y=r+(null!==(n=t.scrollY)&&void 0!==n?n:0)}else Vr.x=s,Vr.y=r;return Vr}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(){const t="imprecise"===this.attribute.boundsMode;if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;Ki.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return Ki.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),"empty"===this.attribute.boundsMode&&e.clear(),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new Yt),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}getClipPath(){const{clipConfig:t}=this.attribute;if(!t)return null;this.clipPathMap||(this.clipPathMap=new Map);const{shape:e}=t;let i=this.clipPathMap.get(e)||null;return i||(this.clipPathMap.size>10&&this.clipPathMap.clear(),i=this.parsePath(e),i&&this.clipPathMap.set(e,i)),i}parsePath(t){if(!t)return null;let e=dr[t];if(e)return e;if(e=Xr.userSymbolMap[t],e)return e;if(!0===((i=t=ur[t]||t).startsWith("<svg")||i.startsWith("<?xml"))){const e=new _r,{svg:i}=e.parse(t);if(!i)return null;const n=ot(i.path)?i.path:[i.path];Ur.clear();const s=[];n.forEach((t=>{const e=(new Ti).fromString(t.d),i={};Nr.forEach((e=>{t[e]&&(i[Fr[e]]=t[e])})),s.push({path:e,attribute:i}),Ur.union(e.bounds)}));const r=Ur.width(),o=Ur.height(),a=1/St(r,o);s.forEach((t=>t.path.transform(0,0,a,a)));const h=new cr(t,s,!0);return Xr.userSymbolMap[t]=h,h}var i;const n=(new Ti).fromString(t),s=n.bounds.width(),r=n.bounds.height(),o=1/St(s,r);n.transform(0,0,o,o);const a=new cr(t,n);return Xr.userSymbolMap[t]=a,a}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,n=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:s=e.boundsPadding}=i,r=(o=s)?ot(o)?0===o.length?0:1===o.length?o[0]:2===o.length?(Kn[0]=o[0],Kn[2]=o[0],Kn[1]=o[1],Kn[3]=o[1],Kn):o:o:0;var o;return r&&n.expand(r),this.clearUpdateBoundTag(),n}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new ae(t);return Ne(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 Xt),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&Se.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&Ki.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&Se.UPDATE_BOUNDS)&&Ki.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&Se.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&Se.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&Se.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&Se.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=Se.CLEAR_SHAPE}containsPoint(t,e,i,n){if(!n)return!1;if(i===Be.GLOBAL){const i=new Pt(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return n.containsPoint(this,{x:t,y:e})}setWidthHeightWithoutTransform(t){this.widthWithoutTransform=t.x2-t.x1,this.heightWithoutTransform=t.y2-t.y1}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 s;const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,n);r?this._setAttributes(r,i,n):it(null===(s=this.normalAttrs)||void 0===s?void 0:s[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]:Hr;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]:Hr;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Ee.INIT};t=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,null,e)||t,this.attribute=t,t.background?this.loadImage(t.background,!0):t.shadowGraphic&&this.setShadowGraphic(t.shadowGraphic),this._updateTag=Se.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,n;if(0===t&&0===e)return this;const s={type:Ee.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,zr,s);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const o=this.attribute,a=o.postMatrix;return a?Ki.transformUtil.fromMatrix(a,a).translate(t,e):(o.x=(null!==(i=o.x)&&void 0!==i?i:Ei.x)+t,o.y=(null!==(n=o.y)&&void 0!==n?n:Ei.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(s),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const n={type:Ee.TRANSLATE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,zr,n);return s?(this._setAttributes(s,!1,n),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}scale(t,e,i){var n,s;if(1===t&&1===e)return this;const r={type:Ee.SCALE},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,Gr,r);o&&(t=o.scaleX,e=o.scaleY,delete o.scaleX,delete o.scaleY,this._setAttributes(o));const a=this.attribute;if(i){let{postMatrix:n}=this.attribute;n||(n=new Xt,a.postMatrix=n),Ki.transformUtil.fromMatrix(n,n).scale(t,e,i)}else a.scaleX=(null!==(n=a.scaleX)&&void 0!==n?n:Ei.scaleX)*t,a.scaleY=(null!==(s=a.scaleY)&&void 0!==s?s:Ei.scaleY)*e;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(r),this}scaleTo(t,e){const i=this.attribute;if(i.scaleX===t&&i.scaleY===e)return this;const n={type:Ee.SCALE_TO},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,Gr,n);return s?(this._setAttributes(s,!1,n),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this)}rotate(t,e){var i;if(0===t)return this;const n={type:Ee.ROTATE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Wr,n);s&&(delete s.angle,this._setAttributes(s,!1,n));const r=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new Xt,r.postMatrix=i),Ki.transformUtil.fromMatrix(i,i).rotate(t,e)}else r.angle=(null!==(i=r.angle)&&void 0!==i?i:Ei.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Ee.ROTATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Wr,i);return n?(this._setAttributes(n,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}animate(t){var e;this.animates||(this.animates=new Map);const i=new Wn(null==t?void 0:t.id,null!==(e=null==t?void 0:t.timeline)&&void 0!==e?e:this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(i.bind(this),t){const{onStart:e,onFrame:n,onEnd:s,onRemove:r}=t;null!=e&&i.onStart(e),null!=n&&i.onFrame(n),null!=s&&i.onEnd(s),null!=r&&i.onRemove(r),i.interpolateFunc=t.interpolate}return this.animates.set(i.id,i),i.onRemove((()=>{i.stop(),this.animates.delete(i.id)})),i}onAttributeUpdate(t){t&&t.skipUpdateCallback||(Ki.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds(),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds(),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!it(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,n){var s,r,o,a;if(i){const i=Object.keys(t),h=this.getNoWorkAnimateAttr(),l={};let c;i.forEach((e=>{h[e]?(c||(c={}),c[e]=t[e]):l[e]=n&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const d=this.animate({slience:!0});d.stateNames=e,d.to(l,null!==(r=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.duration)&&void 0!==r?r:Xn,null!==(a=null===(o=this.stateAnimateConfig)||void 0===o?void 0:o.easing)&&void 0!==a?a:$n),c&&this.setAttributes(c,!1,{type:Ee.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Ee.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();dt(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){const i=ot(t)?e=>!t.includes(e):e=>e!==t,n=this.currentStates.filter(i);n.length!==this.currentStates.length&&this.useStates(n,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 s=e&&(null===(n=this.currentStates)||void 0===n?void 0:n.length)?this.currentStates.concat([t]):[t];this.useStates(s,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 s=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];s&&Object.assign(n,s)})),this.updateNormalAttrs(n),this.currentStates=t,this.applyStateAttrs(n,t,e)}addUpdateBoundTag(){this._updateTag|=Se.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=Se.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=Se.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&Se.UPDATE_SHAPE_AND_BOUNDS)===Se.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=Se.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Se.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Se.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=Se.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=Se.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=Se.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=Se.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&Se.UPDATE_LAYOUT)}getAnchor(t,e,i){const n=[0,0],s=()=>{if(e.b)return e.b;const t=this.clone();return t.attribute.angle=0,t.attribute.scaleCenter=null,i&&(t.attribute.scaleX=1,t.attribute.scaleY=1),e.b=t.AABBBounds,e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,i=s();n[0]=i.x1+(i.x2-i.x1)*e}else n[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,i=s();n[1]=i.y1+(i.y2-i.y1)*e}else n[1]=t[1];return n}doUpdateLocalMatrix(){const{x:t=Ei.x,y:e=Ei.y,scaleX:i=Ei.scaleX,scaleY:n=Ei.scaleY,angle:s=Ei.angle,scaleCenter:r,anchor:o,postMatrix:a}=this.attribute;let h=[0,0];const l={};if(o&&s&&(h=this.getAnchor(o,l)),!r||1===i&&1===n)!function(t,e,i,n,s,r,o,a){const h=e.a,l=e.b,c=e.c,d=e.d,u=e.e,p=e.f,g=Tt(o),f=Et(o);let m,b;a?(m=a[0],b=a[1]):(m=i,b=n);const y=m-i,v=b-n,x=h*g+c*f,w=l*g+d*f,_=c*g-h*f,A=d*g-l*f;t.a=s*x,t.b=s*w,t.c=r*_,t.d=r*A,t.e=u+h*m+c*b-x*y-_*v,t.f=p+l*m+d*b-w*y-A*v}(this._transMatrix,this._transMatrix.reset(),t,e,i,n,s,o&&h);else{const o=this._transMatrix;o.reset(),o.translate(h[0],h[1]),o.rotate(s),o.translate(-h[0],-h[1]),o.translate(t,e),h=this.getAnchor(r,l,!0),Ki.transformUtil.fromMatrix(o,o).scale(i,n,{x:h[0],y:h[1]})}const c=this.getOffsetXY(Ei);if(this._transMatrix.e+=c.x,this._transMatrix.f+=c.y,a){const t=jr.setValue(a.a,a.b,a.c,a.d,a.e,a.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.timeline===Hn&&t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),Ki.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Ee.ANIMATE_END})}onStep(t,e,i,n,s){const r={};if(i.customAnimate)i.customAnimate.update(s,n,r);else{const o=i.props,a=i.parsedProps,h=i.propKeys;this.stepInterpolate(t,e,r,i,n,s,o,void 0,a,h)}this.setAttributes(r,!1,{type:Ee.ANIMATE_UPDATE,animationState:{ratio:n,end:s,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,n,s,r,o,a,h,l){l||(l=Object.keys(o),n.propKeys=l),r?n.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=o[t])})):l.forEach((r=>{var l;if(!e.validAttr(r))return;const c=o[r],d=null!==(l=a&&a[r])&&void 0!==l?l:t.getLastPropByName(r,n);if(null==c||null==d||c===d)return void(i[r]=c);let u;u=e.interpolateFunc&&e.interpolateFunc(r,s,d,c,i),u||(u=e.customInterpolate(r,s,d,c,this,i),u||this.defaultInterpolate(c,d,r,i,h,s)||this._interpolate(r,s,d,c,i))})),n.parsedProps=h}defaultInterpolate(t,e,i,n,s,r){if(Number.isFinite(t)&&Number.isFinite(e))return n[i]=e+(t-e)*r,!0;if("fill"===i){s||(s={});const o=s.fillColorArray,a=es(e,null!=o?o:t,r,!1,((t,e)=>{s.fillColorArray=e}));return a&&(n[i]=a),!0}if("stroke"===i){s||(s={});const o=s.strokeColorArray,a=es(e,null!=o?o:t,r,!1,((t,e)=>{s.strokeColorArray=e}));return a&&(n[i]=a),!0}if("shadowColor"===i){s||(s={});const o=s.shadowColorArray,a=es(e,null!=o?o:t,r,!0,((t,e)=>{s.shadowColorArray=e}));return a&&(n[i]=a),!0}if(Array.isArray(t)&&t.length===e.length){const s=[];let o=!0;for(let i=0;i<t.length;i++){const n=e[i],a=n+(t[i]-n)*r;if(!Number.isFinite(a)){o=!1;break}s.push(a)}o&&(n[i]=s)}return!1}_interpolate(t,e,i,n,s){}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:Ki.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot.release(!0),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 rt(t,!0)?this.pathProxy=(new Ti).fromString(t):this.pathProxy=new Ti,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")?(os.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(ht(t)||t.includes("/")||lt(t))&&(os.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):st(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",this.stopAnimates(),Ki.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,n;if(this._events&&t in this._events){const s=new Fn(t,e);s.bubbles=!1,s.manager=null===(n=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===n?void 0:n.manager,this.dispatchEvent(s)}}}var $r;Xr.userSymbolMap={},Xr.mixin(Nn),function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}($r||($r={}));class qr extends Xr{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Pr,this._childUpdateTag=Se.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 Pn),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Pn)}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(t,e,i){if(i===Be.GLOBAL){const i=new Pt(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&Se.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;Ki.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),Ki.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),"empty"===this.attribute.boundsMode&&e.clear(),e}doUpdateLocalMatrix(){const{x:t=Ei.x,y:e=Ei.y,dx:i=Ei.dx,dy:n=Ei.dy,scaleX:s=Ei.scaleX,scaleY:r=Ei.scaleY,angle:o=Ei.angle,postMatrix:a}=this.attribute;if(0!==t||0!==e||0!==i||0!==n||1!==s||1!==r||0!==o||a)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return On(this).group}updateAABBBounds(t,e,i){const n=i;i=i.clone();const{width:s,height:r,path:o,clip:a=e.clip}=t;if(o&&o.length?o.forEach((t=>{i.union(t.AABBBounds)})):null!=s&&null!=r&&i.set(0,0,Math.max(0,s),Math.max(0,r)),!a){this.forEachChildren((t=>{i.union(t.AABBBounds)}));const{scrollX:e=0,scrollY:n=0}=t;i.translate(e,n)}return Ki.graphicService.updateTempAABBBounds(i),Ki.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&=Se.CLEAR_BOUNDS,this._childUpdateTag&=Se.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=Se.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&Se.UPDATE_BOUNDS||(this._childUpdateTag|=Se.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(),Ki.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),Ki.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,Ki.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{Ki.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),Ki.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&Se.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=Ki.graphicService.creator[i](e),n.name=t,this.add(n)),n}clone(){return new qr(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return qr.NOWORK_ANIMATE_ATTR}release(t){t&&this.forEachChildren((e=>{e.release(t)})),super.release()}}qr.NOWORK_ANIMATE_ATTR=Yr;class Kr extends qr{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 s;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!==(s=n.zIndex)&&void 0!==s?s:0}),this.layer=this,this.subLayers=new Map,this.theme=new Pn,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=>{Ki.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=>{Ki.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 Zr=Symbol.for("TransformUtil"),Jr=Symbol.for("GraphicUtil"),Qr=Symbol.for("LayerService"),to=Symbol.for("StaticLayerHandlerContribution"),eo=Symbol.for("DynamicLayerHandlerContribution"),io=Symbol.for("VirtualLayerHandlerContribution");var no,so=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},ro=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let oo=no=class{static GenerateLayerId(){return`${no.idprefix}_${no.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=Ki.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?cn.get(to):"dynamic"===t?cn.get(eo):cn.get(io),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 s=this.getLayerHandler(n),r=new Kr(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:n,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:no.GenerateLayerId(),layerHandler:s})),o=this.layerMap.get(t)||[];return o.push(r),this.layerMap.set(t,o),this.staticLayerCountInEnv--,r}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)}};oo.idprefix="visactor_layer",oo.prefix_count=0,oo=no=so([v(),ro("design:paramtypes",[])],oo);var ao=new o((t=>{t(z).to($).inSingletonScope(),t(bn).to(vn),t(Jr).to(An).inSingletonScope(),t(Zr).to(Sn).inSingletonScope(),t(Qr).to(oo).inSingletonScope()}));function ho(t,e){return!(!t&&!e)}function lo(t,e){let i;return i=ot(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function co(t,e,i){return i&&t*e>0}function uo(t,e){return t*e>0}const po=Symbol.for("AreaRenderContribution"),go=Symbol.for("GroupRenderContribution"),fo=Symbol.for("InteractiveSubRenderContribution");function mo(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 bo(t,e,i){const n=i[0],s=i[1],r=i[2];let o,a,h,l,c,d,u,p,g,f,m,b;return e===t?(t[12]=e[0]*n+e[4]*s+e[8]*r+e[12],t[13]=e[1]*n+e[5]*s+e[9]*r+e[13],t[14]=e[2]*n+e[6]*s+e[10]*r+e[14],t[15]=e[3]*n+e[7]*s+e[11]*r+e[15]):(o=e[0],a=e[1],h=e[2],l=e[3],c=e[4],d=e[5],u=e[6],p=e[7],g=e[8],f=e[9],m=e[10],b=e[11],t[0]=o,t[1]=a,t[2]=h,t[3]=l,t[4]=c,t[5]=d,t[6]=u,t[7]=p,t[8]=g,t[9]=f,t[10]=m,t[11]=b,t[12]=o*n+c*s+g*r+e[12],t[13]=a*n+d*s+f*r+e[13],t[14]=h*n+u*s+m*r+e[14],t[15]=l*n+p*s+b*r+e[15]),t}function yo(t,e,i){const n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],d=e[8],u=e[9],p=e[10],g=e[11],f=e[12],m=e[13],b=e[14],y=e[15];let v=i[0],x=i[1],w=i[2],_=i[3];return t[0]=v*n+x*a+w*d+_*f,t[1]=v*s+x*h+w*u+_*m,t[2]=v*r+x*l+w*p+_*b,t[3]=v*o+x*c+w*g+_*y,v=i[4],x=i[5],w=i[6],_=i[7],t[4]=v*n+x*a+w*d+_*f,t[5]=v*s+x*h+w*u+_*m,t[6]=v*r+x*l+w*p+_*b,t[7]=v*o+x*c+w*g+_*y,v=i[8],x=i[9],w=i[10],_=i[11],t[8]=v*n+x*a+w*d+_*f,t[9]=v*s+x*h+w*u+_*m,t[10]=v*r+x*l+w*p+_*b,t[11]=v*o+x*c+w*g+_*y,v=i[12],x=i[13],w=i[14],_=i[15],t[12]=v*n+x*a+w*d+_*f,t[13]=v*s+x*h+w*u+_*m,t[14]=v*r+x*l+w*p+_*b,t[15]=v*o+x*c+w*g+_*y,t}class vo{constructor(){this.pools=[]}static identity(t){return mo(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 vo.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 xo=new class{constructor(){this.pools=[]}allocate(t,e,i,n,s,r){if(!this.pools.length)return new Xt(t,e,i,n,s,r);const o=this.pools.pop();return o.a=t,o.b=e,o.c=i,o.d=n,o.e=s,o.f=r,o}allocateByObj(t){if(!this.pools.length)return new Xt(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=[]}},wo=new vo;var _o=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Ao=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Co=function(t,e){return function(i,n){e(i,n,t)}};function To(t,e,i){var n;const{x:s=i.x,y:r=i.y,z:o=i.z,dx:a=i.dx,dy:h=i.dy,dz:l=i.dz,scaleX:c=i.scaleX,scaleY:d=i.scaleY,scaleZ:u=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:f=i.angle,anchor3d:m=e.attribute.anchor,anchor:b}=e.attribute,y=[0,0,0];if(m){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;y[0]=i.x1+(i.x2-i.x1)*t}else y[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;y[1]=i.x1+(i.x2-i.x1)*t}else y[1]=m[1];y[2]=null!==(n=m[2])&&void 0!==n?n:0}if(mo(t),bo(t,t,[s+a,r+h,o+l]),bo(t,t,[y[0],y[1],y[2]]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[4],o=e[5],a=e[6],h=e[7],l=e[8],c=e[9],d=e[10],u=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=r*s+l*n,t[5]=o*s+c*n,t[6]=a*s+d*n,t[7]=h*s+u*n,t[8]=l*s-r*n,t[9]=c*s-o*n,t[10]=d*s-a*n,t[11]=u*s-h*n}(t,t,g),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],o=e[1],a=e[2],h=e[3],l=e[8],c=e[9],d=e[10],u=e[11];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]=r*s-l*n,t[1]=o*s-c*n,t[2]=a*s-d*n,t[3]=h*s-u*n,t[8]=r*n+l*s,t[9]=o*n+c*s,t[10]=a*n+d*s,t[11]=h*n+u*s}(t,t,p),bo(t,t,[-y[0],-y[1],y[2]]),function(t,e,i){const n=i[0],s=i[1],r=i[2];t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*s,t[5]=e[5]*s,t[6]=e[6]*s,t[7]=e[7]*s,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[c,d,u]),f){const i=wo.allocate(),n=[0,0];if(b){if("string"==typeof m[0]){const t=parseFloat(m[0])/100,i=e.AABBBounds;n[0]=i.x1+(i.x2-i.x1)*t}else n[0]=m[0];if("string"==typeof m[1]){const t=parseFloat(m[1])/100,i=e.AABBBounds;n[1]=i.x1+(i.x2-i.x1)*t}else n[1]=m[1]}bo(i,i,[n[0],n[1],0]),function(t,e,i){const n=Math.sin(i),s=Math.cos(i),r=e[0],o=e[1],a=e[2],h=e[3],l=e[4],c=e[5],d=e[6],u=e[7];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]=r*s+l*n,t[1]=o*s+c*n,t[2]=a*s+d*n,t[3]=h*s+u*n,t[4]=l*s-r*n,t[5]=c*s-o*n,t[6]=d*s-a*n,t[7]=u*s-h*n}(i,i,f),bo(i,i,[-n[0],-n[1],0]),yo(t,t,i)}}let So=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 Vt,this.tempAABBBounds2=new Vt}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,s){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,n,s)}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 ae(t);return Ne(i.commandList,n,0,0),!0}updateHTMLTextAABBBounds(t,e,i,n){const{textAlign:s,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=at(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),n=function(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)}(r,e,e);i.set(i.x1,n,i.x2,n+e)}if(null!=t.forceBoundsWidth){const e=at(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),n=function(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}(s,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,s){if(!e.empty()){const{scaleX:s=i.scaleX,scaleY:r=i.scaleY,stroke:o=i.stroke,shadowBlur:a=i.shadowBlur,lineWidth:h=i.lineWidth,pickStrokeBuffer:l=i.pickStrokeBuffer,strokeBoundsBuffer:c=i.strokeBoundsBuffer}=t,d=this.tempAABBBounds1,u=this.tempAABBBounds2;if(o&&h){Ar(d,(h+l)/Math.abs(s+r),n,c),e.union(d),d.setValue(u.x1,u.y1,u.x2,u.y2)}if(a){const{shadowOffsetX:n=i.shadowOffsetX,shadowOffsetY:o=i.shadowOffsetY}=t;Ar(d,a/Math.abs(s+r)*2,!1,c+1),d.translate(n,o),e.union(d)}}if(this.combindShadowAABBBounds(e,s),e.empty())return;let r=!0;const o=s.transMatrix;s&&s.isContainer&&(r=!(1===o.a&&0===o.b&&0===o.c&&1===o.d&&0===o.e&&0===o.f)),r&&Gt(e,e,o)}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:s=e.visible}=t;return!(!n.valid||!s)||(i.empty()||(n.parent&&i.transformWithMatrix(n.parent.globalTransMatrix),Ki.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}}};So=_o([v(),Co(0,b(Dr)),Ao("design:paramtypes",[Object])],So);const Bo=["symbolType","size",...Hr];let Eo=class t extends Xr{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=Ir}getParsedPath(){return this.shouldUpdateShape()&&(this._parsedPath=this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}getParsedPath2D(){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]:1,n=null;try{n=new Path2D}catch(t){return null}const s=this.getParsedPath();if(!s)return null;s.draw(n,i,t,e)}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return ot(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const{symbolType:t="circle"}=this.attribute;return super.parsePath(t)}getGraphicTheme(){return On(this).symbol}updateAABBBounds(t,e,i,n){this.updatePathProxyAABBBounds(i)||(n?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:s,tb2:r}=Ki.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(n){const t=e.outerBorder,{distance:o=t.distance,lineWidth:a=t.lineWidth}=n;Ar(i,o+(s+a)/2,!0,r)}})(t,e,s),i.union(s),s.setValue(r.x1,r.y1,r.x2,r.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,this.x1WithoutTransform=i.x1,this.y1WithoutTransform=i.y1;const{lineJoin:o=e.lineJoin}=t;return Ki.graphicService.transformAABBBounds(t,i,e,"miter"===o,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:n=e.size}=t;if(ot(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,Bo)}needUpdateTag(t){return super.needUpdateTag(t,Bo)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=ot(e)?e:[e,e];return t.path?(new Ti).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Ti).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};Eo.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Yr);const Mo=["width","x1","y1","height","cornerRadius",...Hr];class Ro extends Xr{constructor(t){super(t),this.type="rect",this.numberType=Or}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return On(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:n}=t;const{x1:s,y1:r,x:o,y:a}=t;e=null!=e?e:s-o,n=null!=n?n:r-a,(isFinite(e)||isFinite(n)||isFinite(o)||isFinite(a))&&i.set(0,0,e||0,n||0)}const{tb1:n,tb2:s}=Ki.graphicService.updateTempAABBBounds(i);return((t,e,i)=>{const{outerBorder:n,shadowBlur:s=e.shadowBlur}=t;if(n){const t=e.outerBorder,{distance:r=t.distance,lineWidth:o=t.lineWidth}=n;i.expand(r+(s+o)/2)}})(t,e,n),i.union(n),n.setValue(s.x1,s.y1,s.x2,s.y2),this.widthWithoutTransform=i.x2-i.x1,this.heightWithoutTransform=i.y2-i.y1,Ki.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,Mo)}needUpdateTag(t){return super.needUpdateTag(t,Mo)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:n,height:s}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=it(t.width)?t.x1-t.x:t.width,i=it(t.height)?t.y1-t.y:t.height,n=0,s=0;return e<0?(n=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(s=i,i=-i):Number.isNaN(i)&&(i=0),{x:n,y:s,width:e,height:i}})(t),r=new Ti;return r.moveTo(e,i),r.rect(e,i,n,s),r}clone(){return new Ro(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ro.NOWORK_ANIMATE_ATTR}}function Po(t){return new Ro(t)}Ro.NOWORK_ANIMATE_ATTR=Yr;const Lo=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}};var Oo=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Io=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ko=function(t,e){return function(i,n){e(i,n,t)}};class Do{constructor(){this.time=Ie.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,o,a,h,l,c,d,u){var p;const{background:g,backgroundOpacity:f=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:h.backgroundOpacity),opacity:m=h.opacity,backgroundMode:b=h.backgroundMode,backgroundFit:y=h.backgroundFit,backgroundKeepAspectRatio:v=h.backgroundKeepAspectRatio,backgroundScale:x=h.backgroundScale,backgroundOffsetX:w=h.backgroundOffsetX,backgroundOffsetY:_=h.backgroundOffsetY,backgroundClip:A=h.backgroundClip}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const s=t.resources.get(g);if("success"!==s.state||!s.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=On(t.parent).group,{scrollX:n=i.scrollX,scrollY:s=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(n,s)}A&&e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,n,h),e.globalAlpha=f*m,this.doDrawImage(e,s.data,r,{backgroundMode:b,backgroundFit:y,backgroundKeepAspectRatio:v,backgroundScale:x,backgroundOffsetX:w,backgroundOffsetY:_}),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,n,h),e.globalAlpha=f*m,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,n){const{backgroundMode:s,backgroundFit:r,backgroundKeepAspectRatio:o,backgroundScale:a=1,backgroundOffsetX:h=0,backgroundOffsetY:l=0}=n,c=i.width(),d=i.height();let u=c,p=d;if("no-repeat"===s)if(r)if(o){const n=Math.max(c/e.width,d/e.height);t.drawImage(e,i.x1+h,i.y1+l,e.width*n*a,e.height*n*a)}else t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const n=e.width*a,s=e.height*a;t.drawImage(e,i.x1+h,i.y1+l,n,s)}else{if(r&&"repeat"!==s&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===s?(u=i*(d/n),p=d):"repeat-y"===s&&(p=n*(c/i),u=c);const r=t.dpr,o=gn.allocate({width:u,height:p,dpr:r}),a=o.getContext("2d");a&&(a.inuse=!0,a.clearMatrix(),a.setTransformForCurrent(!0),a.clearRect(0,0,u,p),a.drawImage(e,0,0,u,p),e=o.nativeCanvas),gn.free(o)}const n=t.dpr,o=t.createPattern(e,s);o.setTransform&&o.setTransform(new DOMMatrix([1/n,0,0,1/n,0,0])),t.fillStyle=o,t.translate(i.x1,i.y1),t.fillRect(0,0,c,d),t.translate(-i.x1,-i.y1)}}}const Fo=new Do;let No=class{constructor(t){this.subRenderContribitions=t,this.time=Ie.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,o,a,h,l,c,d,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,n,s,r,o,a,h,l,c,d,u)}))}};No=Oo([v(),ko(0,b(k)),ko(0,x(fo)),Io("design:paramtypes",[Object])],No);const Uo=new class{constructor(){this.time=Ie.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,o,a,h,l,c,d,u){var p,g;const{clipConfig:f}=t.attribute;if(!f)return;const m=t.getClipPath();if(!m)return;const b=!(c||d),y=t.AABBBounds,v=null!==(p=t.attribute.width)&&void 0!==p?p:y.width(),x=null!==(g=t.attribute.height)&&void 0!==g?g:y.height();b&&e.save(),e.beginPath(),!1===m.draw(e,[v,x],i+v/2,n+x/2,0)&&e.closePath(),c&&c(e,t.attribute,h,!0),b&&e.clip()}};const jo=new class{constructor(){this.time=Ie.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,n,s,r,o,a,h,l,c,d,u){const{clipConfig:p}=t.attribute;p&&t.getClipPath()&&(c||d||e.restore())}};class Ho{constructor(){this.time=Ie.afterFillStroke,this.useStyle=!0,this.order=10,this._tempSymbolGraphic=null}createCommonPattern(t,e,i,n,s){const r=(t-2*e)/2,o=n.dpr,a=gn.allocate({width:t,height:t,dpr:o}),h=a.getContext("2d");if(!h)return null;h.inuse=!0,h.clearMatrix(),h.setTransformForCurrent(!0),h.clearRect(0,0,t,t),s(r,h);const l=n.createPattern(a.nativeCanvas,"repeat");return l.setTransform&&l.setTransform(new DOMMatrix([1/o,0,0,1/o,0,0])),gn.free(a),l}createCirclePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,_t),e.fill()}))}createDiamondPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((e,n)=>{const s=t/2,r=s;n.fillStyle=i,n.moveTo(s,r-e),n.lineTo(e+s,r),n.lineTo(s,r+e),n.lineTo(s-e,r),n.closePath(),n.fill()}))}createRectPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(r,0,2*n,t)}))}createHorizontalLinePattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((n,s)=>{const r=e;s.fillStyle=i,s.fillRect(0,r,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 s=t/2,r=-s;n.moveTo(s,r),n.lineTo(s+t,r+t),n.moveTo(-s,-r),n.lineTo(-s+t,-r+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 s=t/2,r=s;n.moveTo(t+s,r),n.lineTo(s,r+t),n.moveTo(t-s,-r),n.lineTo(-s,-r+t),n.stroke()}))}createGridPattern(t,e,i,n){return this.createCommonPattern(t,e,i,n,((t,n)=>{const s=e,r=s;n.fillStyle=i,n.fillRect(s,r,t,t),n.fillRect(s+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,n,s,r,o,a,h,l,c,d,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=h.texture,textureColor:g=h.textureColor,textureSize:f=h.textureSize,texturePadding:m=h.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,n,h,g,f,m)}drawTexture(t,e,i,n,s,r,o,a,h){var l;const{textureRatio:c=r.textureRatio,textureOptions:d=null}=e.attribute;let u=this.textureMap.get(t);if(!u)switch(t){case"circle":u=this.createCirclePattern(a,h,o,i);break;case"diamond":u=this.createDiamondPattern(a,h,o,i);break;case"rect":u=this.createRectPattern(a,h,o,i);break;case"vertical-line":u=this.createVerticalLinePattern(a,h,o,i);break;case"horizontal-line":u=this.createHorizontalLinePattern(a,h,o,i);break;case"bias-lr":u=this.createBiasLRLinePattern(a,h,o,i);break;case"bias-rl":u=this.createBiasRLLinePattern(a,h,o,i);break;case"grid":u=this.createGridPattern(a,h,o,i)}if(d&&d.dynamicTexture){const{gridConfig:u={},useNewCanvas:p}=d,g=e.AABBBounds;n=g.x1,s=g.y1;const f=i;let m;if(p){m=gn.allocate({width:g.width(),height:g.height(),dpr:i.dpr});const t=m.getContext("2d");t.clearRect(0,0,g.width(),g.height()),n=0,s=0,i=t}if(f.save(),e.parent&&!e.transMatrix.onlyTranslate()){const{scrollX:t=0,scrollY:i=0}=e.parent.attribute;f.setTransformFromMatrix(e.parent.globalTransMatrix),f.translate(t,i,!0)}f.setCommonStyle(e,e.attribute,n,s,r),f.clip();const b=g.width(),y=g.height(),v=h,x=a,w=u.columns?u.columns:Math.ceil(b/x),_=u.rows?u.rows:Math.ceil(y/x),A=u.gutterColumn?u.gutterColumn:2*v,C=u.gutterRow?u.gutterRow:2*v;this._tempSymbolGraphic||(this._tempSymbolGraphic=new Eo({}));const T=u.columns?b/u.columns:x,S=u.rows?y/u.rows:x;this._tempSymbolGraphic.setAttributes({size:[T-A,S-C],symbolType:t});const B=this._tempSymbolGraphic.getParsedPath();for(let t=0;t<_;t++)for(let r=0;r<w;r++){const a=n+x/2+r*x,h=s+x/2+t*x;null===(l=d.beforeDynamicTexture)||void 0===l||l.call(d,i,t,r,_,w,c,e,g.width(),g.height()),i.beginPath(),!1===B.draw(i,Math.min(T-A,S-C),a,h,0)&&i.closePath(),i.fillStyle=o,d.dynamicTexture(i,t,r,_,w,c,e,g.width(),g.height())}p&&(f.globalAlpha=1,f.drawImage(m.nativeCanvas,0,0,m.nativeCanvas.width,m.nativeCanvas.height,g.x1,g.y1,g.width()*f.dpr,g.height()*f.dpr)),f.restore()}else if(u)i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,n,s,r),i.fillStyle=u,i.fill(),i.highPerformanceRestore();else if("wave"===t){i.save(),i.setCommonStyle(e,e.attribute,n,s,r),i.clip();const t=e.AABBBounds;(function(t,e,i,n,s,r,o){const{fill:a="orange",percent:h=.6,frequency:l=4,opacity:c,phi:d=0}=s;let{amplitude:u=10}=s;u*=function(t){return t<=.5?4*t-1:-4*t+3}(e);const p=n*(1-h),g=i,f=Math.max(Math.round(g/70),2);t.beginPath(),t.moveTo(0+r,n+o),t.lineTo(0+r,p+o);const m=g/l*e,b=g/Math.PI/(2*l);for(let e=0;e<g;e+=f){const i=u*Math.sin((e+m+d)/b+d);t.lineTo(e+r,p+i+o)}t.lineTo(g+r,n+o),t.closePath(),t.fillStyle=a,isFinite(c)&&(t.globalAlpha=c),t.fill()})(i,c,t.width(),t.height(),Object.assign(Object.assign({},d||{}),{fill:o}),n+t.x1-n,s+t.y1-s),i.restore()}}}new Ho;const zo=new class extends Do{constructor(){super(...arguments),this.time=Ie.beforeFillStroke}drawShape(t,e,i,n,s,r,o,a,h,l,c,d){const{background:u,backgroundMode:p=h.backgroundMode,backgroundFit:g=h.backgroundFit,backgroundKeepAspectRatio:f=h.backgroundKeepAspectRatio,backgroundScale:m=h.backgroundScale,backgroundOffsetX:b=h.backgroundOffsetX,backgroundOffsetY:y=h.backgroundOffsetY}=t.attribute;if(u)if(t.backgroundImg&&t.resources){const i=t.resources.get(u);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,{backgroundMode:p,backgroundFit:g,backgroundKeepAspectRatio:f,backgroundScale:m,backgroundOffsetX:b,backgroundOffsetY:y}),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=u,e.fill(),e.highPerformanceRestore()}},Go=vt/2;const Wo={x:0,y:0,z:0,lastModelMatrix:null};class Vo{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions||(this.builtinContributions=[]),this.builtinContributions.push(Uo),this.builtinContributions.push(jo),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((t=>t.time===Ie.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Ie.afterFillStroke)))}reInit(){this.init(this.graphicRenderContributions)}beforeRenderStep(t,e,i,n,s,r,o,a,h,l,c,d,u){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,s,r,o,a,h,l,c,d,u)}))}afterRenderStep(t,e,i,n,s,r,o,a,h,l,c,d,u){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,s,r,o,a,h,l,c,d,u)}))}drawPathProxy(t,e,i,n,s,r,o,a){if(!t.pathProxy)return!1;const h=On(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:l=h.fill,stroke:c=h.stroke,opacity:d=h.opacity,fillOpacity:u=h.fillOpacity,lineWidth:p=h.lineWidth,strokeOpacity:g=h.strokeOpacity,visible:f=h.visible,x:m=h.x,y:b=h.y}=t.attribute,y=co(d,u,l),v=uo(d,g),x=ho(l),w=lo(c,p);if(!f)return!0;if(!x&&!w)return!0;if(!(y||v||o||a))return!0;e.beginPath();return Ne(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,n),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,n,x,w,y,v,h,s,o,a),w&&(a?a(e,t.attribute,h):v&&(e.setStrokeStyle(t,t.attribute,i-m,n-b,h),e.stroke())),x&&(o?o(e,t.attribute,h):y&&(e.setCommonStyle(t,t.attribute,i-m,n-b,h),e.fill())),this.afterRenderStep(t,e,i,n,x,w,y,v,h,s,o,a),!0}valid(t,e,i,n){const{fill:s=e.fill,background:r,stroke:o=e.stroke,opacity:a=e.opacity,fillOpacity:h=e.fillOpacity,lineWidth:l=e.lineWidth,strokeOpacity:c=e.strokeOpacity,visible:d=e.visible}=t.attribute,u=co(a,h,s),p=uo(a,c),g=ho(s,r),f=lo(o,l);return!(!t.valid||!d)&&!(!g&&!f)&&!!(u||p||i||n||r)&&{fVisible:u,sVisible:p,doFill:g,doStroke:f}}transform(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:s=e.x,y:r=e.y,z:o=e.z,scaleX:a=e.scaleX,scaleY:h=e.scaleY,angle:l=e.angle,postMatrix:c}=t.attribute,d=i.modelMatrix,u=i.camera;Wo.x=s,Wo.y=r,Wo.z=o,Wo.lastModelMatrix=d;const p=u&&(n||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!c:1===a&&1===h&&0===l&&!c;if(p){const n=wo.allocate(),s=wo.allocate();To(s,t,e),yo(n,d||n,s),Wo.x=0,Wo.y=0,Wo.z=0,i.modelMatrix=n,i.setTransform(1,0,0,1,0,0,!0),wo.free(s)}if(g&&!d){const n=t.getOffsetXY(e);Wo.x+=n.x,Wo.y+=n.y,Wo.z=o,i.setTransformForCurrent()}else if(p)Wo.x=0,Wo.y=0,Wo.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const n=t.getOffsetXY(e);Wo.x+=n.x,Wo.y+=n.y,this.transformWithoutTranslate(i,Wo.x,Wo.y,Wo.z,a,h,l)}else i.transformFromMatrix(t.transMatrix,!0),Wo.x=0,Wo.y=0,Wo.z=0;return Wo}transformUseContext2d(t,e,i,n){const s=n.camera;if(this.camera=s,s){const e=t.AABBBounds,s=e.x2-e.x1,r=e.y2-e.y1,o=n.project(0,0,i),a=n.project(s,0,i),h=n.project(s,r,i),l={x:0,y:0},c={x:s,y:0},d={x:s,y:r};n.camera=null;const u=1/(l.x*(d.y-c.y)-c.x*d.y+d.x*c.y+(c.x-d.x)*l.y),p=-(l.y*(h.x-a.x)-c.y*h.x+d.y*a.x+(c.y-d.y)*o.x)*u,g=(c.y*h.y+l.y*(a.y-h.y)-d.y*a.y+(d.y-c.y)*o.y)*u,f=(l.x*(h.x-a.x)-c.x*h.x+d.x*a.x+(c.x-d.x)*o.x)*u,m=-(c.x*h.y+l.x*(a.y-h.y)-d.x*a.y+(d.x-c.x)*o.y)*u,b=(l.x*(d.y*a.x-c.y*h.x)+l.y*(c.x*h.x-d.x*a.x)+(d.x*c.y-c.x*d.y)*o.x)*u,y=(l.x*(d.y*a.y-c.y*h.y)+l.y*(c.x*h.y-d.x*a.y)+(d.x*c.y-c.x*d.y)*o.y)*u;n.setTransform(p,g,f,m,b,y,!0)}}restoreTransformUseContext2d(t,e,i,n){this.camera&&(n.camera=this.camera)}transformWithoutTranslate(t,e,i,n,s,r,o){const a=t.project(e,i,n);t.translate(a.x,a.y,!1),t.scale(s,r,!1),t.rotate(o,!1),t.translate(-a.x,-a.y,!1),t.setTransformForCurrent()}_draw(t,e,i,n,s){const{context:r}=n;if(!r)return;const{renderable:o}=t.attribute;if(!1===o)return;r.highPerformanceSave();const a=this.transform(t,e,r,i),{x:h,y:l,z:c,lastModelMatrix:d}=a;this.z=c,this.drawPathProxy(t,r,h,l,n,s)||(this.drawShape(t,r,h,l,n,s),this.z=0,r.modelMatrix!==d&&wo.free(r.modelMatrix),r.modelMatrix=d),r.highPerformanceRestore()}}function Yo(t,e,i,n){if(!e.p1)return;const{offsetX:s=0,offsetY:r=0,offsetZ:o=0}=n||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(s+e.p1.x,r+e.p1.y,s+e.p2.x,r+e.p2.y,s+e.p3.x,r+e.p3.y,o):t.lineTo(s+e.p1.x,r+e.p1.y,o);else if(e.p2&&e.p3){const[n]=Ye(e,i);t.bezierCurveTo(s+n.p1.x,r+n.p1.y,s+n.p2.x,r+n.p2.y,s+n.p3.x,r+n.p3.y,o)}else{const n=e.getPointAt(i);t.lineTo(s+n.x,r+n.y,o)}}function Xo(t,e,i,n,s,r,o){var a;let h=e.p0,l=n;if(i&&i.originP1===i.originP2&&(h=i.p0),e.defined)n||(t.lineTo(h.x+s,h.y+r,o),l=!n);else{const{originP1:c,originP2:d}=e;let u;if(c&&!1!==c.defined&&!i?u=h:c&&!1!==d.defined&&(u=null!==(a=e.p3)&&void 0!==a?a:e.p1),n){l=!n;const i=u?u.x:e.p0.x,a=u?u.y:e.p0.y;t.moveTo(i+s,a+r,o)}else u&&(l=!n,t.lineTo(u.x+s,u.y+r,o))}return l}function $o(t,e,i,n,s){const{offsetX:r=0,offsetY:o=0,offsetZ:a=0,mode:h="none",drawConnect:l=!1}=s||{};if(l&&"none"===h)return;if(!e)return;let c=!0;const{curves:d}=e;if(i>=1){if(l){let e,i=!0;d.forEach(((n,s)=>{n.originP1!==n.originP2?(i=Xo(t,n,e,i,r,o,a),e=n):e=n}))}else d.forEach((e=>{e.defined?(c&&t.moveTo(e.p0.x+r,e.p0.y+o,a),Yo(t,e,1,s),c=!1):c=!0}));return}if(i<=0)return;let u;"x"===n?u=Le.ROW:"y"===n?u=Le.COLUMN:"auto"===n&&(u=e.direction);const p=i*e.tryUpdateLength(u);let g=0,f=!0,m=null;for(let e=0,i=d.length;e<i;e++){const i=d[e],n=i.getLength(u),h=(p-g)/n;if(g+=n,h<0)break;if(l){if(i.originP1===i.originP2){m=i;continue}f=Xo(t,i,m,f,r,o,a),m=i}else{if(!i.defined){c=!0;continue}c&&t.moveTo(i.p0.x+r,i.p0.y+o,a),Yo(t,i,Bt(h,1),s),c=!1}}}var qo=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};let Ko=class extends Vo{constructor(){super(...arguments),this.numberType=Lr}draw(t,e,i,n){const s=On(t,null==n?void 0:n.theme).line;this._draw(t,s,!1,i,n)}drawSegmentItem(t,e,i,n,s,r,o,a,h,l,c,d,u,p,g){var f;if(!e)return;t.beginPath();const m=null!==(f=this.z)&&void 0!==f?f:0;$o(t.camera?t:t.nativeContext,e,h,l,{offsetX:c,offsetY:d,offsetZ:m}),u.cache&&!ot(u.cache)&&u.cache.curves.every((t=>t.defined))&&u.attribute.curveType&&u.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,o,a);const{x:b=0,x:y=0}=o;return!1!==i&&(p?p(t,o,a):s&&(t.setCommonStyle(u,o,b-c,y-d,a),t.fill())),!1!==n&&(g?g(t,o,a):r&&(t.setStrokeStyle(u,o,b-c,y-d,a),t.stroke())),!1}drawLinearLineHighPerformance(t,e,i,n,s,r,o,a,h,l,c,d,u){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:f}=t.attribute,m=f[0];e.moveTo(m.x+o,m.y+a,g);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+o,i.y+a,g)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h);const{x:b=0,x:y=0}=t.attribute;!1!==i&&(d?d(e,t.attribute,h):s&&(e.setCommonStyle(t,t.attribute,b-o,y-a,h),e.fill())),!1!==n&&(u?u(e,t.attribute,h):r&&(e.setStrokeStyle(t,t.attribute,b-o,y-a,h),e.stroke()))}drawShape(t,e,i,n,s,r,o,a){const h=On(t,null==r?void 0:r.theme).line,{fill:l=h.fill,stroke:c=h.stroke,fillOpacity:d=h.fillOpacity,strokeOpacity:u=h.strokeOpacity,segments:p,points:g,closePath:f,curveTension:m=h.curveTension,connectedType:b=h.connectedType}=t.attribute;if(!this.valid(t,h,o,a))return;let{curveType:y=h.curveType}=t.attribute;f&&"linear"===y&&(y="linearClosed");const{clipRange:v=h.clipRange,clipRangeByDimension:x=h.clipRangeByDimension}=t.attribute;if(1===v&&!p&&!g.some((t=>!1===t.defined))&&"linear"===y)return this.drawLinearLineHighPerformance(t,e,!!l,!!c,d,u,i,n,h,s,r,o,a);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 s=Ci(w(t.points,b),y,{startPoint:e,curveTension:m});return n=s,s})).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=Ci(w(n,b),y,{curveTension:m})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const s=t.attribute.segments.filter((t=>t.points.length));if(1===s[0].points.length&&s.shift(),1===v){let r=!1;t.cache.forEach(((p,g)=>{r||(r=this.drawSegmentItem(e,p,!!l,!!c,d,u,s[g],[h,t.attribute],v,x,i,n,t,o,a))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=v*r;let g=0,f=!1;t.cache.forEach(((r,m)=>{if(f)return;const b=r.getLength(),y=(p-g)/b;g+=b,y>0&&(f=this.drawSegmentItem(e,r,!!l,!!c,d,u,s[m],[h,t.attribute],Bt(y,1),x,i,n,t,o,a))}))}}else this.drawSegmentItem(e,t.cache,!!l,!!c,d,u,t.attribute,h,v,x,i,n,t,o,a)}};function Zo(t,e,i,n){const{offsetX:s=0,offsetY:r=0,offsetZ:o=0}=n||{};let a=!0;e.forEach((e=>{e.defined?(a&&t.moveTo(e.p0.x+s,e.p0.y+r,o),Yo(t,e,1,n),a=!1):a=!0})),a=!0;for(let e=i.length-1;e>=0;e--){const h=i[e];h.defined?(a&&t.lineTo(h.p0.x+s,h.p0.y+r,o),Yo(t,h,1,n),a=!1):a=!0}t.closePath()}Ko=qo([v()],Ko);const Jo=new class extends Ho{constructor(){super(...arguments),this.time=Ie.afterFillStroke}drawShape(t,e,i,n,s,r,o,a,h,l,c,d,u){var p,g,f,m;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:b=t.attribute}=u||{},{texture:y=(null!==(p=t.attribute.texture)&&void 0!==p?p:Zn(h,"texture")),textureColor:v=(null!==(g=t.attribute.textureColor)&&void 0!==g?g:Zn(h,"textureColor")),textureSize:x=(null!==(f=t.attribute.textureSize)&&void 0!==f?f:Zn(h,"textureSize")),texturePadding:w=(null!==(m=t.attribute.texturePadding)&&void 0!==m?m:Zn(h,"texturePadding"))}=b;y&&this.drawTexture(y,t,e,i,n,h,v,x,w)}},Qo=Fo;var ta=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},ea=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ia=function(t,e){return function(i,n){e(i,n,t)}};let na=class extends Vo{constructor(t){super(),this.graphicRenderContributions=t,this.numberType=Rr,this.builtinContributions=[Jo,Qo],this.init(t)}drawLinearAreaHighPerformance(t,e,i,n,s,r,o,a,h,l,c,d,u){var p,g,f;const{points:m}=t.attribute;if(m.length<2)return;e.beginPath();const b=null!==(p=this.z)&&void 0!==p?p:0,y=m[0];e.moveTo(y.x+o,y.y+a,b);for(let t=1;t<m.length;t++){const i=m[t];e.lineTo(i.x+o,i.y+a,b)}for(let t=m.length-1;t>=0;t--){const i=m[t];e.lineTo((null!==(g=i.x1)&&void 0!==g?g:i.x)+o,(null!==(f=i.y1)&&void 0!==f?f:i.y)+a,b)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,o,a,!!s,!1,i,!1,h,l,d,null,{attribute:t.attribute});const{x:v=0,x:x=0}=t.attribute;!1!==i&&(d?d(e,t.attribute,h):s&&(e.setCommonStyle(t,t.attribute,v-o,x-a,h),e.fill())),this.afterRenderStep(t,e,o,a,!!s,!1,i,!1,h,l,d,null,{attribute:t.attribute}),(()=>{var i,s;if(n){const{stroke:n=h&&h.stroke}=t.attribute;if(ot(n)&&(n[0]||n[2])&&!1===n[1])if(e.beginPath(),n[0]){e.moveTo(y.x+o,y.y+a,b);for(let t=1;t<m.length;t++){const i=m[t];e.lineTo(i.x+o,i.y+a,b)}}else if(n[2]){const t=m[m.length-1];e.moveTo(t.x+o,t.y+a,b);for(let t=m.length-2;t>=0;t--){const n=m[t];e.lineTo((null!==(i=n.x1)&&void 0!==i?i:n.x)+o,(null!==(s=n.y1)&&void 0!==s?s:n.y)+a,b)}}u?u(e,t.attribute,h):(e.setStrokeStyle(t,t.attribute,v-o,x-a,h),e.stroke())}})()}drawShape(t,e,i,n,s,r,o,a){var h,l,c,d,u,p;const g=On(t,null==r?void 0:r.theme).area,{fill:f=g.fill,stroke:m=g.stroke,fillOpacity:b=g.fillOpacity,z:y=g.z,strokeOpacity:v=g.strokeOpacity,curveTension:x=g.curveTension,connectedType:w=g.connectedType}=t.attribute,_=this.valid(t,g,o,a);if(!_)return;const{doFill:A}=_,C=_.doStroke&&_.sVisible,{clipRange:T=g.clipRange,closePath:S,points:B,segments:E}=t.attribute;let{curveType:M=g.curveType}=t.attribute;function R(t,e){return"connect"!==e?t:t.filter((t=>!1!==t.defined))}if(S&&"linear"===M&&(M="linearClosed"),1===T&&!E&&!B.some((t=>!1===t.defined))&&"linear"===M)return this.drawLinearAreaHighPerformance(t,e,!!f,C,b,v,i,n,g,s,r,o,a);if(t.shouldUpdateShape()){if(E&&E.length){let e,i;const n=E.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 s=Ci(R(t.points,w),M,{startPoint:e,curveTension:x});return i=s,s})).filter((t=>!!t));let s;const r=[];for(let t=E.length-1;t>=0;t--){const e=E[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=E[t-1].points,n=e[e.length-1];n&&i.push({x:null!==(c=n.x1)&&void 0!==c?c:n.x,y:null!==(d=n.y1)&&void 0!==d?d:n.y})}i.length>1&&(s=Ci(R(i,w),"stepBefore"===M?"stepAfter":"stepAfter"===M?"stepBefore":M,{curveTension:x}),r.unshift(s))}t.cacheArea=r.map(((t,e)=>({top:n[e],bottom:t})))}else{if(!B||!B.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=R(B,w),i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(u=e[t].x1)&&void 0!==u?u:e[t].x,y:null!==(p=e[t].y1)&&void 0!==p?p:e[t].y});const n=Ci(e,M,{curveTension:x}),s=Ci(i,"stepBefore"===M?"stepAfter":"stepAfter"===M?"stepBefore":M,{curveTension:x});t.cacheArea={top:n,bottom:s}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===T){let h=!1;t.cacheArea.forEach(((l,c)=>{h||(h=this.drawSegmentItem(e,l,A,b,C,v,r[c],[g,t.attribute],T,i,n,y,t,s,o,a))}))}else{const h=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),l=T*h;let c=0,d=!1;t.cacheArea.forEach(((h,u)=>{if(d)return;const p=h.top.getLength(),f=(l-c)/p;c+=p,f>0&&(d=this.drawSegmentItem(e,h,A,b,C,v,r[u],[g,t.attribute],Bt(f,1),i,n,y,t,s,o,a))}))}}else this.drawSegmentItem(e,t.cacheArea,A,b,C,v,t.attribute,g,T,i,n,y,t,s,o,a)}draw(t,e,i,n){const s=On(t,null==n?void 0:n.theme).area;this._draw(t,s,!1,i,n)}drawSegmentItem(t,e,i,n,s,r,o,a,h,l,c,d,u,p,g,f){return this._drawSegmentItem(t,e,i,n,s,r,o,a,h,l,c,d,u,p,g,f)}_drawSegmentItem(t,e,i,n,s,r,o,a,h,l,c,d,u,p,g,f){if(!(e&&e.top&&e.bottom&&e.top.curves&&e.top.curves.length&&e.bottom.curves&&e.bottom.curves.length))return;t.beginPath();const{points:m,segments:b}=u.attribute;let y,v,x=Le.ROW;if(b){const t=b[b.length-1];v=b[0].points[0],y=t.points[t.points.length-1]}else v=m[0],y=m[m.length-1];const w=At(y.x-v.x),_=At(y.y-v.y);x=null==y.x1?Le.ROW:null==y.y1?Le.COLUMN:Number.isFinite(w+_)?w>_?Le.ROW:Le.COLUMN:Le.ROW,function(t,e,i,n){var s;const{top:r,bottom:o}=e;if(r.curves.length!==o.curves.length)return;if(i>=1){const e=[],i=[];let s=!0;for(let a=0,h=r.curves.length;a<h;a++){const l=r.curves[a];s!==l.defined?(s?(Zo(t,e,i,n),e.length=0,i.length=0):(e.push(l),i.push(o.curves[h-a-1])),s=!s):s&&(e.push(l),i.push(o.curves[h-a-1]))}return void Zo(t,e,i,n)}if(i<=0)return;let{direction:a}=n||{};const{curves:h}=r,l=null!==(s=h[h.length-1].p3)&&void 0!==s?s:h[h.length-1].p1,c=At(l.x-h[0].p0.x),d=At(l.y-h[0].p0.y);a=null!=a?a:c>d?Le.ROW:Le.COLUMN,Number.isFinite(c)||(a=Le.COLUMN),Number.isFinite(d)||(a=Le.ROW);const u=i*(a===Le.ROW?c:d);let p=0,g=!0;const f=[],m=[];for(let e=0,i=r.curves.length;e<i;e++){const s=r.curves[e],h=s.getLength(a),l=(u-p)/h;if(l<0)break;p+=h;let c=null,d=null;g!==s.defined?(g?(Zo(t,f,m,n),f.length=0,m.length=0):(c=s,d=o.curves[i-e-1]),g=!g):g&&(c=s,d=o.curves[i-e-1]),c&&d&&(l<1&&(c=c.p2&&c.p3?Ye(c,l)[0]:$e(c,l)[0],d=d.p2&&d.p3?Ye(d,1-l)[1]:$e(d,1-l)[1]),c.defined=g,d.defined=g,f.push(c),m.push(d)),c=null,d=null}Zo(t,f,m,n)}(t.camera?t:t.nativeContext,e,h,{offsetX:l,offsetY:c,offsetZ:d,direction:x}),this.beforeRenderStep(u,t,l,c,!!n,!1,i,!1,a,p,g,null,{attribute:o}),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,o,a);const{x:A=0,x:C=0}=o;return!1!==i&&(g?g(t,o,a):n&&(t.setCommonStyle(u,o,A-l,C-c,a),t.fill())),this.afterRenderStep(u,t,l,c,!!n,!1,i,!1,a,p,g,null,{attribute:o}),(()=>{if(!1!==s)if(f)f(t,o,a);else{const{stroke:i=a&&a[1]&&a[1].stroke}=o;ot(i)&&(i[0]||i[2])&&!1===i[1]&&(t.beginPath(),$o(t.camera?t:t.nativeContext,i[0]?e.top:e.bottom,h,x===Le.ROW?"x":"y",{offsetX:l,offsetY:c,offsetZ:d})),t.setStrokeStyle(u,o,A-l,C-c,a),t.stroke()}})(),!1}};na=ta([v(),ia(0,b(k)),ia(0,x(po)),ea("design:paramtypes",[Object])],na);const sa=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Vt)}allocate(t,e,i,n){if(!this.pools.length)return(new Vt).setValue(t,e,i,n);const s=this.pools.pop();return s.x1=t,s.y1=e,s.x2=i,s.y2=n,s}allocateByObj(t){if(!this.pools.length)return new Vt(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=[]}};var ra=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},oa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},aa=function(t,e){return function(i,n){e(i,n,t)}};let ha=class{constructor(t){this.groupRenderContribitions=t,this.numberType=Pr}reInit(){this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(zo)}drawShape(t,e,i,n,s,r,o,a){const h=On(t,null==r?void 0:r.theme).group,{fill:l=h.fill,background:c,stroke:d=h.stroke,opacity:u=h.opacity,width:p=h.width,height:g=h.height,clip:f=h.clip,fillOpacity:m=h.fillOpacity,strokeOpacity:b=h.strokeOpacity,cornerRadius:y=h.cornerRadius,path:v=h.path,lineWidth:x=h.lineWidth,visible:w=h.visible,fillStrokeOrder:_=h.fillStrokeOrder,cornerType:A=h.cornerType,x:C=h.x,y:T=h.y}=t.attribute,S=function(t,e,i,n,s){return s&&t*e>0&&0!==i&&0!==n}(u,m,p,g,l),B=function(t,e,i,n){return t*e>0&&0!==i&&0!==n}(u,b,p,g),E=ho(l,c),M=lo(d,x);if(!t.valid||!w)return;if(!f){if(!E&&!M)return;if(!(S||B||o||a||c))return}if(v&&v.length&&s.drawContribution){const t=e.disableFill,i=e.disableStroke,n=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,v.forEach((t=>{s.drawContribution.getRenderContribution(t).draw(t,s.renderService,s,r)})),e.disableFill=t,e.disableStroke=i,e.disableBeginPath=n}else 0===y||ot(y)&&y.every((t=>0===t))?(e.beginPath(),e.rect(i,n,p,g)):(e.beginPath(),function(t,e,i,n,s,r){let o,a=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],h=arguments.length>7?arguments[7]:void 0;if(Array.isArray(a)&&(h=a,a=!0),n<0&&(e+=n,n=-n),s<0&&(i+=s,s=-s),at(r,!0))o=[r=At(r),r,r,r];else if(Array.isArray(r)){const t=r;let e,i;switch(t.length){case 0:o=[0,0,0,0];break;case 1:e=At(t[0]),o=[e,e,e,e];break;case 2:case 3:e=At(t[0]),i=At(t[1]),o=[e,i,e,i];break;default:o=t,o[0]=At(o[0]),o[1]=At(o[1]),o[2]=At(o[2]),o[3]=At(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,s);const[l,c,d,u]=[[e,i],[e+n,i],[e+n,i+s],[e,i+s]],p=Math.min(n/2,s/2),g=[Math.min(p,o[0]),Math.min(p,o[1]),Math.min(p,o[2]),Math.min(p,o[3])],f=[l[0]+g[0],l[1]],m=[l[0],l[1]+g[0]],b=[c[0]-g[1],c[1]],y=[c[0],c[1]+g[1]],v=[d[0]-g[2],d[1]],x=[d[0],d[1]-g[2]],w=[u[0]+g[3],u[1]],_=[u[0],u[1]-g[3]];if(t.moveTo(f[0],f[1]),a){if(h&&h[0]?h[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),!ut(b,y)){h&&h[0]&&t.moveTo(b[0],b[1]);const e=b[0],i=b[1]+g[1];t.arc(e,i,g[1],-Go,0,!1)}if(h&&h[1]?h[1](y[0],y[1],x[0],x[1]):t.lineTo(x[0],x[1]),!ut(v,x)){const e=x[0]-g[2],i=x[1];h&&h[1]&&t.moveTo(x[0],x[1]),t.arc(e,i,g[2],0,Go,!1)}if(h&&h[2]?h[2](v[0],v[1],w[0],w[1]):t.lineTo(w[0],w[1]),!ut(w,_)){const e=w[0],i=w[1]-g[3];h&&h[2]&&t.moveTo(w[0],w[1]),t.arc(e,i,g[3],Go,vt,!1)}if(h&&h[3]?h[3](_[0],_[1],m[0],m[1]):t.lineTo(m[0],m[1]),!ut(f,m)){const e=f[0],i=f[1]+g[0];h&&h[3]&&t.moveTo(m[0],m[1]),t.arc(e,i,g[0],vt,vt+Go,!1)}}else h&&h[0]?h[0](f[0],f[1],b[0],b[1]):t.lineTo(b[0],b[1]),h&&h[1]?h[1](b[0],b[1],v[0],v[1]):t.lineTo(v[0],v[1]),h&&h[2]?h[2](v[0],v[1],w[0],w[1]):t.lineTo(w[0],w[1]),h&&h[2]?h[2](w[0],w[1],f[0],f[1]):t.lineTo(f[0],f[1]);!h&&t.closePath()}(e,i,n,p,g,y,"bevel"!==A));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(zo));const R={doFill:E,doStroke:M};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this._groupRenderContribitions.forEach((r=>{r.time===Ie.beforeFillStroke&&r.drawShape(t,e,i,n,E,M,S,B,h,s,o,a,R)})),f&&e.clip();const P=()=>{R.doFill&&(o?o(e,t.attribute,h):S&&(e.setCommonStyle(t,t.attribute,C-i,T-n,h),e.fill()))},L=()=>{R.doStroke&&(a?a(e,t.attribute,h):B&&(e.setStrokeStyle(t,t.attribute,C-i,T-n,h),e.stroke()))};_?(L(),P()):(P(),L()),this._groupRenderContribitions.forEach((r=>{r.time===Ie.afterFillStroke&&r.drawShape(t,e,i,n,E,M,S,B,h,s,o,a)}))}draw(t,e,i,n){const{context:s}=i;if(!s)return;const{clip:r,baseOpacity:o=1,drawMode:a,x:h,y:l,width:c,height:d}=t.attribute,u=s.nativeContext,p=s.canvas.nativeCanvas;if(a>0){const t=s.canvas,e=xh.createCanvas({width:t.width,height:t.height,dpr:1}),i=e.getContext("2d"),n=s.nativeContext.getTransform();i.setTransform(n.a,n.b,n.c,n.d,n.e,n.f),1===a&&(i.save(),i.clearRect(0,0,t.width,t.height),i.beginPath(),i.rect(h,l,c,d),i.clip(),i.drawImage(t.nativeCanvas,0,0,t.width,t.height,0,0,t.displayWidth,t.displayHeight),i.restore()),s.nativeContext=i,t.nativeCanvas=e}r?s.save():s.highPerformanceSave();const g=s.baseGlobalAlpha;s.baseGlobalAlpha*=o;const f=On(t,null==n?void 0:n.theme).group,m=s.modelMatrix;if(s.camera){const e=wo.allocate(),i=wo.allocate();To(i,t,f),yo(e,m||e,i),s.modelMatrix=e,wo.free(i),s.setTransform(1,0,0,1,0,0,!0)}else s.transformFromMatrix(t.transMatrix,!0);s.beginPath(),n.skipDraw?this.drawShape(t,s,0,0,i,n,(()=>!1),(()=>!1)):this.drawShape(t,s,0,0,i);const{scrollX:b=f.scrollX,scrollY:y=f.scrollY}=t.attribute;let v;if((b||y)&&s.translate(b,y),n&&n.drawingCb&&(v=n.drawingCb()),s.modelMatrix!==m&&wo.free(s.modelMatrix),s.modelMatrix=m,s.baseGlobalAlpha=g,a>0){const t=s.nativeContext,e=s.canvas.nativeCanvas;u.save(),u.setTransform(s.dpr,0,0,s.dpr,0,0,!0),1===a&&t.rect(h,l,c,d),u.drawImage(e,0,0,e.width,e.height,0,0,s.canvas.displayWidth,s.canvas.displayHeight);const i=t.getTransform();u.setTransform(i.a,i.b,i.c,i.d,i.e,i.f),s.nativeContext=u,s.canvas.nativeCanvas=p,u.restore()}v&&v.then?v.then((()=>{r?s.restore():s.highPerformanceRestore()})):r?s.restore():s.highPerformanceRestore()}};ha=ra([v(),aa(0,b(k)),aa(0,x(go)),oa("design:paramtypes",[Object])],ha);const la=Symbol.for("IncrementalDrawContribution"),ca=Symbol.for("GraphicRender"),da=Symbol.for("GroupRender"),ua=Symbol.for("DrawContribution"),pa=(t,e,i,n)=>{let s,r=!1,o=!1;if(e.forEachChildren((t=>(r=t.numberType===Mr,!r))),e.forEachChildren((t=>(o=!!t.findFace,!o))),r){const t=e.getChildren(),a=[...t];a.sort(((t,e)=>{var i,n,s,r;let o=(null!==(n=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==n?n:0)/2,a=(null!==(r=null!==(s=e.attribute.startAngle)&&void 0!==s?s:0+e.attribute.endAngle)&&void 0!==r?r:0)/2;for(;o<0;)o+=_t;for(;a<0;)a+=_t;return a-o})),a.forEach((t=>{t._next=null,t._prev=null})),e.removeAllChild(),e.update(),a.forEach((t=>{e.appendChild(t)})),n.hack_pieFace="outside",s=i(r,o),s&&s.graphic||(n.hack_pieFace="inside",s=i(r,o)),s&&s.graphic||(n.hack_pieFace="top",s=i(r,o)),e.removeAllChild(),t.forEach((t=>{t._next=null,t._prev=null})),t.forEach((t=>{e.appendChild(t)}))}else if(o){const n=e.getChildren(),a=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})));a.sort(((t,e)=>e.ave_z-t.ave_z)),e.removeAllChild(),a.forEach((t=>{t.g._next=null,t.g._prev=null})),e.update(),a.forEach((t=>{e.add(t.g)})),s=i(r,o),e.removeAllChild(),n.forEach((t=>{t._next=null,t._prev=null})),e.update(),n.forEach((t=>{e.add(t)}))}else s=i(r,o);return s};var ga=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},fa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const ma=Symbol.for("DrawItemInterceptor"),ba=new Vt,ya=new Vt;class va{constructor(){this.order=1}afterDrawItem(t,e,i,n,s){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,s),!1}beforeDrawItem(t,e,i,n,s){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,s),!1}drawItem(t,e,i,n,s){if(!t.shadowRoot)return!1;const{context:r}=i;if(r.highPerformanceSave(),r.transformFromMatrix(t.transMatrix,!0),n.dirtyBounds&&n.backupDirtyBounds){ba.copy(n.dirtyBounds),ya.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,xo.allocate(1,0,0,1,0,0)),r.highPerformanceRestore(),n.dirtyBounds&&n.backupDirtyBounds&&(n.dirtyBounds.copy(ba),n.backupDirtyBounds.copy(ya)),!0}}class xa{constructor(){this.order=1}afterDrawItem(t,e,i,n,s){return t.attribute._debug_bounds&&this.drawItem(t,e,i,n,s),!1}drawItem(t,e,i,n,s){if(!t.attribute._debug_bounds)return!1;const{context:r}=i;r.highPerformanceSave(),t.parent&&r.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&r.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const o=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(r,t),r.strokeRect(o.x1,o.y1,o.width(),o.height()),r.highPerformanceRestore(),!0}}let wa=class{constructor(){this.order=1,this.interceptors=[new va,new Aa,new _a,new xa]}afterDrawItem(t,e,i,n,s){for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].afterDrawItem&&this.interceptors[r].afterDrawItem(t,e,i,n,s))return!0;return!1}beforeDrawItem(t,e,i,n,s){if((!t.in3dMode||i.in3dInterceptor)&&!t.shadowRoot&&!(t.baseGraphic||t.attribute.globalZIndex||t.interactiveGraphic))return!1;for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].beforeDrawItem&&this.interceptors[r].beforeDrawItem(t,e,i,n,s))return!0;return!1}};wa=ga([v(),fa("design:paramtypes",[])],wa);class _a{constructor(){this.order=1}beforeDrawItem(t,e,i,n,s){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,n,s):this.beforeSetInteractive(t,e,i,n,s))}beforeSetInteractive(t,e,i,n,s){let r=t.interactiveGraphic;if(t.attribute.globalZIndex){r||(r=t.clone(),t.interactiveGraphic=r,r.baseGraphic=t),r.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(r),!0}if(r){i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(r),t.interactiveGraphic=null,r.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,n,s){const r=t.baseGraphic;let o=!!r.stage,a=r.parent;for(;o&&a&&a.stage!==a;)o=!!a.stage,a=a.parent;if(!o){const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).removeChild(t),!0}if(r){this.processing=!0;const{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(r.parent.globalTransMatrix,!0),r.isContainer?n.renderGroup(r,i,r.parent.globalTransMatrix):n.renderItem(r,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=Lo.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class Aa{constructor(){this.order=1}beforeDrawItem(t,e,i,n,s){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:r,stage:o}=e.drawParams;r.canvas,r.save(),this.initCanvasCtx(r),r.camera=o.camera;const a=r.currentMatrix;a.a/=r.dpr,a.b/=r.dpr,a.c/=r.dpr,a.d/=r.dpr,a.e/=r.dpr,a.f/=r.dpr;const h=wo.allocate();var l,c;c=a,(l=h)[0]=c.a,l[1]=c.b,l[2]=0,l[3]=0,l[4]=c.c,l[5]=c.d,l[6]=0,l[7]=0,l[8]=0,l[9]=0,l[10]=1,l[11]=0,l[12]=c.e,l[13]=c.f,l[14]=0,l[15]=1;const d=r.modelMatrix;if(d){if(h){const t=wo.allocate();r.modelMatrix=yo(t,d,h)}}else r.modelMatrix=h;return r.setTransform(1,0,0,1,0,0,!0),t.isContainer?pa(r,t,((e,s)=>n.renderGroup(t,i,t.parent.globalTransMatrix,!e&&s)),i):n.renderItem(t,i),r.camera=null,r.restore(),r.modelMatrix!==d&&wo.free(r.modelMatrix),r.modelMatrix=d,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var Ca=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Ta=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Sa=function(t,e){return function(i,n){e(i,n,t)}};const Ba=Symbol.for("RenderService");let Ea=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))}reInit(){this.drawContribution.reInit()}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}};Ea=Ca([v(),Sa(0,b(ua)),Ta("design:paramtypes",[Object])],Ea);var Ma=new o((t=>{t(Ba).to(Ea)}));const Ra=Symbol.for("PickerService"),Pa=Symbol.for("GlobalPickerService"),La=Symbol.for("PickItemInterceptor"),Oa=Symbol.for("PickServiceInterceptor");var Ia=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};let ka=class{constructor(){this.order=1}afterPickItem(t,e,i,n,s){if(t.graphic){let e=t.graphic;for(;e.parent;)e=e.parent;e.shadowHost&&(t.params={shadowTarget:t.graphic},t.graphic=e.shadowHost)}return t}};ka=Ia([v()],ka);let Da=class{constructor(){this.order=1}afterPickItem(t,e,i,n,s){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,n,s):null}beforePickItem(t,e,i,n,s){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,n,s):null}_pickItem(t,e,i,n,s){var r;if(!t.shadowRoot)return null;const{parentMatrix:o}=s||{};if(!o)return null;const a=e.pickContext;a.highPerformanceSave();const h=null===(r=On(t))||void 0===r?void 0:r[t.type],{shadowPickMode:l=(null==h?void 0:h.shadowPickMode)}=t.attribute,c=t.shadowRoot,d=xo.allocateByObj(o),u=new Pt(d.a*i.x+d.c*i.y+d.e,d.b*i.x+d.d*i.y+d.f),p=e.pickGroup(c,u,d,n);return a.highPerformanceRestore(),!p.graphic&&p.group&&"full"===l&&(p.graphic=p.group),p}};Da=Ia([v()],Da);let Fa=class{constructor(){this.order=1}beforePickItem(t,e,i,n,s){const r=t.baseGraphic;if(r&&r.parent){const t=new Pt(i.x,i.y),s=e.pickContext;s.highPerformanceSave();const o=r.parent.globalTransMatrix;o.transformPoint(t,t);const a=r.isContainer?e.pickGroup(r,t.clone(),o,n):e.pickItem(r,t.clone(),o,n);return s.highPerformanceRestore(),a}return null}};Fa=Ia([v()],Fa);let Na=class{constructor(){this.order=1}beforePickItem(t,e,i,n,s){if(!t.in3dMode||n.in3dInterceptor)return null;const r=e.pickContext,o=t.stage;if(!r||!o)return null;if(n.in3dInterceptor=!0,r.save(),this.initCanvasCtx(r),r.camera=o.camera,t.isContainer){const o=pa(r,t,(()=>e.pickGroup(t,i,s.parentMatrix,n)),n);return r.camera=null,n.in3dInterceptor=!1,r.restore(),o}return r.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};Na=Ia([v()],Na);var Ua=new o(((t,e,i)=>{i(Ra)||(t(Pa).toSelf(),t(Ra).toService(Pa)),t(Na).toSelf().inSingletonScope(),t(La).toService(Na),t(Da).toSelf().inSingletonScope(),t(La).toService(Da),t(Fa).toSelf().inSingletonScope(),t(La).toService(Fa),F(t,La),t(ka).toSelf().inSingletonScope(),t(Oa).toService(ka),F(t,Oa)})),ja=new o((t=>{t(kr).to(So).inSingletonScope(),t(Dr).toConstantValue(Lo)}));const Ha=Symbol.for("AutoEnablePlugins"),za=Symbol.for("PluginService");var Ga=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Wa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Va=function(t,e){return function(i,n){e(i,n,t)}};let Ya=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&&cn.isBound(Ha)&&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=[]}};Ya=Ga([v(),Va(0,b(k)),Va(0,x(Ha)),Wa("design:paramtypes",[Object])],Ya);var Xa=new o((t=>{t(za).to(Ya),function(t,e){t(k).toDynamicValue((t=>{let{container:i}=t;return new D(e,i)})).whenTargetNamed(e)}(t,Ha)})),$a=new o((t=>{F(t,H)})),qa=new o((t=>{t(hn).to(ln).inSingletonScope(),F(t,hn)})),Ka=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},Za=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Ja=class{constructor(){this.type="static",this.offscreen=!1,this.global=Ki.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,s=un({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});s.applyPosition(),this.canvas=s,this.context=s.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 s=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:s},i),{clear:i.clear?null!==(n=i.background)&&void 0!==n?n:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};Ja=Ka([v(),Za("design:paramtypes",[])],Ja);var Qa=new o((t=>{t(Ja).toSelf(),t(to).toService(Ja)}));var th=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};function eh(t,e,i){const n={},s=[];return t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;n[i]?n[i].push(t):(n[i]=[t],s.push(i))}),i),s.sort(((t,e)=>i?e-t:t-e)),{childMap:n,zIdxArray:s}}function ih(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return th(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,n)}))}function nh(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=!1;t.forEachChildren(((t,e)=>{const{zIndex:n=i}=t.attribute;if(0===e);else if(void 0!==n)return s=!0,!0;return!1}),n);let r=null,o=!1;if(s){const{childMap:s,zIdxArray:a}=eh(t,i,n);let h=!1;for(let t=0;t<a.length&&!h;t++){const i=s[a[t]];for(let t=0;t<i.length;t++){if(o){h=!0,r=i[t];break}i[t]._uid!==e||(o=!0)}}}else t.forEachChildren((t=>o?(r=t,!0):(t._uid===e&&(o=!0),!1)),n);return r}var sh=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},rh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},oh=function(t,e){return function(i,n){e(i,n,t)}};let ah=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 Wt,this.backupDirtyBounds=new Wt,this.global=Ki.global,this.layerService=Ki.layerService,ot(this.contributions)||(this.contributions=[this.contributions]),this.init()}reInit(){this.init(),this.contributions.forEach((t=>{t.reInit()}))}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:s,transMatrix:r}=e;if(!i)return;const o=this.dirtyBounds.setValue(0,0,s.width(),s.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:s,y11:r,y12:o,x21:a,x22:h,y21:l,y22:c}=kt(t,e,i);return n>=h||s<=a||r>=c||o<=l?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(n,a),y1:Math.max(r,l),x2:Math.min(s,h),y2:Math.min(o,c)}}(o,n.dirtyBounds,!1);o.x1=Math.floor(t.x1),o.y1=Math.floor(t.y1),o.x2=Math.ceil(t.x2),o.y2=Math.ceil(t.y2)}const a=i.dpr%1;(a||.5!==a)&&(o.x1=Math.floor(o.x1*i.dpr)/i.dpr,o.y1=Math.floor(o.y1*i.dpr)/i.dpr,o.x2=Math.ceil(o.x2*i.dpr)/i.dpr,o.y2=Math.ceil(o.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(o),i.inuse=!0,i.setClearMatrix(r.a,r.b,r.c,r.d,r.e,r.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(s.x1,s.y1,!0),i.beginPath(),i.rect(o.x1,o.y1,o.width(),o.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:Ii.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Ii.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,e,xo.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=nh(e,i,Ii.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&&!Dt(t.AABBBounds,this.dirtyBounds,!1)&&"empty"!==t.attribute.boundsMode)return;let s,r=i;if(this.useDirtyBounds){s=sa.allocateByObj(this.dirtyBounds);const e=t.transMatrix;r=xo.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r.getInverse())}this.renderItem(t,e,{drawingCb:()=>{var i;n?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))})):function(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=!1;if(s)r=!0;else{let i;t.forEachChildren(((t,n)=>{const{zIndex:s=e}=t.attribute;if(0===n)i=s;else if(i!==s)return r=!0,!0;return!1}),n)}if(r){const{childMap:r,zIdxArray:o}=eh(t,e,n);let a=!1;for(let t=0;t<o.length&&!a;t++){const e=r[o[t]];s&&e.sort(((t,e)=>{var i,s;return(n?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(s=t.attribute.z)&&void 0!==s?s:0))}));for(let t=0;t<e.length;t++)if(i(e[t],t)){a=!0;break}}}else t.forEachChildren(i,n)}(t,Ii.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(s),sa.free(s),xo.free(r))}_increaseRender(t,e){const{layer:i,stage:n}=e,{subLayers:s}=i;let r=s.get(t._uid);r||(r={layer:this.layerService.createLayer(n),zIndex:s.size,group:t},s.set(t._uid,r));const o=r.layer.getNativeHandler().getContext(),a=r.drawContribution||cn.get(la);a.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),a.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,clear:"transparent",layer:r.layer,context:o,startAtId:t._uid,break:!1})),r.drawContribution=a;const h=this._findNextGraphic(t);if(h)if(h.isContainer&&h.incremental)this._increaseRender(h,e);else{let t=s.get(h._uid);t||(t={layer:this.layerService.createLayer(n),zIndex:s.size},s.set(h._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:a,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 s=this.InterceptorContributions[n];if(s.beforeDrawItem&&s.beforeDrawItem(t,this.currentRenderService,e,this,i))return}const n=this.getRenderContribution(t);if(!n)return;let s,r=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)&&(r=!0,this.scrollMatrix||(this.scrollMatrix=xo.allocate(1,0,0,1,0,0)),this.scrollMatrix.translate(-e,-i))}if(r&&(s=this.dirtyBounds.clone().transformWithMatrix(this.scrollMatrix)),this.useDirtyBounds&&!t.isContainer&&"empty"!==t.attribute.boundsMode&&!Dt(t.AABBBounds,null!=s?s:this.dirtyBounds,!1)){if(r&&t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;this.scrollMatrix&&this.scrollMatrix.translate(e,i)}return}const o=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=o),o?t.isContainer&&n.draw(t,this.currentRenderService,e,i):n.draw(t,this.currentRenderService,e,i),r&&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 mt.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,s;const{clear:r,viewBox:o}=i,a=o.width(),h=o.height();if(r){e.clearRect(0,0,a,h);const i=null===(n=t.drawParams)||void 0===n?void 0:n.stage;if(i&&(e.globalAlpha=null!==(s=i.attribute.opacity)&&void 0!==s?s:1),i&&i.backgroundImg&&i.resources){const t=i.resources.get(r);t&&"success"===t.state&&t.data&&e.drawImage(t.data,0,0,a,h)}else e.fillStyle=Qi(e,r,{AABBBounds:{x1:0,y1:0,x2:0+a,y2:0+h}},0,0),e.fillRect(0,0,a,h)}}afterDraw(t,e){}};ah=sh([v(),oh(0,y(ca)),oh(1,b(k)),oh(1,x(ma)),rh("design:paramtypes",[Array,Object])],ah);var hh=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};let lh=class extends Ko{constructor(){super(...arguments),this.numberType=Lr}drawShape(t,e,i,n,s,r,o,a){if(t.incremental&&s.multiGraphicOptions){const{startAtIdx:e,length:r}=s.multiGraphicOptions,{segments:h=[]}=t.attribute;if(e>h.length)return;const l=On(t).line,{fill:c=l.fill,stroke:d=l.stroke,opacity:u=l.opacity,fillOpacity:p=l.fillOpacity,strokeOpacity:g=l.strokeOpacity,lineWidth:f=l.lineWidth,visible:m=l.visible}=t.attribute,b=co(u,p,c),y=uo(u,g),v=ho(c),x=lo(d,f);if(!t.valid||!m)return;if(!v&&!x)return;if(!(b||y||o||a))return;const{context:w}=s;for(let s=e;s<e+r;s++)this.drawIncreaseSegment(t,w,h[s-1],h[s],t.attribute.segments[s],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,s,r,o,a)}drawIncreaseSegment(t,e,i,n,s,r,o,a){n&&(e.beginPath(),function(t,e,i,n){const{offsetX:s=0,offsetY:r=0}=n||{},o=e?e.points[e.points.length-1]:i.points[0];t.moveTo(o.x+s,o.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+s,e.y+r):t.moveTo(e.x+s,e.y+r)}))}(e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,s,r),e.setStrokeStyle(t,s,o,a,r),e.stroke())}};lh=hh([v()],lh);var ch=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};let dh=class extends na{constructor(){super(...arguments),this.numberType=Rr}drawShape(t,e,i,n,s,r,o){if(t.incremental&&s.multiGraphicOptions){const{startAtIdx:r,length:a}=s.multiGraphicOptions,{segments:h=[]}=t.attribute;if(r>h.length)return;const l=On(t).area,{fill:c=l.fill,fillOpacity:d=l.fillOpacity,opacity:u=l.opacity,visible:p=l.visible}=t.attribute,g=co(u,d,c),f=ho(c);if(!t.valid||!p)return;if(!f)return;if(!g&&!o)return;for(let s=r;s<r+a;s++)this.drawIncreaseSegment(t,e,h[s-1],h[s],t.attribute.segments[s],[l,t.attribute],i,n)}else super.drawShape(t,e,i,n,s,r,o)}drawIncreaseSegment(t,e,i,n,s,r,o,a){n&&(e.beginPath(),function(t,e,i,n){const{offsetX:s=0,offsetY:r=0}=n||{},{points:o}=i,a=[];for(let t=0;t<o.length;t++)o[t].defined;a.push(o),a.forEach(((i,n)=>{var o,a,h,l;const c=e&&0===n?e.points[e.points.length-1]:i[0];t.moveTo(c.x+s,c.y+r),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+s,e.y+r):t.moveTo(e.x+s,e.y+r)}));for(let e=i.length-1;e>=0;e--){const n=i[e];t.lineTo(null!==(o=n.x1)&&void 0!==o?o:n.x,null!==(a=n.y1)&&void 0!==a?a: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()}))}(e.camera?e:e.nativeContext,i,n,{offsetX:o,offsetY:a}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,s,r),e.setCommonStyle(t,s,o,a,r),e.fill())}};dh=ch([v()],dh);var uh,ph=function(t,e,i,n){var s,r=arguments.length,o=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(r<3?s(o):r>3?s(e,i,o):s(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o},gh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fh=function(t,e){return function(i,n){e(i,n,t)}},mh=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{h(n.next(t))}catch(t){r(t)}}function a(t){try{h(n.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(uh||(uh={}));let bh=class extends ah{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=uh.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 mh(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:s}=e;n&&(n.inuse=!0,n.clearMatrix(),n.setTransformForCurrent(!0),n.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,n,e),n.translate(s.x1,s.y1,!0),n.save(),t.renderTreeRoots.sort(((t,e)=>{var i,n;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Ii.zIndex)-(null!==(n=e.attribute.zIndex)&&void 0!==n?n:Ii.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 mh(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return mh(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>mh(this,void 0,void 0,(function*(){if(2!==t.count)yield ih(t,Ii.zIndex,((i,n)=>{if(this.status===uh.STOP)return!0;if(i.isContainer)return!1;if(n<this.currentIdx)return!1;const s=this.currFrameStartAt+t.incremental;return n<s&&(this.currentIdx=n+1,this.renderItem(i,e)),n===s-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 mh(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return mh(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return mh(this,void 0,void 0,(function*(){this.rendering&&(this.status=uh.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=uh.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 mh(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:()=>mh(this,void 0,void 0,(function*(){yield ih(t,Ii.zIndex,(t=>mh(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};bh=ph([v(),fh(0,y(ca)),fh(1,b(lh)),fh(2,b(dh)),fh(3,b(k)),fh(3,x(ma)),gh("design:paramtypes",[Array,Object,Object,Object])],bh);var yh=new o((t=>{t(Do).toSelf().inSingletonScope(),t(Ho).toSelf().inSingletonScope(),t(ua).to(ah),t(la).to(bh),t(da).to(ha).inSingletonScope(),t(ca).toService(da),F(t,go),t(No).toSelf().inSingletonScope(),F(t,fo),F(t,ca),t(wa).toSelf().inSingletonScope(),t(ma).toService(wa),F(t,ma)}));function vh(){vh.__loaded||(vh.__loaded=!0,cn.load(ao),cn.load(ja),cn.load(Ma),cn.load(Ua),cn.load(Xa),function(t){t.load($a),t.load(qa),t.load(Qa)}(cn),function(t){t.load(yh)}(cn))}vh.__loaded=!1,vh();const xh=cn.get(z);Ki.global=xh;const wh=cn.get(Jr);Ki.graphicUtil=wh;const _h=cn.get(Zr);Ki.transformUtil=_h;const Ah=cn.get(kr);Ki.graphicService=Ah;const Ch=cn.get(Qr);function Th(t,e,i,n){return t=>{if(!(t instanceof MouseEvent||t instanceof TouchEvent||t instanceof PointerEvent))return t;const s=e();if(1===(r=s).a&&0===r.b&&0===r.c&&1===r.d&&0===r.e&&0===r.f)return t;var r;const o=i(),a=new t.constructor(t.type,t);if(Object.defineProperties(a,{target:{value:t.target},currentTarget:{value:t.currentTarget}}),t instanceof MouseEvent||t instanceof PointerEvent)n(t.clientX,t.clientY,s,o,a);else if(t instanceof TouchEvent){if(t.touches.length>0){const t=a.touches[0];n(t.clientX,t.clientY,s,o,t)}if(t.changedTouches.length>0){const t=a.changedTouches[0];n(t.clientX,t.clientY,s,o,t)}}return a}}function Sh(t,e,i,n,s){const r=Th(0,i,n,s);t.setEventListenerTransformer(r)}function Bh(t,e,i,n,s){const r=Th(0,i,n,s);t.setEventListenerTransformer(r)}function Eh(t,e,i,n,s){const r={x:t,y:e};i.transformPoint(r,r),Object.defineProperties(s,{_canvasX:{value:r.x},_canvasY:{value:r.y}})}function Mh(t){var e;if(pn(t._canvasX)&&pn(t._canvasY))return{x:t._canvasX,y:t._canvasY};if(t.changedTouches){const i=null!==(e=t.changedTouches[0])&&void 0!==e?e:{};return{x:i._canvasX,y:i._canvasY}}return{x:t._canvasX||0,y:t._canvasY||0}}function Rh(t,e){var i,n,s,r,o,a,h,l;return!t&&!e||!(!t||!e)&&(null===(i=t.start)||void 0===i?void 0:i.col)===(null===(n=e.start)||void 0===n?void 0:n.col)&&(null===(s=t.start)||void 0===s?void 0:s.row)===(null===(r=e.start)||void 0===r?void 0:r.row)&&(null===(o=t.end)||void 0===o?void 0:o.col)===(null===(a=e.end)||void 0===a?void 0:a.col)&&(null===(h=t.end)||void 0===h?void 0:h.row)===(null===(l=e.end)||void 0===l?void 0:l.row)}Ki.layerService=Ch;const Ph="undefined"==typeof window||void 0===window.window;function Lh(t,e,i){return t.start.col<=e&&e<=t.end.col&&t.start.row<=i&&i<=t.end.row||t.end.col<=e&&e<=t.start.col&&t.end.row<=i&&i<=t.start.row||t.end.col<=e&&e<=t.start.col&&t.start.row<=i&&i<=t.end.row||t.start.col<=e&&e<=t.end.col&&t.end.row<=i&&i<=t.start.row}!function(){if(Ph)return{IE:!1,Edge:!1,Chrome:!1,Firefox:!1,Safari:!1};const t=window.navigator.userAgent.toLowerCase();/(msie|trident)/.exec(t),t.indexOf("edge"),t.indexOf("chrome")>-1&&t.indexOf("edge"),t.indexOf("firefox"),t.indexOf("safari")>-1&&t.indexOf("edge")}();function Oh(t,e){return void 0===t&&void 0===e||void 0!==t&&void 0!==e&&(t.start.col===e.start.col&&t.start.row===e.start.row&&t.end.col===e.end.col&&t.end.row===e.end.row)}function Ih(t,e){return void 0===t&&void 0===e||void 0!==t&&void 0!==e&&(t.start.col===e.start.col&&t.start.row===e.start.row&&t.end.col===e.end.col&&t.end.row===e.end.row)}function kh(t){return Math.floor(t)===t}function Dh(t){this.rotateDegree=90;const e=t.clientWidth<t.clientHeight?Math.max(t.clientWidth,t.clientHeight)/2:Math.min(t.clientWidth,t.clientHeight)/2,i=this.getElement().getBoundingClientRect(),n=i.left,s=i.top,r=i.right,o=i.bottom;t.style.transform="rotate(90deg)",t.style.transformOrigin=`${e}px ${e}px`;const a=()=>({x1:n,y1:s,x2:r,y2:o}),h=()=>{const i=("undefined"!=typeof window?{width:window.innerWidth||document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight}:xh&&xh.getViewportSize?xh.getViewportSize():t.getBoundingClientRect()).width,n=this.getElement().getBoundingClientRect(),s=n.top,r=i-n.right,o=xo.allocate(1,0,0,1,0,0);o.translate(s,r);const a=e-s,h=e-r;o.translate(a,h),o.rotate(Math.PI/2),o.translate(-a,-h);const l=this.pluginManager.getPluginByName("Rotate Table");return l&&(l.matrix=o),o};Bh(xh,this.getElement(),h,a,Eh),Sh(this.scenegraph.stage.window,this.getElement(),h,a,Eh);const l=this.pluginManager.getPluginByName("Rotate Table");l&&(l.vglobal_mapToCanvasPoint=xh.mapToCanvasPoint),xh.mapToCanvasPoint=Mh}function Fh(t){this.rotateDegree=0,t.style.transform="none",t.style.transformOrigin="none";const e=this.getElement().getBoundingClientRect(),i=e.left,n=e.top,s=e.right,r=e.bottom,o=()=>({x1:i,y1:n,x2:s,y2:r}),a=()=>{const t=xo.allocate(1,0,0,1,0,0);return t.translate(i,n),t};Bh(xh,this.getElement(),a,o,Eh),Sh(this.scenegraph.stage.window,this.getElement(),a,o,Eh);const h=this.pluginManager.getPluginByName("Rotate Table");h&&(xh.mapToCanvasPoint=h.vglobal_mapToCanvasPoint)}t.AddRowColumnPlugin=class{id=`add-row-column-${Date.now()}`;name="Add Row Column";runTime=[n.TABLE_EVENT_TYPE.MOUSEENTER_CELL,n.TABLE_EVENT_TYPE.MOUSELEAVE_CELL,n.TABLE_EVENT_TYPE.MOUSELEAVE_TABLE];pluginOptions;table;hoverCell;hideAllTimeoutId_addColumn;hideAllTimeoutId_addRow;leftDotForAddColumn;rightDotForAddColumn;addIconForAddColumn;addLineForAddColumn;topDotForAddRow;bottomDotForAddRow;addIconForAddRow;addLineForAddRow;constructor(t={addColumnEnable:!0,addRowEnable:!0}){this.pluginOptions=t,this.pluginOptions.addColumnEnable=this.pluginOptions.addColumnEnable??!0,this.pluginOptions.addRowEnable=this.pluginOptions.addRowEnable??!0,this.pluginOptions.addColumnEnable&&(this.initAddColumnDomElement(),this.bindEventForAddColumn()),this.pluginOptions.addRowEnable&&(this.initAddRowDomElement(),this.bindEventForAddRow())}run(...t){const e=t[0],i=t[1],s=t[2];if(this.table=s,i===n.TABLE_EVENT_TYPE.MOUSEENTER_CELL){clearTimeout(this.hideAllTimeoutId_addColumn),clearTimeout(this.hideAllTimeoutId_addRow);const t=s.canvas.getBoundingClientRect(),i=s.getCellAtRelativePosition(e.event.clientX-t.left,e.event.clientY-t.top);this.hoverCell=i;const n=s.getCellRelativeRect(i.col,i.row);if(this.pluginOptions.addColumnEnable){const e=s.isSeriesNumber(i.col,0);this.showDotForAddColumn(t.top-6,n.left+t.left,n.right+t.left,!e)}if(this.pluginOptions.addRowEnable){const e=s.isHeader(i.col,i.row);this.showDotForAddRow(n.top+t.top,t.left-6,n.bottom+t.top,!e,!e)}}else i===n.TABLE_EVENT_TYPE.MOUSELEAVE_CELL||i===n.TABLE_EVENT_TYPE.MOUSELEAVE_TABLE&&(this.pluginOptions.addColumnEnable&&this.delayHideAllForAddColumn(),this.pluginOptions.addRowEnable&&this.delayHideAllForAddRow())}initAddColumnDomElement(){this.leftDotForAddColumn=document.createElement("div"),this.leftDotForAddColumn.style.width="6px",this.leftDotForAddColumn.style.height="6px",this.leftDotForAddColumn.style.backgroundColor="#4A90E2",this.leftDotForAddColumn.style.position="absolute",this.leftDotForAddColumn.style.cursor="pointer",this.leftDotForAddColumn.style.zIndex="1000",this.leftDotForAddColumn.style.borderRadius="50%",this.leftDotForAddColumn.style.border="1px solid white",this.leftDotForAddColumn.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.leftDotForAddColumn),this.rightDotForAddColumn=document.createElement("div"),this.rightDotForAddColumn.style.width="6px",this.rightDotForAddColumn.style.height="6px",this.rightDotForAddColumn.style.backgroundColor="#4A90E2",this.rightDotForAddColumn.style.position="absolute",this.rightDotForAddColumn.style.cursor="pointer",this.rightDotForAddColumn.style.zIndex="1000",this.rightDotForAddColumn.style.borderRadius="50%",this.rightDotForAddColumn.style.border="1px solid white",this.rightDotForAddColumn.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.rightDotForAddColumn),this.addIconForAddColumn=document.createElement("div"),this.addIconForAddColumn.style.width="18px",this.addIconForAddColumn.style.height="18px",this.addIconForAddColumn.style.backgroundColor="#4A90E2",this.addIconForAddColumn.style.position="absolute",this.addIconForAddColumn.style.zIndex="1001",this.addIconForAddColumn.style.display="none",this.addIconForAddColumn.style.borderRadius="50%",this.addIconForAddColumn.style.boxShadow="0 2px 5px rgba(0,0,0,0.2)",this.addIconForAddColumn.style.display="flex",this.addIconForAddColumn.style.justifyContent="center",this.addIconForAddColumn.style.alignItems="center",this.addIconForAddColumn.style.border="1px solid white",document.body.appendChild(this.addIconForAddColumn);const t=document.createElement("div");t.textContent="+",t.style.color="white",t.style.fontSize="18px",t.style.fontWeight="bold",t.style.lineHeight="15px",t.style.userSelect="none",t.style.cursor="pointer",t.style.verticalAlign="top",t.style.textAlign="center",this.addIconForAddColumn.appendChild(t),this.addLineForAddColumn=document.createElement("div"),this.addLineForAddColumn.style.width="2px",this.addLineForAddColumn.style.height="10px",this.addLineForAddColumn.style.backgroundColor="#4A90E2",this.addLineForAddColumn.style.position="absolute",this.addLineForAddColumn.style.zIndex="1001",this.addLineForAddColumn.style.display="none",document.body.appendChild(this.addLineForAddColumn)}bindEventForAddColumn(){this.leftDotForAddColumn.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addColumn),this.addIconForAddColumn.style.display="block";const t=this.leftDotForAddColumn.offsetWidth,e=this.leftDotForAddColumn.offsetHeight;this.showAddIconForAddColumn(this.leftDotForAddColumn.offsetLeft+t/2,this.leftDotForAddColumn.offsetTop+e/2,!0),this.showSplitLineForAddColumn(this.leftDotForAddColumn.offsetLeft+t/2-1,this.leftDotForAddColumn.offsetTop+e/2+2,this.table.getDrawRange().height)})),this.rightDotForAddColumn.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addColumn),this.addIconForAddColumn.style.display="block";const t=this.rightDotForAddColumn.offsetWidth,e=this.rightDotForAddColumn.offsetHeight;this.showAddIconForAddColumn(this.rightDotForAddColumn.offsetLeft+t/2,this.rightDotForAddColumn.offsetTop+e/2,!1),this.showSplitLineForAddColumn(this.rightDotForAddColumn.offsetLeft+t/2-1,this.rightDotForAddColumn.offsetTop+e/2+2,this.table.getDrawRange().height)})),this.addIconForAddColumn.addEventListener("mouseleave",(()=>{this.addIconForAddColumn.style.display="none",this.addLineForAddColumn.style.display="none",this.delayHideAllForAddColumn()})),this.addIconForAddColumn.addEventListener("click",(t=>{const e="left"===this.addIconForAddColumn.dataset.addIconType,i=this.table.options.columns,n=this.hoverCell.col,s=e?n:n+1;this.pluginOptions.addColumnCallback?this.pluginOptions.addColumnCallback(s):(i.splice(s,0,{field:"",title:`New Column ${n}`,width:100}),this.table.updateColumns(i)),this.delayHideAllForAddColumn(0)}))}showDotForAddColumn(t,e,i,n=!0,s=!0){const r=this.leftDotForAddColumn.offsetWidth,o=this.leftDotForAddColumn.offsetHeight;this.leftDotForAddColumn.style.left=e-r/2+"px",this.leftDotForAddColumn.style.top=t-o/2+"px",this.rightDotForAddColumn.style.left=i-r/2+"px",this.rightDotForAddColumn.style.top=t-o/2+"px",this.leftDotForAddColumn.style.display=n?"block":"none",this.rightDotForAddColumn.style.display=s?"block":"none"}showAddIconForAddColumn(t,e,i){const n=this.addIconForAddColumn.offsetWidth,s=this.addIconForAddColumn.offsetHeight,r=this.leftDotForAddColumn.offsetHeight;this.addIconForAddColumn.style.left=t-n/2+"px",this.addIconForAddColumn.style.top=e-s/2-r/2+"px",this.addIconForAddColumn.dataset.addIconType=i?"left":"right"}showSplitLineForAddColumn(t,e,i){this.addLineForAddColumn.style.left=`${t}px`,this.addLineForAddColumn.style.top=`${e}px`,this.addLineForAddColumn.style.height=`${i}px`,this.addLineForAddColumn.style.display="block"}delayHideAllForAddColumn(t=1e3){this.hideAllTimeoutId_addColumn=setTimeout((()=>{this.addIconForAddColumn.style.display="none",this.addLineForAddColumn.style.display="none",this.leftDotForAddColumn.style.display="none",this.rightDotForAddColumn.style.display="none"}),t)}initAddRowDomElement(){this.topDotForAddRow=document.createElement("div"),this.topDotForAddRow.style.width="6px",this.topDotForAddRow.style.height="6px",this.topDotForAddRow.style.backgroundColor="#4A90E2",this.topDotForAddRow.style.position="absolute",this.topDotForAddRow.style.cursor="pointer",this.topDotForAddRow.style.zIndex="1000",this.topDotForAddRow.style.borderRadius="50%",this.topDotForAddRow.style.border="1px solid white",this.topDotForAddRow.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.topDotForAddRow),this.bottomDotForAddRow=document.createElement("div"),this.bottomDotForAddRow.style.width="6px",this.bottomDotForAddRow.style.height="6px",this.bottomDotForAddRow.style.backgroundColor="#4A90E2",this.bottomDotForAddRow.style.position="absolute",this.bottomDotForAddRow.style.cursor="pointer",this.bottomDotForAddRow.style.zIndex="1000",this.bottomDotForAddRow.style.borderRadius="50%",this.bottomDotForAddRow.style.border="1px solid white",this.bottomDotForAddRow.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.bottomDotForAddRow),this.addIconForAddRow=document.createElement("div"),this.addIconForAddRow.style.width="18px",this.addIconForAddRow.style.height="18px",this.addIconForAddRow.style.backgroundColor="#4A90E2",this.addIconForAddRow.style.position="absolute",this.addIconForAddRow.style.zIndex="1001",this.addIconForAddRow.style.display="none",this.addIconForAddRow.style.borderRadius="50%",this.addIconForAddRow.style.boxShadow="0 2px 5px rgba(0,0,0,0.2)",this.addIconForAddRow.style.display="flex",this.addIconForAddRow.style.justifyContent="center",this.addIconForAddRow.style.alignItems="center",this.addIconForAddRow.style.border="1px solid white",document.body.appendChild(this.addIconForAddRow);const t=document.createElement("div");t.textContent="+",t.style.color="white",t.style.fontSize="18px",t.style.fontWeight="bold",t.style.lineHeight="15px",t.style.userSelect="none",t.style.cursor="pointer",t.style.verticalAlign="top",t.style.textAlign="center",this.addIconForAddRow.appendChild(t),this.addLineForAddRow=document.createElement("div"),this.addLineForAddRow.style.width="10px",this.addLineForAddRow.style.height="2px",this.addLineForAddRow.style.backgroundColor="#4A90E2",this.addLineForAddRow.style.position="absolute",this.addLineForAddRow.style.zIndex="1001",this.addLineForAddRow.style.display="none",document.body.appendChild(this.addLineForAddRow)}bindEventForAddRow(){this.topDotForAddRow.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addRow),this.addIconForAddRow.style.display="block";const t=this.topDotForAddRow.offsetWidth,e=this.topDotForAddRow.offsetHeight;this.showAddIconForAddRow(this.topDotForAddRow.offsetLeft+t/2,this.topDotForAddRow.offsetTop+e/2,!0),this.showSplitLineForAddRow(this.topDotForAddRow.offsetLeft+t+2,this.topDotForAddRow.offsetTop+e/2-1,this.table.getDrawRange().width)})),this.bottomDotForAddRow.addEventListener("mouseenter",(()=>{clearTimeout(this.hideAllTimeoutId_addRow),this.addIconForAddRow.style.display="block";const t=this.bottomDotForAddRow.offsetWidth,e=this.bottomDotForAddRow.offsetHeight;this.showAddIconForAddRow(this.bottomDotForAddRow.offsetLeft+t/2,this.bottomDotForAddRow.offsetTop+e/2,!1),this.showSplitLineForAddRow(this.bottomDotForAddRow.offsetLeft+t+2,this.bottomDotForAddRow.offsetTop+e/2-1,this.table.getDrawRange().height)})),this.addIconForAddRow.addEventListener("mouseleave",(()=>{this.addIconForAddRow.style.display="none",this.addLineForAddRow.style.display="none",this.delayHideAllForAddRow()})),this.addIconForAddRow.addEventListener("click",(t=>{const e="top"===this.addIconForAddRow.dataset.addIconType,i=this.hoverCell.row,n=e?i:i+1;if(this.pluginOptions.addRowCallback)this.pluginOptions.addRowCallback(n);else{const t=this.table.getRecordIndexByCell(0,n);this.table.addRecord({},t)}this.delayHideAllForAddRow(0)}))}showDotForAddRow(t,e,i,n=!0,s=!0){const r=this.topDotForAddRow.offsetWidth,o=this.topDotForAddRow.offsetHeight;this.topDotForAddRow.style.left=e-r/2+"px",this.topDotForAddRow.style.top=t-o/2+"px",this.bottomDotForAddRow.style.left=e-r/2+"px",this.bottomDotForAddRow.style.top=i-o/2+"px",this.topDotForAddRow.style.display=n?"block":"none",this.bottomDotForAddRow.style.display=s?"block":"none"}showAddIconForAddRow(t,e,i){const n=this.addIconForAddRow.offsetWidth,s=this.addIconForAddRow.offsetHeight,r=this.topDotForAddRow.offsetWidth;this.addIconForAddRow.style.left=t-n/2-r/2+"px",this.addIconForAddRow.style.top=e-s/2+"px",this.addIconForAddRow.dataset.addIconType=i?"top":"bottom"}showSplitLineForAddRow(t,e,i){this.addLineForAddRow.style.left=`${t}px`,this.addLineForAddRow.style.top=`${e}px`,this.addLineForAddRow.style.width=`${i}px`,this.addLineForAddRow.style.display="block"}delayHideAllForAddRow(t=1e3){this.hideAllTimeoutId_addRow=setTimeout((()=>{this.addIconForAddRow.style.display="none",this.addLineForAddRow.style.display="none",this.topDotForAddRow.style.display="none",this.bottomDotForAddRow.style.display="none"}),t)}release(){this.leftDotForAddColumn.remove(),this.rightDotForAddColumn.remove(),this.addIconForAddColumn.remove(),this.addLineForAddColumn.remove(),this.topDotForAddRow.remove(),this.bottomDotForAddRow.remove(),this.addIconForAddRow.remove(),this.addLineForAddRow.remove()}},t.CarouselAnimationPlugin=class{table;rowCount;colCount;animationDuration;animationDelay;animationEasing;replaceScrollAction;playing;row;col;willUpdateRow=!1;willUpdateCol=!1;customDistRowFunction;customDistColFunction;constructor(t,e){this.table=t,this.rowCount=e?.rowCount??void 0,this.colCount=e?.colCount??void 0,this.animationDuration=e?.animationDuration??500,this.animationDelay=e?.animationDelay??1e3,this.animationEasing=e?.animationEasing??"linear",this.replaceScrollAction=e?.replaceScrollAction??!1,this.customDistColFunction=e.customDistColFunction,this.customDistRowFunction=e.customDistRowFunction,this.reset(),this.init()}init(){this.replaceScrollAction&&(this.table.disableScroll(),this.table.scenegraph.stage.addEventListener("wheel",this.onScrollEnd.bind(this)))}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}onScrollEnd(t){this.rowCount?(t.deltaY>0?(this.row+=this.rowCount,this.row=Math.min(this.row,this.table.rowCount-this.table.frozenRowCount)):t.deltaY<0&&(this.row-=this.rowCount,this.row=Math.max(this.row,this.table.frozenRowCount)),this.table.scrollToRow(this.row,{duration:this.animationDuration,easing:this.animationEasing})):this.colCount&&(t.deltaX>0?(this.col+=this.colCount,this.col=Math.min(this.col,this.table.colCount-this.table.frozenColCount)):t.deltaX<0&&(this.col-=this.colCount,this.col=Math.max(this.col,this.table.frozenColCount)),this.table.scrollToCol(this.col,{duration:this.animationDuration,easing:this.animationEasing}))}play(){this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistRowFunction&&this.customDistRowFunction(this.row,this.table);e?(this.row=e.distRow,t=e.animation??!0):s(this.row)&&this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):s(this.row)||this.table.scenegraph.proxy.screenTopRow===Math.floor(this.row)?this.row+=this.rowCount:(this.row=this.table.frozenRowCount,t=!1),this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout((()=>{this.willUpdateRow=!1,this.updateRow()}),this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistColFunction&&this.customDistColFunction(this.col,this.table);e?(this.col=e.distCol,t=e.animation??!0):s(this.col)&&this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):s(this.col)||this.table.scenegraph.proxy.screenLeftCol===Math.floor(this.col)?this.col+=this.colCount:(this.col=this.table.frozenColCount,t=!1),this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout((()=>{this.willUpdateCol=!1,this.updateCol()}),this.animationDuration+this.animationDelay)}},t.ColumnSeriesPlugin=class{id=`column-series-${Date.now()}`;name="Column Series";runTime=[n.TABLE_EVENT_TYPE.BEFORE_INIT,n.TABLE_EVENT_TYPE.BEFORE_KEYDOWN];pluginOptions;table;columns=[];constructor(t){this.pluginOptions=Object.assign({columnCount:100},t)}run(...t){if(t[1]===n.TABLE_EVENT_TYPE.BEFORE_INIT){const e=t[0],i=t[2];this.table=i;const n=e.options;this.columns=this.generateColumns(this.pluginOptions.columnCount),n.columns=this.columns}else if(t[1]===n.TABLE_EVENT_TYPE.BEFORE_KEYDOWN){const e=t[0].event;this.pluginOptions.autoExtendColumnTriggerKeys?.includes(e.key)&&this.table.stateManager.select.cellPos.col===this.table.colCount-1&&this.table.addColumn(this.generateColumn(this.table.colCount-1))}}generateColumns(t){const e=[];for(let i=0;i<t;i++)e.push(this.generateColumn(i));return e}generateColumn(t){return{title:this.pluginOptions.generateColumnTitle?this.pluginOptions.generateColumnTitle(t):this.generateColumnField(t)}}generateColumnField(t){if(t<26)return String.fromCharCode(65+t);const e=[];for(t++;t>0;)t--,e.unshift(String.fromCharCode(65+t%26)),t=Math.floor(t/26);return e.join("")}resetColumnCount(t){this.pluginOptions.columnCount=t,this.columns=this.generateColumns(t),this.table.updateColumns(this.columns)}},t.ExcelEditCellKeyboardPlugin=class{id=`excel-edit-cell-keyboard-${Date.now()}`;name="Excel Edit Cell Keyboard";runTime=[n.TABLE_EVENT_TYPE.INITIALIZED];table;pluginOptions;constructor(t){this.pluginOptions=t,this.bindEvent()}run(...t){const e=t[2];this.table=e}bindEvent(){document.addEventListener("keydown",this.handleKeyDown.bind(this),!0)}handleKeyDown(t){if(this.table.editorManager)if("keydown"===this.table.editorManager.beginTriggerEditCellMode){if(this.table.editorManager.editingEditor&&this.isExcelShortcutKey(t)){const{col:e,row:i}=this.table.editorManager.editCell;this.table.editorManager.completeEdit(),this.table.getElement().focus(),t.shiftKey||t.ctrlKey||t.metaKey||("Enter"===t.key?this.table.selectCell(e,i+1):"Tab"===t.key?this.table.selectCell(e+1,i):"ArrowLeft"===t.key?this.table.selectCell(e-1,i):"ArrowRight"===t.key?this.table.selectCell(e+1,i):"ArrowDown"===t.key?this.table.selectCell(e,i+1):"ArrowUp"===t.key&&this.table.selectCell(e,i-1),t.stopPropagation(),t.preventDefault())}}else{const{col:e,row:i}=this.table.stateManager.select.cellPos;if(!this.table.editorManager.editingEditor||"Enter"!==t.key&&"Tab"!==t.key){if("Delete"===t.key){const e=this.table.getSelectedCellInfos();e?.length>0&&function(t,e){for(let i=0;i<t.length;i++)for(let n=0;n<t[i].length;n++)e.changeCellValue(t[i][n].col,t[i][n].row,"")}(e,this.table),t.stopPropagation(),t.preventDefault()}}else this.table.editorManager.completeEdit(),this.table.getElement().focus(),"Enter"===t.key?this.table.selectCell(e,i+1):"Tab"===t.key&&this.table.selectCell(e+1,i),t.stopPropagation(),t.preventDefault()}}isExcelShortcutKey(t){return"Enter"===t.key||"Tab"===t.key||"ArrowLeft"===t.key||"ArrowRight"===t.key||"ArrowDown"===t.key||"ArrowUp"===t.key}release(){document.removeEventListener("keydown",this.handleKeyDown,!0)}},t.FocusHighlightPlugin=class{id=`focus-highlight-${Date.now()}`;name="Focus Highlight";runTime=[e.TABLE_EVENT_TYPE.INITIALIZED,e.TABLE_EVENT_TYPE.SELECTED_CELL,e.TABLE_EVENT_TYPE.SELECTED_CLEAR];table;range;pluginOptions;constructor(t={fill:"#000",opacity:.5,highlightRange:void 0}){this.pluginOptions=Object.assign({fill:"#000",opacity:.5},t)}run(...t){if(this.table||(this.table=t[2]),t[1]===e.TABLE_EVENT_TYPE.INITIALIZED)this.pluginOptions.highlightRange&&this.setFocusHighlightRange(this.pluginOptions.highlightRange);else if(t[1]===e.TABLE_EVENT_TYPE.SELECTED_CELL){const t=this.table.stateManager.select.cellPos;if(this.table.isHeader(t.col,t.row))this.setFocusHighlightRange(void 0);else{const t=this.table.stateManager.select.ranges,e=0,i=this.table.colCount-1,n=Math.min(t[0].start.row,t[0].end.row),s=Math.max(t[0].start.row,t[0].end.row);this.setFocusHighlightRange({start:{col:e,row:n},end:{col:i,row:s}})}}else t[1]===e.TABLE_EVENT_TYPE.SELECTED_CLEAR&&this.setFocusHighlightRange(void 0)}setFocusHighlightRange(t,e=!1){let i;t&&"start"in t&&"end"in t?i=t:t&&(i={start:t,end:t}),Rh(this.range,i)&&!e||(this.range=i,t?this.updateCellGroupShadow():this.deleteAllCellGroupShadow(),this.table.scenegraph.updateNextFrame())}deleteAllCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup)}updateCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup,this.range)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.range,this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup,this.range)}updateCellGroupShadowInContainer(t,e){let i;e&&"start"in e&&"end"in e?i=e:e&&(i={start:e,end:e}),t.forEachChildrenSkipChild((t=>{const e=t;"column"===e.role&&e.forEachChildrenSkipChild((t=>{const e=t;if("cell"!==e.role)return;e.attachShadow(e.shadowRoot);const n=e.shadowRoot;if(i){if(Lh(i,e.col,e.row))n.removeAllChild();else if(!n.firstChild){const t=Po({x:0,y:0,width:e.attribute.width,height:e.attribute.height,fill:this.pluginOptions.fill,opacity:this.pluginOptions.opacity});t.name="shadow-rect",n.appendChild(t)}}else n.removeAllChild()}))}))}update(){this.setFocusHighlightRange(this.range,!0)}},t.HeaderHighlightPlugin=class{table;options;colHeaderRange;rowHeaderRange;constructor(t,e){this.table=t,this.options=e,this.registerStyle(),this.bindEvent()}registerStyle(){this.table.registerCustomCellStyle("col-highlight",{bgColor:this.options?.colHighlightBGColor??"#82b2f5",color:this.options?.colHighlightColor??"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:this.options?.rowHighlightBGColor??"#82b2f5",color:this.options?.rowHighlightColor??"#FFF"})}bindEvent(){this.table.on("selected_cell",(()=>{this.updateHighlight()})),this.table.on("selected_clear",(()=>{this.clearHighlight()})),this.table.on("mousemove_table",(()=>{this.table.stateManager.select.selecting&&this.updateHighlight()}))}clearHighlight(){this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0,!0),this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0,!0),this.colHeaderRange=void 0,this.rowHeaderRange=void 0}updateHighlight(){if(!1===this.options?.colHighlight&&!1===this.options?.rowHighlight)return;const t=this.table.getSelectedCellRanges();if(0===t.length)return void this.clearHighlight();const e=t[0],i=[e.start.row,e.end.row];i.sort(((t,e)=>t-e));const n=[e.start.col,e.end.col];let s,r;n.sort(((t,e)=>t-e)),this.table.isPivotTable()?(s={start:{col:n[0],row:0},end:{col:n[1],row:this.table.columnHeaderLevelCount-1}},r={start:{col:0,row:i[0]},end:{col:this.table.rowHeaderLevelCount-1,row:i[1]}}):this.table.internalProps.transpose?r={start:{col:0,row:i[0]},end:{col:this.table.rowHeaderLevelCount-1,row:i[1]}}:(s={start:{col:n[0],row:0},end:{col:n[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(r={start:{col:0,row:i[0]},end:{col:0,row:i[1]}})),!1===this.options?.colHighlight||Oh(this.colHeaderRange,s)||(this.colHeaderRange&&this.table.arrangeCustomCellStyle({range:this.colHeaderRange},void 0),s&&this.table.arrangeCustomCellStyle({range:s},"col-highlight"),this.colHeaderRange=s),!1===this.options?.rowHighlight||Oh(this.rowHeaderRange,r)||(this.rowHeaderRange&&this.table.arrangeCustomCellStyle({range:this.rowHeaderRange},void 0),r&&this.table.arrangeCustomCellStyle({range:r},"row-highlight"),this.rowHeaderRange=r)}},t.HighlightHeaderWhenSelectCellPlugin=class{id=`highlight-header-when-select-cell-${Date.now()}`;name="Highlight Header When Select Cell";runTime=[e.TABLE_EVENT_TYPE.INITIALIZED,e.TABLE_EVENT_TYPE.SELECTED_CLEAR,e.TABLE_EVENT_TYPE.SELECTED_CELL,e.TABLE_EVENT_TYPE.MOUSEMOVE_TABLE];table;pluginOptions;colHeaderRanges=[];rowHeaderRanges=[];constructor(t){this.pluginOptions=t}run(...t){const i=t[1],n=t[2];this.table=n,i===e.TABLE_EVENT_TYPE.SELECTED_CLEAR?this.clearHighlight():i===e.TABLE_EVENT_TYPE.SELECTED_CELL||i===e.TABLE_EVENT_TYPE.MOUSEMOVE_TABLE?this.updateHighlight():i===e.TABLE_EVENT_TYPE.INITIALIZED&&this.registerStyle()}registerStyle(){this.table.registerCustomCellStyle("col-highlight",{bgColor:this.pluginOptions?.colHighlightBGColor??"#82b2f5",color:this.pluginOptions?.colHighlightColor??"#FFF"}),this.table.registerCustomCellStyle("row-highlight",{bgColor:this.pluginOptions?.rowHighlightBGColor??"#82b2f5",color:this.pluginOptions?.rowHighlightColor??"yellow"})}clearHighlight(){this.colHeaderRanges&&this.colHeaderRanges.forEach((t=>{this.table.arrangeCustomCellStyle({range:t},void 0)})),this.rowHeaderRanges&&this.rowHeaderRanges.forEach((t=>{this.table.arrangeCustomCellStyle({range:t},void 0)})),this.colHeaderRanges=[],this.rowHeaderRanges=[]}updateHighlight(){if(!1===this.pluginOptions?.colHighlight&&!1===this.pluginOptions?.rowHighlight)return;const t=this.table.getSelectedCellRanges();t.length<2&&this.clearHighlight();for(let e=0;e<t.length;e++){const i=t[e],n=[i.start.row,i.end.row];n.sort(((t,e)=>t-e));const s=[i.start.col,i.end.col];let r,o;s.sort(((t,e)=>t-e)),this.table.isPivotTable()?(r={start:{col:s[0],row:0},end:{col:s[1],row:this.table.columnHeaderLevelCount-1}},o={start:{col:0,row:n[0]},end:{col:this.table.rowHeaderLevelCount-1,row:n[1]}}):this.table.internalProps.transpose?o={start:{col:0,row:n[0]},end:{col:this.table.rowHeaderLevelCount-1,row:n[1]}}:(r={start:{col:s[0],row:0},end:{col:s[1],row:this.table.columnHeaderLevelCount-1}},this.table.internalProps.rowSeriesNumber&&(o={start:{col:0,row:n[0]},end:{col:0,row:n[1]}})),!1===this.pluginOptions?.colHighlight||this.colHeaderRanges.find((t=>Ih(t,r)))||(r&&this.table.arrangeCustomCellStyle({range:r},"col-highlight"),this.colHeaderRanges.push(r)),!1===this.pluginOptions?.rowHighlight||this.rowHeaderRanges.find((t=>Ih(t,o)))||(o&&this.table.arrangeCustomCellStyle({range:o},"row-highlight"),this.rowHeaderRanges.push(o))}}update(){this.registerStyle(),this.updateHighlight()}release(){this.rowHeaderRanges=[],this.colHeaderRanges=[]}},t.InvertHighlightPlugin=class{table;range;_fill;_opacity;constructor(t,e){this.table=t,this._fill=e?.fill??"#000",this._opacity=e?.opacity??.5}setInvertHighlightRange(t){Rh(this.range,t)||(this.range=t,t?this.updateCellGroupShadow():this.deleteAllCellGroupShadow(),this.table.scenegraph.updateNextFrame())}deleteAllCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup)}updateCellGroupShadow(){this.table.isPivotTable()||(this.updateCellGroupShadowInContainer(this.table.scenegraph.rowHeaderGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.leftBottomCornerGroup,this.range)),this.updateCellGroupShadowInContainer(this.table.scenegraph.bodyGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.rightFrozenGroup,this.range),this.updateCellGroupShadowInContainer(this.table.scenegraph.bottomFrozenGroup),this.range,this.updateCellGroupShadowInContainer(this.table.scenegraph.rightBottomCornerGroup,this.range)}updateCellGroupShadowInContainer(t,e){t.forEachChildrenSkipChild((t=>{const i=t;"column"===i.role&&i.forEachChildrenSkipChild((t=>{const i=t;if("cell"!==i.role)return;i.attachShadow(i.shadowRoot);const n=i.shadowRoot;if(e){if(Lh(e,i.col,i.row))n.removeAllChild();else if(!n.firstChild){const t=Po({x:0,y:0,width:i.attribute.width,height:i.attribute.height,fill:this._fill,opacity:this._opacity});t.name="shadow-rect",n.appendChild(t)}}else n.removeAllChild()}))}))}},t.RotateTablePlugin=class{id="rotate-table";name="Rotate Table";runTime=[n.TABLE_EVENT_TYPE.INITIALIZED];table;matrix;vglobal_mapToCanvasPoint;constructor(){}run(...t){const e=t[2];this.table=e,this.table.rotate90WithTransform=Dh.bind(this.table),this.table.cancelTransform=Fh.bind(this.table)}release(){}},t.RowSeriesPlugin=class{id=`row-series-${Date.now()}`;name="Row Series";runTime=[e.TABLE_EVENT_TYPE.BEFORE_INIT,e.TABLE_EVENT_TYPE.BEFORE_KEYDOWN];pluginOptions;table;constructor(t){this.pluginOptions=Object.assign({rowCount:100},t)}run(...t){if(t[1]===e.TABLE_EVENT_TYPE.BEFORE_INIT){const e=t[0],i=t[2];this.table=i;const n=e.options,s=n.records??[];for(let t=s.length;t<this.pluginOptions.rowCount;t++)s.push(this.pluginOptions.fillRowRecord?this.pluginOptions.fillRowRecord(t):{});n.records=s,this.pluginOptions.rowSeriesNumber?(n.rowSeriesNumber=this.pluginOptions.rowSeriesNumber,this.pluginOptions.rowSeriesNumber.width||(n.rowSeriesNumber.width="auto")):n.rowSeriesNumber||(n.rowSeriesNumber={width:"auto"})}else if(t[1]===e.TABLE_EVENT_TYPE.BEFORE_KEYDOWN){const e=t[0].event;this.pluginOptions.autoExtendRowTriggerKeys?.includes(e.key)&&this.table.stateManager.select.cellPos.row===this.table.rowCount-1&&this.table.addRecord(this.pluginOptions.fillRowRecord?this.pluginOptions.fillRowRecord(this.table.rowCount-this.table.columnHeaderLevelCount):{})}}},t.TableCarouselAnimationPlugin=class{id=`table-carousel-animation-${Date.now()}`;name="Table Carousel Animation";runTime=[e.TABLE_EVENT_TYPE.INITIALIZED];table;rowCount;colCount;animationDuration;animationDelay;animationEasing;playing;row;col;willUpdateRow=!1;willUpdateCol=!1;autoPlay;autoPlayDelay;customDistRowFunction;customDistColFunction;constructor(t={}){this.rowCount=t?.rowCount??void 0,this.colCount=t?.colCount??void 0,this.animationDuration=t?.animationDuration??500,this.animationDelay=t?.animationDelay??1e3,this.animationEasing=t?.animationEasing??"linear",this.autoPlay=t?.autoPlay??!1,this.autoPlayDelay=t?.autoPlayDelay??0,this.customDistColFunction=t.customDistColFunction,this.customDistRowFunction=t.customDistRowFunction}run(...t){this.table||(this.table=t[2]),this.reset(),this.autoPlay&&setTimeout((()=>{this.play()}),this.autoPlayDelay)}reset(){this.playing=!1,this.row=this.table.frozenRowCount,this.col=this.table.frozenColCount}play(){if(!this.table)throw new Error("table is not initialized");this.playing=!0,this.rowCount&&!this.willUpdateRow?this.updateRow():this.colCount&&!this.willUpdateCol&&this.updateCol()}pause(){this.playing=!1}updateRow(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistRowFunction&&this.customDistRowFunction(this.row,this.table);e?(this.row=e.distRow,t=e.animation??!0):kh(this.row)&&this.table.scenegraph.proxy.screenTopRow!==this.row?(this.row=this.table.frozenRowCount,t=!1):kh(this.row)||this.table.scenegraph.proxy.screenTopRow===Math.floor(this.row)?this.row+=this.rowCount:(this.row=this.table.frozenRowCount,t=!1),this.table.scrollToRow(this.row,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateRow=!0,setTimeout((()=>{this.willUpdateRow=!1,this.updateRow()}),this.animationDuration+this.animationDelay)}updateCol(){if(!this.playing||this.table.isReleased)return;let t=!0;const e=this.customDistColFunction&&this.customDistColFunction(this.col,this.table);e?(this.col=e.distCol,t=e.animation??!0):kh(this.col)&&this.table.scenegraph.proxy.screenLeftCol!==this.col?(this.col=this.table.frozenColCount,t=!1):kh(this.col)||this.table.scenegraph.proxy.screenLeftCol===Math.floor(this.col)?this.col+=this.colCount:(this.col=this.table.frozenColCount,t=!1),this.table.scrollToCol(this.col,t?{duration:this.animationDuration,easing:this.animationEasing}:void 0),this.willUpdateCol=!0,setTimeout((()=>{this.willUpdateCol=!1,this.updateCol()}),this.animationDuration+this.animationDelay)}release(){}},t.cancelTransform=Fh,t.rotate90WithTransform=Dh}));
|