@visactor/vtable-calendar 1.7.6
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/README.md +67 -0
- package/cjs/custom/custom-handler.d.ts +46 -0
- package/cjs/custom/custom-handler.js +147 -0
- package/cjs/custom/custom-handler.js.map +1 -0
- package/cjs/custom/custom-layout.d.ts +6 -0
- package/cjs/custom/custom-layout.js +112 -0
- package/cjs/custom/custom-layout.js.map +1 -0
- package/cjs/date-util.d.ts +10 -0
- package/cjs/date-util.js +99 -0
- package/cjs/date-util.js.map +1 -0
- package/cjs/event/type.d.ts +39 -0
- package/cjs/event/type.js +12 -0
- package/cjs/event/type.js.map +1 -0
- package/cjs/index.d.ts +3 -0
- package/cjs/index.js +30 -0
- package/cjs/index.js.map +1 -0
- package/cjs/month-calendar.d.ts +65 -0
- package/cjs/month-calendar.js +177 -0
- package/cjs/month-calendar.js.map +1 -0
- package/cjs/style.d.ts +13 -0
- package/cjs/style.js +54 -0
- package/cjs/style.js.map +1 -0
- package/cjs/table/table-option.d.ts +7 -0
- package/cjs/table/table-option.js +61 -0
- package/cjs/table/table-option.js.map +1 -0
- package/dist/vtable-calendar.js +54526 -0
- package/dist/vtable-calendar.min.js +1 -0
- package/es/custom/custom-handler.d.ts +46 -0
- package/es/custom/custom-handler.js +140 -0
- package/es/custom/custom-handler.js.map +1 -0
- package/es/custom/custom-layout.d.ts +6 -0
- package/es/custom/custom-layout.js +105 -0
- package/es/custom/custom-layout.js.map +1 -0
- package/es/date-util.d.ts +10 -0
- package/es/date-util.js +88 -0
- package/es/date-util.js.map +1 -0
- package/es/event/type.d.ts +39 -0
- package/es/event/type.js +8 -0
- package/es/event/type.js.map +1 -0
- package/es/index.d.ts +3 -0
- package/es/index.js +4 -0
- package/es/index.js.map +1 -0
- package/es/month-calendar.d.ts +65 -0
- package/es/month-calendar.js +181 -0
- package/es/month-calendar.js.map +1 -0
- package/es/style.d.ts +13 -0
- package/es/style.js +45 -0
- package/es/style.js.map +1 -0
- package/es/table/table-option.d.ts +7 -0
- package/es/table/table-option.js +58 -0
- package/es/table/table-option.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VTableCalendar={})}(this,(function(t){"use strict";class e{static GenAutoIncrementId(){return e.auto_increment_id++}}e.auto_increment_id=0;class i{constructor(t){this.id=e.GenAutoIncrementId(),this.registry=t}}const o="named",n="inject",r="multi_inject",s="inversify:tagged",l="inversify:paramtypes";class a{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===o?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}var h=function(t){var e;return function(t){const e="function"==typeof Symbol&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=Object.getPrototypeOf(Function),o=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),n=new WeakMap;function r(t,e,i){let r=n.get(t);if(h(r)){if(!i)return;r=new o,n.set(t,r)}let s=r.get(e);if(h(s)){if(!i)return;s=new o,r.set(e,s)}return s}function s(t,e,i){if(l(t,e,i))return!0;const o=f(e);return!d(o)&&s(t,o,i)}function l(t,e,i){const o=r(e,i,!1);return!h(o)&&!!o.has(t)}function a(t,e,i){if(l(t,e,i))return function(t,e,i){const o=r(e,i,!1);if(!h(o))return o.get(t)}(t,e,i);const o=f(e);return d(o)?void 0:a(t,o,i)}function h(t){return void 0===t}function d(t){return null===t}function c(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 o=3===i?"string":5===i?"number":"default",n=function(t,e){const i=t[e];if(null!=i){if(!p(i))throw new TypeError;return i}}(t,e);if(void 0!==n){const e=n.call(t,o);if(c(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(p(e)){const i=e.call(t);if(!c(i))return i}const i=t.valueOf;if(p(i)){const e=i.call(t);if(!c(e))return e}}else{const e=t.valueOf;if(p(e)){const i=e.call(t);if(!c(i))return i}const i=t.toString;if(p(i)){const e=i.call(t);if(!c(e))return e}}throw new TypeError}(t,"default"===o?"number":o)}function g(t){const e=u(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function p(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 o=t.prototype,n=o&&Object.getPrototypeOf(o);if(null==n||n===Object.prototype)return e;const r=n.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,o){if(!c(i))throw new TypeError;return n=t,s=e,void r(i,o,!0).set(n,s);var n,s})),t("hasMetadata",(function(t,e,i){if(!c(e))throw new TypeError;return h(i)||(i=g(i)),s(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!c(e))throw new TypeError;return h(i)||(i=g(i)),l(t,e,i)})),t("getMetadata",(function(t,e,i){if(!c(e))throw new TypeError;return h(i)||(i=g(i)),a(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function d(t,e,i,o){!function(t,e,i,o){const n=[o];let r={};h.hasOwnMetadata(t,e)&&(r=h.getMetadata(t,e));let s=r[i];void 0===s&&(s=[]),s.push(...n),r[i]=s,h.defineMetadata(t,r,e)}(s,t,i.toString(),o)}function c(t){return(e,i,o)=>{d(e,0,o,t)}}function u(t){return e=>(i,o,n)=>c(new a(t,e))(i,o,n)}const g=u(n),p=u(r);function f(){return function(t){return h.defineMetadata(l,null,t),t}}function v(t){return c(new a(o,t))}const m="Singleton",b="Transient",C="ConstantValue",y="DynamicValue",w="Factory",x="Function",_="Instance",S="Invalid";class A{constructor(t,i){this.id=e.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=i,this.type=S,this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new A(this.serviceIdentifier,this.scope);return t.activated=t.scope===m&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class R{getConstructorMetadata(t){return{compilerGeneratedMetadata:h.getMetadata(l,t),userGeneratedMetadata:h.getMetadata(s,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const B=(M=o,t=>{const e=e=>{if(null==e)return!1;if(e.key===M&&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===M&&i[e].value===t)return!0;return!1};return e.metaData=new a(M,t),e});var M;class T{constructor(t){this._binding=t}inRequestScope(){throw new Error("暂未实现")}inSingletonScope(){return this._binding.scope=m,this}inTransientScope(){return this._binding.scope=b,this}whenTargetNamed(t){return this._binding.constraint=B(t),this}}class P{constructor(t){this._binding=t}to(t){return this._binding.type=_,this._binding.implementationType=t,new T(this._binding)}toSelf(){const t=this._binding.serviceIdentifier;return this.to(t)}toDynamicValue(t){return this._binding.type=y,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new T(this._binding)}toConstantValue(t){return this._binding.type=C,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=m,new T(this._binding)}toFactory(t){return this._binding.type=w,this._binding.factory=t,this._binding.scope=m,new T(this._binding)}toService(t){this.toDynamicValue((e=>e.container.get(t)))}}const E=Symbol("ContributionProvider");class k{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function L(t,e){t(E).toDynamicValue((t=>{let{container:i}=t;return new k(e,i)})).inSingletonScope().whenTargetNamed(e)}class H{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 o;if("string"==typeof e)o={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof o.name||""===o.name)throw new Error("Missing name for tap");return o=Object.assign({type:t,fn:i},o),o}_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 o=this.taps.length;for(;o>0;){o--;const t=this.taps[o];this.taps[o+1]=t;const n=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(n>i)){o++;break}}this.taps[o]=t}}class F extends H{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 z=Symbol.for("EnvContribution"),I=Symbol.for("VGlobal");var O=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},D=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},W=function(t,e){return function(i,o){e(i,o,t)}};let N=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){this.contributions=t,this.id=e.GenAutoIncrementId(),this.hooks={onSetEnv:new F(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const o=i.configure(this,t);o&&o.then&&e.push(o)})),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 o=this.bindContribution(e);if(o&&o.then)return o.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}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)}};function G(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}N=O([f(),W(0,g(E)),W(0,v(z)),D("design:paramtypes",[Object])],N);var j={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,i="~";function o(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,o,r,s){if("function"!=typeof o)throw new TypeError("The listener must be a function");var l=new n(o,r||t,s),a=i?i+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],l]:t._events[a].push(l):(t._events[a]=l,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new o:delete t._events[e]}function l(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),l.prototype.eventNames=function(){var t,o,n=[];if(0===this._eventsCount)return n;for(o in t=this._events)e.call(t,o)&&n.push(i?o.slice(1):o);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},l.prototype.listeners=function(t){var e=i?i+t:t,o=this._events[e];if(!o)return[];if(o.fn)return[o.fn];for(var n=0,r=o.length,s=new Array(r);n<r;n++)s[n]=o[n].fn;return s},l.prototype.listenerCount=function(t){var e=i?i+t:t,o=this._events[e];return o?o.fn?1:o.length:0},l.prototype.emit=function(t,e,o,n,r,s){var l=i?i+t:t;if(!this._events[l])return!1;var a,h,d=this._events[l],c=arguments.length;if(d.fn){switch(d.once&&this.removeListener(t,d.fn,void 0,!0),c){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,e),!0;case 3:return d.fn.call(d.context,e,o),!0;case 4:return d.fn.call(d.context,e,o,n),!0;case 5:return d.fn.call(d.context,e,o,n,r),!0;case 6:return d.fn.call(d.context,e,o,n,r,s),!0}for(h=1,a=new Array(c-1);h<c;h++)a[h-1]=arguments[h];d.fn.apply(d.context,a)}else{var u,g=d.length;for(h=0;h<g;h++)switch(d[h].once&&this.removeListener(t,d[h].fn,void 0,!0),c){case 1:d[h].fn.call(d[h].context);break;case 2:d[h].fn.call(d[h].context,e);break;case 3:d[h].fn.call(d[h].context,e,o);break;case 4:d[h].fn.call(d[h].context,e,o,n);break;default:if(!a)for(u=1,a=new Array(c-1);u<c;u++)a[u-1]=arguments[u];d[h].fn.apply(d[h].context,a)}}return!0},l.prototype.on=function(t,e,i){return r(this,t,e,i,!1)},l.prototype.once=function(t,e,i){return r(this,t,e,i,!0)},l.prototype.removeListener=function(t,e,o,n){var r=i?i+t:t;if(!this._events[r])return this;if(!e)return s(this,r),this;var l=this._events[r];if(l.fn)l.fn!==e||n&&!l.once||o&&l.context!==o||s(this,r);else{for(var a=0,h=[],d=l.length;a<d;a++)(l[a].fn!==e||n&&!l[a].once||o&&l[a].context!==o)&&h.push(l[a]);h.length?this._events[r]=1===h.length?h[0]:h:s(this,r)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=i?i+t:t,this._events[e]&&s(this,e)):(this._events=new o,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=i,l.EventEmitter=l,t.exports=l}(j);var U=G(j.exports);var V=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`;var $=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"boolean"==typeof t:!0===t||!1===t||V(t,"Boolean")};var Y=t=>"function"==typeof t;var X=t=>null==t;var K=t=>null!=t;var Z=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e};var q=t=>"object"==typeof t&&null!==t;var J=function(t){if(!q(t)||!V(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};var Q=t=>void 0===t;var tt=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"string"===e:"string"===e||V(t,"String")};var et=t=>Array.isArray?Array.isArray(t):V(t,"Array");var it=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)};var ot=t=>V(t,"Date");var nt=function(t){const e=typeof t;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?"number"===e:"number"===e||V(t,"Number")};var rt=t=>nt(t)&&Number.isFinite(t);var st=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);var at=t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,""));const ht=Object.prototype;var dt=function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ht)};const ct=Object.prototype.hasOwnProperty;function ut(t){if(X(t))return!0;if(it(t))return!t.length;const e=at(t);if("Map"===e||"Set"===e)return!t.size;if(dt(t))return!Object.keys(t).length;for(const e in t)if(ct.call(t,e))return!1;return!0}var gt=(t,e,i)=>{const o=tt(e)?e.split("."):e;for(let e=0;e<o.length;e++)t=t?t[o[e]]:void 0;return void 0===t?i:t};const pt=Object.prototype.hasOwnProperty;var ft=(t,e)=>null!=t&&pt.call(t,e);function vt(t,e,i){let o;if(!K(t)||"object"!=typeof t||e&&e(t))return t;const n=et(t),r=t.length;o=n?new Array(r):"object"==typeof t?{}:$(t)||nt(t)||tt(t)?t:ot(t)?new Date(+t):void 0;const s=n?void 0:Object.keys(Object(t));let l=-1;if(o)for(;++l<(s||t).length;){const n=s?s[l]:l,r=t[n];i&&i.includes(n.toString())?o[n]=r:o[n]=vt(r,e,i)}return o}function mt(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){if(t===e)return;if(K(e)&&"object"==typeof e){const n=Object(e),r=[];for(const t in n)r.push(t);let{length:s}=r,l=-1;for(;s--;){const s=r[++l];!K(n[s])||"object"!=typeof n[s]||o&&et(t[s])?Ct(t,s,n[s]):bt(t,e,s,i,o)}}}}function bt(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const r=t[i],s=e[i];let l=e[i],a=!0;if(et(s)){if(o)l=[];else if(et(r))l=r;else if(it(r)){l=new Array(r.length);let t=-1;const e=r.length;for(;++t<e;)l[t]=r[t]}}else J(s)?(l=null!=r?r:{},"function"!=typeof r&&"object"==typeof r||(l={})):a=!1;a&&mt(l,s,o,n),Ct(t,i,l)}function Ct(t,e,i){(void 0!==i&&!function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}(t[e],i)||void 0===i&&!(e in t))&&(t[e]=i)}function yt(t){let e=-1;const i=arguments.length<=1?0:arguments.length-1;for(;++e<i;)mt(t,e+1<1||arguments.length<=e+1?void 0:arguments[e+1],!0);return t}function wt(t){return Object.prototype.toString.call(t)}function xt(t){return Object.keys(t)}function _t(t,e,i){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(wt(t)!==wt(e))return!1;if(Y(t))return!!(null==i?void 0:i.skipFunction);if("object"!=typeof t)return!1;if(et(t)){if(t.length!==e.length)return!1;for(let o=t.length-1;o>=0;o--)if(!_t(t[o],e[o],i))return!1;return!0}if(!J(t))return!1;const o=xt(t),n=xt(e);if(o.length!==n.length)return!1;o.sort(),n.sort();for(let t=o.length-1;t>=0;t--)if(o[t]!=n[t])return!1;for(let n=o.length-1;n>=0;n--){const r=o[n];if(!_t(t[r],e[r],i))return!1}return!0}function St(t,e,i){const o=function(t){if(!t)return[];if(Object.keys)return Object.keys(t);const e=[];for(const i in t)t.hasOwnProperty(i)&&e.push(i);return e}(e);for(let n=0;n<o.length;n++){const r=o[n];(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}return t}function At(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames){const o=Object.getOwnPropertyNames(e);for(let n=0;n<o.length;n++){const r=o[n];"constructor"!==r&&(i?null!=e[r]:null==t[r])&&(t[r]=e[r])}}else St(t,e,i)}function Rt(t){return K(t)?et(t)?t:[t]:[]}function Bt(t){if(it(t))return t[t.length-1]}const Mt=(t,e)=>{var i;if(0===t.length)return;let o=t[0];for(let n=1;n<t.length;n++){const r=t[n];(null!==(i=null==e?void 0:e(r,o))&&void 0!==i?i:r-o>0)&&(o=r)}return o},Tt=(t,e)=>{var i;if(0===t.length)return;let o=t[0];for(let n=1;n<t.length;n++){const r=t[n];(null!==(i=null==e?void 0:e(r,o))&&void 0!==i?i:r-o<0)&&(o=r)}return o};function Pt(t,e){if(!et(t)||!et(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}function Et(t){if(!et(t))return[t];const e=[];for(const i of t)e.push(...Et(i));return e}function kt(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Lt(t){return Number(t)}const Ht="undefined"!=typeof console;function Ft(t,e,i){const o=[e].concat([].slice.call(i));Ht&&console[t].apply(console,o)}var zt;!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"}(zt||(zt={}));class It{static getInstance(t,e){return It._instance&&nt(t)?It._instance.level(t):It._instance||(It._instance=new It(t,e)),It._instance}static setInstance(t){return It._instance=t}static setInstanceLevel(t){It._instance?It._instance.level(t):It._instance=new It(t)}static clearInstance(){It._instance=null}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zt.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>=zt.Info}canLogDebug(){return this._level>=zt.Debug}canLogError(){return this._level>=zt.Error}canLogWarn(){return this._level>=zt.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(){for(var t,e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return this._level>=zt.Error&&(this._onErrorHandler.length?this.callErrorHandler(...i):Ft(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>=zt.Warn&&Ft(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>=zt.Info&&Ft(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>=zt.Debug&&Ft(this._method||"log","DEBUG",e),this}}It._instance=null;const Ot=1e-10,Dt=1e-10;function Wt(t,e){const i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ot,o=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:Dt)*Math.max(t,e);return Math.abs(t-e)<=Math.max(i,o)}function Nt(t,e,i,o){return t>e&&!Wt(t,e,i,o)}function Gt(t,e,i,o){return t<e&&!Wt(t,e,i,o)}const jt=t=>{let e=null,i=null;return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];return e&&n.every(((t,i)=>t===e[i]))||(e=n,i=t(...n)),i}};var Ut=function(t,e,i){return t<e?e:t>i?i:t};var Vt=(t,e,i)=>{let[o,n]=t;n<o&&(o=t[1],n=t[0]);const r=n-o;return r>=i-e?[e,i]:(o=Math.min(Math.max(o,e),i-r),[o,o+r])};function $t(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}let Yt=!1;try{Yt="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){Yt=!1}function Xt(t,e,i){let o,n,r,s,l,a,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&Yt;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,r=n;return o=n=void 0,h=e,s=t.apply(r,i),s}function f(t,e){return g?(cancelAnimationFrame(l),requestAnimationFrame(t)):setTimeout(t,e)}function v(t){const i=t-a;return void 0===a||i>=e||i<0||c&&t-h>=r}function m(){const t=Date.now();if(v(t))return b(t);l=f(m,function(t){const i=t-h,o=e-(t-a);return c?Math.min(o,r-i):o}(t))}function b(t){return l=void 0,u&&o?p(t):(o=n=void 0,s)}function C(){const t=Date.now(),i=v(t);for(var r=arguments.length,u=new Array(r),g=0;g<r;g++)u[g]=arguments[g];if(o=u,n=this,a=t,i){if(void 0===l)return function(t){return h=t,l=f(m,e),d?p(t):s}(a);if(c)return l=f(m,e),p(a)}return void 0===l&&(l=f(m,e)),s}return e=+e||0,Z(i)&&(d=!!i.leading,c="maxWait"in i,c&&(r=Math.max(rt(i.maxWait)?i.maxWait:0,e)),u="trailing"in i?!!i.trailing:u),C.cancel=function(){void 0!==l&&function(t){if(g)return cancelAnimationFrame(t);clearTimeout(t)}(l),h=0,o=a=n=l=void 0},C.flush=function(){return void 0===l?s:b(Date.now())},C.pending=function(){return void 0!==l},C}function Kt(t,e,i){let o=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return Z(i)&&(o="leading"in i?!!i.leading:o,n="trailing"in i?!!i.trailing:n),Xt(t,e,{leading:o,trailing:n,maxWait:e})}function Zt(t,e){return i=>t*(1-i)+e*i}function qt(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}Yt=!1;const Jt=1e-12,Qt=Math.PI,te=Qt/2,ee=2*Qt,ie=2*Math.PI,oe=Math.abs,ne=Math.atan2,re=Math.cos,se=Math.max,le=Math.min,ae=Math.sin,he=Math.sqrt,de=Math.pow;function ce(t){return t>=1?te:t<=-1?-te:Math.asin(t)}function ue(t,e,i,o,n){let r=i,s=o;return"number"==typeof t&&"number"==typeof i&&(r=(1-n)*t+n*i),"number"==typeof e&&"number"==typeof o&&(s=(1-n)*e+n*o),{x:r,y:s}}class ge{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,o=arguments.length>3?arguments[3]:void 0;this.x=0,this.y=0,this.x=t,this.y=e,this.x1=i,this.y1=o}clone(){return new ge(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 nt(t)?(this.x+=t,void(this.y+=t)):(this.x+=t.x,this.y+=t.y,this)}sub(t){return nt(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 pe{static distancePP(t,e){return he(de(t.x-e.x,2)+de(t.y-e.y,2))}static distanceNN(t,e,i,o){return he(de(t-i,2)+de(e-o,2))}static distancePN(t,e,i){return he(de(e-t.x,2)+de(i-t.y,2))}static pointAtPP(t,e,i){return new ge((e.x-t.x)*i+t.x,(e.y-t.y)*i+t.y)}}function fe(t){return t*(Math.PI/180)}const ve=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<-ee;)t+=ee;else if(t>0)for(;t>ee;)t-=ee;return t};function me(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function be(t,e,i){if(null===t)return e;if(null===e)return t;const{x11:o,x12:n,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}=ye(t,e,i);return o>=a||n<=l||r>=d||s<=h?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(o,l),y1:Math.max(r,h),x2:Math.min(n,a),y2:Math.min(s,d)}}var Ce;!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Ce||(Ce={}));const ye=(t,e,i)=>{let o=t.x1,n=t.x2,r=t.y1,s=t.y2,l=e.x1,a=e.x2,h=e.y1,d=e.y2;return i&&(o>n&&([o,n]=[n,o]),r>s&&([r,s]=[s,r]),l>a&&([l,a]=[a,l]),h>d&&([h,d]=[d,h])),{x11:o,x12:n,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}};function we(t,e,i){if(!t||!e)return Ce.NONE;const{x11:o,x12:n,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}=ye(t,e,i);return o>l&&n<a&&r>h&&s<d?Ce.BBOX1:l>o&&a<n&&h>r&&d<s?Ce.BBOX2:Ce.NONE}function xe(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:o,x12:n,y11:r,y12:s,x21:l,x22:a,y21:h,y22:d}=ye(t,e,!0);return!(o>a||n<l||r>d||s<h)}return!0}function _e(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function Se(t,e){let{x:i,y:o}=t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};return{x:(i-n.x)*Math.cos(e)-(o-n.y)*Math.sin(e)+n.x,y:(i-n.x)*Math.sin(e)+(o-n.y)*Math.cos(e)+n.y}}function Ae(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function Re(t,e){const i=e?fe(t.angle):t.angle,o=Ae(t);return[Se({x:t.x1,y:t.y1},i,o),Se({x:t.x2,y:t.y1},i,o),Se({x:t.x2,y:t.y2},i,o),Se({x:t.x1,y:t.y2},i,o)]}function Be(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3?arguments[3]:void 0;const n=Re(t,i),r=Re(e,i),s=(t,e)=>[e.x-t.x,e.y-t.y];o&&(o.save(),o.fillStyle="red",o.globalAlpha=.6,n.forEach(((t,e)=>{0===e?o.moveTo(t.x,t.y):o.lineTo(t.x,t.y)})),o.fill(),o.restore(),o.save(),o.fillStyle="green",o.globalAlpha=.6,r.forEach(((t,e)=>{0===e?o.moveTo(t.x,t.y):o.lineTo(t.x,t.y)})),o.fill(),o.restore());const l=Ae(t),a=Ae(e);o&&o.fillRect(l.x,l.y,2,2),o&&o.fillRect(a.x,a.y,2,2);const h=s(l,a),d=s(n[0],n[1]),c=s(n[1],n[2]),u=s(r[0],r[1]),g=s(r[1],r[2]),p=i?fe(t.angle):t.angle;let f=i?fe(90-t.angle):t.angle+te;const v=i?fe(e.angle):e.angle;let m=i?fe(90-e.angle):e.angle+te;f>ie&&(f-=ie),m>ie&&(m-=ie);const b=(t,e,i,o)=>{const n=[Math.cos(e),Math.sin(e)];return t+(_e(n,i)+_e(n,o))/2>_e(n,h)};return b((t.x2-t.x1)/2,p,u,g)&&b((t.y2-t.y1)/2,f,u,g)&&b((e.x2-e.x1)/2,v,d,c)&&b((e.y2-e.y1)/2,m,d,c)}const Me=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,o=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,o=e<<10|i,o+=65536),12288===o||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":8361===o||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||172===o||175===o||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":161===o||164===o||167<=o&&o<=168||170===o||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||198===o||208===o||215<=o&&o<=216||222<=o&&o<=225||230===o||232<=o&&o<=234||236<=o&&o<=237||240===o||242<=o&&o<=243||247<=o&&o<=250||252===o||254===o||257===o||273===o||275===o||283===o||294<=o&&o<=295||299===o||305<=o&&o<=307||312===o||319<=o&&o<=322||324===o||328<=o&&o<=331||333===o||338<=o&&o<=339||358<=o&&o<=359||363===o||462===o||464===o||466===o||468===o||470===o||472===o||474===o||476===o||593===o||609===o||708===o||711===o||713<=o&&o<=715||717===o||720===o||728<=o&&o<=731||733===o||735===o||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||1025===o||1040<=o&&o<=1103||1105===o||8208===o||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||8240===o||8242<=o&&o<=8243||8245===o||8251===o||8254===o||8308===o||8319===o||8321<=o&&o<=8324||8364===o||8451===o||8453===o||8457===o||8467===o||8470===o||8481<=o&&o<=8482||8486===o||8491===o||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||8585===o||8592<=o&&o<=8601||8632<=o&&o<=8633||8658===o||8660===o||8679===o||8704===o||8706<=o&&o<=8707||8711<=o&&o<=8712||8715===o||8719===o||8721===o||8725===o||8730===o||8733<=o&&o<=8736||8739===o||8741===o||8743<=o&&o<=8748||8750===o||8756<=o&&o<=8759||8764<=o&&o<=8765||8776===o||8780===o||8786===o||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||8853===o||8857===o||8869===o||8895===o||8978===o||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||9675===o||9678<=o&&o<=9681||9698<=o&&o<=9701||9711===o||9733<=o&&o<=9734||9737===o||9742<=o&&o<=9743||9748<=o&&o<=9749||9756===o||9758===o||9792===o||9794===o||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||9839===o||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||9955===o||9960<=o&&o<=9983||10045===o||10071===o||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||65533===o||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"};function Te(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:o=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:s=e.fontSize,fontFamily:l=e.fontFamily}=t;return(o?o+" ":"")+(n?n+" ":"")+(r?r+" ":"")+s*i+"px "+(l||"sans-serif")}class Pe{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(),K(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=K(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(X(this._canvas)&&(K(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),X(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&K(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),X(this._context)&&K(this._canvas)){const t=this._canvas.getContext("2d");K(t)&&(t.save(),t.font=Te(this.textSpec),this._contextSaved=!0,this._context=t)}return!X(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:o={}}=this._option,{fontStyle:n=o.fontStyle,fontVariant:r=o.fontVariant,fontWeight:s=(null!==(t=o.fontWeight)&&void 0!==t?t:"normal"),fontSize:l=(null!==(e=o.fontSize)&&void 0!==e?e:12),fontFamily:a=(null!==(i=o.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:d=(null!=h?h:"center"),baseline:c,textBaseline:u=(null!=c?c:"middle"),ellipsis:g,limit:p}=this._userSpec;let{lineHeight:f=l}=this._userSpec;if(tt(f)&&"%"===f[f.length-1]){const t=Number.parseFloat(f.substring(0,f.length-1))/100;f=l*t}return{fontStyle:n,fontVariant:r,fontFamily:a,fontSize:l,fontWeight:s,textAlign:d,textBaseline:u,ellipsis:g,limit:p,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(X(t))return{width:0,height:0};if(X(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:o,textAlign:n,textBaseline:r,ellipsis:s,limit:l,lineHeight:a}=this.textSpec;let h;try{const d=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:o,textAlign:n,textBaseline:r,ellipsis:!!s,maxLineWidth:l||1/0,lineHeight:a});h={width:d.width(),height:d.height()}}catch(e){this._notSupportVRender=!0,h=this.measureWithNaiveCanvas(t)}return h}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:o,lineHeight:n}=this.textSpec;return{width:i.width,height:null!==(e=n)&&void 0!==e?e:o}}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 o=t[i];let n=this._measureSpecialChar(o);X(n)&&Pe.NUMBERS_CHAR_SET.includes(o)&&(n=this._measureNumberChar()),X(n)&&["F","W"].includes(Me(o))&&(n=this._measureFullSizeChar()),X(n)&&(n=this._measureLetterChar()),e.width+=n.width,e.height=Math.max(e.height,n.height)}return e}quickMeasureWithoutCanvas(t){return this._measureReduce(t,this._quickMeasureWithoutCanvas.bind(this))}_quickMeasureWithoutCanvas(t){var e;const i={width:0,height:0},{fontSize:o,lineHeight:n}=this.textSpec;for(let e=0;e<t.length;e++){const n=t[e],r=["F","W"].includes(Me(n))?1:.53;i.width+=r*o}return i.height=null!==(e=n)&&void 0!==e?e:o,i}_measureReduce(t,e){var i;const{fontSize:o,lineHeight:n}=this.textSpec,r={width:0,height:0};if(X(t))return r;if(et(t)){const s=t.filter(K).map((t=>t.toString()));return 0===s.length?r:1===s.length?e(s[0]):{width:s.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:s.length*((null!==(i=n)&&void 0!==i?i:o)+1)+1}}return e(t.toString())}_measureNumberChar(){if(X(this._numberCharSize)){const t=this._standardMethod(Pe.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/Pe.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return X(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(Pe.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(X(this._letterCharSize)){const t=this._standardMethod(Pe.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/Pe.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return K(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){K(this._canvas)&&(this._canvas=null),K(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}function Ee(t,e,i){const{x1:o,y1:n,x2:r,y2:s}=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*o+i.c*n+i.e,i.b*o+i.d*n+i.f),t.add(i.a*r+i.c*n+i.e,i.b*r+i.d*n+i.f),t.add(i.a*r+i.c*s+i.e,i.b*r+i.d*s+i.f),t.add(i.a*o+i.c*s+i.e,i.b*o+i.d*s+i.f),e)}Pe.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Pe.NUMBERS_CHAR_SET="0123456789",Pe.FULL_SIZE_CHAR="字";class ke{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new ke(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,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this.x1=t,this.y1=e,this.x2=i,this.y2=o,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,o=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),o<e?(this.y2=e,this.y1=o):(this.y1=e,this.y2=o),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 et(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 o=this.rotatedPoints(t,e,i);return this.clear().add(o[0],o[1]).add(o[2],o[3]).add(o[4],o[5]).add(o[6],o[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,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const n=this.scalePoints(t,e,i,o);return this.clear().add(n[0],n[1]).add(n[2],n[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 Ee(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:o,y1:n,x2:r,y2:s}=this,l=Math.cos(t),a=Math.sin(t),h=e-e*l+i*a,d=i-e*a-i*l;return[l*o-a*n+h,a*o+l*n+d,l*o-a*s+h,a*o+l*s+d,l*r-a*n+h,a*r+l*n+d,l*r-a*s+h,a*r+l*s+d]}scalePoints(t,e,i,o){const{x1:n,y1:r,x2:s,y2:l}=this;return[t*n+(1-t)*i,e*r+(1-e)*o,t*s+(1-t)*i,e*l+(1-e)*o]}}class Le extends ke{}class He extends ke{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(t),t&&(this.angle=e)}intersects(t){return Be(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,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return super.setValue(t,e,i,o),this.angle=n,this}}class Fe{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,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=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=o,this.e=n,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,o,n,r){return!(this.e!==n||this.f!==r||this.a!==t||this.d!==o||this.b!==e||this.c!==i)}setValue(t,e,i,o,n,r){return this.a=t,this.b=e,this.c=i,this.d=o,this.e=n,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,o=this.d,n=this.e,r=this.f,s=new Fe,l=t*o-e*i;return s.a=o/l,s.b=-e/l,s.c=-i/l,s.d=t/l,s.e=(i*r-o*n)/l,s.f=-(t*r-e*n)/l,s}rotate(t){const e=Math.cos(t),i=Math.sin(t),o=this.a*e+this.c*i,n=this.b*e+this.d*i,r=this.a*-i+this.c*e,s=this.b*-i+this.d*e;return this.a=o,this.b=n,this.c=r,this.d=s,this}rotateByCenter(t,e,i){const o=Math.cos(t),n=Math.sin(t),r=(1-o)*e+n*i,s=(1-o)*i-n*e,l=o*this.a-n*this.b,a=n*this.a+o*this.b,h=o*this.c-n*this.d,d=n*this.c+o*this.d,c=o*this.e-n*this.f+r,u=n*this.e+o*this.f+s;return this.a=l,this.b=a,this.c=h,this.d=d,this.e=c,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,o,n,r){return this.multiply(t,e,i,o,n,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:o,e:n,f:r}=this;return this.a=e,this.b=t,this.c=o,this.d=i,this.e=r,this.f=n,this}multiply(t,e,i,o,n,r){const s=this.a,l=this.b,a=this.c,h=this.d,d=s*t+a*e,c=l*t+h*e,u=s*i+a*o,g=l*i+h*o,p=s*n+a*r+this.e,f=l*n+h*r+this.f;return this.a=d,this.b=c,this.c=u,this.d=g,this.e=p,this.f=f,this}interpolate(t,e){const i=new Fe;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:o,c:n,d:r,e:s,f:l}=this,a=i*r-o*n,h=r/a,d=-o/a,c=-n/a,u=i/a,g=(n*l-r*s)/a,p=-(i*l-o*s)/a,{x:f,y:v}=t;e.x=f*h+v*c+g,e.y=f*d+v*u+p}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 Fe(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,o=this.d,n=t*o-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 s=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/s):-Math.acos(t/s),r.scaleX=s,r.scaleY=n/s,r.skewX=(t*i+e*o)/n,r.skewY=0}else if(0!==i||0!==o){const s=Math.sqrt(i*i+o*o);r.rotateDeg=Math.PI/2-(o>0?Math.acos(-i/s):-Math.acos(i/s)),r.scaleX=n/s,r.scaleY=s,r.skewX=0,r.skewY=(t*i+e*o)/n}return r.rotateDeg=180*r.rotateDeg/Math.PI,r}}class ze{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:o=this.L_TIME,R_COUNT:n=this.R_COUNT}=e;if(t.size<i)return 0;let r=0;const s=e=>{r++,t.delete(e)},l=Date.now();return t.forEach(((t,e)=>{if(t.timestamp.length<n)return s(e);let i=0;for(;l-t.timestamp[t.timestamp.length-1-i]<o&&(i++,!(i>=n)););if(i<n)return s(e);for(;l-t.timestamp[0]>o;)t.timestamp.shift()})),r}addLimitedTimestamp(t,e,i){const{R_TIMESTAMP_MAX_SIZE:o=this.R_TIMESTAMP_MAX_SIZE}=i;t.timestamp.length>o&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:i=this.L_TIME}=e,o=Date.now();t.forEach((t=>{for(;o-t.timestamp[0]>i;)t.timestamp.shift()}))}clearItemTimestamp(t,e){const{L_TIME:i=this.L_TIME}=e,o=Date.now();for(;o-t.timestamp[0]>i;)t.timestamp.shift()}}function Ie(t,e,i){e/=100,i/=100;const o=(1-Math.abs(2*i-1))*e,n=o*(1-Math.abs(t/60%2-1)),r=i-o/2;let s=0,l=0,a=0;return 0<=t&&t<60?(s=o,l=n,a=0):60<=t&&t<120?(s=n,l=o,a=0):120<=t&&t<180?(s=0,l=o,a=n):180<=t&&t<240?(s=0,l=n,a=o):240<=t&&t<300?(s=n,l=0,a=o):300<=t&&t<360&&(s=o,l=0,a=n),s=Math.round(255*(s+r)),l=Math.round(255*(l+r)),a=Math.round(255*(a+r)),{r:s,g:l,b:a}}function Oe(t,e,i){t/=255,e/=255,i/=255;const o=Math.min(t,e,i),n=Math.max(t,e,i),r=n-o;let s=0,l=0,a=0;return s=0===r?0:n===t?(e-i)/r%6:n===e?(i-t)/r+2:(t-e)/r+4,s=Math.round(60*s),s<0&&(s+=360),a=(n+o)/2,l=0===r?0:r/(1-Math.abs(2*a-1)),l=+(100*l).toFixed(1),a=+(100*a).toFixed(1),{h:s,s:l,l:a}}const De=/^#([0-9a-f]{3,8})$/,We={transparent:4294967040},Ne={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 Ge(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function je(t){return nt(t)?new Xe(t>>16,t>>8&255,255&t,1):et(t)?new Xe(t[0],t[1],t[2]):new Xe(255,255,255)}function Ue(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ve(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const $e=(t,e)=>{const i=De.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new Xe((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?je(t):8===e?new Xe(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class Ye{static Brighter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Ye(t).brighter(e).toRGBA()}static SetOpacity(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 1===e?t:new Ye(t).setOpacity(e).toRGBA()}static getColorBrightness(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hsl";const i=t instanceof Ye?t:new Ye(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()}}static parseColorString(t){if(K(We[t]))return function(t){return nt(t)?new Xe(t>>>24,t>>>16&255,t>>>8&255,255&t):et(t)?new Xe(t[0],t[1],t[2],t[3]):new Xe(255,255,255,1)}(We[t]);if(K(Ne[t]))return je(Ne[t]);const e=`${t}`.trim().toLowerCase(),i=$e(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 Xe(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=Ie(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Xe(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=Ye.parseColorString(t);this.color=e||new Xe(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:o}=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(o*t))),this}add(t){const{r:e,g:i,b:o}=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,o+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:o}=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(o*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 o=this.color.opacity,n=Oe(this.color.r,this.color.g,this.color.b),r=Ie(X(t)?n.h:Ut(t,0,360),X(e)?n.s:e>=0&&e<=1?100*e:e,X(i)?n.l:i<=1&&i>=0?100*i:i);return this.color=new Xe(r.r,r.g,r.b,o),this}setRGB(t,e,i){return!X(t)&&(this.color.r=t),!X(e)&&(this.color.g=e),!X(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=$e(e,!0);return null!=i?i:this}setColorName(t){const e=Ne[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}clone(){return new Ye(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=Ue(t.color.r),this.color.g=Ue(t.color.g),this.color.b=Ue(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Ve(t.color.r),this.color.g=Ve(t.color.g),this.color.b=Ve(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Xe{constructor(t,e,i,o){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)),K(o)?this.opacity=isNaN(+o)?1:Math.max(0,Math.min(1,+o)):this.opacity=1}formatHex(){return`#${Ge(this.r)+Ge(this.g)+Ge(this.b)+(1===this.opacity?"":Ge(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:o}=Oe(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${o}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}var Ke=Object.freeze({__proto__:null,Color:Ye,DEFAULT_COLORS:Ne,RGB:Xe,hexToRgb:function(t){let e="",i="",o="";const n="#"===t[0]?1:0;for(let r=n;r<t.length;r++)"#"!==t[r]&&(r<n+2?e+=t[r]:r<n+4?i+=t[r]:r<n+6&&(o+=t[r]));return[parseInt(e,16),parseInt(i,16),parseInt(o,16)]},hslToRgb:Ie,interpolateRgb:function(t,e){const i=t.r,o=e.r,n=t.g,r=e.g,s=t.b,l=e.b,a=t.opacity,h=e.opacity;return t=>{const e=Math.round(i*(1-t)+o*t),d=Math.round(n*(1-t)+r*t),c=Math.round(s*(1-t)+l*t);return new Xe(e,d,c,a*(1-t)+h*t)}},rgbToHex:function(t,e,i){return Number((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},rgbToHsl:Oe});function Ze(t){if(rt(t))return[t,t,t,t];if(et(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,i]=t;return[e,i,e,i]}if(3===e){const[e,i,o]=t;return[e,i,o,i]}if(4===e)return t}if(Z(t)){const{top:e=0,right:i=0,bottom:o=0,left:n=0}=t;return[e,i,o,n]}return[0,0,0,0]}const qe=ee-1e-8;class Je{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,o,n,r){if(Math.abs(n-o)>qe)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let s,l,a,h,d=1/0,c=-1/0,u=1/0,g=-1/0;function p(t){a=i*Math.cos(t),h=i*Math.sin(t),a<d&&(d=a),a>c&&(c=a),h<u&&(u=h),h>g&&(g=h)}if(p(o),p(n),n!==o)if((o%=ee)<0&&(o+=ee),(n%=ee)<0&&(n+=ee),n<o&&(r=!r,s=o,o=n,n=s),r)for(n-=ee,s=o-o%te,l=0;l<4&&s>n;++l,s-=te)p(s);else for(s=o-o%te+te,l=0;l<4&&s<n;++l,s+=te)p(s);this.bounds.add(t+d,e+u),this.bounds.add(t+c,e+g)}arcTo(t,e,i,o,n){this.bounds.add(t,e)}bezierCurveTo(t,e,i,o,n,r){this.bounds.add(t,e),this.bounds.add(i,o),this.bounds.add(n,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,o){this.bounds.add(t,e),this.bounds.add(i,o)}rect(t,e,i,o){this.bounds.add(t,e),this.bounds.add(t+i,e+o)}clear(){this.bounds.clear()}release(){}}class Qe{constructor(){this.curves=[],this.bounds=new Le}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const ti=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,ei={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},ii=0,oi=1,ni=2,ri=3,si=4,li=5,ai=6,hi=7,di=8;let ci,ui,gi,pi,fi,vi;var mi,bi,Ci,yi,wi,xi,_i,Si,Ai;function Ri(t){const e=t[0],i=t[1],o=t[2],n=t[3],r=t[4],s=t[5],l=t[6],a=t[7],h=a*r,d=-l*s,c=l*r,u=a*s,g=Math.cos(o),p=Math.sin(o),f=Math.cos(n),v=Math.sin(n),m=.5*(n-o),b=Math.sin(.5*m),C=8/3*b*b/Math.sin(m),y=e+g-C*p,w=i+p+C*g,x=e+f,_=i+v,S=x+C*v,A=_-C*f;return[h*y+d*w,c*y+u*w,h*S+d*A,c*S+u*A,h*x+d*_,c*x+u*_]}function Bi(t,e,i,o){const n=function(t,e,i,o,n,r,s,l,a){const h=fe(s),d=Math.sin(h),c=Math.cos(h),u=c*(l-t)*.5+d*(a-e)*.5,g=c*(a-e)*.5-d*(l-t)*.5;let p=u*u/((i=Math.abs(i))*i)+g*g/((o=Math.abs(o))*o);p>1&&(p=Math.sqrt(p),i*=p,o*=p);const f=c/i,v=d/i,m=-d/o,b=c/o,C=f*l+v*a,y=m*l+b*a,w=f*t+v*e,x=m*t+b*e;let _=1/((w-C)*(w-C)+(x-y)*(x-y))-.25;_<0&&(_=0);let S=Math.sqrt(_);r===n&&(S=-S);const A=.5*(C+w)-S*(x-y),R=.5*(y+x)+S*(w-C),B=Math.atan2(y-R,C-A);let M=Math.atan2(x-R,w-A)-B;M<0&&1===r?M+=ee:M>0&&0===r&&(M-=ee);const T=Math.ceil(Math.abs(M/(te+.001))),P=[];for(let t=0;t<T;++t){const e=B+t*M/T,n=B+(t+1)*M/T;P[t]=[A,R,e,n,i,o,d,c]}return P}(o[5],o[6],o[0],o[1],o[3],o[4],o[2],e,i);for(let e=0;e<n.length;++e){const i=Ri(n[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"}(mi||(mi={})),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"}(bi||(bi={})),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"}(Ci||(Ci={})),function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSED=2]="PAUSED",t[t.END=3]="END"}(yi||(yi={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SET_ATTR_IMMEDIATELY=1]="SET_ATTR_IMMEDIATELY"}(wi||(wi={})),function(t){t.wait="wait",t.from="from",t.to="to",t.customAnimate="customAnimate"}(xi||(xi={})),function(t){t[t.ROW=1]="ROW",t[t.COLUMN=2]="COLUMN"}(_i||(_i={})),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"}(Si||(Si={})),function(t){t[t.beforeFillStroke=0]="beforeFillStroke",t[t.afterFillStroke=1]="afterFillStroke"}(Ai||(Ai={}));const Mi=[(t,e,i,o,n,r,s)=>e.arc(t[1]*n+i,t[2]*r+o,t[3]*(n+r)/2,t[4],t[5],t[6],s),(t,e,i,o,n,r,s)=>e.arcTo(t[1]*n+i,t[2]*r+o,t[3]*n+i,t[4]*r+o,t[5]*(n+r)/2,s),(t,e,i,o,n,r,s)=>e.bezierCurveTo(t[1]*n+i,t[2]*r+o,t[3]*n+i,t[4]*r+o,t[5]*n+i,t[6]*r+o,s),(t,e,i,o)=>e.closePath(),(t,e,i,o,n,r)=>e.ellipse(t[1]*n+i,t[2]*r+o,t[3]*n,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,o,n,r,s)=>e.lineTo(t[1]*n+i,t[2]*r+o,s),(t,e,i,o,n,r,s)=>e.moveTo(t[1]*n+i,t[2]*r+o,s),(t,e,i,o,n,r,s)=>e.quadraticCurveTo(t[1]*n+i,t[2]*r+o,t[3]*n+i,t[4]*r+o,s),(t,e,i,o,n,r,s)=>e.rect(t[1]*n+i,t[2]*r+o,t[3]*n,t[4]*r,s)];function Ti(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,s=arguments.length>6?arguments[6]:void 0;for(let l=0;l<t.length;l++){const a=t[l];Mi[a[0]](a,e,i,o,n,r,s)}}class Pi{getLength(t){return null!=t?this.calcProjLength(t):(Number.isFinite(this.length)||(this.length=this.calcLength()),this.length)}}function Ei(t,e,i,o,n){return function(t,e){let i=0;const o=t.length;for(let n=0;n<o;n++){const r=t[n],s=e[n],l=t[(n+1)%o],a=e[(n+1)%o];i+=pe.distanceNN(r,s,l,a)}return i/2}([t.x,e.x,i.x,o.x],[t.y,e.y,i.y,o.y])}function ki(t,e,i,o,n){const r=1-n;return r*r*r*t+3*e*n*r*r+3*i*n*n*r+o*n*n*n}function Li(t,e,i,o,n){const r=ki(t.x,e.x,i.x,o.x,n),s=ki(t.y,e.y,i.y,o.y,n);return new ge(r,s)}function Hi(t,e){const{p0:i,p1:o,p2:n,p3:r}=t,s=Li(i,o,n,r,e),l=pe.pointAtPP(i,o,e),a=pe.pointAtPP(o,n,e),h=pe.pointAtPP(n,r,e),d=pe.pointAtPP(l,a,e),c=pe.pointAtPP(a,h,e);return[new Fi(i,l,d,s),new Fi(s,c,h,r)]}class Fi extends Pi{constructor(t,e,i,o){super(),this.type=Si.CubicBezierCurve,this.p0=t,this.p1=e,this.p2=i,this.p3=o}_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 Li(this.p0,this.p1,this.p2,this.p3,t);throw new Error("defined为false的点不能getPointAt")}calcLength(){return this._validPoint()?Ei(this.p0,this.p1,this.p2,this.p3):60}calcProjLength(t){return t===_i.ROW?oe(this.p0.x-this.p3.x):t===_i.COLUMN?oe(this.p0.y-this.p3.y):0}getAngleAt(t){const e=se(t-.01,0),i=le(t+.01,1),o=this.getPointAt(e),n=this.getPointAt(i);return ne(n.y-o.y,n.x-o.x)}}function zi(t,e){const{p0:i,p1:o}=t,n=pe.pointAtPP(i,o,e);return[new Ii(i,n),new Ii(n,o)]}class Ii extends Pi{constructor(t,e){super(),this.type=Si.LineCurve,this.p0=t,this.p1=e}getPointAt(t){if(!1!==this.defined)return pe.pointAtPP(this.p0,this.p1,t);throw new Error("defined为false的点不能getPointAt")}getAngleAt(t){return null==this.angle&&(this.angle=ne(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()?pe.distancePP(this.p0,this.p1):60}calcProjLength(t){return t===_i.ROW?oe(this.p0.x-this.p1.x):t===_i.COLUMN?oe(this.p0.y-this.p1.y):0}}class Oi{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,o,n,r,s,l){const a=new Fi(new ge(this._lastX,this._lastY),new ge(t,e),new ge(i,o),new ge(n,r));a.originP1=this._lastOriginP,a.originP2=l,a.defined=s,this.curves.push(a),this._lastX=n,this._lastY=r,this._lastOriginP=l}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,o){const n=this.addLinearCurve(t,e,i,this._lastOriginP,o);this.curves.push(n),this._lastX=t,this._lastY=e,this._lastOriginP=o}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,o){throw new Error("SegContext不支持调用quadraticCurveTo")}clear(){this.curves=[],this.length=NaN}tryUpdateLength(t){return this.getLength(t)}addLinearCurve(t,e,i,o,n){const r=new Ii(new ge(this._lastX,this._lastY),new ge(t,e));return r.originP1=o,r.originP2=n,r.defined=i,r}getPointAt(t){throw new Error("暂未实现")}getCurveLengths(){return[]}getLength(t){var e,i;if(t===_i.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],i=this.curves[this.curves.length-1],o=null!==(e=i.p3)&&void 0!==e?e:i.p1;return oe(t.p0.y-o.y)}if(t===_i.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1],o=null!==(i=e.p3)&&void 0!==i?i:e.p1;return oe(t.p0.x-o.x)}return Number.isFinite(this.length)||(this.length=this.curves.reduce(((t,e)=>t+e.getLength()),0)),this.length}}class Di extends Oi{bezierCurveTo(t,e,i,o,n,r,s,l){return super.bezierCurveTo(e,t,o,i,r,n,s,l)}lineTo(t,e,i,o){return super.lineTo(e,t,i,o)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function Wi(t,e){let i=!1;for(let o=0,n=e.length;o<=n;o++)o>=n===i&&((i=!i)?t.lineStart():t.lineEnd()),i&&t.point(e[o])}function Ni(t,e,i){const o=null!=e?e:oe(i[i.length-1].x-i[0].x)>oe(i[i.length-1].y-i[0].y)?_i.ROW:_i.COLUMN;return"monotoneY"===t?new Di(t,o):new Oi(t,o)}class Gi{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 ji(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:o}=e;if(t.length<2-Number(!!o))return null;const n=Ni("linear",i,t);return function(t,e){Wi(t,e)}(new Gi(n,o),t),n}function Ui(t,e,i,o,n){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,o,t.lastPoint1)}class Vi{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&Ui(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:Ui(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 $i(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:o}=e;if(t.length<2-Number(!!o))return null;if(t.length<3-Number(!!o))return ji(t,e);const n=Ni("basis",i,t);return function(t,e){Wi(t,e)}(new Vi(n,o),t),n}function Yi(t){return t<0?-1:1}function Xi(t,e,i){const o=t._x1-t._x0,n=e-t._x1,r=(t._y1-t._y0)/(o||Number(n<0&&-0)),s=(i-t._y1)/(n||Number(o<0&&-0)),l=(r*n+s*o)/(o+n);return(Yi(r)+Yi(s))*Math.min(Math.abs(r),Math.abs(s),.5*Math.abs(l))||0}function Ki(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Zi(t,e,i,o,n){const r=t._x0,s=t._y0,l=t._x1,a=t._y1,h=(l-r)/3;t.context.bezierCurveTo(r+h,s+h*e,l-h,a-h*i,l,a,o,t.lastPoint1)}class qi{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:Zi(this,this._t0,Ki(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,o=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,o,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,o,t);break;case 1:this._point=2;break;case 2:this._point=3,Zi(this,Ki(this,e=Xi(this,i,o)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Zi(this,this._t0,e=Xi(this,i,o),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=o,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 Ji extends qi{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}function Qi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:o}=e;if(t.length<2-Number(!!o))return null;if(t.length<3-Number(!!o))return ji(t,e);const n=Ni("monotoneX",i,t);return function(t,e){Wi(t,e)}(new qi(n,o),t),n}function to(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:o}=e;if(t.length<2-Number(!!o))return null;if(t.length<3-Number(!!o))return ji(t,e);const n=Ni("monotoneY",i,t);return function(t,e){Wi(t,e)}(new Ji(n,o),t),n}let eo=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 o=this._x*(1-this._t)+e*this._t;this.context.lineTo(o,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(o,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}};function io(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:o,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const r=new Oi("step",null!=o?o:oe(t[t.length-1].x-t[0].x)>oe(t[t.length-1].y-t[0].y)?_i.ROW:_i.COLUMN);return function(t,e){Wi(t,e)}(new eo(r,e,n),t),r}class oo extends Gi{lineEnd(){this.context.closePath()}}function no(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{direction:i,startPoint:o}=e;if(t.length<2-Number(!!o))return null;const n=Ni("linear",i,t);return function(t,e){Wi(t,e)}(new oo(n,o),t),n}function ro(t,e,i,o,n){let r=t._x1,s=t._y1,l=t._x2,a=t._y2;if(t._l01_a>Jt){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,s=(s*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>Jt){const o=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,n=3*t._l23_a*(t._l23_a+t._l12_a);l=(l*o+t._x1*t._l23_2a-e*t._l12_2a)/n,a=(a*o+t._y1*t._l23_2a-i*t._l12_2a)/n}t.context.bezierCurveTo(r,s,l,a,t._x2,t._y2,o,t.lastPoint1)}function so(t,e){return function(i,o){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{direction:r,startPoint:s}=n;if(i.length<2-Number(!!s))return null;if(i.length<3-Number(!!s))return ji(i,n);const l=Ni(t,r,i);return Wi(new e(l,o,s),i),l}}const lo=so("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,o=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+o*o,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:ro(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 ao=so("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,o=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+o*o,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:ro(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});function ho(t,e,i){var o,n;switch(e){case"linear":default:return ji(t,i);case"basis":return $i(t,i);case"monotoneX":return Qi(t,i);case"monotoneY":return to(t,i);case"step":return io(t,.5,i);case"stepBefore":return io(t,0,i);case"stepAfter":return io(t,1,i);case"catmullRom":return lo(t,null!==(o=null==i?void 0:i.curveTension)&&void 0!==o?o:.5,i);case"catmullRomClosed":return ao(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return no(t,i)}}class co extends Qe{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Je(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([ai,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([li,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,o){return this.commandList.push([hi,t,e,i,o]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,o),this}bezierCurveTo(t,e,i,o,n,r){return this.commandList.push([ni,t,e,i,o,n,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,o,n,r),this}arcTo(t,e,i,o,n){return this.commandList.push([oi,t,e,i,o,n]),this._ctx&&this._ctx.arcTo(t,e,i,o,n),this}ellipse(t,e,i,o,n,r,s,l){return this.commandList.push([si,t,e,i,o,n,r,s,l]),this._ctx&&this._ctx.ellipse(t,e,i,o,n,r,s,l),this}rect(t,e,i,o){return this.commandList.push([di,t,e,i,o]),this._ctx&&this._ctx.rect(t,e,i,o),this}arc(t,e,i,o,n,r){return this.commandList.push([ii,t,e,i,o,n,r]),this._ctx&&this._ctx.arc(t,e,i,o,n,r),this}closePath(){return this.commandList.push([ri]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[ai]=t=>`M${t[1]} ${t[2]}`,t[li]=t=>`L${t[1]} ${t[2]}`,t[hi]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[ni]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[ii]=t=>{const e=[];((t,e,i,o,n,r,s)=>{const l=Math.abs(i-e),a=l>.5*Math.PI?Math.ceil(2*l/Math.PI):1,h=(i-e)/a;for(let i=0;i<a;i++){const l=e+h*i,a=e+h*(i+1),d=4*Math.tan(Math.abs(h)/4)/3,c=a<l?-1:1,u=Math.cos(l),g=Math.sin(l),p=Math.cos(a),f=Math.sin(a),v=u*r+o,m=g*s+n,b=p*r+o,C=f*s+n,y=r*d*c,w=s*d*c;t.push(v-y*g,m+w*u,b+y*f,C-w*p,b,C)}})(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[di]=t=>`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[ri]=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,o,n){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,o;const n=[];for(let t=0,r=e.length;t<r;t++)if(ci=e[t],ui=ci.slice(1),gi=ci[0],i=[gi],o=ui.match(ti),null!==o){for(let t=0,e=o.length;t<e;t++)pi=o[t],fi=parseFloat(pi),Number.isNaN(fi)||i.push(fi);if(vi=ei[gi],i.length-1>vi){let t,e=gi;for(let o=1,r=i.length;o<r;o+=vi){t=[e];for(let e=o,n=o+vi;e<n;e++)t.push(i[e]);n.push(t),"m"===e?e="l":"M"===e&&(e="L")}}else n.push(i)}else n.push(i);return n}(t);return this._runCommandStrList(r,e,i,o,n),this._updateBounds(),this}fromLine(t){const{points:e,curveType:i,clipRangeByDimension:o}=t.attribute;if(!e)return;const n=ho(e,i);"x"===o?this.direction=_i.ROW:"y"===o?this.direction=_i.COLUMN:"auto"===o&&(this.direction=n.direction),this.curves=n.curves}fromCustomPath2D(t,e,i,o,n){return this.clear(),this._runCommandList(t.commandList,e,i,o,n),this._updateBounds(),this}transform(t,e,i,o){const n=this.commandList;if(!this.transformCbList){const t=[];t[ai]=this.moveToTransform,t[li]=this.lineToTransform,t[hi]=this.quadraticCurveToTransform,t[ni]=this.bezierCurveToTransform,t[oi]=this.arcToTransform,t[si]=this.ellipseTransform,t[di]=this.rectTransform,t[ii]=this.arcTransform,t[ri]=this.closePathTransform,this.transformCbList=t}n.forEach((n=>{this.transformCbList[n[0]](n,t,e,i,o)})),this._updateBounds()}moveToTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i}lineToTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i}quadraticCurveToTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i,t[3]=t[3]*o+e,t[4]=t[4]*n+i}bezierCurveToTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i,t[3]=t[3]*o+e,t[4]=t[4]*n+i,t[5]=t[5]*o+e,t[6]=t[6]*n+i}arcToTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i,t[3]=t[3]*o+e,t[4]=t[4]*n+i,t[5]=t[5]*(o+n)/2}ellipseTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i,t[3]=t[3]*o,t[4]=t[4]*n}rectTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i,t[3]=t[3]*o,t[4]=t[4]*n}arcTransform(t,e,i,o,n){t[1]=t[1]*o+e,t[2]=t[2]*n+i,t[3]=t[3]*(o+n)/2}closePathTransform(){}_runCommandStrList(t){let e,i,o,n,r,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,h=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,d=null,c=0,u=0,g=0,p=0;for(let f=0,v=t.length;f<v;++f){switch(e=t[f],1===a&&1===h||(e=go(e,a,h)),e[0]){case"l":c+=e[1],u+=e[2],this.lineTo(c+s,u+l);break;case"L":c=e[1],u=e[2],this.lineTo(c+s,u+l);break;case"h":c+=e[1],this.lineTo(c+s,u+l);break;case"H":c=e[1],this.lineTo(c+s,u+l);break;case"v":u+=e[1],this.lineTo(c+s,u+l);break;case"V":u=e[1],this.lineTo(c+s,u+l);break;case"m":c+=e[1],u+=e[2],this.moveTo(c+s,u+l);break;case"M":c=e[1],u=e[2],this.moveTo(c+s,u+l);break;case"c":i=c+e[5],o=u+e[6],g=c+e[3],p=u+e[4],this.bezierCurveTo(c+e[1]+s,u+e[2]+l,g+s,p+l,i+s,o+l),c=i,u=o;break;case"C":c=e[5],u=e[6],g=e[3],p=e[4],this.bezierCurveTo(e[1]+s,e[2]+l,g+s,p+l,c+s,u+l);break;case"s":i=c+e[3],o=u+e[4],g=2*c-g,p=2*u-p,this.bezierCurveTo(g+s,p+l,c+e[1]+s,u+e[2]+l,i+s,o+l),g=c+e[1],p=u+e[2],c=i,u=o;break;case"S":i=e[3],o=e[4],g=2*c-g,p=2*u-p,this.bezierCurveTo(g+s,p+l,e[1]+s,e[2]+l,i+s,o+l),c=i,u=o,g=e[1],p=e[2];break;case"q":i=c+e[3],o=u+e[4],g=c+e[1],p=u+e[2],this.quadraticCurveTo(g+s,p+l,i+s,o+l),c=i,u=o;break;case"Q":i=e[3],o=e[4],this.quadraticCurveTo(e[1]+s,e[2]+l,i+s,o+l),c=i,u=o,g=e[1],p=e[2];break;case"t":i=c+e[1],o=u+e[2],null===d[0].match(/[QqTt]/)?(g=c,p=u):"t"===d[0]?(g=2*c-n,p=2*u-r):"q"===d[0]&&(g=2*c-g,p=2*u-p),n=g,r=p,this.quadraticCurveTo(g+s,p+l,i+s,o+l),c=i,u=o,g=c+e[1],p=u+e[2];break;case"T":i=e[1],o=e[2],g=2*c-g,p=2*u-p,this.quadraticCurveTo(g+s,p+l,i+s,o+l),c=i,u=o;break;case"a":Bi(this,c+s,u+l,[e[1],e[2],e[3],e[4],e[5],e[6]+c+s,e[7]+u+l]),c+=e[6],u+=e[7];break;case"A":Bi(this,c+s,u+l,[e[1],e[2],e[3],e[4],e[5],e[6]+s,e[7]+l]),c=e[6],u=e[7];break;case"z":case"Z":this.closePath()}d=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,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if(0!==e||0!==i||1!==o||1!==n)for(let r=0,s=t.length;r<s;++r){const s=t[r].slice();switch(s[0]){case li:this.lineToTransform(s,e,i,o,n);break;case ai:this.moveToTransform(s,e,i,o,n);break;case ni:this.bezierCurveToTransform(s,e,i,o,n);break;case hi:this.quadraticCurveToTransform(s,e,i,o,n);break;case ii:this.arcToTransform(s,e,i,o,n);break;case si:this.ellipseTransform(s,e,i,o,n);break;case di:this.rectTransform(s,e,i,o,n);break;case oi:this.arcToTransform(s,e,i,o,n);break;case ri:this.closePath()}}else this.commandList=t.map((t=>t.slice()))}_updateBounds(){this.bounds.clear(),Ti(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===_i.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return oe(t.p0.y-e.p1.y)}if(this.direction===_i.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return oe(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let o=0;o<this.curves.length;o++){e=this.curves[o];const n=e.getLength(this.direction);if(i+n>=t)break;i+=n}const o=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(o),angle:e.getAngleAt(o)}}}const uo=["l",0,0,0,0,0,0,0];function go(t,e,i){const o=uo[0]=t[0];if("a"===o||"A"===o)uo[1]=e*t[1],uo[2]=i*t[2],uo[3]=t[3],uo[4]=t[4],uo[5]=t[5],uo[6]=e*t[6],uo[7]=i*t[7];else if("h"===o||"H"===o)uo[1]=e*t[1];else if("v"===o||"V"===o)uo[1]=i*t[1];else for(let o=1,n=t.length;o<n;++o)uo[o]=(o%2==1?e:i)*t[o];return uo}const po={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 Fe},fo={fillOpacity:1,fill:!1,shadowBlur:0,shadowColor:"black",shadowOffsetX:0,shadowOffsetY:0},vo={strokeOpacity:1,lineDash:[],lineDashOffset:0,lineWidth:1,lineCap:"butt",lineJoin:"miter",miterLimit:10,strokeBoundsBuffer:2,stroke:!1},mo=Object.assign({outerBorder:Object.assign(Object.assign({},vo),{distance:0}),innerBorder:Object.assign(Object.assign({},vo),{distance:0})},vo),bo={text:"",maxLineWidth: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},Co=Object.assign(Object.assign(Object.assign(Object.assign({forceBoundsWidth:void 0,forceBoundsHeight:void 0,opacity:1,background:null,backgroundOpacity:1,backgroundCornerRadius:0,texture:null,textureColor:"black",textureSize:10,texturePadding:2,backgroundMode:"no-repeat",backgroundFit:!0,blur:0,cursor:null,html:null,react:null},fo),mo),{alignSelf:"auto"}),{pickStrokeBuffer:0}),yo={connectedType:"none",connectedStyle:{},connectedX:NaN,connectedY:NaN},wo=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"},{_debug_bounds:!1}),Co),po),xo=Object.assign(Object.assign({},wo),{startAngle:0,endAngle:ie,innerRadius:0,outerRadius:1,innerPadding:0,outerPadding:0,cornerRadius:0,padRadius:0,padAngle:0,cap:!1,forceShowCap:!1}),_o=Object.assign(Object.assign(Object.assign({},wo),yo),{points:[],segments:[],curveType:"linear",clipRange:1,closePath:!1,curveTension:1}),So=Object.assign(Object.assign({},wo),{radius:1,startAngle:0,endAngle:ie}),Ao=Object.assign(Object.assign({},wo),{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}),Ro=Object.assign(Object.assign({},wo),{path:"",width:0,height:0,cornerRadius:0,clip:!1}),Bo=Object.assign(Object.assign(Object.assign({},wo),yo),{points:[],segments:[],curveType:"linear",clipRange:1,clipRangeByDimension:"default",closePath:!1,curveTension:1}),Mo=Object.assign(Object.assign({},wo),{path:new co,fillStrokeOrder:1,customPath:()=>{It.getInstance().warn("空函数")}}),To=Object.assign(Object.assign({},wo),{points:[],cornerRadius:0,closePath:!0}),Po=Object.assign(Object.assign({},wo),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0});Object.assign(Object.assign({},wo),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0});const Eo=Object.assign(Object.assign({},wo),{symbolType:"circle",size:10,keepDirIn3d:!0}),ko=Object.assign(Object.assign(Object.assign({},wo),bo),{strokeBoundsBuffer:0,keepDirIn3d:!0}),Lo=Object.assign(Object.assign(Object.assign({},wo),bo),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),Ho=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},wo),{fill:!0,cornerRadius:0}),Fo=Object.assign(Object.assign({},Ho),{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 zo=new class{},Io={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},Oo=!0,Do=!1,Wo=/\w|\(|\)|-/,No=/[.?!,;:/,。?!、;:]/,Go=/\S/,jo=(t,e)=>{let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily||"sans-serif"})};function Uo(t,e,i,o,n){if(!e||e<=0)return 0;const r=zo.graphicUtil.textMeasure;let s=o,l=t.slice(0,s),a=Math.floor(r.measureText(l,i).width),h=t.slice(0,s+1),d=Math.floor(r.measureText(h,i).width);for(;a>e||d<=e;){if(a>e?s--:s++,s>t.length){s=t.length;break}if(s<0){s=0;break}l=t.slice(0,s),a=Math.floor(r.measureText(l,i).width),h=t.slice(0,s+1),d=Math.floor(r.measureText(h,i).width)}return n&&(s=Vo(t,s)),s}function Vo(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e;for(;Wo.test(t[o-1])&&Wo.test(t[o])||No.test(t[o]);)if(o--,o<=0)return i?$o(t,e):e;return o}function $o(t,e){let i=e;for(;Wo.test(t[i-1])&&Wo.test(t[i])||No.test(t[i]);)if(i++,i>=t.length)return i;return i}function Yo(t,e){const i=zo.graphicUtil.textMeasure.measureText(t,e),o={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(o.width=Math.floor(i.width),o.height=e.fontSize||0,o.ascent=o.height,o.descent=0):(o.width=Math.floor(i.width),o.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),o.ascent=Math.floor(i.actualBoundingBoxAscent),o.descent=o.height-o.ascent),o}var Xo=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Ko=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}estimate(t,e){let{fontSize:i=ko.fontSize}=e,o=0,n=0;for(let e=0;e<t.length;e++)t.charCodeAt(e)<128?o++:n++;return{width:~~(.8*o*i+n*i),height:i}}measureTextPixelHeight(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:bo.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const o=this.context.measureText(t);return Math.abs(o.actualBoundingBoxAscent-o.actualBoundingBoxDescent)}measureTextBoundHieght(t,e){var i;if(!this.context)return null!==(i=e.fontSize)&&void 0!==i?i:bo.fontSize;this.context.setTextStyleWithoutAlignBaseline(e);const o=this.context.measureText(t);return Math.abs(o.fontBoundingBoxAscent-o.fontBoundingBoxDescent)}measureText(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t)):this.estimate(t,e)}clipTextVertical(t,e,i,o){if(0===t.length)return{verticalList:t,width:0};const{fontSize:n=12}=e;t.forEach((t=>{t.width=0===t.direction?n:this.measureTextWidth(t.text,e)}));const r=[];let s=0,l=0;for(;l<t.length&&s+t[l].width<i;l++)s+=t[l].width,r.push(t[l]);if(t[l]&&t[l].text.length>1){const n=this._clipText(t[l].text,e,i-s,0,t[l].text.length-1,"end",!1);if(o&&n.str!==t[l].text){let i="",o=0;for(let e=0;e<l;e++){const n=t[e];i+=n.text,o+=n.text.length}i+=t[l].text;let r=Vo(i,o+n.str.length);r-=o,r!==n.str.length-1&&(n.str=n.str.substring(0,r),n.width=this.measureTextWidth(n.str,e))}r.push(Object.assign(Object.assign({},t[l]),{text:n.str,width:n.width})),s+=n.width}return{verticalList:r,width:s}}clipText(t,e,i,o,n){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 s=this._clipText(t,e,i,0,t.length-1,"end",!1);if(o&&s.str!==t){let i=Vo(t,s.str.length,n);i!==s.str.length&&(i>s.str.length&&(s.wordBreaked=i,i=s.str.length),s.str=t.substring(0,i),s.width=this.measureTextWidth(s.str,e))}return s}_clipText(t,e,i,o,n,r,s){let l;if("start"===r)l=this._clipTextStart(t,e,i,o,n),s&&(l.result=s+l.str);else if("middle"===r){const o=this._clipTextMiddle(t,e,i,"","",0,0,1);l={str:"none",width:o.width,result:o.left+s+o.right}}else l=this._clipTextEnd(t,e,i,o,n),s&&(l.result=l.str+s);return l}_clipTextEnd(t,e,i,o,n){if(o===n){It.getInstance().warn(`【_clipTextEnd】不应该走到这里${t}, ${o}, ${n}`);const i=t.substring(0,n+1);return{str:i,width:this.measureTextWidth(i,e)}}const r=Math.floor((o+n)/2),s=t.substring(0,r+1),l=this.measureTextWidth(s,e);let a;if(l>i){if(s.length<=1)return{str:"",width:0};const n=t.substring(0,r);return a=this.measureTextWidth(n,e),a<=i?{str:n,width:a}:this._clipTextEnd(t,e,i,o,r)}if(l<i){if(r>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const o=t.substring(0,r+2);return a=this.measureTextWidth(o,e),a>=i?{str:s,width:l}:this._clipTextEnd(t,e,i,r,n)}return{str:s,width:l}}_clipTextStart(t,e,i,o,n){const r=Math.ceil((o+n)/2),s=t.substring(r-1,t.length),l=this.measureTextWidth(s,e);let a;if(l>i){if(s.length<=1)return{str:"",width:0};const o=t.substring(r,t.length);return a=this.measureTextWidth(o,e),a<=i?{str:o,width:a}:this._clipTextStart(t,e,i,r,t.length)}if(l<i){if(r<=0)return{str:t,width:this.measureTextWidth(t,e)};const n=t.substring(r-2,t.length);return a=this.measureTextWidth(n,e),a>=i?{str:s,width:l}:this._clipTextStart(t,e,i,o,r)}return{str:s,width:l}}_clipTextMiddle(t,e,i,o,n,r,s,l){const a=t.substring(0,l),h=this.measureTextWidth(a,e);if(h+s>i)return{left:o,right:n,width:r+s};const d=t.substring(t.length-l,t.length),c=this.measureTextWidth(d,e);return h+c>i?{left:a,right:n,width:h+s}:this._clipTextMiddle(t,e,i,a,d,h,c,l+1)}clipTextWithSuffixVertical(t,e,i,o,n,r){if(""===o)return this.clipTextVertical(t,e,i,n);if(0===t.length)return{verticalList:t,width:0};const s=this.clipTextVertical(t,e,i,n);if(s.verticalList.length===t.length&&s.verticalList[s.verticalList.length-1].width===t[t.length-1].width)return s;const l=this.measureTextWidth(o,e);if(l>i)return s;let a;if(i-=l,"start"===r){const r=this.revertVerticalList(t);a=this.clipTextVertical(r,e,i,n);const s=this.revertVerticalList(a.verticalList);s.unshift({text:o,direction:1,width:l}),a.verticalList=s}else if("middle"===r){const r=this.clipTextVertical(t,e,i/2,n),s=this.revertVerticalList(t),h=this.clipTextVertical(s,e,i/2,n);r.verticalList.push({text:o,direction:1,width:l}),this.revertVerticalList(h.verticalList).forEach((t=>r.verticalList.push(t))),a={verticalList:r.verticalList,width:r.width+h.width}}else a=this.clipTextVertical(t,e,i,n),a.verticalList.push({text:o,direction:1,width:l});return a.width+=l,a}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,o,n,r){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];if(""===o)return this.clipText(t,e,i,n);if(0===t.length)return{str:"",width:0};const l=this.measureTextWidth(t,e);if(!s&&l<=i)return{str:t,width:l};const a=this.measureTextWidth(o,e);if(a>i)return{str:"",width:0};if(s&&l+a<=i)return{str:t+o,width:l+a};i-=a;const h=this._clipText(t,e,i,0,t.length-1,r,o);if(n&&h.str!==t){const i=Vo(t,h.str.length);i!==h.str.length&&(h.result=t.substring(0,i),h.width=this.measureTextWidth(h.str,e))}else s&&h.str===t&&(h.result=t+o);return h.str=h.result,h.width+=a,h}};Ko=Xo([f()],Ko);var Zo=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const qo=Symbol.for("TextMeasureContribution");let Jo=class extends Ko{};Jo=Zo([f()],Jo);const Qo=new class{constructor(t){const i=t||{};i.defaultScope=i.defaultScope||b,this.options=i,this.id=e.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 o=this._getNotAllArgs(t,!1,e,i);return this._get(o)}getNamed(t,e){return this.getTagged(t,o,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new A(t,e),o=this._bindingDictionary.get(t)||[];return o.push(i),this._bindingDictionary.set(t,o),new P(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 o=this.bind(i);return t(o,e),o},i=()=>t=>this.unbind(t),o=()=>t=>this.isBound(t),n=e=>i=>{const o=this.rebind(i);return t(o,e),o};return t=>({bindFunction:e(t),isboundFunction:o(),rebindFunction:n(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,o){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:o}}_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),o=Object.keys(i),s=[];for(let t=0;t<o.length;t++){const e=i[t],o={};e.forEach((t=>{o[t.key]=t.value}));const l={inject:o[n],multiInject:o[r]},a=l.inject||l.multiInject,h={serviceIdentifier:a,constructorArgsMetadata:e},d={injectIdentifier:a,metadata:e,bindings:this._bindingDictionary.get(a).filter((t=>t.constraint(h)))};s.push(d)}return s}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case C:case x:e=t.cache;break;case _:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===m&&(t.cache=e,t.activated=!0)}},tn=Symbol.for("CanvasFactory"),en=Symbol.for("Context2dFactory");function on(t){return Qo.getNamed(tn,zo.global.env)(t)}const nn=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=on(Object.assign({nativeCanvas:zo.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=on(Object.assign({nativeCanvas:zo.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 rn=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},sn=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const ln=Symbol.for("VWindow"),an=Symbol.for("WindowHandlerContribution");let hn=class{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){this.hooks={onChange:new F(["x","y","width","height"])},this.active=()=>{const t=this.global;t.env&&!this.actived&&(Qo.getNamed(an,t.env).configure(this,t),this.actived=!0)},this._uid=e.GenAutoIncrementId(),this.global=zo.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}}set style(t){this._handler.setStyle(t)}create(t){var e,i;this._handler.createWindow(t);const o=this._handler.getWH();this._width=o.width,this._height=o.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(i=t.height)&&void 0!==i?i:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t){this._handler.clearViewBox(t)}setViewBox(t){this._handler.setViewBox(t)}setViewBoxTransform(t,e,i,o,n,r){this._handler.setViewBoxTransform(t,e,i,o,n,r)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){const i=this._handler.getViewBox(),o={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},o),o.x-=i.x1,o.y-=i.y1,o}hasSubView(){const t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&Wt(this.width,t.width())&&Wt(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)}};hn=rn([f(),sn("design:paramtypes",[])],hn);var dn=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},cn=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},un=function(t,e){return function(i,o){e(i,o,t)}};let gn=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=zo.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=nn.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 o;this.configure(this.global,this.global.env);const n=this.global.measureTextMethod;this.global.measureTextMethod=i;const r={width:this._textMeasure.measureTextWidth(t,e),height:null!==(o=e.fontSize)&&void 0!==o?o:bo.fontSize};return this.global.measureTextMethod=n,r}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new Pe(Object.assign({defaultFontParams:{fontFamily:bo.fontFamily,fontSize:bo.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Pe.ALPHABET_CHAR_SET+Pe.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const o=Qo.get(ln),n=t.AABBBounds,r=n.width(),s=n.height(),l=-n.x1,a=-n.y1;o.create({viewBox:{x1:l,y1:a,x2:n.x2,y2:n.y2},width:r,height:s,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});const h=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(o,[t],{transMatrix:o.getViewBoxTransform(),viewBox:o.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=h;const d=o.getNativeHandler();return d.nativeCanvas?d.nativeCanvas:null}};var pn;gn=dn([f(),un(0,g(E)),un(0,v(qo)),cn("design:paramtypes",[Object])],gn),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(pn||(pn={}));const fn=new Fe;let vn=class{constructor(){this.matrix=new Fe}init(t){return this.mode=pn.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=pn.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const o=this.outSourceMatrix;if(fn.setValue(o.a,o.b,o.c,o.d,o.e,o.f),this.outTargetMatrix.reset(),i){const{x:o,y:n}=i;this.outTargetMatrix.translate(o,n),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-o,-n)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(fn.a,fn.b,fn.c,fn.d,fn.e,fn.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(fn.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:o}=e;this.outTargetMatrix.translate(i,o),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-o)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(fn.a,fn.b,fn.c,fn.d,fn.e,fn.f),this}scale(t,e,i){return this.mode===pn.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===pn.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return fn.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(fn.a,fn.b,fn.c,fn.d,fn.e,fn.f),this}translate(t,e){return this.mode===pn.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===pn.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};vn=dn([f(),cn("design:paramtypes",[])],vn);const mn={arc:xo,area:_o,circle:So,line:Bo,path:Mo,symbol:Eo,text:ko,rect:Po,polygon:To,richtext:Lo,richtextIcon:Fo,image:Ho,group:Ao,glyph:Ro},bn=Object.keys(mn);function Cn(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const yn={arc:Object.assign({},mn.arc),area:Object.assign({},mn.area),circle:Object.assign({},mn.circle),line:Object.assign({},mn.line),path:Object.assign({},mn.path),symbol:Object.assign({},mn.symbol),text:Object.assign({},mn.text),rect:Object.assign({},mn.rect),polygon:Object.assign({},mn.polygon),richtext:Object.assign({},mn.richtext),richtextIcon:Object.assign({},mn.richtextIcon),image:Object.assign({},mn.image),group:Object.assign({},mn.group),glyph:Object.assign({},mn.glyph)};class wn{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},bn.forEach((t=>{this._defaultTheme[t]=Object.create(yn[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 o=this.getParentWithTheme(t);if(o){const t=o.theme;(t.dirty||i)&&t.applyTheme(o,e,!0)}this.userTheme?this.doCombine(o&&o.theme.combinedTheme):(o?this.combinedTheme=o.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,It.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;bn.forEach((o=>{const n=Object.create(yn[o]);t&&t[o]&&Cn(n,t[o]),i[o]&&Cn(n,i[o]),e[o]&&Cn(n,e[o]),this.combinedTheme[o]=n})),e.common&&bn.forEach((t=>{Cn(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 xn=new wn;function _n(t,e){return t.glyphHost?_n(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)):xn.getTheme()}return null}(t)||t.attachedThemeGraphic&&_n(t.attachedThemeGraphic)||xn.getTheme()}var Sn=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};class An extends U{get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=e.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Sn(this,void 0,void 0,(function*(){if(e){let e=this._lastChild,i=0;for(;e;){let o=t(e,i++);if(o.then&&(o=yield o),o)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let o=t(e,i++);if(o.then&&(o=yield o),o)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._uid===t._uid)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._uid===t._uid)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&&It.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)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 o=this.insertInto(t,0);return this._ignoreWarn=!1,o}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,o)=>!(e===this||!t(e,o)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const o=e.find(t,!0);if(o)return i=o,!0}return!1})),i}findAll(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];return this.forEachChildren(((e,o)=>{e!==this&&t(e,o)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const o=e.findAll(t,!0);o.length&&(i=i.concat(o))}})),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 o=$(i,!0)&&i||Z(i)&&i.capture,n=Z(i)&&i.once,r=Y(e)?void 0:e;return t=o?`${t}capture`:t,e=Y(e)?e:e.handleEvent,n?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 o=$(i,!0)&&i||Z(i)&&i.capture,n=Y(e)?void 0:e;t=o?`${t}capture`:t,e=Y(e)?e:e.handleEvent;const r=Z(i)&&i.once;return super.off(t,e,n,r),this}off(t,e,i){return this.removeEventListener(t,e,i)}once(t,e,i){return Z(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),o=1;o<e;o++)i[o-1]=arguments[o];return super.emit(t.type,t,...i),!t.defaultPrevented}emit(t,e){return this.dispatchEvent(t,e)}release(){this.removeAllListeners()}}class Rn{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=Rn.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer={x:0,y:0},this.page={x:0,y:0},this.canvas={x:0,y:0},this.viewport={x:0,y:0},this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}composedPath(){return!this.manager||this.path&&this.path[this.path.length-1]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.composedDetailPath(),this.path}composedDetailPath(){return this.pickParams&&this.pickParams.graphic?(this.detailPath=this.path.slice(),this._composedDetailPath(this.pickParams)):this.detailPath=this.path.slice(),this.detailPath}_composedDetailPath(t){if(t&&t.graphic){const e=this.pickParams.graphic;if(e.stage){const i=e.stage.eventSystem.manager.propagationPath(e);this.detailPath.push(i),this._composedDetailPath(t.params)}}}preventDefault(){try{this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault()}catch(t){this.nativeEvent.preventDefault&&Y(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&&Y(this.nativeEvent.stopPropagation)&&this.nativeEvent.stopPropagation()}this.propagationStopped=!0}initEvent(){}initUIEvent(){}clone(){throw new Error("Method not implemented.")}}class Bn extends Rn{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){throw new Error("Method not implemented.")}}class Mn extends Bn{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const o=new Mn(this.manager);o.eventPhase=o.NONE,o.currentTarget=null,o.path=[],o.detailPath=[],o.target=null,o.nativeEvent=this.nativeEvent,o.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,o),null===(e=this.manager)||void 0===e||e.copyMouseData(this,o),null===(i=this.manager)||void 0===i||i.copyData(this,o),o.target=this.target,o.path=this.composedPath().slice();const n=this.composedDetailPath();return o.detailPath=n&&n.slice(),o.type=this.type,o}}class Tn extends Bn{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const o=new Tn(this.manager);o.eventPhase=o.NONE,o.currentTarget=null,o.path=[],o.detailPath=[],o.target=null,o.nativeEvent=this.nativeEvent,o.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,o),null===(e=this.manager)||void 0===e||e.copyMouseData(this,o),null===(i=this.manager)||void 0===i||i.copyData(this,o),o.target=this.target,o.path=this.composedPath().slice();const n=this.composedDetailPath();return o.detailPath=n&&n.slice(),o.type=this.type,o}}Tn.DOM_DELTA_PIXEL=0,Tn.DOM_DELTA_LINE=1,Tn.DOM_DELTA_PAGE=2;class Pn extends Rn{constructor(t,e){super(),this.type=t,this.detail=e}}const En="object"==typeof performance&&performance.now?performance:Date;function kn(t){return"mouse"===t||"pen"===t}const Ln={dispatchEvent(t){var e;if(!(t instanceof Rn))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 Pn(t,e))}},Hn={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};class Fn{constructor(t){this.resolution=1,this.onPointerDown=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,i=e.length;t<i;t++){const i=e[t],o=this.bootstrapEvent(this.rootPointerEvent,i);this.manager.mapEvent(o)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerMove=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerUp=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,o=i.length;t<o;t++){const o=this.bootstrapEvent(this.rootPointerEvent,i[t]);o.type+=e,this.manager.mapEvent(o)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onPointerOverOut=t=>{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t<i;t++){const i=this.bootstrapEvent(this.rootPointerEvent,e[t]);this.manager.mapEvent(i)}this.setCursor(this.manager.cursor,this.manager.cursorTarget),this.rootPointerEvent.nativeEvent=null},this.onWheel=t=>{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:o,global:n,autoPreventDefault:r=!1,clickInterval:s,supportsTouchEvents:l=n.supportsTouchEvents,supportsPointerEvents:a=n.supportsPointerEvents}=t;this.manager=new class{constructor(t,e){this.dispatch=new U,this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof Mn))return void It.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(kn(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,o;if(!(t instanceof Mn))return void It.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.createPointerEvent(t,t.type,e),r=kn(n.pointerType),s=this.trackingData(t.pointerId),l=this.findMountedTarget(s.overTargets);if(s.overTargets&&l&&l!==this.rootTarget&&l!==n.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,l||void 0);if(this.dispatchEvent(i,"pointerout"),r&&this.dispatchEvent(i,"mouseout"),!n.composedPath().includes(l)){const e=this.createPointerEvent(t,"pointerleave",l||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!n.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),r&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(l!==n.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(n,e);this.dispatchEvent(i,"pointerover"),r&&this.dispatchEvent(i,"mouseover");let o=null==l?void 0:l.parent;for(;o&&o!==this.rootTarget.parent&&o!==n.target;)o=o.parent;if(!o||o===this.rootTarget.parent){const t=this.clonePointerEvent(n,"pointerenter");t.eventPhase=t.AT_TARGET;let e=t.target;const i=new Set;let o=l;for(;o&&o!==this.rootTarget;)i.add(o),o=o.parent;for(;e&&e!==l&&e!==this.rootTarget.parent;)i.has(e)||(t.currentTarget=e,this.notifyTarget(t),r&&this.notifyTarget(t,"mouseenter")),e=e.parent;this.freeEvent(t)}this.freeEvent(i)}this.dispatchEvent(n,"pointermove"),"touch"===n.pointerType&&this.dispatchEvent(n,"touchmove"),r&&(this.dispatchEvent(n,"mousemove"),this.cursorTarget=n.target,this.cursor=(null===(o=null===(i=n.target)||void 0===i?void 0:i.attribute)||void 0===o?void 0:o.cursor)||this.rootTarget.getCursor()),s.overTargets=n.composedPath(),this.freeEvent(n)},this.onPointerOver=(t,e)=>{var i,o;if(!(t instanceof Mn))return void It.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.trackingData(t.pointerId),r=this.createPointerEvent(t,t.type,e),s=kn(r.pointerType);this.dispatchEvent(r,"pointerover"),s&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursorTarget=r.target,this.cursor=(null===(o=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===o?void 0:o.cursor)||this.rootTarget.getCursor());const l=this.clonePointerEvent(r,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==this.rootTarget.parent;)l.currentTarget=l.target,this.notifyTarget(l),s&&this.notifyTarget(l,"mouseenter"),l.target=l.target.parent;n.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(l)},this.onPointerOut=(t,e)=>{if(!(t instanceof Mn))return void It.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=kn(t.pointerType),o=this.findMountedTarget(i.overTargets),n=this.createPointerEvent(t,"pointerout",o||void 0);this.dispatchEvent(n),e&&this.dispatchEvent(n,"mouseout");const r=this.createPointerEvent(t,"pointerleave",o||void 0);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),e&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;i.overTargets=[],this.freeEvent(n),this.freeEvent(r)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,e)=>{var i;if(!(t instanceof Mn))return void It.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const o=En.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(kn(n.pointerType)){const t=2===n.button;this.dispatchEvent(n,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),s=this.findMountedTarget(r.pressTargetsByButton[t.button]);let l=s;if(s&&!n.composedPath().includes(s)){let e=s;for(;e&&!n.composedPath().includes(e);){if(n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)this.notifyTarget(n,"touchendoutside");else if(kn(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],l=e}if(l){const e=this.clonePointerEvent(n,"click");e.target=l,e.path=[],e.detailPath=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:o});const s=r.clicksByButton[t.button];s.target===e.target&&o-s.timeStamp<(null!==(i=this._config.clickInterval)&&void 0!==i?i:200)?++s.clickCount:s.clickCount=1,s.target=e.target,s.timeStamp=o,e.detail=s.clickCount,kn(e.pointerType)?(this.dispatchEvent(e,"click"),2===s.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&this._config.supportsTouchEvents&&(this.dispatchEvent(e,"tap"),2===s.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof Mn))return void It.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),o=this.findMountedTarget(i.pressTargetsByButton[t.button]),n=this.createPointerEvent(t,t.type,e);if(o){let e=o;for(;e;)n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?this.notifyTarget(n,"touchendoutside"):kn(n.pointerType)&&this.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(n)},this.onWheel=(t,e)=>{if(!(t instanceof Tn))return void It.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,i,o,n,r,s,l;if(!this.rootTarget)return;const a=this.mappingTable[t.type];let h;const d=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[d])&&(null===(o=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[d])||void 0===o?void 0:o.stage)&&(null===(r=null===(n=this._prePointTargetCache)||void 0===n?void 0:n[d])||void 0===r?void 0:r.stage.renderCount)===(null===(s=this._prePointTargetCache)||void 0===s?void 0:s.stageRenderCount)?h=this._prePointTargetCache[d]:(h=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[d]:h,stageRenderCount:null!==(l=null==h?void 0:h.stage.renderCount)&&void 0!==l?l:-1})),a)for(let e=0,i=a.length;e<i;e++)a[e].fn(t,h);else It.getInstance().warn(`[EventManager]: Event mapping not defined for ${t.type}`)}propagate(t,e){if(!t.target)return;const i=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(let o=0,n=i.length-1;o<n;o++)if(t.currentTarget=i[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){t.eventPhase=t.BUBBLING_PHASE;for(let o=i.length-2;o>=0;o--)if(t.currentTarget=i[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){if(this.pauseNotify)return;e=null!=e?e:t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i<t.length&&t[i].parent===e;i++)e=t[i];return e}createPointerEvent(t,e,i){var o,n;const r=this.allocateEvent(Mn);return this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.nativeEvent=t.nativeEvent,r.originalEvent=t,r.target=i||this.pickTarget(null!==(o=r.viewX)&&void 0!==o?o:r.global.x,null!==(n=r.viewY)&&void 0!==n?n:r.global.y,r),"string"==typeof e&&(r.type=e),r}createWheelEvent(t,e){var i,o;const n=this.allocateEvent(Tn);return this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,n.target=e||this.pickTarget(null!==(i=n.viewX)&&void 0!==i?i:n.global.x,null!==(o=n.viewY)&&void 0!==o?o:n.global.y,n),n}clonePointerEvent(t,e){const i=this.allocateEvent(Mn);i.nativeEvent=t.nativeEvent,i.originalEvent=t.originalEvent,this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.target=t.target,i.path=t.composedPath().slice();const o=t.composedDetailPath();return i.detailPath=o&&o.slice(),i.type=null!=e?e:i.type,i}copyWheelData(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}copyPointerData(t,e){t instanceof Mn&&e instanceof Mn&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)}copyMouseData(t,e){t instanceof Bn&&e instanceof Bn&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.shiftKey=t.shiftKey,e.metaKey=t.metaKey,["client","movement","canvas","screen","global","offset","viewport"].forEach((i=>{e[i].x=t[i].x,e[i].y=t[i].y})))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=En.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.detailPath=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let o=0,n=i.length;o<n&&!t.propagationImmediatelyStopped;o++)i[o].once&&t.currentTarget.removeEventListener(e,i[o].fn,{once:!0}),i[o].fn.call(i[o].context,t);this.emitDelegation(t,e)}emitDelegation(t,e){const i=t.currentTarget._events["*"];if(i)if("fn"in i)i.fn.call(i.context,t,e);else for(let o=0,n=i.length;o<n&&!t.propagationImmediatelyStopped;o++)i[o].fn.call(i[o].context,t,e)}pickTarget(t,e,i){let o;const n=this.rootTarget.pick(t,e);return o=n&&n.graphic?n.graphic:n&&n.group?n.group:this.rootTarget.AABBBounds.contains(t,e)?this.rootTarget:null,i&&(i.pickParams=n.params),o}release(){this.dispatch.removeAllListeners(),this.eventPool.clear(),this.rootTarget=null,this.mappingTable=null,this.mappingState=null,this.cursorTarget=null}}(o,{clickInterval:s,supportsTouchEvents:l}),this.globalObj=n,this.supportsPointerEvents=a,this.supportsTouchEvents=l,this.supportsMouseEvents=n.supportsMouseEvents,this.applyStyles=n.applyStyles,this.autoPreventDefault=r,this.eventsAdded=!1,this.rootPointerEvent=new Mn,this.rootWheelEvent=new Tn,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:o}=this;if(this.currentCursor===t)return;this.currentCursor=t;const n=this.cursorStyles[t];n?"string"==typeof n&&i?o.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&i&&Object.assign(o.style,n):i&&tt(t)&&!ft(this.cursorStyles,t)&&(o.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e,i;const o=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(o)return o;let n=0,r=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};n=e.clientX||0,r=e.clientY||0}else n=t.clientX||0,r=t.clientY||0;const s=this.domElement.getBoundingClientRect();return{x:n-s.left,y:r-s.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,o=t.changedTouches.length;i<o;i++){const o=t.changedTouches[i];Q(o.button)&&(o.button=0),Q(o.buttons)&&(o.buttons=1),Q(o.isPrimary)&&(o.isPrimary=1===t.touches.length&&"touchstart"===t.type),Q(o.width)&&(o.width=o.radiusX||1),Q(o.height)&&(o.height=o.radiusY||1),Q(o.tiltX)&&(o.tiltX=0),Q(o.tiltY)&&(o.tiltY=0),Q(o.pointerType)&&(o.pointerType="touch"),Q(o.pointerId)&&(o.pointerId=o.identifier||0),Q(o.pressure)&&(o.pressure=o.force||.5),Q(o.twist)&&(o.twist=0),Q(o.tangentialPressure)&&(o.tangentialPressure=0),Q(o.layerX)&&(o.layerX=o.offsetX=o.clientX),Q(o.layerY)&&(o.layerY=o.offsetY=o.clientY),o.isNormalized=!0,o.type=t.type,e.push(o)}else if(!this.globalObj.supportsMouseEvents||t instanceof MouseEvent&&!(this.supportsPointerEvents&&t instanceof PointerEvent)){const i=t;Q(i.isPrimary)&&(i.isPrimary=!0),Q(i.width)&&(i.width=1),Q(i.height)&&(i.height=1),Q(i.tiltX)&&(i.tiltX=0),Q(i.tiltY)&&(i.tiltY=0),Q(i.pointerType)&&(i.pointerType="mouse"),Q(i.pointerId)&&(i.pointerId=1),Q(i.pressure)&&(i.pressure=.5),Q(i.twist)&&(i.twist=0),Q(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}else e.push(t);return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;const{x:i,y:o}=this.mapToCanvasPoint(t);e.canvas.x=i,e.canvas.y=o,e.global.x=i,e.global.y=o,e.offset.x=i,e.offset.y=o;const{x:n,y:r}=this.mapToViewportPoint(e);return e.viewport.x=n,e.viewport.y=r,e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);const{x:i,y:o}=this.mapToCanvasPoint(e);t.canvas.x=i,t.canvas.y=o,t.global.x=i,t.global.y=o,t.offset.x=i,t.offset.y=o;const{x:n,y:r}=this.mapToViewportPoint(t);return t.viewport.x=n,t.viewport.y=r,t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Hn[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=En.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.shiftKey=e.shiftKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null}isEventOutsideOfTargetViewPort(t){if(this.isEventOutsideOfTargetElement(t))return!0;if(this.domElement.getViewBox){const e=this.mapToViewportPoint(this.mapToCanvasPoint(t)),i=this.domElement.getViewBox(),o=i.width(),n=i.height();return!(e.x<o&&e.y<n&&e.x>0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}var zn;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(zn||(zn={}));class In{static Avaliable(){return!!zo.global.getRequestAnimationFrame()}avaliable(){return In.Avaliable()}tick(t,e){zo.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class On{static Avaliable(){return!0}avaliable(){return On.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}class Dn{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===zn.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=zn.INITIAL,zo.global.hooks.onSetEnv.tap("default-ticker",(()=>{this.initHandler()})),zo.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:In},{mode:"timeout",cons:On}];for(let e=0;e<t.length;e++)if(t[e].cons.Avaliable()){this.mode=t[e].mode;break}return null}setupTickHandler(){let t;switch(this._mode){case"raf":t=new In;break;case"timeout":t=new On;break;default:It.getInstance().warn("非法的计时器模式"),t=new In}return!!t.avaliable()&&(this.tickerHandler&&this.tickerHandler.release(),this.tickerHandler=t,!0)}setInterval(t){this.interval=t}getInterval(){return this.interval}setFPS(t){this.setInterval(1e3/t)}getFPS(){return 1e3/this.interval}tick(t){this.tickerHandler.tick(t,(t=>{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==zn.INITIAL&&(this.status=zn.PAUSE,!0)}resume(){return this.status!==zn.INITIAL&&(this.status=zn.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.status===zn.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===zn.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=zn.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=zn.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}}class Wn{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-Wn.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*Wn.bounceIn(2*t):.5*Wn.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const o=e/ie*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-o)*ie/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const o=e/ie*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-o)*ie/e)+1}}static getElasticInOut(t,e){return function(i){const o=e/ie*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-o)*ie/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-o)*ie/e)*.5+1}}}Wn.quadIn=Wn.getPowIn(2),Wn.quadOut=Wn.getPowOut(2),Wn.quadInOut=Wn.getPowInOut(2),Wn.cubicIn=Wn.getPowIn(3),Wn.cubicOut=Wn.getPowOut(3),Wn.cubicInOut=Wn.getPowInOut(3),Wn.quartIn=Wn.getPowIn(4),Wn.quartOut=Wn.getPowOut(4),Wn.quartInOut=Wn.getPowInOut(4),Wn.quintIn=Wn.getPowIn(5),Wn.quintOut=Wn.getPowOut(5),Wn.quintInOut=Wn.getPowInOut(5),Wn.backIn=Wn.getBackIn(1.7),Wn.backOut=Wn.getBackOut(1.7),Wn.backInOut=Wn.getBackInOut(1.7),Wn.elasticIn=Wn.getElasticIn(1,.3),Wn.elasticOut=Wn.getElasticOut(1,.3),Wn.elasticInOut=Wn.getElasticInOut(1,.3*1.5);class Nn{constructor(){this.id=e.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===yi.END?this.removeAnimate(e):e.status===yi.RUNNING||e.status===yi.INITIAL?(this.animateCount++,e.advance(t)):e.status===yi.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()}}const Gn=new Nn;class jn{constructor(t,e,i,o,n){this.from=t,this.to=e,this.duration=i,this.easing=o,this.params=n,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 Un extends jn{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Vn{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.GenAutoIncrementId(),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Gn,o=arguments.length>2?arguments[2]:void 0;this.id=t,this.timeline=i,this.status=yi.INITIAL,this.tailAnimate=new $n(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=o}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=se(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Vn.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]:Vn.mode;t&&e&wi.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Ci.ANIMATE_PLAY})}runCb(t){const e=new Un((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,o,n,r){const s=Vn.interpolateMap.get(t)||Vn.interpolateMap.get("");return!!s&&s(t,e,i,o,n,r)}pause(){this.status===yi.RUNNING&&(this.status=yi.PAUSED)}resume(){this.status===yi.PAUSED&&(this.status=yi.RUNNING)}to(t,e,i,o){if(this.tailAnimate.to(t,e,i,o),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,o){if(this.tailAnimate.from(t,e,i,o),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 $n(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===yi.INITIAL&&(this.status=yi.RUNNING,this._onStart&&this._onStart.forEach((t=>t()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===yi.RUNNING&&(this.status=yi.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const o=this.rawPosition,n=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const r=t>=n;if(r&&(t=n),t===o)return r;for(let o=0;o<this.subAnimates.length&&(e=this.subAnimates[o],!(i+e.totalDuration>=t));o++)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=yi.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()}}Vn.mode=wi.NORMAL,Vn.interpolateMap=new Map;class $n{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,o="string"==typeof i?Wn[i]:i,n=this._addStep(e,null,o);return n.type=xi.customAnimate,this._appendProps(t.getEndProps(),n,!1),this._appendCustomAnimate(t,n),this}to(t,e,i,o){(null==e||e<0)&&(e=0);const n="string"==typeof i?Wn[i]:i,r=this._addStep(e,null,n);return r.type=xi.to,this._appendProps(t,r,!!o&&o.tempProps),r.propKeys||(r.propKeys=Object.keys(r.props)),o&&o.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(r.propKeys)})),this}from(t,e,i,o){this.to(t,0,i,o);const n={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{n[t]=this.getLastPropByName(t,this.stepTail)})),this.to(n,e,i,o),this.stepTail.type=xi.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=xi.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 o=new Yn(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(o),this.stepTail=o,o}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let o=e.prev;const n=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))}));o.prev;)o.props&&(o.propKeys||(o.propKeys=Object.keys(o.props)),o.propKeys.forEach((t=>{void 0===n[t]&&(n[t]=o.props[t])}))),e.propKeys=Object.keys(e.props),o=o.prev;const r=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(n)),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,o=this.loop,n=this.rawPosition;let r,s,l=!1;const a=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t<a)return this.rawPosition=t,!1;if(t-=a,i<=0&&(l=!0,i<0))return l;if(r=Math.floor(t/i),s=t-r*i,l=t>=o*i+i,l&&(s=i,r=o,t=s*r+i),t===n)return l;const h=!this.reversed!=!(this.bounce&&r%2);return h&&(s=i-s),this._deltaPosition=s-this.position,this.position=s,this.rawPosition=t+a,this.updatePosition(l,h),l}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const o=this.position,n=this.duration;if(this.target&&i){let r=i.next;for(;r&&r.position<=o;)i=r,r=i.next;let s=t?0===n?1:o/n:(o-i.position)/i.duration;i.easing&&(s=i.easing(s)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,s,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,s)))}}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 It.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,o){this.duration=e,this.position=t,this.props=i,this.easing=o}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,Kn="cubicOut";var Zn;!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"}(Zn||(Zn={}));const qn=[!1,!1,!1,!1],Jn=[0,0,0,0],Qn=t=>t?et(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Jn[0]=t[0],Jn[2]=t[0],Jn[1]=t[1],Jn[3]=t[1],Jn):t:t:0,tr=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],er=[1,2,3,0,1,2,3,0];function ir(t,e,i,o){for(;t>=ie;)t-=ie;for(;t<0;)t+=ie;for(;t>e;)e+=ie;tr[0].x=i,tr[1].y=i,tr[2].x=-i,tr[3].y=-i;const n=Math.ceil(t/te)%4,r=Math.ceil(e/te)%4;if(o.add(re(t)*i,ae(t)*i),o.add(re(e)*i,ae(e)*i),n!==r||e-t>Qt){let t=!1;for(let e=0;e<er.length;e++)if(t||n!==er[e]){if(t&&r===er[e])break;if(t){const t=tr[er[e]];o.add(t.x,t.y)}}else{t=!0;const e=tr[n];o.add(e.x,e.y)}}}function or(t,e,i){const{x:o,y:n}=ue(t.x,t.y,e.x,e.y,i),{x:r,y:s}=ue(t.x1,t.y1,e.x1,e.y1,i),l=new ge(o,n,r,s);return l.defined=e.defined,l}function nr(t,e,i){if(!t||!e)return[];Array.isArray(t)||(t=[t]),Array.isArray(e)||(e=[e]);let o=[];if(t.length>e.length){o=e.map((t=>{const e=new ge(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n<e.length;n++)o[n]=or(t[n],e[n],i)}else{o=e.map((t=>{const e=new ge(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n<t.length;n++)o[n]=or(t[n],e[n],i)}return o}function rr(t,e){if(et(t)){let i;for(let o=0;o<t.length&&void 0===i;o++)i=t[o][e];return i}return t[e]}class sr{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:sr.TimeOut;this.durations=[],this.timeout=t,this.lastDate=0,this.durationsListThreshold=30}call(t){return this.lastDate=Date.now(),setTimeout((()=>{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}sr.TimeOut=1e3/60;const lr=new sr,ar=(t,e)=>tt(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t;var hr;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(hr||(hr={}));class dr{static Get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hr.Color1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0,1];if(e===hr.Color1){const e=dr.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const o=Ye.parseColorString(t);if(o){const e=[o.r/255,o.g/255,o.b/255,o.opacity];dr.store1[t]=e,dr.store255[t]=[o.r,o.g,o.b,o.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const o=dr.store255[t];if(o)return i[0]=o[0],i[1]=o[1],i[2]=o[2],i[3]=o[3],i;const n=Ye.parseColorString(t);return n&&(dr.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],dr.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=n.r,i[1]=n.g,i[2]=n.b,i[3]=n.opacity),i}static Set(t,e,i){if(e===hr.Color1){if(dr.store1[t])return;dr.store1[t]=i,dr.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(dr.store255[t])return;dr.store255[t]=i,dr.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function cr(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Array.isArray(t)&&nt(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 ur(t,e,i,o,n){return Array.isArray(t)&&!nt(t[0])||Array.isArray(e)&&!nt(e[0])?new Array(4).fill(0).map(((n,r)=>gr(et(t)?t[r]:t,et(e)?e[r]:e,i,o))):gr(t,e,i,o,n)}function gr(t,e,i,o,n){if(!t||!e)return t&&cr(t)||e&&cr(e)||!1;let r,s,l=!1,a=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=dr.Get(t,hr.Color255):l=!0,Array.isArray(e)?s=e:"string"==typeof e?s=dr.Get(e,hr.Color255):a=!0,l!==a){const r=l?t:e,s=l?e:t,a=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:cr(s)})))});return l?ur(r,a,i,o,n):ur(a,r,i,o,n)}if(l){if(t.gradient===e.gradient){const o=t,n=e,r=o.stops,s=n.stops;if(r.length!==s.length)return!1;if("linear"===o.gradient)return function(t,e,i){const o=t.stops,n=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(o.length).fill(0).map(((t,e)=>({color:vr(o[e].color,n[e].color,i),offset:o[e].offset+(n[e].offset-o[e].offset)*i})))}}(o,n,i);if("radial"===o.gradient)return function(t,e,i){const o=t.stops,n=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(o.length).fill(0).map(((t,e)=>({color:vr(o[e].color,n[e].color,i),offset:o[e].offset+(n[e].offset-o[e].offset)*i})))}}(o,n,i);if("conical"===o.gradient)return function(t,e,i){const o=t.stops,n=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(o.length).fill(0).map(((t,e)=>({color:vr(o[e].color,n[e].color,i),offset:o[e].offset+(n[e].offset-o[e].offset)*i})))}}(o,n,i)}return!1}return n&&n(r,s),cr(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,s,i),o)}dr.store255={},dr.store1={};const pr=[0,0,0,0],fr=[0,0,0,0];function vr(t,e,i){return dr.Get(t,hr.Color255,pr),dr.Get(e,hr.Color255,fr),`rgba(${Math.round(pr[0]+(fr[0]-pr[0])*i)},${Math.round(pr[1]+(fr[1]-pr[1])*i)},${Math.round(pr[2]+(fr[2]-pr[2])*i)},${pr[3]+(fr[3]-pr[3])*i})`}class mr{static GetImage(t,e){var i;const o=mr.cache.get(t);o?"fail"===o.loadState?zo.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===o.loadState||"loading"===o.loadState?null===(i=o.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,o.data):mr.loadImage(t,e)}static GetSvg(t,e){var i;let o=mr.cache.get(t);o?"fail"===o.loadState?zo.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===o.loadState||"loading"===o.loadState?null===(i=o.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,o.data):(o={type:"image",loadState:"init"},mr.cache.set(t,o),o.dataPromise=zo.global.loadSvg(t),o.dataPromise?(o.waitingMark=[e],o.dataPromise.then((e=>{var i;o.loadState=(null==e?void 0:e.data)?"success":"fail",o.data=null==e?void 0:e.data,null===(i=o.waitingMark)||void 0===i||i.map(((i,n)=>{(null==e?void 0:e.data)?(o.loadState="success",o.data=e.data,i.imageLoadSuccess(t,e.data)):(o.loadState="fail",i.imageLoadFail(t))})),o.waitingMark&&(o.waitingMark=[])}))):(o.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=mr.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"},mr.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=zo.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=zo.global.loadBlob(t):"json"===e&&(i.dataPromise=zo.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!mr.isLoading&&mr.toLoadAueue.length){mr.isLoading=!0;const t=mr.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:o}=t,n={type:"image",loadState:"init"};if(mr.cache.set(i,n),n.dataPromise=zo.global.loadImage(i),n.dataPromise){n.waitingMark=o;const t=n.dataPromise.then((t=>{var e;n.loadState=(null==t?void 0:t.data)?"success":"fail",n.data=null==t?void 0:t.data,null===(e=n.waitingMark)||void 0===e||e.map(((e,o)=>{(null==t?void 0:t.data)?(n.loadState="success",n.data=t.data,e.imageLoadSuccess(i,t.data)):(n.loadState="fail",e.imageLoadFail(i))})),n.waitingMark&&(n.waitingMark=[])}));e.push(t)}else n.loadState="fail",o.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{mr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),mr.loading()})).catch((t=>{mr.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),mr.loading()}))}}),0)}static loadImage(t,e){const i=br(t,mr.toLoadAueue);if(-1!==i)return mr.toLoadAueue[i].marks.push(e),void mr.loading();mr.toLoadAueue.push({url:t,marks:[e]}),mr.loading()}static improveImageLoading(t){const e=br(t,mr.toLoadAueue);if(-1!==e){const t=mr.toLoadAueue.splice(e,1);mr.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function br(t,e){for(let i=0;i<e.length;i++)if(e[i].url===t)return i;return-1}mr.cache=new Map,mr.isLoading=!1,mr.toLoadAueue=[],mr.onLoadSuccessCb=[];const Cr=new Fe,yr=new Le,wr=["lineWidth","scaleX","scaleY","angle","anchor","visible"],xr=["x","y"],_r=["scaleX","scaleY"],Sr=["angle"],Ar=new ge,Rr={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 Br extends An{static mixin(t){const e=Object.keys(t);for(let i=0;i<e.length;++i){const o=e[i];Object.defineProperty(Br.prototype,o,Object.getOwnPropertyDescriptor(t,o))}}get AABBBounds(){return this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode)}get OBBBounds(){return this.tryUpdateOBBBounds()}get globalAABBBounds(){return this.tryUpdateGlobalAABBBounds()}get transMatrix(){return this.tryUpdateLocalTransMatrix(!0)}get globalTransMatrix(){return this.tryUpdateGlobalTransMatrix(!0)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super(),this._AABBBounds=new Le,this._updateTag=mi.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,o;const{dx:n=t.dx,dy:r=t.dy}=this.attribute;if(e&&this.parent){const t=this.parent.attribute;Ar.x=n+(null!==(i=t.scrollX)&&void 0!==i?i:0),Ar.y=r+(null!==(o=t.scrollY)&&void 0!==o?o:0)}else Ar.x=n,Ar.y=r;return Ar}onAnimateBind(t){this._emitCustomEvent("animate-bind",t)}tryUpdateAABBBounds(t){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;if(!this.valid)return this._AABBBounds.clear(),this._AABBBounds;zo.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const e=this.doUpdateAABBBounds(t);return zo.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,!0),e}tryUpdateOBBBounds(){return this._OBBBounds||(this._OBBBounds=new He),this.tryUpdateAABBBounds(),this.updateOBBBoundsStamp===this.updateAABBBoundsStamp?this._OBBBounds:(this.updateOBBBoundsStamp=this.updateAABBBoundsStamp,this.valid?this.doUpdateOBBBounds():(this._OBBBounds.clear(),this._OBBBounds))}combindShadowAABBBounds(t){if(this.shadowRoot){const e=this.shadowRoot.AABBBounds.clone();t.union(e)}}doUpdateOBBBounds(){return this._OBBBounds}doUpdateAABBBounds(t){this.updateAABBBoundsStamp++;const e=this.getGraphicTheme();this._AABBBounds.clear();const i=this.attribute,o=this.updateAABBBounds(i,e,this._AABBBounds,t),{boundsPadding:n=e.boundsPadding}=i,r=Qn(n);return r&&o.expand(r),this.clearUpdateBoundTag(),o}updatePathProxyAABBBounds(t){const e="function"==typeof this.pathProxy?this.pathProxy(this.attribute):this.pathProxy;if(!e)return!1;const i=new Je(t);return Ti(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 Fe),this.shouldUpdateLocalMatrix()&&(this.doUpdateLocalMatrix(),t&&this.clearUpdateLocalPositionTag()),this._transMatrix}shouldUpdateAABBBounds(){return this.shadowRoot?(!!(this._updateTag&mi.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds())&&zo.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this):!!(this._updateTag&mi.UPDATE_BOUNDS)&&zo.graphicService.validCheck(this.attribute,this.getGraphicTheme(),this._AABBBounds,this)}shouldSelfChangeUpdateAABBBounds(){return this.shadowRoot?!!(this._updateTag&mi.UPDATE_BOUNDS)||this.shadowRoot.shouldUpdateAABBBounds():!!(this._updateTag&mi.UPDATE_BOUNDS)}shouldUpdateLocalMatrix(){return!!(this._updateTag&mi.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&mi.UPDATE_SHAPE)}clearUpdateShapeTag(){this._updateTag&=mi.CLEAR_SHAPE}containsPoint(t,e,i,o){if(!o)return!1;if(i===bi.GLOBAL){const i=new ge(t,e);this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),t=i.x,e=i.y}return o.containsPoint(this,{x:t,y:e})}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 o=Object.keys(t);for(let e=0;e<o.length;e++){const i=o[e];this.attribute[i]=t[i]}this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(o)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i)}setAttribute(t,e,i,o){var n;const r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({[t]:e},this.attribute,t,o);r?this._setAttributes(r,i,o):X(null===(n=this.normalAttrs)||void 0===n?void 0:n[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(o)):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]:wr;for(let i=0;i<e.length;i++){const o=e[i];if(-1!==t.indexOf(o))return!0}return!1}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:wr;for(let i=0;i<e.length;i++)if(t===e[i])return!0;return!1}initAttributes(t){const e={type:Ci.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=mi.INIT,this.valid=this.isValid(),this.onAttributeUpdate(e)}translate(t,e){var i,o;if(0===t&&0===e)return this;const n={type:Ci.TRANSLATE},r=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,xr,n);r&&(t=r.x,e=r.y,delete r.x,delete r.y,this._setAttributes(r));const s=this.attribute,l=s.postMatrix;return l?zo.transformUtil.fromMatrix(l,l).translate(t,e):(s.x=(null!==(i=s.x)&&void 0!==i?i:po.x)+t,s.y=(null!==(o=s.y)&&void 0!==o?o:po.y)+e),this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(n),this}translateTo(t,e){const i=this.attribute;if(i.x===t&&i.y===e)return this;const o={type:Ci.TRANSLATE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({x:t,y:e},this.attribute,xr,o);return n?(this._setAttributes(n,!1,o),this):(i.x=t,i.y=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this)}scale(t,e,i){var o,n;if(1===t&&1===e)return this;const r={type:Ci.SCALE},s=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e,scaleCenter:i},this.attribute,_r,r);s&&(t=s.scaleX,e=s.scaleY,delete s.scaleX,delete s.scaleY,this._setAttributes(s));const l=this.attribute;if(i){let{postMatrix:o}=this.attribute;o||(o=new Fe,l.postMatrix=o),zo.transformUtil.fromMatrix(o,o).scale(t,e,i)}else l.scaleX=(null!==(o=l.scaleX)&&void 0!==o?o:po.scaleX)*t,l.scaleY=(null!==(n=l.scaleY)&&void 0!==n?n:po.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 o={type:Ci.SCALE_TO},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({scaleX:t,scaleY:e},this.attribute,_r,o);return n?(this._setAttributes(n,!1,o),this):(i.scaleX=t,i.scaleY=e,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this)}rotate(t,e){var i;if(0===t)return this;const o={type:Ci.ROTATE},n=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate({angle:t,rotateCenter:e},this.attribute,Sr,o);n&&(delete n.angle,this._setAttributes(n,!1,o));const r=this.attribute;if(e){let{postMatrix:i}=this.attribute;i||(i=new Fe,r.postMatrix=i),zo.transformUtil.fromMatrix(i,i).rotate(t,e)}else r.angle=(null!==(i=r.angle)&&void 0!==i?i:po.angle)+t;return this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(o),this}rotateTo(t){const e=this.attribute;if(e.angle===t)return this;const i={type:Ci.ROTATE_TO},o=this.onBeforeAttributeUpdate&&this.onBeforeAttributeUpdate(t,this.attribute,Sr,i);return o?(this._setAttributes(o,!1,i),this):(e.angle=t,this.addUpdatePositionTag(),this.addUpdateBoundTag(),this.addUpdateLayoutTag(),this.onAttributeUpdate(i),this)}skewTo(t,e){return this}animate(t){this.animates||(this.animates=new Map);const e=new Vn(null==t?void 0:t.id,this.stage&&this.stage.getTimeline(),null==t?void 0:t.slience);if(e.bind(this),t){const{onStart:i,onFrame:o,onEnd:n,onRemove:r}=t;null!=i&&e.onStart(i),null!=o&&e.onFrame(o),null!=n&&e.onEnd(n),null!=r&&e.onRemove(r),e.interpolateFunc=t.interpolate}return this.animates.set(e.id,e),e.onRemove((()=>{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(zo.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!X(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,o){var n,r,s,l;if(i){const i=Object.keys(t),a=this.getNoWorkAnimateAttr(),h={};let d;i.forEach((e=>{a[e]?(d||(d={}),d[e]=t[e]):h[e]=o&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const c=this.animate({slience:!0});c.stateNames=e,c.to(h,null!==(r=null===(n=this.stateAnimateConfig)||void 0===n?void 0:n.duration)&&void 0!==r?r:Xn,null!==(l=null===(s=this.stateAnimateConfig)||void 0===s?void 0:s.easing)&&void 0!==l?l:Kn),d&&this.setAttributes(d,!1,{type:Ci.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Ci.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 o=i.getEndProps();ft(o,t)&&(e=o[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var o;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const n=e&&(null===(o=this.currentStates)||void 0===o?void 0:o.length)?this.currentStates.concat([t]):[t];this.useStates(n,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 o={};t.forEach((e=>{var i;const n=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];n&&Object.assign(o,n)})),this.updateNormalAttrs(o),this.currentStates=t,this.applyStateAttrs(o,t,e)}addUpdateBoundTag(){this._updateTag|=mi.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=mi.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=mi.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&mi.UPDATE_SHAPE_AND_BOUNDS)===mi.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=mi.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=mi.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=mi.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=mi.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=mi.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=mi.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=mi.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&mi.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],o=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:o}=this.attribute;return yr.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(yr),this.setAttributes({scaleX:t,scaleY:i,angle:o}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,n=o();i[0]=n.x1+(n.x2-n.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,n=o();i[1]=n.y1+(n.y2-n.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=po.x,y:e=po.y,scaleX:i=po.scaleX,scaleY:o=po.scaleY,angle:n=po.angle,scaleCenter:r,anchor:s,postMatrix:l}=this.attribute;let a=[0,0];const h={};if(s&&(a=this.getAnchor(s,h)),!r||1===i&&1===o)!function(t,e,i,o,n,r,s,l){const a=e.a,h=e.b,d=e.c,c=e.d,u=e.e,g=e.f,p=re(s),f=ae(s);let v,m;l?(v=l[0],m=l[1]):(v=i,m=o);const b=v-i,C=m-o,y=a*p+d*f,w=h*p+c*f,x=d*p-a*f,_=c*p-h*f;t.a=n*y,t.b=n*w,t.c=r*x,t.d=r*_,t.e=u+a*v+d*m-y*b-x*C,t.f=g+h*v+c*m-w*b-_*C}(this._transMatrix,this._transMatrix.reset(),t,e,i,o,n,s&&a);else{const s=this._transMatrix;s.reset(),s.translate(a[0],a[1]),s.rotate(n),s.translate(-a[0],-a[1]),s.translate(t,e),a=this.getAnchor(r,h),zo.transformUtil.fromMatrix(s,s).scale(i,o,{x:a[0],y:a[1]})}const d=this.getOffsetXY(po);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,l){const t=Cr.setValue(l.a,l.b,l.c,l.d,l.e,l.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),zo.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Ci.ANIMATE_END})}onStep(t,e,i,o,n){const r={};if(i.customAnimate)i.customAnimate.update(n,o,r);else{const s=i.props,l=i.parsedProps,a=i.propKeys;this.stepInterpolate(t,e,r,i,o,n,s,void 0,l,a)}this.setAttributes(r,!1,{type:Ci.ANIMATE_UPDATE,animationState:{ratio:o,end:n,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,o,n,r,s,l,a,h){h||(h=Object.keys(s),o.propKeys=h),r?o.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=s[t])})):h.forEach((r=>{var h;if(!e.validAttr(r))return;const d=s[r],c=null!==(h=l&&l[r])&&void 0!==h?h:t.getLastPropByName(r,o);if(null==d||null==c||d===c)return void(i[r]=d);let u;u=e.interpolateFunc&&e.interpolateFunc(r,n,c,d,i),u||(u=e.customInterpolate(r,n,c,d,this,i),u||this.defaultInterpolate(d,c,r,i,a,n)||this._interpolate(r,n,c,d,i))})),o.parsedProps=a}defaultInterpolate(t,e,i,o,n,r){if(Number.isFinite(t))return o[i]=e+(t-e)*r,!0;if("fill"===i){n||(n={});const s=n.fillColorArray,l=ur(e,null!=s?s:t,r,!1,((t,e)=>{n.fillColorArray=e}));return l&&(o[i]=l),!0}if("stroke"===i){n||(n={});const s=n.strokeColorArray,l=ur(e,null!=s?s:t,r,!1,((t,e)=>{n.strokeColorArray=e}));return l&&(o[i]=l),!0}if("shadowColor"===i){n||(n={});const s=n.shadowColorArray,l=ur(e,null!=s?s:t,r,!0,((t,e)=>{n.shadowColorArray=e}));return l&&(o[i]=l),!0}return!1}_interpolate(t,e,i,o,n){}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:zo.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return tt(t,!0)?this.pathProxy=(new co).fromString(t):this.pathProxy=new co,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 o={data:"init",state:null};this.resources.set(i,o),"string"==typeof t?(o.state="loading",t.startsWith("<svg")?(mr.GetSvg(t,this),this.backgroundImg=this.backgroundImg||e):(st(t)||t.includes("/")||lt(t))&&(mr.GetImage(t,this),this.backgroundImg=this.backgroundImg||e)):Z(t)?(o.state="success",o.data=t,this.backgroundImg=this.backgroundImg||e):o.state="fail"}setShadowGraphic(t){t?this.attachShadow().add(t):this.detachShadow()}imageLoadSuccess(t,e,i){if(!this.resources)return;const o=this.resources.get(t);o&&(o.state="success",o.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",zo.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,o;if(this._events&&t in this._events){const n=new Pn(t,e);n.bubbles=!1,n.manager=null===(o=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===o?void 0:o.manager,this.dispatchEvent(n)}}}Br.mixin(Ln);class Mr{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 Tr(t,e,i,o){const n=t.indexOf(e,i);if(-1===n)throw new Error(o);return n+e.length-1}function Pr(t,e,i){const o=function(t,e){let i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",n="";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===o[0]){if(!o[1])return{data:n,index:r};if(t[r+1]===o[1])return{data:n,index:r}}else"\t"===e&&(e=" ");n+=e}}(t,e+1,arguments.length>3&&void 0!==arguments[3]?arguments[3]:">");if(!o)return;let n=o.data;const r=o.index,s=n.search(/\s/);let l=n,a=!0;-1!==s&&(l=n.substr(0,s).replace(/\s\s*$/,""),n=n.substr(s+1));const h=l;if(i){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),a=l!==o.data.substr(t+1))}return{tagName:l,tagExp:n,closeIndex:r,attrExpPresent:a,rawTagName:h}}const Er=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");class kr{constructor(t){this.currentNode=null,this.options=t,this.tagsNodeStack=[],this.docTypeEntities={}}addChild(t,e,i){const o=e.tagname;"string"==typeof o?(e.tagname=o,t.addChild(e)):t.addChild(e)}buildAttributesMap(t,e,i){const o={};if(!t)return;const n=function(t,e){const i=[];let o=e.exec(t);for(;o;){const n=[];n.startIndex=e.lastIndex-o[0].length;const r=o.length;for(let t=0;t<r;t++)n.push(o[t]);i.push(n),o=e.exec(t)}return i}(t,Er),r=n.length;for(let t=0;t<r;t++){const e=n[t][1],i=n[t][4];e&&(o[e]=void 0===i||(isNaN(i)?i:Number(i)))}return o}parseXml(t){t=t.replace(/\r\n?/g,"\n");const e=new Mr("!xml");let i=e,o="",n="";for(let r=0;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){const e=Tr(t,">",r,"Closing Tag is not closed."),s=n.lastIndexOf(".");n=n.substring(0,s),i=this.tagsNodeStack.pop(),i&&i.child&&o&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=o),o="",r=e}else if("?"===t[r+1])r=Pr(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=Tr(t,"--\x3e",r+4,"Comment is not closed.");else{const s=Pr(t,r,!1);let l=s.tagName,a=s.tagExp;const h=s.attrExpPresent,d=s.closeIndex;if(l!==e.tagname&&(n+=n?"."+l:l),a.length>0&&a.lastIndexOf("/")===a.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),n=n.substr(0,n.length-1),a=l):a=a.substr(0,a.length-1);const t=new Mr(l);l!==a&&h&&(t[":@"]=this.buildAttributesMap(a,n,l)),this.addChild(i,t,n),n=n.substr(0,n.lastIndexOf("."))}else{const t=new Mr(l);this.tagsNodeStack.push(i),l!==a&&h&&(t[":@"]=this.buildAttributesMap(a,n,l)),this.addChild(i,t,n),i=t}o="",r=d}else o+=t[r];return e.child}}function Lr(t,e){return Hr(t)}function Hr(t,e){const i={};for(let e=0;e<t.length;e++){const o=t[e],n=Fr(o);if(void 0!==n&&o[n]){const t=Hr(o[n]);Ir(t),o[":@"]&&zr(t,o[":@"]),void 0!==i[n]&&i.hasOwnProperty(n)?(Array.isArray(i[n])||(i[n]=[i[n]]),i[n].push(t)):i[n]=t}}return i}function Fr(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function zr(t,e,i){if(e){const i=Object.keys(e),o=i.length;for(let n=0;n<o;n++){const o=i[n];t[o]=e[o]}}}function Ir(t){return 0===Object.keys(t).length}class Or{constructor(t){this.options=Object.assign({},Or.defaultOptions,t)}valid(t){return t.startsWith("<")}parse(t){if(!this.valid)return!1;return Lr(new kr(this.options).parseXml(t),this.options)}}function Dr(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return t.expand(e+(o/2+(i?function(t,e){return t?e:0}(i,e):0))),t}Or.defaultOptions={};let Wr=0;function Nr(){return Wr++}var Gr;function jr(t){const e=[];let i=0,o="";for(let n=0;n<t.length;n++)$r(t[n])?i?o+=t[n]:(i=1,o=t[n]):(i&&(e.push({text:o,direction:Gr.VERTICAL}),o="",i=0),e.push({text:t[n],direction:Gr.HORIZONTAL}));return o&&e.push({text:o,direction:Gr.VERTICAL}),e}!function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(Gr||(Gr={}));const Ur=new Map;["…","(",")","—","【","】","「","」","《","》"].forEach((t=>Ur.set(t,!0)));const Vr=new Map;function $r(t){if(Ur.has(t))return!0;if(Vr.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>Vr.set(t,!0)));const Yr=Nr(),Xr=Nr(),Kr=Nr(),Zr=Nr();Nr();const qr=Nr(),Jr=Nr(),Qr=Nr(),ts=Nr(),es=Nr();Nr();const is=Nr();Nr();const os=Nr(),ns=Nr(),rs=Nr(),ss=Symbol.for("GraphicService"),ls=Symbol.for("GraphicCreator"),as={"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"},hs=Object.keys(as);var ds;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(ds||(ds={}));let cs=class t extends Br{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=qr,this._childUpdateTag=mi.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 wn),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new wn)}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===bi.GLOBAL){const i=new ge(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&mi.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;zo.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),zo.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=po.x,y:e=po.y,dx:i=po.dx,dy:o=po.dy,scaleX:n=po.scaleX,scaleY:r=po.scaleY,angle:s=po.angle,postMatrix:l}=this.attribute;if(0!==t||0!==e||0!==i||0!==o||1!==n||1!==r||0!==s||l)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return _n(this).group}updateAABBBounds(t,e,i){const o=i;i=i.clone();const{width:n,height:r,path:s,clip:l=e.clip,display:a}=t;return s&&s.length?s.forEach((t=>{i.union(t.AABBBounds)})):null!=n&&null!=r&&i.set(0,0,Math.max(0,n),Math.max(0,r)),l||this.forEachChildren((t=>{i.union(t.AABBBounds)})),zo.graphicService.updateTempAABBBounds(i),zo.graphicService.transformAABBBounds(t,i,e,!1,this),o.copy(i),o}doUpdateAABBBounds(){this.updateAABBBoundsStamp++;const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=mi.CLEAR_BOUNDS,this._childUpdateTag&=mi.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=mi.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&mi.UPDATE_BOUNDS||(this._childUpdateTag|=mi.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(),zo.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),zo.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,zo.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.forEachChildren((e=>{zo.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),zo.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&mi.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let o=this._getChildByName(t);return o?o.setAttributes(e):(o=zo.graphicService.creator[i](e),o.name=t,this.add(o)),o}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function us(t){return new cs(t)}cs.NOWORK_ANIMATE_ATTR=Rr;class gs extends cs{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,o){var n;super({}),this.stage=t,this.global=e,this.window=i,this.main=o.main,this.layerHandler=o.layerHandler,this.layerHandler.init(this,i,{main:o.main,canvasId:o.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(n=o.zIndex)&&void 0!==n?n:0}),this.layer=this,this.subLayers=new Map,this.theme=new wn,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=>{zo.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=>{zo.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 ps=Symbol.for("TransformUtil"),fs=Symbol.for("GraphicUtil"),vs=Symbol.for("LayerService"),ms=Symbol.for("StaticLayerHandlerContribution"),bs=Symbol.for("DynamicLayerHandlerContribution"),Cs=Symbol.for("VirtualLayerHandlerContribution");var ys,ws=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},xs=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let _s=ys=class{static GenerateLayerId(){return`${ys.idprefix}_${ys.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=zo.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?Qo.get(ms):"dynamic"===t?Qo.get(bs):Qo.get(Cs),e}createLayer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{main:!1};var i;this.tryInit();let o=this.getRecommendedLayerType(e.layerMode);o=e.main||e.canvasId?"static":o;const n=this.getLayerHandler(o),r=new gs(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:o,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:ys.GenerateLayerId(),layerHandler:n})),s=this.layerMap.get(t)||[];return s.push(r),this.layerMap.set(t,s),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)}};_s.idprefix="visactor_layer",_s.prefix_count=0,_s=ys=ws([f(),xs("design:paramtypes",[])],_s);var Ss=new i((t=>{t(I).to(N).inSingletonScope(),t(ln).to(hn),t(fs).to(gn).inSingletonScope(),t(ps).to(vn).inSingletonScope(),t(vs).to(_s).inSingletonScope()}));function As(t,e){return!(!t&&!e)}function Rs(t,e){let i;return i=et(t)?t.some((t=>t||void 0===t)):!!t,i&&e>0}function Bs(t,e,i){return i&&t*e>0}function Ms(t,e,i,o,n){return n&&t*e>0&&0!==i&&0!==o}function Ts(t,e){return t*e>0}function Ps(t,e,i,o){return t*e>0&&0!==i&&0!==o}function Es(t,e,i,o,n,r,s){const l=t-i,a=e-o,h=(s?r:-r)/Math.sqrt(l*l+a*a),d=h*a,c=-h*l,u=t+d,g=e+c,p=i+d,f=o+c,v=(u+p)/2,m=(g+f)/2,b=p-u,C=f-g,y=b*b+C*C,w=n-r,x=u*f-p*g,_=(C<0?-1:1)*Math.sqrt(Math.max(0,w*w*y-x*x));let S=(x*C-b*_)/y,A=(-x*b-C*_)/y;const R=(x*C+b*_)/y,B=(-x*b+C*_)/y,M=S-v,T=A-m,P=R-v,E=B-m;return M*M+T*T>P*P+E*E&&(S=R,A=B),{cx:S,cy:A,x01:-d,y01:-c,x11:S*(n/w-1),y11:A*(n/w-1)}}function ks(t,e,i,o,n){const r=oe(i-e),s=t.getParsedCornerRadius(),l=et(s),{outerDeltaAngle:a,innerDeltaAngle:h,outerStartAngle:d,outerEndAngle:c,innerEndAngle:u,innerStartAngle:g}=t.getParsePadAngle(e,i),p=l?s[0]:s,f=l?s[1]:s,v=l?s[2]:s,m=l?s[3]:s,b=Math.max(f,p),C=Math.max(v,m);let y=b,w=C;const x=n*re(d),_=n*ae(d),S=o*re(u),A=o*ae(u);let R,B,M,T;if((C>Jt||b>Jt)&&(R=n*re(c),B=n*ae(c),M=o*re(g),T=o*ae(g),r<Qt)){const t=function(t,e,i,o,n,r,s,l){const a=i-t,h=o-e,d=s-n,c=l-r;let u=c*a-d*h;return u*u<Jt?[]:(u=(d*(e-r)-c*(t-n))/u,[t+u*a,e+u*h])}(x,_,M,T,R,B,S,A);if(t){const e=x-t[0],i=_-t[1],r=R-t[0],s=B-t[1],l=1/ae(((P=(e*r+i*s)/(he(e*e+i*i)*he(r*r+s*s)))>1?0:P<-1?Qt:Math.acos(P))/2),a=he(t[0]*t[0]+t[1]*t[1]);w=le(C,(o-a)/(l-1)),y=le(b,(n-a)/(l+1))}}var P;return{outerDeltaAngle:a,xors:x,yors:_,xirs:M,yirs:T,xore:R,yore:B,xire:S,yire:A,limitedOcr:y,limitedIcr:w,outerCornerRadiusStart:p,outerCornerRadiusEnd:f,maxOuterCornerRadius:b,maxInnerCornerRadius:C,outerStartAngle:d,outerEndAngle:c,innerDeltaAngle:h,innerEndAngle:u,innerStartAngle:g,innerCornerRadiusStart:m,innerCornerRadiusEnd:v}}function Ls(t,e,i,o,n,r,s){const{startAngle:l,endAngle:a}=t.getParsedAngle(),h=oe(a-l),d=a>l;let c=!1;if(n<r){const t=n;n=r,r=t}if(n<=Jt)e.moveTo(i,o);else if(h>=ie-Jt)e.moveTo(i+n*re(l),o+n*ae(l)),e.arc(i,o,n,l,a,!d),r>Jt&&(e.moveTo(i+r*re(a),o+r*ae(a)),e.arc(i,o,r,a,l,d));else{const{outerDeltaAngle:h,xors:u,yors:g,xirs:p,yirs:f,limitedOcr:v,outerCornerRadiusStart:m,outerCornerRadiusEnd:b,maxOuterCornerRadius:C,xore:y,yore:w,xire:x,yire:_,outerStartAngle:S,outerEndAngle:A,limitedIcr:R,innerDeltaAngle:B,innerEndAngle:M,innerStartAngle:T,innerCornerRadiusStart:P,innerCornerRadiusEnd:E,maxInnerCornerRadius:k}=ks(t,l,a,r,n);if(h<.001)s&&(s[3]||s[1])&&e.moveTo(i+u,o+g),c=!0;else if(v>Jt){const t=le(m,v),r=le(b,v),l=Es(p,f,u,g,n,t,Number(d)),a=Es(y,w,x,_,n,r,Number(d));v<C&&t===r?!s||s[0]?(e.moveTo(i+l.cx+l.x01,o+l.cy+l.y01),e.arc(i+l.cx,o+l.cy,v,ne(l.y01,l.x01),ne(a.y01,a.x01),!d)):e.moveTo(i+l.cx+v*re(ne(a.y01,a.x01)),o+l.cy+v*ae(ne(a.y01,a.x01))):!s||s[0]?(e.moveTo(i+l.cx+l.x01,o+l.cy+l.y01),t>0&&e.arc(i+l.cx,o+l.cy,t,ne(l.y01,l.x01),ne(l.y11,l.x11),!d),e.arc(i,o,n,ne(l.cy+l.y11,l.cx+l.x11),ne(a.cy+a.y11,a.cx+a.x11),!d),r>0&&e.arc(i+a.cx,o+a.cy,r,ne(a.y11,a.x11),ne(a.y01,a.x01),!d)):r>0?e.moveTo(i+a.cx+r*re(ne(a.y01,a.x01)),o+a.cy+r*ae(ne(a.y01,a.x01))):e.moveTo(i+y,o+n*ae(A))}else!s||s[0]?(e.moveTo(i+u,o+g),e.arc(i,o,n,S,A,!d)):e.moveTo(i+n*re(A),o+n*ae(A));if(!(r>Jt)||B<.001)!s||s[1]?e.lineTo(i+x,o+_):e.moveTo(i+x,o+_),c=!0;else if(R>Jt){const t=le(P,R),n=le(E,R),l=Es(x,_,y,w,r,-n,Number(d)),a=Es(u,g,p,f,r,-t,Number(d));if(!s||s[1]?e.lineTo(i+l.cx+l.x01,o+l.cy+l.y01):e.moveTo(i+l.cx+l.x01,o+l.cy+l.y01),R<k&&t===n){const t=ne(a.y01,a.x01);!s||s[2]?e.arc(i+l.cx,o+l.cy,R,ne(l.y01,l.x01),t,!d):e.moveTo(i+l.cx+re(t),o+l.cy+ae(t))}else!s||s[2]?(n>0&&e.arc(i+l.cx,o+l.cy,n,ne(l.y01,l.x01),ne(l.y11,l.x11),!d),e.arc(i,o,r,ne(l.cy+l.y11,l.cx+l.x11),ne(a.cy+a.y11,a.cx+a.x11),d),t>0&&e.arc(i+a.cx,o+a.cy,t,ne(a.y11,a.x11),ne(a.y01,a.x01),!d)):t>0?e.moveTo(i+a.cx+t*re(ne(a.y01,a.x01)),o+a.cy+t*ae(ne(a.y01,a.x01))):e.moveTo(i+p,o+f)}else!s||s[1]?e.lineTo(i+x,o+_):e.moveTo(i+x,o+_),!s||s[2]?e.arc(i,o,r,M,T,d):e.moveTo(i+r*re(T),o+r*ae(T))}return s?s[3]&&e.lineTo(i+n*re(l),o+n*ae(l)):e.closePath(),c}class Hs{static GetCanvas(){try{return Hs.canvas||(Hs.canvas=zo.global.createCanvas({})),Hs.canvas}catch(t){return null}}static GetCtx(){if(!Hs.ctx){const t=Hs.GetCanvas();Hs.ctx=t.getContext("2d")}return Hs.ctx}}class Fs extends ze{static getInstance(){return Fs._instance||(Fs._instance=new Fs),Fs._instance}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=Hs.GetCanvas(),o=Hs.GetCtx();if(i.width=e,i.height=1,!o)return;if(o.translate(0,0),!o)throw new Error("获取ctx发生错误");const n=o.createLinearGradient(0,0,e,0);t.forEach((t=>{n.addColorStop(t[0],t[1])})),o.fillStyle=n,o.fillRect(0,0,e,1),this.rgbaSet=o.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:100,s=`${t}${e}${i}${o}`;n.forEach((t=>s+=t.join())),s+=r;let l=this.dataMap.get(s);return l||(l={data:new Fs(n,r),timestamp:[]},this.addLimitedTimestamp(l,Date.now(),{}),this.dataMap.set(s,l)),this.clearCache(this.dataMap,this.cacheParams),l.data}}class zs{static GetSize(t){for(let e=0;e<zs.ImageSize.length;e++)if(zs.ImageSize[e]>=t)return zs.ImageSize[e];return t}static Get(t,e,i,o,n,r,s){const l=zs.GenKey(t,e,i,o,n),a=zs.cache[l];if(!a||0===a.length)return null;for(let t=0;t<a.length;t++)if(a[t].width>=r&&a[t].height>=s)return a[t].pattern;return null}static Set(t,e,i,o,n,r,s,l){const a=zs.GenKey(t,e,i,o,n);zs.cache[a]?zs.cache[a].push({width:s,height:l,pattern:r}):zs.cache[a]=[{width:s,height:l,pattern:r}]}static GenKey(t,e,i,o,n){return`${e},${i},${o},${n},${t.join()}`}}zs.cache={},zs.ImageSize=[20,40,80,160,320,640,1280,2560];const Is=Symbol.for("ArcRenderContribution"),Os=Symbol.for("AreaRenderContribution"),Ds=Symbol.for("CircleRenderContribution"),Ws=Symbol.for("GroupRenderContribution"),Ns=Symbol.for("ImageRenderContribution"),Gs=Symbol.for("PathRenderContribution"),js=Symbol.for("PolygonRenderContribution"),Us=Symbol.for("RectRenderContribution"),Vs=Symbol.for("SymbolRenderContribution"),$s=Symbol.for("TextRenderContribution"),Ys=Symbol.for("InteractiveSubRenderContribution");function Xs(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Ks(t,e,i){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?(arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function Zs(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 qs(t,e,i){const o=i[0],n=i[1],r=i[2];let s,l,a,h,d,c,u,g,p,f,v,m;return e===t?(t[12]=e[0]*o+e[4]*n+e[8]*r+e[12],t[13]=e[1]*o+e[5]*n+e[9]*r+e[13],t[14]=e[2]*o+e[6]*n+e[10]*r+e[14],t[15]=e[3]*o+e[7]*n+e[11]*r+e[15]):(s=e[0],l=e[1],a=e[2],h=e[3],d=e[4],c=e[5],u=e[6],g=e[7],p=e[8],f=e[9],v=e[10],m=e[11],t[0]=s,t[1]=l,t[2]=a,t[3]=h,t[4]=d,t[5]=c,t[6]=u,t[7]=g,t[8]=p,t[9]=f,t[10]=v,t[11]=m,t[12]=s*o+d*n+p*r+e[12],t[13]=l*o+c*n+f*r+e[13],t[14]=a*o+u*n+v*r+e[14],t[15]=h*o+g*n+m*r+e[15]),t}function Js(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function Qs(t,e,i){const o=e[0],n=e[1],r=e[2],s=e[3],l=e[4],a=e[5],h=e[6],d=e[7],c=e[8],u=e[9],g=e[10],p=e[11],f=e[12],v=e[13],m=e[14],b=e[15];let C=i[0],y=i[1],w=i[2],x=i[3];return t[0]=C*o+y*l+w*c+x*f,t[1]=C*n+y*a+w*u+x*v,t[2]=C*r+y*h+w*g+x*m,t[3]=C*s+y*d+w*p+x*b,C=i[4],y=i[5],w=i[6],x=i[7],t[4]=C*o+y*l+w*c+x*f,t[5]=C*n+y*a+w*u+x*v,t[6]=C*r+y*h+w*g+x*m,t[7]=C*s+y*d+w*p+x*b,C=i[8],y=i[9],w=i[10],x=i[11],t[8]=C*o+y*l+w*c+x*f,t[9]=C*n+y*a+w*u+x*v,t[10]=C*r+y*h+w*g+x*m,t[11]=C*s+y*d+w*p+x*b,C=i[12],y=i[13],w=i[14],x=i[15],t[12]=C*o+y*l+w*c+x*f,t[13]=C*n+y*a+w*u+x*v,t[14]=C*r+y*h+w*g+x*m,t[15]=C*s+y*d+w*p+x*b,t}function tl(t,e,i){const o=e[0],n=e[1],r=e[2];let s=i[3]*o+i[7]*n+i[11]*r+i[15];return s=s||1,t[0]=(i[0]*o+i[4]*n+i[8]*r+i[12])/s,t[1]=(i[1]*o+i[5]*n+i[9]*r+i[13])/s,t[2]=(i[2]*o+i[6]*n+i[10]*r+i[14])/s,t}class el{constructor(){this.pools=[]}static identity(t){return Zs(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 el.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 il=new class{constructor(){this.pools=[]}allocate(t,e,i,o,n,r){if(!this.pools.length)return new Fe(t,e,i,o,n,r);const s=this.pools.pop();return s.a=t,s.b=e,s.c=i,s.d=o,s.e=n,s.f=r,s}allocateByObj(t){if(!this.pools.length)return new Fe(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=[]}},ol=new el;var nl=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},rl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},sl=function(t,e){return function(i,o){e(i,o,t)}};function ll(t,e,i){var o;const{x:n=i.x,y:r=i.y,z:s=i.z,dx:l=i.dx,dy:a=i.dy,dz:h=i.dz,scaleX:d=i.scaleX,scaleY:c=i.scaleY,scaleZ:u=i.scaleZ,alpha:g=i.alpha,beta:p=i.beta,angle:f=i.angle,anchor3d:v=e.attribute.anchor,anchor:m}=e.attribute,b=[0,0,0];if(v){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;b[0]=i.x1+(i.x2-i.x1)*t}else b[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;b[1]=i.x1+(i.x2-i.x1)*t}else b[1]=v[1];b[2]=null!==(o=v[2])&&void 0!==o?o:0}if(Zs(t),qs(t,t,[n+l,r+a,s+h]),qs(t,t,[b[0],b[1],b[2]]),function(t,e,i){const o=Math.sin(i),n=Math.cos(i),r=e[4],s=e[5],l=e[6],a=e[7],h=e[8],d=e[9],c=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*n+h*o,t[5]=s*n+d*o,t[6]=l*n+c*o,t[7]=a*n+u*o,t[8]=h*n-r*o,t[9]=d*n-s*o,t[10]=c*n-l*o,t[11]=u*n-a*o}(t,t,p),function(t,e,i){const o=Math.sin(i),n=Math.cos(i),r=e[0],s=e[1],l=e[2],a=e[3],h=e[8],d=e[9],c=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*n-h*o,t[1]=s*n-d*o,t[2]=l*n-c*o,t[3]=a*n-u*o,t[8]=r*o+h*n,t[9]=s*o+d*n,t[10]=l*o+c*n,t[11]=a*o+u*n}(t,t,g),qs(t,t,[-b[0],-b[1],b[2]]),function(t,e,i){const o=i[0],n=i[1],r=i[2];t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t[3]=e[3]*o,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,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,[d,c,u]),f){const i=ol.allocate(),o=[0,0];if(m){if("string"==typeof v[0]){const t=parseFloat(v[0])/100,i=e.AABBBounds;o[0]=i.x1+(i.x2-i.x1)*t}else o[0]=v[0];if("string"==typeof v[1]){const t=parseFloat(v[1])/100,i=e.AABBBounds;o[1]=i.x1+(i.x2-i.x1)*t}else o[1]=v[1]}qs(i,i,[o[0],o[1],0]),function(t,e,i){const o=Math.sin(i),n=Math.cos(i),r=e[0],s=e[1],l=e[2],a=e[3],h=e[4],d=e[5],c=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*n+h*o,t[1]=s*n+d*o,t[2]=l*n+c*o,t[3]=a*n+u*o,t[4]=h*n-r*o,t[5]=d*n-s*o,t[6]=c*n-l*o,t[7]=u*n-a*o}(i,i,f),qs(i,i,[-o[0],-o[1],0]),Qs(t,t,i)}}let al=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new F(["graphic"]),onSetStage:new F(["graphic","stage"]),onRemove:new F(["graphic"]),onRelease:new F(["graphic"]),onAddIncremental:new F(["graphic","group","stage"]),onClearIncremental:new F(["graphic","group","stage"]),beforeUpdateAABBBounds:new F(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new F(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"]),clearAABBBounds:new F(["graphic","stage","aabbBounds"])},this.tempAABBBounds1=new Le,this.tempAABBBounds2=new Le}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,o){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,o)}afterUpdateAABBBounds(t,e,i,o,n){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,o,n)}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 o=new Je(t);return Ti(i.commandList,o,0,0),!0}updateHTMLTextAABBBounds(t,e,i,o){const{textAlign:n,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=nt(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),o=Ks(r,e,e);i.set(i.x1,o,i.x2,o+e)}if(null!=t.forceBoundsWidth){const e=nt(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),o=Xs(n,e);i.set(o,i.y1,o+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,o,n){if(!e.empty()){const{scaleX:n=i.scaleX,scaleY:r=i.scaleY,stroke:s=i.stroke,shadowBlur:l=i.shadowBlur,lineWidth:a=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:d=i.strokeBoundsBuffer}=t,c=this.tempAABBBounds1,u=this.tempAABBBounds2;if(s&&a){Dr(c,(a+h)/Math.abs(n+r),o,d),e.union(c),c.setValue(u.x1,u.y1,u.x2,u.y2)}if(l){const{shadowOffsetX:o=i.shadowOffsetX,shadowOffsetY:s=i.shadowOffsetY}=t;Dr(c,l/Math.abs(n+r)*2,!1,d+1),c.translate(o,s),e.union(c)}}if(this.combindShadowAABBBounds(e,n),e.empty())return;let r=!0;const s=n.transMatrix;n&&n.isContainer&&(r=!(1===s.a&&0===s.b&&0===s.c&&1===s.d&&0===s.e&&0===s.f)),r&&Ee(e,e,s)}validCheck(t,e,i,o){if(!o)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(o.shadowRoot||o.isContainer)return!0;const{visible:n=e.visible}=t;return!(!o.valid||!n)||(i.empty()||(o.parent&&i.transformWithMatrix(o.parent.globalTransMatrix),zo.graphicService.clearAABBBounds(o,o.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}}};al=nl([f(),sl(0,g(ls)),rl("design:paramtypes",[Object])],al);const hl={x:0,y:0,z:0,lastModelMatrix:null};class dl{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===Ai.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===Ai.afterFillStroke)))}beforeRenderStep(t,e,i,o,n,r,s,l,a,h,d,c,u){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((g=>{g.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(g.supportedAppName)?g.supportedAppName:[g.supportedAppName]).includes(t.stage.params.context.appName)||g.drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u)}))}afterRenderStep(t,e,i,o,n,r,s,l,a,h,d,c,u){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((g=>{g.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(g.supportedAppName)?g.supportedAppName:[g.supportedAppName]).includes(t.stage.params.context.appName)||g.drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u)}))}valid(t,e,i,o){const{fill:n=e.fill,background:r,stroke:s=e.stroke,opacity:l=e.opacity,fillOpacity:a=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:d=e.strokeOpacity,visible:c=e.visible}=t.attribute,u=Bs(l,a,n),g=Ts(l,d),p=As(n,r),f=Rs(s,h);return!(!t.valid||!c)&&!(!p&&!f)&&!!(u||g||i||o||r)&&{fVisible:u,sVisible:g,doFill:p,doStroke:f}}transform(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{x:n=e.x,y:r=e.y,z:s=e.z,scaleX:l=e.scaleX,scaleY:a=e.scaleY,angle:h=e.angle,postMatrix:d}=t.attribute,c=i.modelMatrix,u=i.camera;hl.x=n,hl.y=r,hl.z=s,hl.lastModelMatrix=c;const g=u&&(o||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),p=g?t.transMatrix.onlyTranslate()&&!d:1===l&&1===a&&0===h&&!d;if(g){const o=ol.allocate(),n=ol.allocate();ll(n,t,e),Qs(o,c||o,n),hl.x=0,hl.y=0,hl.z=0,i.modelMatrix=o,i.setTransform(1,0,0,1,0,0,!0),ol.free(n)}if(p&&!c){const o=t.getOffsetXY(e);hl.x+=o.x,hl.y+=o.y,hl.z=s,i.setTransformForCurrent()}else if(g)hl.x=0,hl.y=0,hl.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const o=t.getOffsetXY(e);hl.x+=o.x,hl.y+=o.y,this.transformWithoutTranslate(i,hl.x,hl.y,hl.z,l,a,h)}else i.transformFromMatrix(t.transMatrix,!0),hl.x=0,hl.y=0,hl.z=0;return hl}transformUseContext2d(t,e,i,o){const n=o.camera;if(this.camera=n,n){const e=t.AABBBounds,n=e.x2-e.x1,r=e.y2-e.y1,s=o.project(0,0,i),l=o.project(n,0,i),a=o.project(n,r,i),h={x:0,y:0},d={x:n,y:0},c={x:n,y:r};o.camera=null;const u=1/(h.x*(c.y-d.y)-d.x*c.y+c.x*d.y+(d.x-c.x)*h.y),g=-(h.y*(a.x-l.x)-d.y*a.x+c.y*l.x+(d.y-c.y)*s.x)*u,p=(d.y*a.y+h.y*(l.y-a.y)-c.y*l.y+(c.y-d.y)*s.y)*u,f=(h.x*(a.x-l.x)-d.x*a.x+c.x*l.x+(d.x-c.x)*s.x)*u,v=-(d.x*a.y+h.x*(l.y-a.y)-c.x*l.y+(c.x-d.x)*s.y)*u,m=(h.x*(c.y*l.x-d.y*a.x)+h.y*(d.x*a.x-c.x*l.x)+(c.x*d.y-d.x*c.y)*s.x)*u,b=(h.x*(c.y*l.y-d.y*a.y)+h.y*(d.x*a.y-c.x*l.y)+(c.x*d.y-d.x*c.y)*s.y)*u;o.setTransform(g,p,f,v,m,b,!0)}}restoreTransformUseContext2d(t,e,i,o){this.camera&&(o.camera=this.camera)}transformWithoutTranslate(t,e,i,o,n,r,s){const l=t.project(e,i,o);t.translate(l.x,l.y,!1),t.scale(n,r,!1),t.rotate(s,!1),t.translate(-l.x,-l.y,!1),t.setTransformForCurrent()}_draw(t,e,i,o,n){const{context:r}=o;if(!r)return;const{renderable:s}=t.attribute;if(!1===s)return;r.highPerformanceSave();const l=this.transform(t,e,r,i),{x:a,y:h,z:d,lastModelMatrix:c}=l;this.z=d,function(t,e,i,o,n,r,s,l){if(!t.pathProxy)return!1;const a=_n(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:h=a.fill,stroke:d=a.stroke,opacity:c=a.opacity,fillOpacity:u=a.fillOpacity,lineWidth:g=a.lineWidth,strokeOpacity:p=a.strokeOpacity,visible:f=a.visible,x:v=a.x,y:m=a.y}=t.attribute,b=Bs(c,u,h),C=Ts(c,p),y=As(h),w=Rs(d,g);return!f||(!y&&!w||(!(b||C||s||l)||(e.beginPath(),Ti(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,o),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),w&&(l?l(e,t.attribute,a):C&&(e.setStrokeStyle(t,t.attribute,i-v,o-m,a),e.stroke())),y&&(s?s(e,t.attribute,a):b&&(e.setCommonStyle(t,t.attribute,i-v,o-m,a),e.fill())),!0)))}(t,r,a,h,0,n)||(this.drawShape(t,r,a,h,o,n),this.z=0,r.modelMatrix!==c&&ol.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}}const cl=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 o(){return n("linear",t.linearGradient,r)||n("radial",t.radialGradient,l)||n("conic",t.conicGradient,s)}function n(e,o,n){return function(o,r){const s=m(o);if(s){m(t.startCall)||i("Missing (");const o=function(o){const r=n();return r&&(m(t.comma)||i("Missing comma before color stops")),{type:e,orientation:r,colorStops:u(g)}}();return m(t.endCall)||i("Missing )"),o}}(o)}function r(){return v("directional",t.sideOrCorner,1)||v("angular",t.angleValue,1)}function s(){return v("angular",t.fromAngleValue,1)}function l(){let i,o,n=a();return n&&(i=[],i.push(n),o=e,m(t.comma)&&(n=a(),n?i.push(n):e=o)),i}function a(){let t=function(){const t=v("shape",/^(circle)/i,0);return t&&(t.style=f()||h()),t}()||function(){const t=v("shape",/^(ellipse)/i,0);return t&&(t.style=p()||h()),t}();if(t)t.at=d();else{const e=h();if(e){t=e;const i=d();i&&(t.at=i)}else{const e=c();e&&(t={type:"default-radial",at:e})}}return t}function h(){return v("extent-keyword",t.extentKeywords,1)}function d(){if(v("position",/^at/,0)){const t=c();return t||i("Missing positioning value"),t}}function c(){const t={x:p(),y:p()};if(t.x||t.y)return{type:"position",value:t}}function u(e){let o=e();const n=[];if(o)for(n.push(o);m(t.comma);)o=e(),o?n.push(o):i("One extra comma");return n}function g(){const e=v("hex",t.hexColor,1)||v("rgba",t.rgbaColor,1)||v("rgb",t.rgbColor,1)||v("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=p(),e}function p(){return v("%",t.percentageValue,1)||v("position-keyword",t.positionKeywords,1)||f()}function f(){return v("px",t.pixelValue,1)||v("em",t.emValue,1)}function v(t,e,i){const o=m(e);if(o)return{type:t,value:o[i]}}function m(t){const i=/^[\n\r\t\s]+/.exec(e);i&&b(i[0].length);const o=t.exec(e);return o&&b(o[0].length),o}function b(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=u(o);return e.length>0&&i("Invalid input not EOF"),t}()}}();class ul{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(ul.IsGradientStr(t))try{const e=cl(t)[0];if(e){if("linear"===e.type)return ul.ParseLinear(e);if("radial"===e.type)return ul.ParseRadial(e);if("conic"===e.type)return ul.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,o=Qt/2,n=parseFloat(e.value)/180*Qt-o;return{gradient:"conical",x:.5,y:.5,startAngle:n,endAngle:n+ie,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,o=Qt/2;let n="angular"===e.type?parseFloat(e.value)/180*Qt:0;for(;n<0;)n+=ie;for(;n>ie;)n-=ie;let r=0,s=0,l=0,a=0;return n<o?(r=0,s=1,l=Math.sin(n),a=Math.cos(n)):n<Qt?(r=0,s=0,l=Math.cos(n-o),a=Math.sin(n-o)):n<Qt+o?(r=1,s=0,l=r-Math.sin(n-Qt),a=Math.cos(n-Qt)):(r=1,l=r-Math.cos(n-o-Qt),a-=Math.sin(n-o-Qt)),{gradient:"linear",x0:r,y0:s,x1:l,y1:a,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function gl(t,e,i){let o=e;const{a:n,b:r,c:s,d:l}=t.currentMatrix,a=Math.sign(n)*Math.sqrt(n*n+r*r),h=Math.sign(l)*Math.sqrt(s*s+l*l);return a+h===0?0:(o=o/Math.abs(a+h)*2*i,o)}function pl(t,e,i){let o,n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!e||!0===e)return"black";if(et(e))for(let t=0;t<e.length&&(n=e[t],!n);t++);else n=e;if(n=ul.Parse(n),"string"==typeof n)return n;if(i.AABBBounds&&(!i.attribute||0!==i.attribute.scaleX||0!==i.attribute.scaleY)){const e=i.AABBBounds;let l=e.x2-e.x1,a=e.y2-e.y1,h=e.x1-r,d=e.y1-s;if(i.attribute){const{scaleX:t=1,scaleY:e=1}=i.attribute;l/=t,a/=e,h/=t,d/=e}"linear"===n.gradient?o=function(t,e,i,o,n,r){var s,l,a,h;const d=t.createLinearGradient(i+(null!==(s=e.x0)&&void 0!==s?s:0)*n,o+(null!==(l=e.y0)&&void 0!==l?l:0)*r,i+(null!==(a=e.x1)&&void 0!==a?a:1)*n,o+(null!==(h=e.y1)&&void 0!==h?h:0)*r);return e.stops.forEach((t=>{d.addColorStop(t.offset,t.color)})),d}(t,n,h,d,l,a):"conical"===n.gradient?o=function(t,e,i,o,n,r){var s,l;const a=t.createConicGradient(i+(null!==(s=e.x)&&void 0!==s?s:0)*n,o+(null!==(l=e.y)&&void 0!==l?l:0)*r,e.startAngle,e.endAngle);return e.stops.forEach((t=>{a.addColorStop(t.offset,t.color)})),a.GetPattern(n+i,r+o,void 0)}(t,n,h,d,l,a):"radial"===n.gradient&&(o=function(t,e,i,o,n,r){var s,l,a,h,d,c;const u=t.createRadialGradient(i+(null!==(s=e.x0)&&void 0!==s?s:.5)*n,o+(null!==(l=e.y0)&&void 0!==l?l:.5)*r,Math.max(n,r)*(null!==(a=e.r0)&&void 0!==a?a:0),i+(null!==(h=e.x1)&&void 0!==h?h:.5)*n,o+(null!==(d=e.y1)&&void 0!==d?d:.5)*r,Math.max(n,r)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,n,h,d,l,a))}return o||"orange"}var fl=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},vl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ml=function(t,e){return function(i,o){e(i,o,t)}};class bl{constructor(){this.time=Ai.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g;const{background:p,backgroundOpacity:f=(null!==(g=t.attribute.fillOpacity)&&void 0!==g?g:a.backgroundOpacity),opacity:v=a.opacity,backgroundMode:m=a.backgroundMode,backgroundFit:b=a.backgroundFit}=t.attribute;if(p)if(t.backgroundImg&&t.resources){const n=t.resources.get(p);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=_n(t.parent).group,{scrollX:o=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(o,n)}e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,o,a),e.globalAlpha=f*v,this.doDrawImage(e,n.data,r,m,b),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,o,a),e.globalAlpha=f*v,e.fillStyle=p,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,o,n){if("no-repeat"===o)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const r=i.width(),s=i.height();let l=r,a=s;if(n&&"repeat"!==o&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===o?(l=i*(s/n),a=s):"repeat-y"===o&&(a=n*(r/i),l=r);const h=t.dpr,d=nn.allocate({width:l,height:a,dpr:h}),c=d.getContext("2d");c&&(c.inuse=!0,c.clearMatrix(),c.setTransformForCurrent(!0),c.clearRect(0,0,l,a),c.drawImage(e,0,0,l,a),e=d.nativeCanvas),nn.free(d)}const h=t.dpr,d=t.createPattern(e,o);d.setTransform&&d.setTransform(new DOMMatrix([1/h,0,0,1/h,0,0])),t.fillStyle=d,t.translate(i.x1,i.y1),t.fillRect(0,0,r,s),t.translate(-i.x1,-i.y1)}}}const Cl=new bl;let yl=class{constructor(t){this.subRenderContribitions=t,this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((g=>{g.render(t,e,i,o,n,r,s,l,a,h,d,c,u)}))}};yl=fl([f(),ml(0,g(E)),ml(0,v(Ys)),vl("design:paramtypes",[Object])],yl);class wl{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,o,n){const r=(t-2*e)/2,s=o.dpr,l=nn.allocate({width:t,height:t,dpr:s}),a=l.getContext("2d");if(!a)return null;a.inuse=!0,a.clearMatrix(),a.setTransformForCurrent(!0),a.clearRect(0,0,t,t),n(r,a);const h=o.createPattern(l.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/s,0,0,1/s,0,0])),nn.free(l),h}createCirclePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,ie),e.fill()}))}createDiamondPattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((e,o)=>{const n=t/2,r=n;o.fillStyle=i,o.moveTo(n,r-e),o.lineTo(e+n,r),o.lineTo(n,r+e),o.lineTo(n-e,r),o.closePath(),o.fill()}))}createRectPattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((t,o)=>{const n=e,r=n;o.fillStyle=i,o.fillRect(n,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((o,n)=>{const r=e;n.fillStyle=i,n.fillRect(r,0,2*o,t)}))}createHorizontalLinePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((o,n)=>{const r=e;n.fillStyle=i,n.fillRect(0,r,t,2*o)}))}createBiasLRLinePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((e,o)=>{o.strokeStyle=i,o.lineWidth=e,o.moveTo(0,0),o.lineTo(t,t);const n=t/2,r=-n;o.moveTo(n,r),o.lineTo(n+t,r+t),o.moveTo(-n,-r),o.lineTo(-n+t,-r+t),o.stroke()}))}createBiasRLLinePattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((e,o)=>{o.strokeStyle=i,o.lineWidth=e,o.moveTo(t,0),o.lineTo(0,t);const n=t/2,r=n;o.moveTo(t+n,r),o.lineTo(n,r+t),o.moveTo(t-n,-r),o.lineTo(-n,-r+t),o.stroke()}))}createGridPattern(t,e,i,o){return this.createCommonPattern(t,e,i,o,((t,o)=>{const n=e,r=n;o.fillStyle=i,o.fillRect(n,r,t,t),o.fillRect(n+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:g=a.texture,textureColor:p=a.textureColor,textureSize:f=a.textureSize,texturePadding:v=a.texturePadding}=t.attribute;g&&this.drawTexture(g,t,e,i,o,a,p,f,v)}drawTexture(t,e,i,o,n,r,s,l,a){let h=this.textureMap.get(t);if(!h)switch(t){case"circle":h=this.createCirclePattern(l,a,s,i);break;case"diamond":h=this.createDiamondPattern(l,a,s,i);break;case"rect":h=this.createRectPattern(l,a,s,i);break;case"vertical-line":h=this.createVerticalLinePattern(l,a,s,i);break;case"horizontal-line":h=this.createHorizontalLinePattern(l,a,s,i);break;case"bias-lr":h=this.createBiasLRLinePattern(l,a,s,i);break;case"bias-rl":h=this.createBiasRLLinePattern(l,a,s,i);break;case"grid":h=this.createGridPattern(l,a,s,i)}h&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,o,n,r),i.fillStyle=h,i.fill(),i.highPerformanceRestore())}}const xl=new wl;const _l=new class{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{outerBorder:u,innerBorder:g}=t.attribute,p=u&&!1!==u.visible,f=g&&!1!==g.visible;if(!p&&!f)return;const{innerPadding:v=a.innerPadding,outerPadding:m=a.outerPadding,startAngle:b=a.startAngle,endAngle:C=a.endAngle,opacity:y=a.opacity,x:w=a.x,y:x=a.y,scaleX:_=a.scaleX,scaleY:S=a.scaleY}=t.attribute;let{innerRadius:A=a.innerRadius,outerRadius:R=a.outerRadius}=t.attribute;R+=m,A-=v;const B=(n,r)=>{const s=!(!n||!n.stroke),{distance:l=a[r].distance}=n,h=gl(e,l,e.dpr),d=l/R,u="outerBorder"===r?1:-1;if(t.setAttributes({outerRadius:R+u*h,innerRadius:A-u*h,startAngle:b-u*d,endAngle:C+u*d}),e.beginPath(),Ls(t,e,i,o,R+u*h,A-u*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),c)c(e,n,a[r]);else if(s){const s=a[r].opacity;a[r].opacity=y,e.setStrokeStyle(t,n,(w-i)/_,(x-o)/S,a[r]),a[r].opacity=s,e.stroke()}};p&&B(u,"outerBorder"),f&&B(g,"innerBorder"),t.setAttributes({outerRadius:R,innerRadius:A,startAngle:b,endAngle:C})}},Sl=xl,Al=Cl;const Rl=new class{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{outerBorder:u,innerBorder:g}=t.attribute,p=u&&!1!==u.visible,f=g&&!1!==g.visible;if(!p&&!f)return;const{radius:v=a.radius,startAngle:m=a.startAngle,endAngle:b=a.endAngle,opacity:C=a.opacity,x:y=a.x,y:w=a.y,scaleX:x=a.scaleX,scaleY:_=a.scaleY}=t.attribute,S=(n,r)=>{const s=!(!n||!n.stroke),{distance:l=a[r].distance}=n,h=gl(e,l,e.dpr),d="outerBorder"===r?1:-1;if(e.beginPath(),e.arc(i,o,v+d*h,m,b),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),c)c(e,n,a[r]);else if(s){const s=a[r].opacity;a[r].opacity=C,e.setStrokeStyle(t,n,(y-i)/x,(w-o)/_,a[r]),a[r].opacity=s,e.stroke()}};p&&S(u,"outerBorder"),f&&S(g,"innerBorder")}},Bl=xl,Ml=Cl;const Tl=new class extends bl{constructor(){super(...arguments),this.time=Ai.beforeFillStroke}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{background:u,backgroundMode:g=a.backgroundMode,backgroundFit:p=a.backgroundFit}=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 o=t.AABBBounds;this.doDrawImage(e,i.data,o,g,p),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=u,e.fill(),e.highPerformanceRestore()}},Pl=Qt/2;function El(t,e,i,o,n,r,s){let l;if(o<0&&(e+=o,o=-o),n<0&&(i+=n,n=-n),nt(r,!0))l=[r=oe(r),r,r,r];else if(Array.isArray(r)){const t=r;let e,i;switch(t.length){case 0:l=[0,0,0,0];break;case 1:e=oe(t[0]),l=[e,e,e,e];break;case 2:case 3:e=oe(t[0]),i=oe(t[1]),l=[e,i,e,i];break;default:l=t,l[0]=oe(l[0]),l[1]=oe(l[1]),l[2]=oe(l[2]),l[3]=oe(l[3])}}else l=[0,0,0,0];if(o<0||l[0]+l[1]+l[2]+l[3]<1e-12)return t.rect(e,i,o,n);const[a,h,d,c]=[[e,i],[e+o,i],[e+o,i+n],[e,i+n]],u=Math.min(o/2,n/2),g=[Math.min(u,l[0]),Math.min(u,l[1]),Math.min(u,l[2]),Math.min(u,l[3])],p=[a[0]+g[0],a[1]],f=[a[0],a[1]+g[0]],v=[h[0]-g[1],h[1]],m=[h[0],h[1]+g[1]],b=[d[0]-g[2],d[1]],C=[d[0],d[1]-g[2]],y=[c[0]+g[3],c[1]],w=[c[0],c[1]-g[3]];if(t.moveTo(p[0],p[1]),s&&s[0]?s[0](p[0],p[1],v[0],v[1]):t.lineTo(v[0],v[1]),!Pt(v,m)){s&&s[0]&&t.moveTo(v[0],v[1]);const e=v[0],i=v[1]+g[1];t.arc(e,i,g[1],-Pl,0,!1)}if(s&&s[1]?s[1](m[0],m[1],C[0],C[1]):t.lineTo(C[0],C[1]),!Pt(b,C)){const e=C[0]-g[2],i=C[1];s&&s[1]&&t.moveTo(C[0],C[1]),t.arc(e,i,g[2],0,Pl,!1)}if(s&&s[2]?s[2](b[0],b[1],y[0],y[1]):t.lineTo(y[0],y[1]),!Pt(y,w)){const e=y[0],i=y[1]-g[3];s&&s[2]&&t.moveTo(y[0],y[1]),t.arc(e,i,g[3],Pl,Qt,!1)}if(s&&s[3]?s[3](w[0],w[1],f[0],f[1]):t.lineTo(f[0],f[1]),!Pt(p,f)){const e=p[0],i=p[1]+g[0];s&&s[3]&&t.moveTo(f[0],f[1]),t.arc(e,i,g[0],Qt,Qt+Pl,!1)}return!s&&t.closePath(),t}var kl=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class Ll{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{outerBorder:u,innerBorder:g}=t.attribute,p=u&&!1!==u.visible,f=g&&!1!==g.visible;if(!p&&!f)return;const{cornerRadius:v=a.cornerRadius,opacity:m=a.opacity,x:b=a.x,y:C=a.y,scaleX:y=a.scaleX,scaleY:w=a.scaleY,x1:x,y1:_}=t.attribute;let{width:S,height:A}=t.attribute;S=(null!=S?S:x-i)||0,A=(null!=A?A:_-o)||0;const R=(n,r)=>{const s=!(!n||!n.stroke),l="outerBorder"===r?-1:1,{distance:h=a[r].distance}=n,d=gl(e,h,e.dpr),u=i+l*d,g=o+l*d,p=2*d;if(0===v||et(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(u,g,S-l*p,A-l*p)):(e.beginPath(),El(e,u,g,S-l*p,A-l*p,v)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),c)c(e,n,a[r]);else if(s){const s=a[r].opacity;a[r].opacity=m,e.setStrokeStyle(t,n,(b-i)/y,(C-o)/w,a[r]),a[r].opacity=s,e.stroke()}};p&&R(u,"outerBorder"),f&&R(g,"innerBorder")}}let Hl=class{constructor(){this.time=Ai.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{stroke:g=a.stroke}=t.attribute;Array.isArray(g)&&g.some((t=>!1===t))&&(u.doStroke=!1)}};Hl=kl([f()],Hl);let Fl=class{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{x1:u,y1:g,x:p=a.x,y:f=a.y,stroke:v=a.stroke,cornerRadius:m=a.cornerRadius}=t.attribute;let{width:b,height:C}=t.attribute;if(b=(null!=b?b:u-p)||0,C=(null!=C?C:g-f)||0,Array.isArray(v)&&v.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,o,a),!(0===m||et(m)&&m.every((t=>0===t)))){let n,r=0;return El(e,i,o,b,C,m,new Array(4).fill(0).map(((s,l)=>(s,h,d,c)=>{v[l]&&(r===l-1&&v[l]===n||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:v[l]}),i,o,a),e.beginPath(),e.moveTo(s,h),n=v[l]),r=l,e.lineTo(d,c),e.stroke(),3===l&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,o),v[0]?e.lineTo(i+b,o):e.moveTo(i+b,o),v[1]?e.lineTo(i+b,o+C):e.moveTo(i+b,o+C),v[2]?e.lineTo(i,o+C):e.moveTo(i,o+C),v[3]){const t=v[0]?o-e.lineWidth/2:o;e.lineTo(i,t)}else e.moveTo(i,o);e.stroke()}}};Fl=kl([f()],Fl);const zl=new Ll,Il=xl,Ol=Cl;const Dl=new class extends Ll{constructor(){super(...arguments),this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){if(!(t.isGifImage&&t.renderFrame&&t.playing))return super.drawShape(t,e,i,o,n,r,s,l,a,h,d,c);t.renderFrame(e,i,o)}},Wl=new class extends bl{constructor(){super(...arguments),this.time=Ai.beforeFillStroke}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{background:u,backgroundMode:g=a.backgroundMode,backgroundFit:p=a.backgroundFit}=t.attribute;if(u)if(t.backgroundImg){const i=t.resources.get(u);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=_n(t.parent).group,{scrollX:o=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(o,n)}const o=t.AABBBounds;this.doDrawImage(e,i.data,o,g,p),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(Z(u)){const{stroke:i,fill:o,lineWidth:n=1,cornerRadius:r=0,expandX:s=0,expandY:l=0}=u;if(!i&&!o)return;e.beginPath();const{x:a,y:h,width:d,height:c}=function(t){const e=Qn(t.attribute.boundsPadding),i=t.AABBBounds;let o=i.x1,n=i.y1,r=i.width(),s=i.height();return nt(e)?(o+=e,n+=e,r-=2*e,s-=2*e):(o+=e[3],n+=e[0],r-=e[1]+e[3],s-=e[0]+e[2]),{x:o,y:n,width:r,height:s}}(t);r?El(e,a-s,h-l,d+2*s,c+2*l,r):e.rect(a-s,h-l,d+2*s,c+2*l),e.globalAlpha=1,o&&(e.fillStyle=o,e.fill()),i&&n>0&&(e.lineWidth=n,e.strokeStyle=i,e.stroke())}else{e.beginPath();const n=t.AABBBounds;e.rect(i,o,n.width(),n.height()),e.fillStyle=u,e.globalAlpha=1,e.fill()}}};const Nl=new class{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const u=t.getParsedPath();if(!u)return;const{outerBorder:g,innerBorder:p}=t.attribute,f=g&&!1!==g.visible,v=p&&!1!==p.visible;if(!f&&!v)return;const{size:m=a.size,opacity:b=a.opacity,x:C=a.x,y:y=a.y,scaleX:w=a.scaleX,scaleY:x=a.scaleY}=t.attribute,_=(n,r)=>{const s=!(!n||!n.stroke),{distance:l=a[r].distance}=n,h=gl(e,l,e.dpr),d="outerBorder"===r?1:-1;if(e.beginPath(),!1===u.drawOffset(e,m,i,o,d*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),c)c(e,n,a[r]);else if(s){const s=a[r].opacity;a[r].opacity=b,e.setStrokeStyle(t,n,(C-i)/w,(y-o)/x,a[r]),a[r].opacity=s,e.stroke()}};f&&_(g,"outerBorder"),v&&_(p,"innerBorder")}},Gl=xl,jl=Cl;var Ul=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Vl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},$l=function(t,e){return function(i,o){e(i,o,t)}};let Yl=class extends dl{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=Yr,this.builtinContributions=[_l,Al,Sl],this.init(t)}drawArcTailCapPath(t,e,i,o,n,r,s,l){const a=l-s,h=t.getParsedAngle(),d=h.startAngle;let c=h.endAngle;c=l;const u=c>d;let g=!1;if(n<r){const t=n;n=r,r=t}const{outerDeltaAngle:p,xors:f,yors:v,xirs:m,yirs:b,limitedOcr:C,outerCornerRadiusStart:y,outerCornerRadiusEnd:w,maxOuterCornerRadius:x,xore:_,yore:S,xire:A,yire:R,limitedIcr:B,innerDeltaAngle:M,innerStartAngle:T,innerCornerRadiusStart:P,innerCornerRadiusEnd:E,maxInnerCornerRadius:k}=ks(t,d,c,r,n);if(C>Jt){const t=le(y,C),r=le(w,C),s=Es(m,b,f,v,n,t,Number(u)),l=Es(_,S,A,R,n,r,Number(u));if(C<x&&t===r)e.moveTo(i+s.cx+s.x01,o+s.cy+s.y01),e.arc(i+s.cx,o+s.cy,C,ne(s.y01,s.x01),ne(l.y01,l.x01),!u);else{const t=c-a-.03,s=ne(l.y11,l.x11);e.arc(i,o,n,t,s,!u),r>0&&e.arc(i+l.cx,o+l.cy,r,ne(l.y11,l.x11),ne(l.y01,l.x01),!u)}}else e.moveTo(i+f,o+v);if(!(r>Jt)||M<.001)e.lineTo(i+A,o+R),g=!0;else if(B>Jt){const t=le(P,B),n=le(E,B),s=Es(A,R,_,S,r,-n,Number(u)),l=Es(f,v,m,b,r,-t,Number(u));if(e.lineTo(i+s.cx+s.x01,o+s.cy+s.y01),B<k&&t===n){const t=ne(l.y01,l.x01);e.arc(i+s.cx,o+s.cy,B,ne(s.y01,s.x01),t,!u)}else{n>0&&e.arc(i+s.cx,o+s.cy,n,ne(s.y01,s.x01),ne(s.y11,s.x11),!u);const t=ne(s.cy+s.y11,s.cx+s.x11),l=c-a-.03;e.arc(i,o,r,t,l,u)}}else e.lineTo(i+r*re(T),o+r*ae(T));return g}drawShape(t,e,i,o,n,r,s,l){const a=_n(t,null==r?void 0:r.theme).arc,{fill:h=a.fill,stroke:d=a.stroke,x:c=a.x,y:u=a.y,fillStrokeOrder:g=a.fillStrokeOrder}=t.attribute,p=this.valid(t,a,s,l);if(!p)return;const{fVisible:f,sVisible:v,doFill:m,doStroke:b}=p,{outerPadding:C=a.outerPadding,innerPadding:y=a.innerPadding,cap:w=a.cap,forceShowCap:x=a.forceShowCap}=t.attribute;let{outerRadius:_=a.outerRadius,innerRadius:S=a.innerRadius}=t.attribute;_+=C,S-=y;let A=0;const R=($(w)&&w||w[0])&&"conical"===h.gradient;if(R){const{sc:e,startAngle:i,endAngle:o}=t.getParsedAngle();oe(o-i)<ie-Jt&&(A=e||0,h.startAngle-=A,h.endAngle-=A)}let B=!1;const{isFullStroke:M,stroke:T}=(t=>{var e;let i=!0;if($(t,!0)){for(let o=0;o<4;o++)qn[o]=t,i&&(i=!(null!==(e=qn[o])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)qn[e]=!!t[e],i&&(i=!!qn[e]);else qn[0]=!1,qn[1]=!1,qn[2]=!1,qn[3]=!1;return{isFullStroke:i,stroke:qn}})(d);if(m||M){e.beginPath(),Ls(t,e,i,o,_,S),B=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),this.beforeRenderStep(t,e,i,o,m,b,f,v,a,n,s,l);const r=()=>{m&&(s?s(e,t.attribute,a):f&&(e.setCommonStyle(t,t.attribute,c-i,u-o,a),e.fill()))},h=()=>{b&&M&&(l?l(e,t.attribute,a):v&&(e.setStrokeStyle(t,t.attribute,c-i,u-o,a),e.stroke()))};g?(h(),r()):(r(),h())}if(!M&&b&&(e.beginPath(),Ls(t,e,i,o,_,S,T),B||this.beforeRenderStep(t,e,i,o,m,b,f,v,a,n,s,l),l?l(e,t.attribute,a):v&&(e.setStrokeStyle(t,t.attribute,i,o,a),e.stroke())),($(w)&&w||w[1])&&x){const{startAngle:r,endAngle:h}=t.getParsedAngle();if(oe(h-r)>=ie-Jt){e.beginPath();const r=Math.abs(_-S)/2/_,{endAngle:h=a.endAngle,fill:d=a.fill}=t.attribute,c=h;this.drawArcTailCapPath(t,e,i,o,_,S,c,c+r),B||this.beforeRenderStep(t,e,i,o,m,b,f,v,a,n,s,l);const u=()=>{if(m){const n=d;if("conical"===n.gradient){const r=function(t,e,i,o){const{stops:n,startAngle:r,endAngle:s}=o;for(;i<0;)i+=ie;for(;i>ie;)i-=ie;if(i<r)return n[0].color;if(i>s)return n[0].color;let l,a,h=(i-r)/(s-r);for(let t=0;t<n.length;t++)if(n[t].offset>=h){l=n[t-1],a=n[t];break}return h=(h-l.offset)/(a.offset-l.offset),ur(l.color,a.color,h,!1)}(0,0,h,n);s||Bs&&(e.setCommonStyle(t,t.attribute,i,o,a),e.fillStyle=r,e.fill())}}},g=()=>{b&&(l||v&&(e.setStrokeStyle(t,t.attribute,i,o,a),e.stroke()))};u(),g()}}this.afterRenderStep(t,e,i,o,m,b,f,v,a,n,s,l),R&&(h.startAngle+=A,h.endAngle+=A)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).arc;this._draw(t,n,!1,i,o)}};Yl=Ul([f(),$l(0,g(E)),$l(0,v(Is)),Vl("design:paramtypes",[Object])],Yl);var Xl=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Kl=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Zl=function(t,e){return function(i,o){e(i,o,t)}};let ql=class extends dl{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=Zr,this.builtinContributions=[Rl,Ml,Bl],this.init(t)}drawShape(t,e,i,o,n,r,s,l){const a=_n(t,null==r?void 0:r.theme).circle,{radius:h=a.radius,startAngle:d=a.startAngle,endAngle:c=a.endAngle,x:u=a.x,y:g=a.y,fillStrokeOrder:p=a.fillStrokeOrder}=t.attribute,f=this.valid(t,a,s,l);if(!f)return;const{fVisible:v,sVisible:m,doFill:b,doStroke:C}=f;e.beginPath(),e.arc(i,o,h,d,c),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),this.beforeRenderStep(t,e,i,o,b,C,v,m,a,n,s,l);const y=()=>{b&&(s?s(e,t.attribute,a):v&&(e.setCommonStyle(t,t.attribute,u-i,g-o,a),e.fill()))},w=()=>{C&&(l?l(e,t.attribute,a):m&&(e.setStrokeStyle(t,t.attribute,u-i,g-o,a),e.stroke()))};p?(w(),y()):(y(),w()),this.afterRenderStep(t,e,i,o,b,C,v,m,a,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).circle;this._draw(t,n,!1,i,o)}};function Jl(t,e,i,o){if(!e.p1)return;const{offsetX:n=0,offsetY:r=0,offsetZ:s=0}=o||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(n+e.p1.x,r+e.p1.y,n+e.p2.x,r+e.p2.y,n+e.p3.x,r+e.p3.y,s):t.lineTo(n+e.p1.x,r+e.p1.y,s);else if(e.p2&&e.p3){const[o]=Hi(e,i);t.bezierCurveTo(n+o.p1.x,r+o.p1.y,n+o.p2.x,r+o.p2.y,n+o.p3.x,r+o.p3.y,s)}else{const o=e.getPointAt(i);t.lineTo(n+o.x,r+o.y,s)}}function Ql(t,e,i,o,n,r,s){var l;let a=e.p0,h=o;if(i&&i.originP1===i.originP2&&(a=i.p0),e.defined)o||(t.lineTo(a.x+n,a.y+r,s),h=!o);else{const{originP1:i,originP2:d}=e;let c;if(i&&!1!==i.defined?c=a:i&&!1!==d.defined&&(c=null!==(l=e.p3)&&void 0!==l?l:e.p1),o){h=!o;const i=c?c.x:e.p0.x,l=c?c.y:e.p0.y;t.moveTo(i+n,l+r,s)}else c&&(h=!o,t.lineTo(c.x+n,c.y+r,s))}return h}function ta(t,e,i,o,n){const{offsetX:r=0,offsetY:s=0,offsetZ:l=0,mode:a="none",drawConnect:h=!1}=n||{};if(h&&"none"===a)return;if(!e)return;let d=!0;const{curves:c}=e;if(i>=1){if(h){let e,i=!0;c.forEach(((o,n)=>{o.originP1!==o.originP2?(i=Ql(t,o,e,i,r,s,l),e=o):e=o}))}else c.forEach((e=>{e.defined?(d&&t.moveTo(e.p0.x+r,e.p0.y+s,l),Jl(t,e,1,n),d=!1):d=!0}));return}if(i<=0)return;let u;"x"===o?u=_i.ROW:"y"===o?u=_i.COLUMN:"auto"===o&&(u=e.direction);const g=i*e.tryUpdateLength(u);let p=0,f=!0,v=null;for(let e=0,i=c.length;e<i;e++){const i=c[e],o=i.getLength(u),a=(g-p)/o;if(p+=o,a<0)break;if(h){if(i.originP1===i.originP2){v=i;continue}f=Ql(t,i,v,f,r,s,l),v=i}else{if(!i.defined){d=!0;continue}d&&t.moveTo(i.p0.x+r,i.p0.y+s,l),Jl(t,i,le(a,1),n),d=!1}}}ql=Xl([f(),Zl(0,g(E)),Zl(0,v(Ds)),Kl("design:paramtypes",[Object])],ql);var ea=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let ia=class extends dl{constructor(){super(...arguments),this.numberType=Qr}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).line;this._draw(t,n,!1,i,o)}drawSegmentItem(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f,v,m,b,C;if(!e)return;t.beginPath();const y=null!==(f=this.z)&&void 0!==f?f:0;ta(t.camera?t:t.nativeContext,e,a,h,{offsetX:d,offsetY:c,offsetZ:y}),u.cache&&!et(u.cache)&&u.cache.curves.every((t=>t.defined))&&u.attribute.curveType&&u.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,s,l);const{x:w=0,x:x=0}=s;!1!==i&&(g?g(t,s,l):n&&(t.setCommonStyle(u,s,w-d,x-c,l),t.fill())),!1!==o&&(p?p(t,s,l):r&&(t.setStrokeStyle(u,s,w-d,x-c,l),t.stroke()));let{connectedType:_,connectedX:S,connectedY:A,connectedStyle:R}=s;if(et(l)?(_=null!==(v=null!=_?_:l[0].connectedType)&&void 0!==v?v:l[1].connectedType,S=null!==(m=null!=S?S:l[0].connectedX)&&void 0!==m?m:l[1].connectedX,A=null!==(b=null!=A?A:l[0].connectedY)&&void 0!==b?b:l[1].connectedY,R=null!==(C=null!=R?R:l[0].connectedStyle)&&void 0!==C?C:l[1].connectedStyle):(_=null!=_?_:l.connectedType,S=null!=S?S:l.connectedX,A=null!=A?A:l.connectedY,R=null!=R?R:l.connectedStyle),"connect"!==_&&"zero"!==_&&(_="none"),"none"!==_){t.beginPath(),ta(t.camera?t:t.nativeContext,e,a,h,{offsetX:d,offsetY:c,offsetZ:y,drawConnect:!0,mode:_,zeroX:S,zeroY:A});const f=[];et(l)?l.forEach((t=>f.push(t))):f.push(l),f.push(s),!1!==i&&(g?g(t,s,l):n&&(t.setCommonStyle(u,R,w-d,x-c,f),t.fill())),!1!==o&&(p?p(t,s,l):r&&(t.setStrokeStyle(u,R,w-d,x-c,f),t.stroke()))}return!1}drawLinearLineHighPerformance(t,e,i,o,n,r,s,l,a,h,d,c,u){var g;e.beginPath();const p=null!==(g=this.z)&&void 0!==g?g:0,{points:f}=t.attribute,v=f[0];e.moveTo(v.x+s,v.y+l,p);for(let t=1;t<f.length;t++){const i=f[t];e.lineTo(i.x+s,i.y+l,p)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a);const{x:m=0,x:b=0}=t.attribute;!1!==i&&(c?c(e,t.attribute,a):n&&(e.setCommonStyle(t,t.attribute,m-s,b-l,a),e.fill())),!1!==o&&(u?u(e,t.attribute,a):r&&(e.setStrokeStyle(t,t.attribute,m-s,b-l,a),e.stroke()))}drawShape(t,e,i,o,n,r,s,l){const a=_n(t,null==r?void 0:r.theme).line,{fill:h=a.fill,stroke:d=a.stroke,fillOpacity:c=a.fillOpacity,strokeOpacity:u=a.strokeOpacity,segments:g,points:p,closePath:f,curveTension:v=a.curveTension}=t.attribute;if(!this.valid(t,a,s,l))return;let{curveType:m=a.curveType}=t.attribute;f&&"linear"===m&&(m="linearClosed");const{clipRange:b=a.clipRange,clipRangeByDimension:C=a.clipRangeByDimension}=t.attribute;if(1===b&&!g&&!p.some((t=>!1===t.defined))&&"linear"===m)return this.drawLinearLineHighPerformance(t,e,!!h,!!d,c,u,i,o,a,n,r,s,l);if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,o=e;if(i&&i.length){let e,o;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(o={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:o.endX,y:o.endY,defined:o.curves[o.curves.length-1].defined}:i>1&&(e.x=o.endX,e.y=o.endY,e.defined=o.curves[o.curves.length-1].defined);const n=ho(t.points,m,{startPoint:e,curveTension:v});return o=n,n})).filter((t=>!!t)),"linearClosed"===m){let e;for(let i=0;i<t.cache.length;i++){const o=t.cache[i];for(let t=0;t<o.curves.length;t++)if(o.curves[t].defined){e=o.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=ho(o,m,{curveTension:v})}t.clearUpdateShapeTag()}if(Array.isArray(t.cache)){const n=t.attribute.segments.filter((t=>t.points.length));if(1===n[0].points.length&&n.shift(),1===b){let r=!1;t.cache.forEach(((g,p)=>{r||(r=this.drawSegmentItem(e,g,!!h,!!d,c,u,n[p],[a,t.attribute],b,C,i,o,t,s,l))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),g=b*r;let p=0,f=!1;t.cache.forEach(((r,v)=>{if(f)return;const m=r.getLength(),b=(g-p)/m;p+=m,b>0&&(f=this.drawSegmentItem(e,r,!!h,!!d,c,u,n[v],[a,t.attribute],le(b,1),C,i,o,t,s,l))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!d,c,u,t.attribute,a,b,C,i,o,t,s,l)}};function oa(t,e,i,o){if(e.length<2)return;const{offsetX:n=0,offsetY:r=0,offsetZ:s=0,mode:l}=o||{};let a=e[0];t.moveTo(a.p0.x+n,a.p0.y+r,s),a=e[e.length-1];let h=a.p3||a.p1;t.lineTo(h.x+n,h.y+r,s),a=i[i.length-1],t.lineTo(a.p0.x+n,a.p0.y+r,s),a=i[0],h=a.p3||a.p1,t.lineTo(h.x+n,h.y+r,s),t.closePath()}function na(t,e,i,o){const{offsetX:n=0,offsetY:r=0,offsetZ:s=0}=o||{};let l=!0;e.forEach((e=>{e.defined?(l&&t.moveTo(e.p0.x+n,e.p0.y+r,s),Jl(t,e,1,o),l=!1):l=!0})),l=!0;for(let e=i.length-1;e>=0;e--){const a=i[e];a.defined?(l&&t.lineTo(a.p0.x+n,a.p0.y+r,s),Jl(t,a,1,o),l=!1):l=!0}t.closePath()}ia=ea([f()],ia);const ra=new class extends wl{constructor(){super(...arguments),this.time=Ai.afterFillStroke}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g,p,f,v;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:m=t.attribute}=u||{},{texture:b=(null!==(g=t.attribute.texture)&&void 0!==g?g:rr(a,"texture")),textureColor:C=(null!==(p=t.attribute.textureColor)&&void 0!==p?p:rr(a,"textureColor")),textureSize:y=(null!==(f=t.attribute.textureSize)&&void 0!==f?f:rr(a,"textureSize")),texturePadding:w=(null!==(v=t.attribute.texturePadding)&&void 0!==v?v:rr(a,"texturePadding"))}=m;b&&this.drawTexture(b,t,e,i,o,a,C,y,w)}},sa=Cl;var la=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},aa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ha=function(t,e){return function(i,o){e(i,o,t)}};let da=class extends dl{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=Kr,this.builtinContributions=[ra,sa],this.init(t)}drawLinearAreaHighPerformance(t,e,i,o,n,r,s,l,a,h,d,c,u){var g,p,f;const{points:v}=t.attribute;if(v.length<2)return;e.beginPath();const m=null!==(g=this.z)&&void 0!==g?g:0,b=v[0];e.moveTo(b.x+s,b.y+l,m);for(let t=1;t<v.length;t++){const i=v[t];e.lineTo(i.x+s,i.y+l,m)}for(let t=v.length-1;t>=0;t--){const i=v[t];e.lineTo((null!==(p=i.x1)&&void 0!==p?p:i.x)+s,(null!==(f=i.y1)&&void 0!==f?f:i.y)+l,m)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),this.beforeRenderStep(t,e,s,l,!!n,!1,i,!1,a,h,c,null,{attribute:t.attribute});const{x:C=0,x:y=0}=t.attribute;!1!==i&&(c?c(e,t.attribute,a):n&&(e.setCommonStyle(t,t.attribute,C-s,y-l,a),e.fill())),this.afterRenderStep(t,e,s,l,!!n,!1,i,!1,a,h,c,null,{attribute:t.attribute}),(()=>{var i,n;if(o){const{stroke:o=a&&a.stroke}=t.attribute;if(et(o)&&(o[0]||o[2])&&!1===o[1])if(e.beginPath(),o[0]){e.moveTo(b.x+s,b.y+l,m);for(let t=1;t<v.length;t++){const i=v[t];e.lineTo(i.x+s,i.y+l,m)}}else if(o[2]){const t=v[v.length-1];e.moveTo(t.x+s,t.y+l,m);for(let t=v.length-2;t>=0;t--){const o=v[t];e.lineTo((null!==(i=o.x1)&&void 0!==i?i:o.x)+s,(null!==(n=o.y1)&&void 0!==n?n:o.y)+l,m)}}u?u(e,t.attribute,a):(e.setStrokeStyle(t,t.attribute,C-s,y-l,a),e.stroke())}})()}drawShape(t,e,i,o,n,r,s,l){var a,h,d,c,u,g;const p=_n(t,null==r?void 0:r.theme).area,{fill:f=p.fill,stroke:v=p.stroke,fillOpacity:m=p.fillOpacity,z:b=p.z,strokeOpacity:C=p.strokeOpacity,curveTension:y=p.curveTension}=t.attribute,w=this.valid(t,p,s,l);if(!w)return;const{doFill:x}=w,_=w.doStroke&&w.sVisible,{clipRange:S=p.clipRange,closePath:A,points:R,segments:B}=t.attribute;let{curveType:M=p.curveType}=t.attribute;if(A&&"linear"===M&&(M="linearClosed"),1===S&&!B&&!R.some((t=>!1===t.defined))&&"linear"===M)return this.drawLinearAreaHighPerformance(t,e,!!f,_,m,C,i,o,p,n,r,s,l);if(t.shouldUpdateShape()){if(B&&B.length){let e,i;const o=B.map(((t,o)=>{if(t.points.length<=1&&0===o)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===o?e={x:i.endX,y:i.endY}:o>1&&(e.x=i.endX,e.y=i.endY);const n=ho(t.points,M,{startPoint:e,curveTension:y});return i=n,n})).filter((t=>!!t));let n;const r=[];for(let t=B.length-1;t>=0;t--){const e=B[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(a=e[t].x1)&&void 0!==a?a:e[t].x,y:null!==(h=e[t].y1)&&void 0!==h?h:e[t].y});if(0!==t){const e=B[t-1].points,o=e[e.length-1];o&&i.push({x:null!==(d=o.x1)&&void 0!==d?d:o.x,y:null!==(c=o.y1)&&void 0!==c?c:o.y})}i.length>1&&(n=ho(i,"stepBefore"===M?"stepAfter":"stepAfter"===M?"stepBefore":M,{curveTension:y}),r.unshift(n))}t.cacheArea=r.map(((t,e)=>({top:o[e],bottom:t})))}else{if(!R||!R.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=R,i=[];for(let t=R.length-1;t>=0;t--)i.push({x:null!==(u=R[t].x1)&&void 0!==u?u:R[t].x,y:null!==(g=R[t].y1)&&void 0!==g?g:R[t].y});const o=ho(e,M,{curveTension:y}),n=ho(i,"stepBefore"===M?"stepAfter":"stepAfter"===M?"stepBefore":M,{curveTension:y});t.cacheArea={top:o,bottom:n}}}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===S){let a=!1;t.cacheArea.forEach(((h,d)=>{a||(a=this.drawSegmentItem(e,h,x,m,_,C,r[d],[p,t.attribute],S,i,o,b,t,n,s,l))}))}else{const a=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),h=S*a;let d=0,c=!1;t.cacheArea.forEach(((a,u)=>{if(c)return;const g=a.top.getLength(),f=(h-d)/g;d+=g,f>0&&(c=this.drawSegmentItem(e,a,x,m,_,C,r[u],[p,t.attribute],le(f,1),i,o,b,t,n,s,l))}))}}else this.drawSegmentItem(e,t.cacheArea,x,m,_,C,t.attribute,p,S,i,o,b,t,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).area;this._draw(t,n,!1,i,o)}drawSegmentItem(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f){let v=!1;return v=v||this._drawSegmentItem(t,e,i,o,n,r,s,l,a,h,d,c,u,g,!1,p,f),v=v||this._drawSegmentItem(t,e,i,o,n,r,s,l,a,h,d,c,u,g,!0,p,f),v}_drawSegmentItem(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v){var m,b,C,y;if(!(e&&e.top&&e.bottom&&e.top.curves&&e.top.curves.length&&e.bottom.curves&&e.bottom.curves.length))return;let{connectedType:w,connectedX:x,connectedY:_,connectedStyle:S}=s;const A=[];if(p&&(et(l)?(w=null!==(m=null!=w?w:l[0].connectedType)&&void 0!==m?m:l[1].connectedType,x=null!==(b=null!=x?x:l[0].connectedX)&&void 0!==b?b:l[1].connectedX,_=null!==(C=null!=_?_:l[0].connectedY)&&void 0!==C?C:l[1].connectedY,S=null!==(y=null!=S?S:l[0].connectedStyle)&&void 0!==y?y:l[1].connectedStyle):(w=null!=w?w:l.connectedType,x=null!=x?x:l.connectedX,_=null!=_?_:l.connectedY,S=null!=S?S:l.connectedStyle),"connect"!==w&&"zero"!==w&&(w="none"),et(l)?l.forEach((t=>A.push(t))):A.push(l),A.push(s)),p&&"none"===w)return!1;t.beginPath();const{points:R,segments:B}=u.attribute;let M,T,P=_i.ROW;if(B){const t=B[B.length-1];T=B[0].points[0],M=t.points[t.points.length-1]}else T=R[0],M=R[R.length-1];const E=oe(M.x-T.x),k=oe(M.y-T.y);P=null==M.x1?_i.ROW:null==M.y1?_i.COLUMN:Number.isFinite(E+k)?E>k?_i.ROW:_i.COLUMN:_i.ROW,function(t,e,i,o){var n;const{drawConnect:r=!1,mode:s="none"}=o||{};if(r&&"none"===s)return;const{top:l,bottom:a}=e;if(l.curves.length!==a.curves.length)return;if(i>=1){const e=[],i=[];let n=!0;if(r){let n,r,s=!0;const h=l.curves.length;l.curves.forEach(((l,d)=>{const c=a.curves[h-d-1];let u=l,g=c;if(l.originP1===l.originP2)return n=l,void(r=c);if(n&&n.originP1===n.originP2&&(u=n,g=r),l.defined)s||(e.push(u),i.push(g),oa(t,e,i,o),e.length=0,i.length=0,s=!s);else{const{originP1:n,originP2:r}=l;let a,h;n&&!1!==n.defined?(a=u,h=g):n&&!1!==r.defined&&(a=l,h=c),s?(s=!s,e.push(a||l),i.push(h||c)):a&&(s=!s,e.push(a||l),i.push(h||c),oa(t,e,i,o),e.length=0,i.length=0)}n=l})),oa(t,e,i,o)}else{for(let r=0,s=l.curves.length;r<s;r++){const h=l.curves[r];n!==h.defined?(n?(na(t,e,i,o),e.length=0,i.length=0):(e.push(h),i.push(a.curves[s-r-1])),n=!n):n&&(e.push(h),i.push(a.curves[s-r-1]))}na(t,e,i,o)}return}if(i<=0)return;let{direction:h}=o||{};const{curves:d}=l,c=null!==(n=d[d.length-1].p3)&&void 0!==n?n:d[d.length-1].p1,u=oe(c.x-d[0].p0.x),g=oe(c.y-d[0].p0.y);h=null!=h?h:u>g?_i.ROW:_i.COLUMN,Number.isFinite(u)||(h=_i.COLUMN),Number.isFinite(g)||(h=_i.ROW);const p=i*(h===_i.ROW?u:g);let f=0,v=!0;const m=[],b=[];let C,y,w=!0;for(let e=0,i=l.curves.length;e<i;e++){const n=l.curves[e],s=n.getLength(h),d=(p-f)/s;if(d<0)break;if(f+=s,r){const r=a.curves[i-e-1];let s=n,l=r;if(n.originP1===n.originP2){C=n,y=r;continue}if(C&&C.originP1===C.originP2&&(s=C,l=y),n.defined)w||(m.push(s),b.push(l),oa(t,m,b,o),m.length=0,b.length=0,w=!w);else{const{originP1:e,originP2:i}=n;let a,h;e&&!1!==e.defined?(a=s,h=l):e&&!1!==i.defined&&(a=n,h=r),w?(w=!w,m.push(a||n),b.push(h||r)):a&&(w=!w,m.push(a||n),b.push(h||r),oa(t,m,b,o),m.length=0,b.length=0)}C=n}else{let r=null,s=null;v!==n.defined?(v?(na(t,m,b,o),m.length=0,b.length=0):(r=n,s=a.curves[i-e-1]),v=!v):v&&(r=n,s=a.curves[i-e-1]),r&&s&&(d<1&&(r=r.p2&&r.p3?Hi(r,d)[0]:zi(r,d)[0],s=s.p2&&s.p3?Hi(s,1-d)[1]:zi(s,1-d)[1]),r.defined=v,s.defined=v,m.push(r),b.push(s)),r=null,s=null}}r?oa(t,m,b,o):na(t,m,b,o)}(t.camera?t:t.nativeContext,e,a,{offsetX:h,offsetY:d,offsetZ:c,direction:P,drawConnect:p,mode:w,zeroX:x,zeroY:_}),this.beforeRenderStep(u,t,h,d,!!o,!1,i,!1,l,g,f,null,{attribute:s}),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,s,l);const{x:L=0,x:H=0}=s;return!1!==i&&(f?f(t,s,l):o&&(t.setCommonStyle(u,p?S:s,L-h,H-d,p?A:l),t.fill())),this.afterRenderStep(u,t,h,d,!!o,!1,i,!1,l,g,f,null,{attribute:s}),(()=>{if(!1!==n)if(v)v(t,s,l);else{const{stroke:i=l&&l[1]&&l[1].stroke}=s;et(i)&&(i[0]||i[2])&&!1===i[1]&&(t.beginPath(),ta(t.camera?t:t.nativeContext,i[0]?e.top:e.bottom,a,P===_i.ROW?"x":"y",{offsetX:h,offsetY:d,offsetZ:c,drawConnect:p,mode:w,zeroX:x,zeroY:_})),t.setStrokeStyle(u,p?S:s,L-h,H-d,p?A:l),t.stroke()}})(),!1}};da=la([f(),ha(0,g(E)),ha(0,v(Os)),aa("design:paramtypes",[Object])],da);const ca=xl,ua=Cl;var ga=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},pa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},fa=function(t,e){return function(i,o){e(i,o,t)}};let va=class extends dl{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=ts,this.builtinContributions=[ua,ca],this.init(t)}drawShape(t,e,i,o,n,r,s,l){var a,h,d;const c=null!==(a=this.tempTheme)&&void 0!==a?a:_n(t,null==r?void 0:r.theme).path,{x:u=c.x,y:g=c.y,fillStrokeOrder:p=c.fillStrokeOrder}=t.attribute,f=null!==(h=this.z)&&void 0!==h?h:0,v=this.valid(t,c,s,l);if(!v)return;const{fVisible:m,sVisible:b,doFill:C,doStroke:y}=v;if(e.beginPath(),t.pathShape)Ti(t.pathShape.commandList,e,i,o,1,1,f);else{Ti((null!==(d=t.attribute.path)&&void 0!==d?d:c.path).commandList,e,i,o,1,1,f)}e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,o,C,y,m,b,c,n,s,l);const w=()=>{y&&(l?l(e,t.attribute,c):b&&(e.setStrokeStyle(t,t.attribute,u-i,g-o,c),e.stroke()))},x=()=>{C&&(s?s(e,t.attribute,c):m&&(e.setCommonStyle(t,t.attribute,u-i,g-o,c),e.fill()))};p?(w(),x()):(x(),w()),this.afterRenderStep(t,e,i,o,C,y,m,b,c,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).path;this.tempTheme=n,this._draw(t,n,!1,i,o),this.tempTheme=null}};va=ga([f(),fa(0,g(E)),fa(0,v(Gs)),pa("design:paramtypes",[Object])],va);var ma=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},ba=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ca=function(t,e){return function(i,o){e(i,o,t)}};let ya=class extends dl{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=is,this.builtinContributions=[zl,Ol,Il],this.init(t)}drawShape(t,e,i,o,n,r,s,l){var a;const h=null!==(a=this.tempTheme)&&void 0!==a?a:_n(t,null==r?void 0:r.theme).rect,{fill:d=h.fill,background:c,stroke:u=h.stroke,cornerRadius:g=h.cornerRadius,opacity:p=h.opacity,fillOpacity:f=h.fillOpacity,lineWidth:v=h.lineWidth,strokeOpacity:m=h.strokeOpacity,visible:b=h.visible,x1:C,y1:y,x:w=h.x,y:x=h.y,fillStrokeOrder:_=h.fillStrokeOrder}=t.attribute;let{width:S,height:A}=t.attribute;S=(null!=S?S:C-w)||0,A=(null!=A?A:y-x)||0;const R=Ms(p,f,S,A,d),B=Ps(p,m,S,A),M=As(d,c),T=Rs(u,v);if(!t.valid||!b)return;if(!M&&!T)return;if(!(R||B||s||l||c))return;0===g||et(g)&&g.every((t=>0===t))?(e.beginPath(),e.rect(i,o,S,A)):(e.beginPath(),El(e,i,o,S,A,g));const P={doFill:M,doStroke:T};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,o,M,T,R,B,h,n,s,l,P);const E=()=>{P.doFill&&(s?s(e,t.attribute,h):R&&(e.setCommonStyle(t,t.attribute,w-i,x-o,h),e.fill()))},k=()=>{P.doStroke&&(l?l(e,t.attribute,h):B&&(e.setStrokeStyle(t,t.attribute,w-i,x-o,h),e.stroke()))};_?(k(),E()):(E(),k()),this.afterRenderStep(t,e,i,o,M,T,R,B,h,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).rect;this.tempTheme=n,this._draw(t,n,!1,i,o),this.tempTheme=null}};ya=ma([f(),Ca(0,g(E)),Ca(0,v(Us)),ba("design:paramtypes",[Object])],ya);var wa=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},xa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},_a=function(t,e){return function(i,o){e(i,o,t)}};let Sa=class extends dl{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=ns,this.builtinContributions=[Nl,jl,Gl],this.init(t)}drawShape(t,e,i,o,n,r,s,l){var a;const h=_n(t,null==r?void 0:r.theme).symbol,{size:d=h.size,x:c=h.x,y:u=h.y,scaleX:g=h.scaleX,scaleY:p=h.scaleY,fillStrokeOrder:f=h.fillStrokeOrder}=t.attribute,v=this.valid(t,h,s,l);if(!v)return;const{fVisible:m,sVisible:b,doFill:C,doStroke:y}=v,w=t.getParsedPath();if(!w)return;const{keepDirIn3d:x=h.keepDirIn3d}=t.attribute,_=null!==(a=this.z)&&void 0!==a?a:0;e.beginPath();const S=(n,r)=>{var a,d,v;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(a=r.fill)&&void 0!==a?a:t.attribute.fill,e.opacity=null!==(d=r.opacity)&&void 0!==d?d:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(v=r.stroke)&&void 0!==v?v:t.attribute.stroke,r=e}const m=()=>{r.fill&&(s?s(e,t.attribute,h):(e.setCommonStyle(t,r,c-i,u-o,h),e.fill()))},b=()=>{r.stroke&&(l?l(e,t.attribute,h):(e.setStrokeStyle(t,r,(c-i)/g,(u-o)/p,h),e.stroke()))};f?(b(),m()):(m(),b())};if(x&&e.camera&&e.project){const t=e.project(i,o,_),n=e.camera;e.camera=null,!1===w.draw(e,et(d)?[d[0]*g,d[1]*p]:d*g,t.x,t.y,void 0,S)&&e.closePath(),e.camera=n}else!1===w.draw(e,d,i,o,_,S)&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,o,C,y,m,b,h,n,s,l);const A=()=>{C&&!w.isSvg&&(s?s(e,t.attribute,h):m&&(e.setCommonStyle(t,t.attribute,c-i,u-o,h),e.fill()))},R=()=>{y&&!w.isSvg&&(l?l(e,t.attribute,h):b&&(e.setStrokeStyle(t,t.attribute,(c-i)/g,(u-o)/p,h),e.stroke()))};f?(R(),A()):(A(),R()),this.afterRenderStep(t,e,i,o,C,y,m,b,h,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).symbol;this._draw(t,n,!1,i,o)}};Sa=wa([f(),_a(0,g(E)),_a(0,v(Vs)),xa("design:paramtypes",[Object])],Sa);const Aa=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Le)}allocate(t,e,i,o){if(!this.pools.length)return(new Le).setValue(t,e,i,o);const n=this.pools.pop();return n.x1=t,n.y1=e,n.x2=i,n.y2=o,n}allocateByObj(t){if(!this.pools.length)return new Le(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(){this.pools=[]}};const Ra=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}};let Ba;function Ma(t){return Ba||(Ba=Ra.CreateGraphic("text",{})),Ba.initAttributes(t),Ba.AABBBounds}const Ta=new class extends bl{constructor(){super(...arguments),this.time=Ai.beforeFillStroke}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f,v,m,b,C,y,w;const{backgroundMode:x=a.backgroundMode,backgroundFit:_=a.backgroundFit}=t.attribute;let S,{background:A}=t.attribute;if(!A)return;const R=()=>{"richtext"===t.type&&(e.restore(),e.save(),S&&e.setTransformFromMatrix(S,!0,1))};let B;"richtext"===t.type&&(S=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const M=Z(A)&&A.background,T=t.transMatrix.onlyTranslate();if(M){const e=t.AABBBounds,i=(null!==(u=A.x)&&void 0!==u?u:e.x1)+(null!==(g=A.dx)&&void 0!==g?g:0),o=(null!==(p=A.y)&&void 0!==p?p:e.y1)+(null!==(f=A.dy)&&void 0!==f?f:0),n=null!==(v=A.width)&&void 0!==v?v:e.width(),r=null!==(m=A.height)&&void 0!==m?m:e.height();if(B=Aa.allocate(i,o,i+n,o+r),A=A.background,!T){const t=B.width(),e=B.height();B.set((null!==(b=A.x)&&void 0!==b?b:0)+(null!==(C=A.dx)&&void 0!==C?C:0),(null!==(y=A.y)&&void 0!==y?y:0)+(null!==(w=A.dy)&&void 0!==w?w:0),t,e)}}else B=t.AABBBounds,T||(B=Ma(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const n=t.resources.get(A);if("success"!==n.state||!n.data)return void R();e.highPerformanceSave(),T&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,o,a),this.doDrawImage(e,n.data,B,x,_),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:n}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,o,a),e.fillStyle=A,n?(El(e,B.x1,B.y1,B.width(),B.height(),n),e.fill()):e.fillRect(B.x1,B.y1,B.width(),B.height()),e.highPerformanceRestore()}M&&Aa.free(B),R()}};var Pa=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Ea=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ka=function(t,e){return function(i,o){e(i,o,t)}};let La=class extends dl{constructor(t){super(),this.textRenderContribitions=t,this.numberType=rs,this.builtinContributions=[Ta],this.init(t)}drawShape(t,e,i,o,n,r,s,l){var a,h,d;const c=_n(t,null==r?void 0:r.theme).text,{text:u,underline:g=c.underline,lineThrough:p=c.lineThrough,keepDirIn3d:f=c.keepDirIn3d,direction:v=c.direction,fontSize:m=c.fontSize,verticalMode:b=c.verticalMode,x:C=c.x,y:y=c.y}=t.attribute;let{textAlign:w=c.textAlign,textBaseline:x=c.textBaseline}=t.attribute;if(!b&&"vertical"===v){const e=w;w=null!==(a=t.getBaselineMapAlign()[x])&&void 0!==a?a:"left",x=null!==(h=t.getAlignMapBaseline()[e])&&void 0!==h?h:"top"}const _=null!==(d=ar(t.attribute.lineHeight,m))&&void 0!==d?d:m,S=this.valid(t,c,s,l);if(!S)return;const{fVisible:A,sVisible:R,doFill:B,doStroke:M}=S,T=!f,P=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,o,B,M,A,R,c,n,s,l),T&&this.transformUseContext2d(t,c,P,e);const E=(n,r,a,h)=>{let d=i+r;const u=o+a;if(h){e.highPerformanceSave(),d+=m;const t=il.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,d,u),e.transformFromMatrix(t,!0),il.free(t)}M&&(l?l(e,t.attribute,c):R&&(e.setStrokeStyle(t,t.attribute,C-i,y-o,c),e.strokeText(n,d,u,P))),B&&(s?s(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,C-i,y-o,c),e.fillText(n,d,u,P),this.drawUnderLine(g,p,t,d,u,P,c,e))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(t.isMultiLine)if(e.setTextStyleWithoutAlignBaseline(t.attribute,c,P),"horizontal"===v){const{multilineLayout:n}=t;if(!n)return void e.highPerformanceRestore();const{xOffset:r,yOffset:a}=n.bbox;M&&(l?l(e,t.attribute,c):R&&(e.setStrokeStyle(t,t.attribute,C-i,y-o,c),n.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+i,(t.topOffset||0)+a+o,P)})))),B&&(s?s(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,C-i,y-o,c),n.lines.forEach((n=>{var s,l;e.fillText(n.str,(n.leftOffset||0)+r+i,(n.topOffset||0)+a+o,P),this.drawUnderLine(g,p,t,(n.leftOffset||0)+r+i,(n.topOffset||0)+a+o-(l=m,"top"===(s="bottom")?Math.ceil(.79*l):"middle"===s?Math.round(.3*l):"bottom"===s?Math.round(-.21*l):0)-.05*m,P,c,e,{width:n.width})}))))}else{t.tryUpdateAABBBounds();const i=t.cache,{verticalList:o}=i;e.textAlign="left",e.textBaseline="top";const n=_*o.length;let r=0;o.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);r=se(e,r)}));let s=0,l=0;"bottom"===x?l=-n:"middle"===x&&(l=-n/2),"center"===w?s-=r/2:"right"===w&&(s-=r),o.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),o=r-i;let a=s;"center"===w?a+=o/2:"right"===w&&(a+=o),t.forEach((t=>{const{text:i,width:o,direction:r}=t;E(i,n-(e+1)*_+l,a,r),a+=o}))}))}else if("horizontal"===v){e.setTextStyle(t.attribute,c,P);const i=t.clipedText;let o=0;_!==m&&("top"===x?o=(_-m)/2:"middle"===x||"bottom"===x&&(o=-(_-m)/2)),E(i,0,o,0)}else{t.tryUpdateAABBBounds();const i=t.cache;if(i){e.setTextStyleWithoutAlignBaseline(t.attribute,c,P);const{verticalList:o}=i;let n=0;const r=o[0].reduce(((t,e)=>t+(e.width||0)),0);let s=0;"bottom"===x?s=-_:"middle"===x&&(s=-_/2),"center"===w?n-=r/2:"right"===w&&(n-=r),e.textAlign="left",e.textBaseline="top",o[0].forEach((t=>{const{text:e,width:i,direction:o}=t;E(e,s,n,o),n+=i}))}}T&&this.restoreTransformUseContext2d(t,c,P,e),this.afterRenderStep(t,e,i,o,B,M,A,R,c,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).text,{keepDirIn3d:r=n.keepDirIn3d}=t.attribute,s=!r;this._draw(t,n,s,i,o)}drawUnderLine(t,e,i,o,n,r,s,l,a){if(e+t<=0)return;const{textAlign:h=s.textAlign,textBaseline:d=s.textBaseline,fontSize:c=s.fontSize,fill:u=s.fill,opacity:g=s.opacity,underlineOffset:p=s.underlineOffset,underlineDash:f=s.underlineDash,fillOpacity:v=s.fillOpacity}=i.attribute,m=!X(a),b=m?a.width:i.clipedWidth,C=m?0:Xs(h,b),y=Ks(m?"alphabetic":d,c,c),w={lineWidth:0,stroke:u,opacity:g,strokeOpacity:v};let x=m?-3:0;if(t){w.lineWidth=t,l.setStrokeStyle(i,w,o,n,s),f&&l.setLineDash(f),l.beginPath();const e=n+y+c+p+x;l.moveTo(o+C,e,r),l.lineTo(o+C+b,e,r),l.stroke()}if(m&&(x=-1),e){w.lineWidth=e,l.setStrokeStyle(i,w,o,n,s),l.beginPath();const t=n+y+c/2+x;l.moveTo(o+C,t,r),l.lineTo(o+C+b,t,r),l.stroke()}}};function Ha(t,e,i,o){t.moveTo(e[0].x+i,e[0].y+o);for(let n=1;n<e.length;n++)t.lineTo(e[n].x+i,e[n].y+o)}function Fa(t,e){return Math.sqrt(t*t+e*e)}function za(t,e,i,o,n){const r=e/i;return{x:t.x-o*r,y:t.y-n*r}}La=Pa([f(),ka(0,g(E)),ka(0,v($s)),Ea("design:paramtypes",[Object])],La);const Ia=xl,Oa=Cl;var Da=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Wa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Na=function(t,e){return function(i,o){e(i,o,t)}};let Ga=class extends dl{constructor(t){super(),this.polygonRenderContribitions=t,this.numberType=es,this.builtinContributions=[Oa,Ia],this.init(t)}drawShape(t,e,i,o,n,r,s,l){const a=_n(t,null==r?void 0:r.theme).polygon,{points:h=a.points,cornerRadius:d=a.cornerRadius,x:c=a.x,y:u=a.y,closePath:g=a.closePath,fillStrokeOrder:p=a.fillStrokeOrder}=t.attribute,f=this.valid(t,a,s,l);if(!f)return;const{fVisible:v,sVisible:m,doFill:b,doStroke:C}=f;e.beginPath(),d<=0||et(d)&&d.every((t=>0===t))?Ha(e.camera?e:e.nativeContext,h,i,o):function(t,e,i,o,n){let r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];var s;if(e.length<3)return void Ha(t,e,i,o);let l=0,a=e.length-1;r||(l+=1,a-=1,t.moveTo(e[0].x+i,e[0].y+o));for(let r=l;r<=a;r++){const l=e[0===r?a:(r-1)%e.length],h=e[r%e.length],d=e[(r+1)%e.length],c=h.x-l.x,u=h.y-l.y,g=h.x-d.x,p=h.y-d.y,f=(Math.atan2(u,c)-Math.atan2(p,g))/2,v=Math.abs(Math.tan(f));let m=Array.isArray(n)?null!==(s=n[r%e.length])&&void 0!==s?s:0:n,b=m/v;const C=Fa(c,u),y=Fa(g,p),w=Math.min(C,y);b>w&&(b=w,m=w*v);const x=za(h,b,C,c,u),_=za(h,b,y,g,p),S=2*h.x-x.x-_.x,A=2*h.y-x.y-_.y,R=Fa(S,A),B=za(h,Fa(b,m),R,S,A);let M=Math.atan2(x.y-B.y,x.x-B.x);const T=Math.atan2(_.y-B.y,_.x-B.x);let P=T-M;P<0&&(M=T,P=-P),P>Math.PI&&(P-=Math.PI),0===r?t.moveTo(x.x+i,x.y+o):t.lineTo(x.x+i,x.y+o),P&&t.arcTo(h.x+i,h.y+o,_.x+i,_.y+o,m),t.lineTo(_.x+i,_.y+o)}r||t.lineTo(e[a+1].x+i,e[a+1].y+o)}(e.camera?e:e.nativeContext,h,i,o,d,g),g&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),this.beforeRenderStep(t,e,i,o,b,C,v,m,a,n,s,l);const y=()=>{b&&(s?s(e,t.attribute,a):v&&(e.setCommonStyle(t,t.attribute,c-i,u-o,a),e.fill()))},w=()=>{C&&(l?l(e,t.attribute,a):m&&(e.setStrokeStyle(t,t.attribute,c-i,u-o,a),e.stroke()))};p?(w(),y()):(y(),w()),this.afterRenderStep(t,e,i,o,b,C,v,m,a,n,s,l)}draw(t,e,i,o){const n=_n(t,null==o?void 0:o.theme).polygon;this._draw(t,n,!1,i,o)}};Ga=Da([f(),Na(0,g(E)),Na(0,v(js)),Wa("design:paramtypes",[Object])],Ga);var ja=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Ua=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Va=function(t,e){return function(i,o){e(i,o,t)}};let $a=class{constructor(t){this.groupRenderContribitions=t,this.numberType=qr}drawShape(t,e,i,o,n,r,s,l){const a=_n(t,null==r?void 0:r.theme).group,{fill:h=a.fill,background:d,stroke:c=a.stroke,opacity:u=a.opacity,width:g=a.width,height:p=a.height,clip:f=a.clip,fillOpacity:v=a.fillOpacity,strokeOpacity:m=a.strokeOpacity,cornerRadius:b=a.cornerRadius,path:C=a.path,lineWidth:y=a.lineWidth,visible:w=a.visible,fillStrokeOrder:x=a.fillStrokeOrder,x:_=a.x,y:S=a.y}=t.attribute,A=Ms(u,v,g,p,h),R=Ps(u,m,g,p),B=As(h,d),M=Rs(c,y);if(!t.valid||!w)return;if(!f){if(!B&&!M)return;if(!(A||R||s||l||d))return}if(C&&C.length&&n.drawContribution){const t=e.disableFill,i=e.disableStroke,o=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,C.forEach((t=>{n.drawContribution.getRenderContribution(t).draw(t,n.renderService,n,r)})),e.disableFill=t,e.disableStroke=i,e.disableBeginPath=o}else 0===b||et(b)&&b.every((t=>0===t))?(e.beginPath(),e.rect(i,o,g,p)):(e.beginPath(),El(e,i,o,g,p,b));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(Tl));const T={doFill:B,doStroke:M};this._groupRenderContribitions.forEach((r=>{r.time===Ai.beforeFillStroke&&r.drawShape(t,e,i,o,B,M,A,R,a,n,s,l,T)})),f&&e.clip(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a);const P=()=>{T.doFill&&(s?s(e,t.attribute,a):A&&(e.setCommonStyle(t,t.attribute,_-i,S-o,a),e.fill()))},E=()=>{T.doStroke&&(l?l(e,t.attribute,a):R&&(e.setStrokeStyle(t,t.attribute,_-i,S-o,a),e.stroke()))};x?(E(),P()):(P(),E()),this._groupRenderContribitions.forEach((r=>{r.time===Ai.afterFillStroke&&r.drawShape(t,e,i,o,B,M,A,R,a,n,s,l)}))}draw(t,e,i,o){const{context:n}=i;if(!n)return;const{clip:r,baseOpacity:s=1}=t.attribute;r?n.save():n.highPerformanceSave();const l=n.baseGlobalAlpha;n.baseGlobalAlpha*=s;const a=_n(t,null==o?void 0:o.theme).group,h=n.modelMatrix;if(n.camera){const e=ol.allocate(),i=ol.allocate();ll(i,t,a),Qs(e,h||e,i),n.modelMatrix=e,ol.free(i),n.setTransform(1,0,0,1,0,0,!0)}else n.transformFromMatrix(t.transMatrix,!0);n.beginPath(),o.skipDraw?this.drawShape(t,n,0,0,i,o,(()=>!1),(()=>!1)):this.drawShape(t,n,0,0,i);const{scrollX:d=a.scrollX,scrollY:c=a.scrollY}=t.attribute;let u;(d||c)&&n.translate(d,c),o&&o.drawingCb&&(u=o.drawingCb()),n.modelMatrix!==h&&ol.free(n.modelMatrix),n.modelMatrix=h,n.baseGlobalAlpha=l,u&&u.then?u.then((()=>{r?n.restore():n.highPerformanceRestore()})):r?n.restore():n.highPerformanceRestore()}};$a=ja([f(),Va(0,g(E)),Va(0,v(Ws)),Ua("design:paramtypes",[Object])],$a);var Ya=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Xa=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ka=function(t,e){return function(i,o){e(i,o,t)}};const Za=["","repeat-x","repeat-y","repeat"];let qa=class extends dl{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=Jr,this.builtinContributions=[Dl,Wl],this.init(t)}drawShape(t,e,i,o,n,r,s,l){const a=_n(t).image,{width:h=a.width,height:d=a.height,repeatX:c=a.repeatX,repeatY:u=a.repeatY,x:g=a.x,y:p=a.y,cornerRadius:f=a.cornerRadius,fillStrokeOrder:v=a.fillStrokeOrder,image:m}=t.attribute,b=this.valid(t,a,s);if(!b)return;const{fVisible:C,sVisible:y,doFill:w,doStroke:x}=b;e.setShadowBlendStyle&&e.setShadowBlendStyle(t,a),this.beforeRenderStep(t,e,i,o,w,!1,C,!1,a,n,s);const _=()=>{if(w)if(s)s(e,t.attribute,a);else if(C){if(!m||!t.resources)return;const n=t.resources.get(m);if("success"!==n.state)return;let r=!1;0===f||et(f)&&f.every((t=>0===t))||(e.beginPath(),El(e,i,o,h,d,f),e.save(),e.clip(),r=!0),e.setCommonStyle(t,t.attribute,i,o,a);let s=0;if("repeat"===c&&(s|=1),"repeat"===u&&(s|=2),s){const t=e.createPattern(n.data,Za[s]);e.fillStyle=t,e.translate(i,o,!0),e.fillRect(0,0,h,d),e.translate(-i,-o,!0)}else e.drawImage(n.data,i,o,h,d);r&&e.restore()}},S=()=>{x&&(l?l(e,t.attribute,a):y&&(e.setStrokeStyle(t,t.attribute,g-i,p-o,a),e.stroke()))};v?(S(),_()):(_(),S()),this.afterRenderStep(t,e,i,o,w,!1,C,!1,a,n,s)}draw(t,e,i){const{image:o}=t.attribute;if(!t.isGifImage){if(!o||!t.resources)return;const e=t.resources.get(o);if("loading"===e.state&&tt(o))return void mr.improveImageLoading(o);if("success"!==e.state)return}const{context:n}=e.drawParams;if(!n)return;const r=_n(t).image;this._draw(t,r,!1,i)}};qa=Ya([f(),Ka(0,g(E)),Ka(0,v(Ns)),Xa("design:paramtypes",[Object])],qa);const Ja=Symbol.for("IncrementalDrawContribution"),Qa=Symbol.for("ArcRender"),th=Symbol.for("CircleRender"),eh=Symbol.for("GraphicRender"),ih=Symbol.for("GroupRender"),oh=Symbol.for("LineRender"),nh=Symbol.for("PathRender"),rh=Symbol.for("PolygonRender"),sh=Symbol.for("RectRender"),lh=Symbol.for("SymbolRender"),ah=Symbol.for("TextRender"),hh=Symbol.for("RichTextRender"),dh=Symbol.for("ImageRender"),ch=Symbol.for("DrawContribution"),uh=(t,e,i,o)=>{let n,r=!1,s=!1;if(e.forEachChildren((t=>(r=t.numberType===Xr,!r))),e.forEachChildren((t=>(s=!!t.findFace,!s))),r){const t=e.getChildren(),l=[...t];l.sort(((t,e)=>{var i,o,n,r;let s=(null!==(o=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==o?o:0)/2,l=(null!==(r=null!==(n=e.attribute.startAngle)&&void 0!==n?n:0+e.attribute.endAngle)&&void 0!==r?r:0)/2;for(;s<0;)s+=ie;for(;l<0;)l+=ie;return l-s})),l.forEach((t=>{t._next=null,t._prev=null})),e.removeAllChild(),e.update(),l.forEach((t=>{e.appendChild(t)})),o.hack_pieFace="outside",n=i(r,s),n&&n.graphic||(o.hack_pieFace="inside",n=i(r,s)),n&&n.graphic||(o.hack_pieFace="top",n=i(r,s)),e.removeAllChild(),t.forEach((t=>{t._next=null,t._prev=null})),t.forEach((t=>{e.appendChild(t)}))}else if(s){const o=e.getChildren(),l=o.map((e=>({ave_z:e.findFace().vertices.map((i=>{var o;return t.view(i[0],i[1],null!==(o=i[2]+e.attribute.z)&&void 0!==o?o:0)[2]})).reduce(((t,e)=>t+e),0),g:e})));l.sort(((t,e)=>e.ave_z-t.ave_z)),e.removeAllChild(),l.forEach((t=>{t.g._next=null,t.g._prev=null})),e.update(),l.forEach((t=>{e.add(t.g)})),n=i(r,s),e.removeAllChild(),o.forEach((t=>{t._next=null,t._prev=null})),e.update(),o.forEach((t=>{e.add(t)}))}else n=i(r,s);return n};var gh=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},ph=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const fh=Symbol.for("DrawItemInterceptor"),vh=new Le,mh=new Le;class bh{constructor(){this.order=1}afterDrawItem(t,e,i,o,n){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,o,n),!1}beforeDrawItem(t,e,i,o,n){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,o,n),!1}drawItem(t,e,i,o,n){if(!t.shadowRoot)return!1;const{context:r}=i;if(r.highPerformanceSave(),r.transformFromMatrix(t.transMatrix,!0),o.dirtyBounds&&o.backupDirtyBounds){vh.copy(o.dirtyBounds),mh.copy(o.backupDirtyBounds);const e=t.globalTransMatrix.getInverse();o.dirtyBounds.copy(o.backupDirtyBounds).transformWithMatrix(e),o.backupDirtyBounds.copy(o.dirtyBounds)}return o.renderGroup(t.shadowRoot,i,il.allocate(1,0,0,1,0,0)),r.highPerformanceRestore(),o.dirtyBounds&&o.backupDirtyBounds&&(o.dirtyBounds.copy(vh),o.backupDirtyBounds.copy(mh)),!0}}class Ch{constructor(){this.order=1}afterDrawItem(t,e,i,o,n){return t.attribute._debug_bounds&&this.drawItem(t,e,i,o,n),!1}drawItem(t,e,i,o,n){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 s=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(r,t),r.strokeRect(s.x1,s.y1,s.width(),s.height()),r.highPerformanceRestore(),!0}}let yh=class{constructor(){this.order=1,this.interceptors=[new bh,new xh,new wh,new Ch]}afterDrawItem(t,e,i,o,n){for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].afterDrawItem&&this.interceptors[r].afterDrawItem(t,e,i,o,n))return!0;return!1}beforeDrawItem(t,e,i,o,n){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,o,n))return!0;return!1}};yh=gh([f(),ph("design:paramtypes",[])],yh);class wh{constructor(){this.order=1}beforeDrawItem(t,e,i,o,n){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,o,n):this.beforeSetInteractive(t,e,i,o,n))}beforeSetInteractive(t,e,i,o,n){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,o,n){const r=t.baseGraphic;let s=!!r.stage,l=r.parent;for(;s&&l&&l.stage!==l;)s=!!l.stage,l=l.parent;if(!s){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?o.renderGroup(r,i,r.parent.globalTransMatrix):o.renderItem(r,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=Ra.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class xh{constructor(){this.order=1}beforeDrawItem(t,e,i,o,n){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:r,stage:s}=e.drawParams;r.canvas,r.save(),this.initCanvasCtx(r),r.camera=s.camera;const l=r.currentMatrix;l.a/=r.dpr,l.b/=r.dpr,l.c/=r.dpr,l.d/=r.dpr,l.e/=r.dpr,l.f/=r.dpr;const a=ol.allocate();Js(a,l);const h=r.modelMatrix;if(h){if(a){const t=ol.allocate();r.modelMatrix=Qs(t,h,a)}}else r.modelMatrix=a;return r.setTransform(1,0,0,1,0,0,!0),t.isContainer?uh(r,t,((e,n)=>o.renderGroup(t,i,t.parent.globalTransMatrix,!e&&n)),i):o.renderItem(t,i),r.camera=null,r.restore(),r.modelMatrix!==h&&ol.free(r.modelMatrix),r.modelMatrix=h,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}var _h=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Sh=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ah=function(t,e){return function(i,o){e(i,o,t)}};const Rh=Symbol.for("RenderService");let Bh=class{constructor(t){this.drawContribution=t}prepare(t){t&&this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}};Bh=_h([f(),Ah(0,g(ch)),Sh("design:paramtypes",[Object])],Bh);var Mh=new i((t=>{t(Rh).to(Bh)}));const Th=Symbol.for("PickerService"),Ph=Symbol.for("GlobalPickerService"),Eh=(t,e,i)=>{const{outerBorder:o,shadowBlur:n=e.shadowBlur}=t;if(o){const t=e.outerBorder,{distance:r=t.distance,lineWidth:s=t.lineWidth}=o;i.expand(r+(n+s)/2)}return i},kh=["radius","startAngle","endAngle",...wr];class Lh extends Br{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{radius:1}),this.type="circle",this.numberType=Zr}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}getGraphicTheme(){return _n(this).circle}updateAABBBounds(t,e,i,o){this.updatePathProxyAABBBounds(i)||(o?this.updateCircleAABBBoundsImprecise(t,e,i):this.updateCircleAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=zo.graphicService.updateTempAABBBounds(i);return Eh(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),zo.graphicService.transformAABBBounds(t,i,e,!1,this),i}updateCircleAABBBoundsImprecise(t,e,i){const{radius:o=e.radius}=t;return i.set(-o,-o,o,o),i}updateCircleAABBBoundsAccurate(t,e,i){const{startAngle:o=e.startAngle,endAngle:n=e.endAngle,radius:r=e.radius}=t;return n-o>ie-Jt?i.set(-r,-r,r,r):ir(o,n,r,i),i}needUpdateTags(t){return super.needUpdateTags(t,kh)}needUpdateTag(t){return super.needUpdateTag(t,kh)}toCustomPath(){var t,e,i;const o=this.attribute,n=null!==(t=o.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),r=null!==(e=o.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),s=null!==(i=o.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),l=new co;return l.arc(0,0,n,r,s),l}clone(){return new Lh(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Lh.NOWORK_ANIMATE_ATTR}}function Hh(t){return new Lh(t)}Lh.NOWORK_ANIMATE_ATTR=Rr;class Fh{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,o,n,r,s,l,a){const h=[],d=[e,i],c=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,s,l,a);h.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===o||"start"===o||("center"===o?c[0]=d[0]/-2:"right"!==o&&"end"!==o||(c[0]=-d[0])),"top"===n||("middle"===n?c[1]=d[1]/-2:"bottom"===n&&(c[1]=-d[1]));const u={xOffset:c[0],yOffset:c[1],width:d[0],height:d[1]};return this.layoutWithBBox(u,h,o,n,r)}GetLayoutByLines(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",r=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"end";t=t.map((t=>t.toString()));const a=[],h=[0,0];if("number"==typeof s&&s!==1/0){let e;for(let i=0,o=t.length;i<o;i++)e=Math.min(this.textMeasure.measureTextWidth(t[i],this.textOptions),s),a.push({str:this.textMeasure.clipTextWithSuffix(t[i],this.textOptions,e,n,r,l).str,width:e});h[0]=s}else{let e,i;s=0;for(let o=0,n=t.length;o<n;o++)i=t[o],e=this.textMeasure.measureTextWidth(i,this.textOptions),s=Math.max(s,e),a.push({str:i,width:e});h[0]=s}h[1]=a.length*o,h[0]=a.reduce(((t,e)=>Math.max(t,e.width)),0);const d={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(d,e,i),this.layoutWithBBox(d,a,e,i,o)}layoutWithBBox(t,e,i,o,n){const r=[0,0],s=e.length*n;"top"===o||("middle"===o?r[1]=(t.height-s)/2:"bottom"===o&&(r[1]=t.height-s));for(let s=0;s<e.length;s++)this.lineOffset(t,e[s],i,o,n,r);return{bbox:t,lines:e,fontFamily:this.fontFamily,fontSize:this.textOptions.fontSize,fontWeight:this.textOptions.fontWeight,lineHeight:n,textAlign:i,textBaseline:o}}lineOffset(t,e,i,o,n,r){return"left"===i||"start"===i?e.leftOffset=0:"center"===i?e.leftOffset=(t.width-e.width)/2:"right"!==i&&"end"!==i||(e.leftOffset=t.width-e.width),e.topOffset=(n-this.textOptions.fontSize)/2+.79*this.textOptions.fontSize+r[1],r[1]+=n,e}}const zh=["text","maxLineWidth","textAlign","textBaseline","heightLimit","lineClamp","fontSize","fontFamily","fontWeight","ellipsis","lineHeight","direction","wordBreak","heightLimit","lineClamp",...wr];class Ih extends Br{get font(){const t=this.getGraphicTheme();return this._font||(this._font=Te(this.attribute,t)),this._font}get clipedText(){var t;const e=this.attribute,i=this.getGraphicTheme();if(!this.isSimplify())return;const{maxLineWidth:o=i.maxLineWidth}=e;return Number.isFinite(o)?(this.tryUpdateAABBBounds(),this.cache.clipedText):(null!==(t=e.text)&&void 0!==t?t:i.text).toString()}get clipedWidth(){if(this.isSimplify())return this.tryUpdateAABBBounds(),this.cache.clipedWidth}get cliped(){var t,e;const i=this.getGraphicTheme(),o=this.attribute,{maxLineWidth:n=i.maxLineWidth,text:r,whiteSpace:s=i.whiteSpace}=o;if(!Number.isFinite(n))return!1;if(this.tryUpdateAABBBounds(),null===(e=null===(t=this.cache)||void 0===t?void 0:t.layoutData)||void 0===e?void 0:e.lines){let t="";return this.cache.layoutData.lines.forEach((e=>{t+=e.str})),(Array.isArray(r)?r.join(""):r)!==t}return"vertical"===o.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==o.text.toString():null!=this.clipedText&&this.clipedText!==o.text.toString()}get multilineLayout(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{text:"",fontSize:16}),this.type="text",this.numberType=rs,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return et(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return _n(this).text}doUpdateOBBBounds(){const t=this.getGraphicTheme();this._OBBBounds.clear();const e=this.attribute,{angle:i=t.angle}=e;if(!i){const t=this.AABBBounds;return this._OBBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._OBBBounds}this.obbText||(this.obbText=new Ih({})),this.obbText.setAttributes(Object.assign(Object.assign({},e),{angle:0}));const o=this.obbText.AABBBounds,{x:n,y:r}=e,s={x:(o.x1+o.x2)/2,y:(o.y1+o.y2)/2},l=Se(s,i,{x:n,y:r});return this._OBBBounds.copy(o),this._OBBBounds.translate(l.x-s.x,l.y-s.y),this._OBBBounds.angle=i,this._OBBBounds}updateAABBBounds(t,e,i){const{text:o=e.text}=this.attribute;Array.isArray(o)?this.updateMultilineAABBBounds(o):this.updateSingallineAABBBounds(o);const{tb1:n}=zo.graphicService.updateTempAABBBounds(i),{scaleX:r=e.scaleX,scaleY:s=e.scaleY,shadowBlur:l=e.shadowBlur,strokeBoundsBuffer:a=e.strokeBoundsBuffer}=t;if(l){Dr(n,l/Math.abs(r+s),!0,a),i.union(n)}return zo.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||zo.graphicService.updateHTMLTextAABBBounds(t,e,i),Ee(i,i,this.transMatrix),i}updateWrapAABBBounds(t){var e,i,o,n;const r=this.getGraphicTheme(),{fontFamily:s=r.fontFamily,textAlign:l=r.textAlign,textBaseline:a=r.textBaseline,fontSize:h=r.fontSize,ellipsis:d=r.ellipsis,maxLineWidth:c,stroke:u=r.stroke,lineWidth:g=r.lineWidth,wordBreak:p=r.wordBreak,fontWeight:f=r.fontWeight,ignoreBuf:v=r.ignoreBuf,suffixPosition:m=r.suffixPosition,heightLimit:b=0,lineClamp:C}=this.attribute,y=null!==(e=ar(this.attribute.lineHeight,this.attribute.fontSize||r.fontSize))&&void 0!==e?e:this.attribute.fontSize||r.fontSize,w=v?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}const x=zo.graphicUtil.textMeasure,_=new Fh(s,{fontSize:h,fontWeight:f,fontFamily:s},x),S=et(t)?t.map((t=>t.toString())):[t.toString()],A=[],R=[0,0];let B=1/0;if(b>0&&(B=Math.max(Math.floor(b/y),1)),C&&(B=Math.min(B,C)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<S.length;t++){const e=S[t];let i=!0;if(t===B-1){const i=_.textMeasure.clipTextWithSuffix(e,_.textOptions,c,d,!1,m,t!==S.length-1);A.push({str:i.str,width:i.width});break}const r=_.textMeasure.clipText(e,_.textOptions,c,"break-all"!==p,"keep-all"===p);if(""!==e&&""===r.str||r.wordBreaked){if(d){const t=_.textMeasure.clipTextWithSuffix(e,_.textOptions,c,d,!1,m);r.str=null!==(o=t.str)&&void 0!==o?o:"",r.width=null!==(n=t.width)&&void 0!==n?n:0}else r.str="",r.width=0;i=!1}A.push({str:r.str,width:r.width});let s=r.str.length;if(!r.wordBreaked||""!==e&&""===r.str||(i=!0,s=r.wordBreaked),r.str.length===e.length);else if(i){let i=e.substring(s);"keep-all"===p&&(i=i.replace(/^\s+/g,"")),S.splice(t+1,0,i)}}let t=0;A.forEach((e=>{t=Math.max(t,e.width)})),R[0]=t}else{let t,e,i=0;for(let o=0,n=S.length;o<n;o++){if(o===B-1){const t=_.textMeasure.clipTextWithSuffix(S[o],_.textOptions,c,d,!1,m);A.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=S[o],t=_.textMeasure.measureTextWidth(e,_.textOptions,"break-word"===p),i=Math.max(i,t),A.push({str:e,width:t})}R[0]=i}R[1]=A.length*(y+w);const M={xOffset:0,yOffset:0,width:R[0],height:R[1]};_.LayoutBBox(M,l,a);const T=_.layoutWithBBox(M,A,l,a,y);return this.cache.layoutData=T,this.clearUpdateShapeTag(),this._AABBBounds.set(M.xOffset,M.yOffset,M.xOffset+M.width,M.yOffset+M.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}updateSingallineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:o=e.underlineOffset}=this.attribute,n="horizontal"===i?this.updateHorizontalSinglelineAABBBounds(t):this.updateVerticalSinglelineAABBBounds(t);return"horizontal"===i&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),n}updateMultilineAABBBounds(t){const e=this.getGraphicTheme(),{direction:i=e.direction,underlineOffset:o=e.underlineOffset}=this.attribute,n="horizontal"===i?this.updateHorizontalMultilineAABBBounds(t):this.updateVerticalMultilineAABBBounds(t);return"horizontal"===i&&o&&this._AABBBounds.add(this._AABBBounds.x1,this._AABBBounds.y2+o),n}updateHorizontalSinglelineAABBBounds(t){var e,i;const o=this.getGraphicTheme(),{wrap:n=o.wrap}=this.attribute;if(n)return this.updateWrapAABBBounds([t]);const r=zo.graphicUtil.textMeasure;let s,l;const a=this.attribute,{maxLineWidth:h=o.maxLineWidth,ellipsis:d=o.ellipsis,textAlign:c=o.textAlign,textBaseline:u=o.textBaseline,fontFamily:g=o.fontFamily,fontSize:p=o.fontSize,fontWeight:f=o.fontWeight,stroke:v=o.stroke,lineWidth:m=o.lineWidth,ignoreBuf:b=o.ignoreBuf,whiteSpace:C=o.whiteSpace,suffixPosition:y=o.suffixPosition}=a;if("normal"===C)return this.updateWrapAABBBounds(t);const w=b?0:Math.max(2,.075*p),x=a.fontSize||o.fontSize,_=null!==(e=ar(a.lineHeight,x))&&void 0!==e?e:x+w;if(!this.shouldUpdateShape()&&this.cache){s=null!==(i=this.cache.clipedWidth)&&void 0!==i?i:0;const t=Xs(c,s),e=Ks(u,_,p);return this._AABBBounds.set(t,e,t+s,e+_),v&&this._AABBBounds.expand(m/2),this._AABBBounds}if(Number.isFinite(h)){if(d){const e=!0===d?o.ellipsis:d,i=r.clipTextWithSuffix(t.toString(),{fontSize:p,fontWeight:f,fontFamily:g},h,e,!1,y);l=i.str,s=i.width}else{const e=r.clipText(t.toString(),{fontSize:p,fontWeight:f,fontFamily:g},h,!1);l=e.str,s=e.width}this.cache.clipedText=l,this.cache.clipedWidth=s}else s=r.measureTextWidth(t.toString(),{fontSize:p,fontWeight:f,fontFamily:g}),this.cache.clipedText=t.toString(),this.cache.clipedWidth=s;this.clearUpdateShapeTag();const S=Xs(c,s);let A=_;zo.global&&zo.global.isSafari()&&(A+=.2*p);const R=Ks(u,A,p,w);return this._AABBBounds.set(S,R,S+s,R+A),v&&this._AABBBounds.expand(m/2),this._AABBBounds}getBaselineMapAlign(){return Ih.baselineMapAlign}getAlignMapBaseline(){return Ih.alignMapBaseline}updateVerticalSinglelineAABBBounds(t){var e,i,o;const n=this.getGraphicTheme(),r=zo.graphicUtil.textMeasure;let s;const l=this.attribute,{ignoreBuf:a=n.ignoreBuf}=l,h=a?0:2,{maxLineWidth:d=n.maxLineWidth,ellipsis:c=n.ellipsis,fontSize:u=n.fontSize,fontWeight:g=n.fontWeight,fontFamily:p=n.fontFamily,stroke:f=n.stroke,lineWidth:v=n.lineWidth,verticalMode:m=n.verticalMode,suffixPosition:b=n.suffixPosition}=l,C=null!==(e=ar(l.lineHeight,l.fontSize||n.fontSize))&&void 0!==e?e:(l.fontSize||n.fontSize)+h;let{textAlign:y=n.textAlign,textBaseline:w=n.textBaseline}=l;if(!m){const t=y;y=null!==(i=Ih.baselineMapAlign[w])&&void 0!==i?i:"left",w=null!==(o=Ih.alignMapBaseline[t])&&void 0!==o?o:"top"}if(!this.shouldUpdateShape()&&this.cache){s=this.cache.clipedWidth;const t=Xs(y,s),e=Ks(w,C,u);return this._AABBBounds.set(e,t,e+C,t+s),f&&this._AABBBounds.expand(v/2),this._AABBBounds}let x=[jr(t.toString())];if(Number.isFinite(d)){if(c){const t=!0===c?n.ellipsis:c,e=r.clipTextWithSuffixVertical(x[0],{fontSize:u,fontWeight:g,fontFamily:p},d,t,!1,b);x=[e.verticalList],s=e.width}else{const t=r.clipTextVertical(x[0],{fontSize:u,fontWeight:g,fontFamily:p},d,!1);x=[t.verticalList],s=t.width}this.cache.verticalList=x,this.cache.clipedWidth=s}else s=0,x[0].forEach((t=>{const e=t.direction===Gr.HORIZONTAL?u:r.measureTextWidth(t.text,{fontSize:u,fontWeight:g,fontFamily:p});s+=e,t.width=e})),this.cache.verticalList=x,this.cache.clipedWidth=s;this.clearUpdateShapeTag();const _=Xs(y,s),S=Ks(w,C,u);return this._AABBBounds.set(S,_,S+C,_+s),f&&this._AABBBounds.expand(v/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,i;const o=this.getGraphicTheme(),{wrap:n=o.wrap}=this.attribute;if(n)return this.updateWrapAABBBounds(t);const r=this.attribute,{fontFamily:s=o.fontFamily,textAlign:l=o.textAlign,textBaseline:a=o.textBaseline,fontSize:h=o.fontSize,fontWeight:d=o.fontWeight,ellipsis:c=o.ellipsis,maxLineWidth:u,stroke:g=o.stroke,lineWidth:p=o.lineWidth,whiteSpace:f=o.whiteSpace,suffixPosition:v=o.suffixPosition}=r,m=null!==(e=ar(r.lineHeight,r.fontSize||o.fontSize))&&void 0!==e?e:r.fontSize||o.fontSize;if("normal"===f)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),g&&this._AABBBounds.expand(p/2),this._AABBBounds}const b=zo.graphicUtil.textMeasure,C=new Fh(s,{fontSize:h,fontWeight:d,fontFamily:s},b).GetLayoutByLines(t,l,a,m,!0===c?o.ellipsis:c||void 0,!1,u,v),{bbox:y}=C;return this.cache.layoutData=C,this.clearUpdateShapeTag(),this._AABBBounds.set(y.xOffset,y.yOffset,y.xOffset+y.width,y.yOffset+y.height),g&&this._AABBBounds.expand(p/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i,o;const n=this.getGraphicTheme(),r=zo.graphicUtil.textMeasure;let s;const l=this.attribute,{ignoreBuf:a=n.ignoreBuf}=l,h=a?0:2,{maxLineWidth:d=n.maxLineWidth,ellipsis:c=n.ellipsis,fontFamily:u=n.fontFamily,fontSize:g=n.fontSize,fontWeight:p=n.fontWeight,stroke:f=n.stroke,lineWidth:v=n.lineWidth,verticalMode:m=n.verticalMode,suffixPosition:b=n.suffixPosition}=l,C=null!==(e=ar(l.lineHeight,l.fontSize||n.fontSize))&&void 0!==e?e:(l.fontSize||n.fontSize)+h;let{textAlign:y=n.textAlign,textBaseline:w=n.textBaseline}=l;if(!m){const t=y;y=null!==(i=Ih.baselineMapAlign[w])&&void 0!==i?i:"left",w=null!==(o=Ih.alignMapBaseline[t])&&void 0!==o?o:"top"}if(s=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);s=se(e,s)}));const t=Xs(y,s),e=this.cache.verticalList.length*C,i=Ks(w,e,g);return this._AABBBounds.set(i,t,i+e,t+s),f&&this._AABBBounds.expand(v/2),this._AABBBounds}const x=t.map((t=>jr(t.toString())));x.forEach(((t,e)=>{if(Number.isFinite(d))if(c){const i=!0===c?n.ellipsis:c,o=r.clipTextWithSuffixVertical(t,{fontSize:g,fontWeight:p,fontFamily:u},d,i,!1,b);x[e]=o.verticalList,s=o.width}else{const i=r.clipTextVertical(t,{fontSize:g,fontWeight:p,fontFamily:u},d,!1);x[e]=i.verticalList,s=i.width}else s=0,t.forEach((t=>{const e=t.direction===Gr.HORIZONTAL?g:r.measureTextWidth(t.text,{fontSize:g,fontWeight:p,fontFamily:u});s+=e,t.width=e}))})),this.cache.verticalList=x,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);s=se(e,s)}));const _=Xs(y,s),S=this.cache.verticalList.length*C,A=Ks(w,S,g);return this._AABBBounds.set(A,_,A+S,_+s),f&&this._AABBBounds.expand(v/2),this._AABBBounds}needUpdateTags(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zh;return super.needUpdateTags(t,e)}needUpdateTag(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zh;return super.needUpdateTag(t,e)}clone(){return new Ih(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Ih.NOWORK_ANIMATE_ATTR}}function Oh(t){return new Ih(t)}Ih.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Rr),Ih.baselineMapAlign={top:"left",bottom:"right",middle:"center"},Ih.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const Dh=["heightLimit","lineClamp"];class Wh extends Ih{constructor(t){super(Object.assign(Object.assign({},t),{wrap:!0}))}_isValid(){const{text:t}=this.attribute;return et(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}updateMultilineAABBBounds(t){var e,i,o,n;const r=this.getGraphicTheme(),{fontFamily:s=r.fontFamily,textAlign:l=r.textAlign,textBaseline:a=r.textBaseline,fontSize:h=r.fontSize,ellipsis:d=r.ellipsis,maxLineWidth:c,stroke:u=r.stroke,lineWidth:g=r.lineWidth,wordBreak:p=r.wordBreak,fontWeight:f=r.fontWeight,ignoreBuf:v=r.ignoreBuf,heightLimit:m=0,suffixPosition:b=r.suffixPosition,lineClamp:C}=this.attribute,y=null!==(e=ar(this.attribute.lineHeight,this.attribute.fontSize||r.fontSize))&&void 0!==e?e:this.attribute.fontSize||r.fontSize,w=v?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}const x=zo.graphicUtil.textMeasure,_=new Fh(s,{fontSize:h,fontWeight:f,fontFamily:s},x),S=t.map((t=>t.toString())),A=[],R=[0,0];let B=1/0;if(m>0&&(B=Math.max(Math.floor(m/y),1)),C&&(B=Math.min(B,C)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t<S.length;t++){const e=S[t];let i=!0;if(t===B-1){const t=_.textMeasure.clipTextWithSuffix(e,_.textOptions,c,d,!1,b);A.push({str:t.str,width:t.width});break}const r=_.textMeasure.clipText(e,_.textOptions,c,"break-word"===p);if(""!==e&&""===r.str){if(d){const t=_.textMeasure.clipTextWithSuffix(e,_.textOptions,c,d,!1,b);r.str=null!==(o=t.str)&&void 0!==o?o:"",r.width=null!==(n=t.width)&&void 0!==n?n:0}else r.str="",r.width=0;i=!1}if(A.push({str:r.str,width:r.width}),r.str.length===e.length);else if(i){const i=e.substring(r.str.length);S.splice(t+1,0,i)}}let t=0;A.forEach((e=>{t=Math.max(t,e.width)})),R[0]=t}else{let t,e,i=0;for(let o=0,n=S.length;o<n;o++){if(o===B-1){const t=_.textMeasure.clipTextWithSuffix(S[o],_.textOptions,c,d,!1,b);A.push({str:t.str,width:t.width}),i=Math.max(i,t.width);break}e=S[o],t=_.textMeasure.measureTextWidth(e,_.textOptions,"break-word"===p),i=Math.max(i,t),A.push({str:e,width:t})}R[0]=i}R[1]=A.length*(y+w);const M={xOffset:0,yOffset:0,width:R[0],height:R[1]};_.LayoutBBox(M,l,a);const T=_.layoutWithBBox(M,A,l,a,y);return this.cache.layoutData=T,this.clearUpdateShapeTag(),this._AABBBounds.set(M.xOffset,M.yOffset,M.xOffset+M.width,M.yOffset+M.height),u&&this._AABBBounds.expand(g/2),this._AABBBounds}needUpdateTags(t){for(let e=0;e<Dh.length;e++){const i=Dh[e];if(-1!==t.indexOf(i))return!0}return super.needUpdateTags(t)}needUpdateTag(t){for(let e=0;e<Dh.length;e++)if(t===Dh[e])return!0;return super.needUpdateTag(t)}getNoWorkAnimateAttr(){return Wh.NOWORK_ANIMATE_ATTR}}function Nh(t){return new Wh(t)}class Gh{bounds(t,e){if(nt(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}}function jh(t,e,i,o,n){return n?t.arc(i,o,e,0,ee,!1,n):t.arc(i,o,e,0,ee),!1}var Uh=new class extends Gh{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,o,n){return jh(t,e/2,i,o,n)}drawOffset(t,e,i,o,n,r){return jh(t,e/2+n,i,o,r)}drawToSvgPath(t,e,i,o){const n=t/2;return`M ${e-n}, ${i} a ${n},${n} 0 1,0 ${2*n},0 a ${n},${n} 0 1,0 -${2*n},0`}};var Vh=new class extends Gh{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,o,n){return function(t,e,i,o,n){return t.moveTo(-3*e+i,-e+o,n),t.lineTo(-e+i,-e+o,n),t.lineTo(-e+i,-3*e+o,n),t.lineTo(e+i,-3*e+o,n),t.lineTo(e+i,-e+o,n),t.lineTo(3*e+i,-e+o,n),t.lineTo(3*e+i,e+o,n),t.lineTo(e+i,e+o,n),t.lineTo(e+i,3*e+o,n),t.lineTo(-e+i,3*e+o,n),t.lineTo(-e+i,e+o,n),t.lineTo(-3*e+i,e+o,n),t.closePath(),!0}(t,e/6,i,o,n)}drawOffset(t,e,i,o,n,r){return function(t,e,i,o,n,r){return t.moveTo(-3*e+i-n,-e+o-n,r),t.lineTo(-e+i-n,-e+o-n,r),t.lineTo(-e+i-n,-3*e+o-n,r),t.lineTo(e+i+n,-3*e+o-n,r),t.lineTo(e+i+n,-e+o-n,r),t.lineTo(3*e+i+n,-e+o-n,r),t.lineTo(3*e+i+n,e+o+n,r),t.lineTo(e+i+n,e+o+n,r),t.lineTo(e+i+n,3*e+o+n,r),t.lineTo(-e+i-n,3*e+o+n,r),t.lineTo(-e+i-n,e+o+n,r),t.lineTo(-3*e+i-n,e+o+n,r),t.closePath(),!0}(t,e/6,i,o,n,r)}};function $h(t,e,i,o,n){return t.moveTo(i,o-e,n),t.lineTo(e+i,o,n),t.lineTo(i,o+e,n),t.lineTo(i-e,o,n),t.closePath(),!0}var Yh=new class extends Gh{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,o,n){return $h(t,e/2,i,o,n)}drawFitDir(t,e,i,o,n){return $h(t,e/2,i,o,n)}drawOffset(t,e,i,o,n,r){return $h(t,e/2+n,i,o,r)}};function Xh(t,e,i,o){const n=2*e;return t.rect(i-e,o-e,n,n),!1}var Kh=new class extends Gh{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,o){return Xh(t,e/2,i,o)}drawOffset(t,e,i,o,n){return Xh(t,e/2+n,i,o)}};function Zh(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i+e+2*n,e+o+n),t.lineTo(i-e-2*n,e+o+n),t.lineTo(i,o-e-2*n),t.closePath(),!0}class qh extends Gh{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,o){return Zh(t,e/2,i,o)}drawOffset(t,e,i,o,n){return Zh(t,e/2,i,o,n)}}var Jh=new qh;var Qh=new class extends qh{constructor(){super(...arguments),this.type="triangle"}};const td=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),ed=Math.sin(ee/10)*td,id=-Math.cos(ee/10)*td;function od(t,e,i,o){const n=ed*e,r=id*e;t.moveTo(i,-e+o),t.lineTo(n+i,r+o);for(let s=1;s<5;++s){const l=ee*s/5,a=Math.cos(l),h=Math.sin(l);t.lineTo(h*e+i,-a*e+o),t.lineTo(a*n-h*r+i,h*n+a*r+o)}return t.closePath(),!0}var nd=new class extends Gh{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,o){return od(t,e/2,i,o)}drawOffset(t,e,i,o,n){return od(t,e/2+n,i,o)}};const rd=he(3);function sd(t,e,i,o){const n=e,r=n/rd,s=r/5,l=e;return t.moveTo(0+i,-n+o),t.lineTo(r/2+i,o),t.lineTo(s/2+i,o),t.lineTo(s/2+i,l+o),t.lineTo(-s/2+i,l+o),t.lineTo(-s/2+i,o),t.lineTo(-r/2+i,o),t.closePath(),!0}var ld=new class extends Gh{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,o){return sd(t,e/2,i,o)}drawOffset(t,e,i,o,n){return sd(t,e/2+n,i,o)}};function ad(t,e,i,o){const n=2*e;return t.moveTo(i,-e+o),t.lineTo(n/3/2+i,e+o),t.lineTo(-n/3/2+i,e+o),t.closePath(),!0}var hd=new class extends Gh{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,o){return ad(t,e/2,i,o)}drawOffset(t,e,i,o,n){return ad(t,e/2+n,i,o)}};function dd(t,e,i,o){return t.moveTo(-e+i,o),t.lineTo(i,e+o),!1}var cd=new class extends Gh{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,o){return dd(t,e/2,i,o)}drawOffset(t,e,i,o,n){return dd(t,e/2+n,i,o)}};const ud=-.5,gd=he(3)/2,pd=1/he(12);function fd(t,e,i,o){const n=e/2,r=e*pd,s=n,l=e*pd+e,a=-s,h=l;return t.moveTo(n+i,r+o),t.lineTo(s+i,l+o),t.lineTo(a+i,h+o),t.lineTo(ud*n-gd*r+i,gd*n+ud*r+o),t.lineTo(ud*s-gd*l+i,gd*s+ud*l+o),t.lineTo(ud*a-gd*h+i,gd*a+ud*h+o),t.lineTo(ud*n+gd*r+i,ud*r-gd*n+o),t.lineTo(ud*s+gd*l+i,ud*l-gd*s+o),t.lineTo(ud*a+gd*h+i,ud*h-gd*a+o),t.closePath(),!1}var vd=new class extends Gh{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,o){return fd(t,e/2,i,o)}drawOffset(t,e,i,o,n){return fd(t,e/2+n,i,o)}};function md(t,e,i,o,n){return t.moveTo(-e+i-2*n,o),t.lineTo(e+i+n,e+o+2*n),t.lineTo(e+i+n,o-e-2*n),t.closePath(),!0}var bd=new class extends Gh{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,o){return md(t,e/2,i,o,0)}drawOffset(t,e,i,o,n){return md(t,e/2,i,o,n)}};function Cd(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-n,e+o+2*n),t.lineTo(e+i+2*n,o),t.lineTo(i-e-n,o-e-2*n),t.closePath(),!0}var yd=new class extends Gh{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,o){return Cd(t,e/2,i,o)}drawOffset(t,e,i,o,n){return Cd(t,e/2,i,o,n)}};function wd(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return t.moveTo(i-e-2*n,o-e-n),t.lineTo(i+e+2*n,o-e-n),t.lineTo(i,o+e+2*n),t.closePath(),!0}var xd=new class extends Gh{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,o){return wd(t,e/2,i,o)}drawOffset(t,e,i,o,n){return wd(t,e/2,i,o,n)}};const _d=he(3);function Sd(t,e,i,o){const n=e*_d;return t.moveTo(i,o+-n/3*2),t.lineTo(e+i,o+n),t.lineTo(i-e,o+n),t.closePath(),!0}var Ad=new class extends Gh{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,o){return Sd(t,e/2/_d,i,o)}drawOffset(t,e,i,o,n){return Sd(t,e/2/_d+n,i,o)}};function Rd(t,e,i,o){const n=2*e;return t.moveTo(e+i,o-n),t.lineTo(i-e,o),t.lineTo(e+i,n+o),!0}var Bd=new class extends Gh{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,o){return Rd(t,e/4,i,o)}drawOffset(t,e,i,o,n){return Rd(t,e/4+n,i,o)}};function Md(t,e,i,o){const n=2*e;return t.moveTo(i-e,o-n),t.lineTo(i+e,o),t.lineTo(i-e,n+o),!0}var Td=new class extends Gh{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,o){return Md(t,e/4,i,o)}drawOffset(t,e,i,o,n){return Md(t,e/4+n,i,o)}};function Pd(t,e,i,o){const n=2*e;return t.moveTo(i-n,o+e),t.lineTo(i,o-e),t.lineTo(i+n,o+e),!0}var Ed=new class extends Gh{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,o){return Pd(t,e/4,i,o)}drawOffset(t,e,i,o,n){return Pd(t,e/4+n,i,o)}};function kd(t,e,i,o){const n=2*e;return t.moveTo(i-n,o-e),t.lineTo(i,o+e),t.lineTo(i+n,o-e),!0}var Ld=new class extends Gh{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,o){return kd(t,e/4,i,o)}drawOffset(t,e,i,o,n){return kd(t,e/4+n,i,o)}};function Hd(t,e,i,o,n){return t.moveTo(i,o-e),t.lineTo(i,o+e),!0}var Fd=new class extends Gh{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,o,n){return Hd(t,e/2,i,o)}drawOffset(t,e,i,o,n,r){return Hd(t,e/2+n,i,o)}drawToSvgPath(t,e,i,o){const n=t/2;return`M ${e}, ${i-n} L ${e},${i+n}`}};function zd(t,e,i,o,n){return t.moveTo(i-e,o),t.lineTo(i+e,o),!0}var Id=new class extends Gh{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,o,n){return zd(t,e/2,i,o)}drawOffset(t,e,i,o,n,r){return zd(t,e/2+n,i,o)}drawToSvgPath(t,e,i,o){const n=t/2;return`M ${e-n}, ${i} L ${e+n},${i}`}};function Od(t,e,i,o,n){return t.moveTo(i-e,o-e),t.lineTo(i+e,o+e),t.moveTo(i+e,o-e),t.lineTo(i-e,o+e),!0}var Dd=new class extends Gh{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,o,n){return Od(t,e/2,i,o)}drawOffset(t,e,i,o,n,r){return Od(t,e/2+n,i,o)}drawToSvgPath(t,e,i,o){const n=t/2;return`M ${e-n}, ${i-n} L ${e+n},${i+n} M ${e+n}, ${i-n} L ${e-n},${i+n}`}};function Wd(t,e,i,o){return t.rect(i-e[0]/2,o-e[1]/2,e[0],e[1]),!1}function Nd(t,e,i,o){const n=e,r=e/2;return t.rect(i-n/2,o-r/2,n,r),!1}var Gd=new class extends Gh{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,o){return nt(e)?Nd(t,e,i,o):Wd(t,e,i,o)}drawOffset(t,e,i,o,n){return nt(e)?Nd(t,e+2*n,i,o):Wd(t,[e[0]+2*n,e[1]+2*n],i,o)}};const jd=new Le;class Ud{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.pathStr="",this.type=t,et(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,o,n,r,s){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),Ti(n.path.commandList,t,i,o,e,e),s&&s(n.path,n.attribute)})),!1):(Ti(this.path.commandList,t,i,o,e+n,e+n),!1)}draw(t,e,i,o,n,r){return this.drawOffset(t,e,i,o,0,n,r)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((i=>{let{path:o}=i;jd.x1=o.bounds.x1*t,jd.y1=o.bounds.y1*t,jd.x2=o.bounds.x2*t,jd.y2=o.bounds.y2*t,e.union(jd)}))}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 Vd={};[Uh,Vh,Yh,Kh,Ad,Qh,nd,ld,hd,cd,vd,bd,yd,Jh,xd,Bd,Td,Ed,Ld,Gd,Fd,Id,Dd].forEach((t=>{Vd[t.type]=t}));const $d={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"},Yd=new Le,Xd=["symbolType","size",...wr];let Kd=class t extends Br{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{symbolType:"circle"}),this.type="symbol",this.numberType=ns}getParsedPath(){return this.shouldUpdateShape()&&(this.doUpdateParsedPath(),this.clearUpdateShapeTag()),this._parsedPath}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{size:t}=this.attribute;return et(t)?2===t.length&&t.every(this._validNumber):this._validNumber(t)}doUpdateParsedPath(){const e=this.getGraphicTheme();let{symbolType:i=e.symbolType}=this.attribute,o=Vd[i];if(o)return this._parsedPath=o,o;if(o=t.userSymbolMap[i],o)return this._parsedPath=o,o;if(i=$d[i]||i,!0===function(t){return t.startsWith("<svg")||t.startsWith("<?xml")}(i)){const e=new Or,{svg:o}=e.parse(i);if(!o)return null;const n=et(o.path)?o.path:[o.path];Yd.clear();const r=[];n.forEach((t=>{const e=(new co).fromString(t.d),i={};hs.forEach((e=>{t[e]&&(i[as[e]]=t[e])})),r.push({path:e,attribute:i}),Yd.union(e.bounds)}));const s=Yd.width(),l=Yd.height(),a=1/se(s,l);return r.forEach((t=>t.path.transform(0,0,a,a))),this._parsedPath=new Ud(i,r,!0),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}const n=(new co).fromString(i),r=n.bounds.width(),s=n.bounds.height(),l=1/se(r,s);return n.transform(0,0,l,l),this._parsedPath=new Ud(i,n),t.userSymbolMap[i]=this._parsedPath,this._parsedPath}getGraphicTheme(){return _n(this).symbol}updateAABBBounds(t,e,i,o){this.updatePathProxyAABBBounds(i)||(o?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=zo.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:o,shadowBlur:n=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(o){const t=e.outerBorder,{distance:s=t.distance,lineWidth:l=t.lineWidth}=o;Dr(i,s+(n+l)/2,!0,r)}})(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:s=e.lineJoin}=t;return zo.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:o=e.size}=t;if(et(o))i.set(-o[0]/2,-o[1]/2,o[0]/2,o[1]/2);else{const t=o/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:o=e.size}=t;return this.getParsedPath().bounds(o,i),i}needUpdateTags(t){return super.needUpdateTags(t,Xd)}needUpdateTag(t){return super.needUpdateTag(t,Xd)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=et(e)?e:[e,e];return t.path?(new co).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new co).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Zd(t){return new Kd(t)}Kd.userSymbolMap={},Kd.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Rr);const qd=["segments","points","curveType","curveTension",...wr];let Jd=class t extends Br{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),this.type="line",this.numberType=Qr}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,o,n){"points"===t&&(n.points=nr(i,o,e))}getGraphicTheme(){return _n(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),zo.graphicService.updateTempAABBBounds(i);const{lineJoin:o=e.lineJoin}=t;return zo.graphicService.transformAABBBounds(t,i,e,"miter"===o,this),i}updateLineAABBBoundsByPoints(t,e,i,o){const{points:n=e.points,connectedType:r}=t,s=i;return n.forEach((t=>{!1===t.defined&&"zero"!==r&&"connect"!==r||s.add(t.x,t.y)})),s}updateLineAABBBoundsBySegments(t,e,i,o){const{segments:n=e.segments,connectedType:r}=t,s=i;return n.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"zero"!==r&&"connect"!==r||s.add(t.x,t.y)}))})),s}needUpdateTags(t){return super.needUpdateTags(t,qd)}needUpdateTag(t){return super.needUpdateTag(t,qd)}toCustomPath(){const t=this.attribute,e=new co,i=t.segments,o=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{o(t.points)})):t.points&&o(t.points),e}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function Qd(t){return new Jd(t)}Jd.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Rr);const tc=["width","x1","y1","height","cornerRadius",...wr];let ec=class t extends Br{constructor(t){super(t),this.type="rect",this.numberType=is}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return _n(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:o}=t;const{x1:n,y1:r,x:s,y:l}=t;e=null!=e?e:n-s,o=null!=o?o:r-l,(isFinite(e)||isFinite(o)||isFinite(s)||isFinite(l))&&i.set(0,0,e||0,o||0)}const{tb1:o,tb2:n}=zo.graphicService.updateTempAABBBounds(i);return Eh(t,e,o),i.union(o),o.setValue(n.x1,n.y1,n.x2,n.y2),zo.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,tc)}needUpdateTag(t){return super.needUpdateTag(t,tc)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:o,height:n}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=X(t.width)?t.x1-t.x:t.width,i=X(t.height)?t.y1-t.y:t.height,o=0,n=0;return e<0?(o=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(n=i,i=-i):Number.isNaN(i)&&(i=0),{x:o,y:n,width:e,height:i}})(t),r=new co;return r.moveTo(e,i),r.rect(e,i,o,n),r}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function ic(t){return new ec(t)}ec.NOWORK_ANIMATE_ATTR=Rr;class oc{constructor(t,e,i,o,n,r,s,l,a,h,d,c,u,g){this.left=t,this.top=e,this.width=i,this.height=o,this.actualHeight=0,this.bottom=e+o,this.right=t+i,this.ellipsis=n,this.wordBreak=r,this.verticalDirection=s,this.lines=[],this.globalAlign=l,this.globalBaseline=a,this.layoutDirection=h,this.directionKey=Io[this.layoutDirection],this.isWidthMax=d,this.isHeightMax=c,this.singleLine=u,g?(g.clear(),this.icons=g):this.icons=new Map}draw(t,e){const{width:i,height:o}=this.getActualSize(),n=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,o):this.height||o||0;r=Math.min(r,o);let s=0;switch(this.globalBaseline){case"top":s=0;break;case"middle":s=-r/2;break;case"bottom":s=-r}let l=0;"right"===this.globalAlign||"end"===this.globalAlign?l=-n:"center"===this.globalAlign&&(l=-n/2);let a=this[this.directionKey.height];this.singleLine&&(a=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=a&&0!==a)for(let i=0;i<this.lines.length;i++){const{top:o,height:n}=this.lines[i];if(o+n<this[this.directionKey.top]||o+n>this[this.directionKey.top]+a)return h;let r=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+a&&(r=!0,h=!0),this.lines[i].draw(t,r,this.lines[i][this.directionKey.left]+l,this.lines[i][this.directionKey.top]+s,this.ellipsis,e)}else{const i=Math.floor((a-this.actualHeight)/2);"vertical"===this.layoutDirection?l+=i:s+=i;for(let i=0;i<this.lines.length;i++)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+l,this.lines[i][this.directionKey.top]+s,this.ellipsis,e)}else if("bottom"===this.verticalDirection&&"vertical"!==this.layoutDirection)for(let i=0;i<this.lines.length;i++){const{top:o,height:n}=this.lines[i],r=a-this.lines[i].top-this.lines[i].height;if(0===a)this.lines[i].draw(t,!1,l,r+s,this.ellipsis,e);else{if(r+n>this[this.directionKey.top]+a||r<this[this.directionKey.top])return h;{let o=!1;this.ellipsis&&this.lines[i+1]&&r-this.lines[i+1].height<this[this.directionKey.top]&&(o=!0,h=!0),this.lines[i].draw(t,o,l,r+s,this.ellipsis,e)}}}else{"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&this.singleLine&&this.isWidthMax&&(l+=this.lines[0].height+1);for(let i=0;i<this.lines.length;i++){"bottom"===this.verticalDirection&&"vertical"===this.layoutDirection&&(l-=this.lines[i].height+this.lines[i].top);const{top:o,height:n}=this.lines[i];if(0===a)this.lines[i].draw(t,!1,this.lines[i][this.directionKey.left]+l,this.lines[i][this.directionKey.top]+s,this.ellipsis,e);else{if(o+n<this[this.directionKey.top]||o+n>this[this.directionKey.top]+a)return h;{let o=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+a&&(o=!0,h=!0),this.lines[i].draw(t,o,this.lines[i][this.directionKey.left]+l,this.lines[i][this.directionKey.top]+s,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;i<this.lines.length;i++){const o=this.lines[i];o.actualWidth>t&&(t=o.actualWidth),e+=o.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:o}=this.getRawActualSize();this.width,this.height;let n=this[this.directionKey.height];if(this.singleLine&&(n=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=n&&0!==n)for(let i=0;i<this.lines.length;i++){const{top:o,height:r}=this.lines[i];if(o+r<this[this.directionKey.top]||o+r>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+n){const o=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(o);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((n-this.actualHeight)/2);for(let i=0;i<this.lines.length;i++)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;i<this.lines.length;i++){const{top:o,height:r}=this.lines[i],s=n-this.lines[i].top-this.lines[i].height;if(0===n)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(s+r>this[this.directionKey.top]+n||s<this[this.directionKey.top]);else if(this.ellipsis&&this.lines[i+1]&&s-this.lines[i+1].height<this[this.directionKey.top]){const o=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(o);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;i<this.lines.length;i++){const{top:o,height:r}=this.lines[i];if(0===n)this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(o+r<this[this.directionKey.top]||o+r>this[this.directionKey.top]+n);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+n){const o=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(o);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class nc{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";const o=ar(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof o?o>this.fontSize?o:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:n,height:r,descent:s,width:l}=Yo(t,i);let a=0,h=0,d=0;this.height>r&&(a=(this.height-r)/2,h=Math.ceil(a),d=Math.floor(a)),"top"===this.textBaseline?(this.ascent=a,this.descent=r-a):"bottom"===this.textBaseline?(this.ascent=r-a,this.descent=a):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=s+d),this.length=t.length,this.width=l||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=Yo(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,o,n){let r=this.text,s=this.left+i;e+=this.top;let l=this.direction;if(this.verticalEllipsis)r=this.ellipsisStr,l="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)r+=this.ellipsisStr,"right"!==n&&"end"!==n||(s-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Uo(r,("vertical"===l?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,r.length-1);if(r=r.slice(0,t),r+=this.ellipsisStr,"right"===n||"end"===n){const{width:e}=Yo(this.text.slice(t),this.character);"vertical"===l||(s-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===l&&(t.save(),t.rotateAbout(Math.PI/2,s,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(s,e),s=0,e=0),this.character.stroke&&(function(t,e){const i=e&&e.stroke||Do;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:o=1,opacity:n=1}=e;t.globalAlpha=o*n,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,jo(t,e)}(t,this.character),t.strokeText(r,s,e)),function(t,e){const i=e&&e.fill||Oo;if(!i)return void(t.globalAlpha=0);const{fillOpacity:o=1,opacity:n=1}=e;t.globalAlpha=o*n,t.fillStyle=i,jo(t,e)}(t,this.character),this.character.fill&&t.fillText(r,s,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(s,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(s,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(s,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(s,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===l&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Uo(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:o}=Yo(this.text.slice(t),this.character);return i+this.ellipsisWidth-o}return i}}const rc=["width","height","image",...wr];let sc=class t extends Br{constructor(t){super(t),this.type="image",this.numberType=Jr,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,o){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,o)}getGraphicTheme(){return _n(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{width:o=e.width,height:n=e.height}=t;i.set(0,0,o,n)}const{tb1:o,tb2:n}=zo.graphicService.updateTempAABBBounds(i);return Eh(t,e,o),i.union(o),o.setValue(n.x1,n.y1,n.x2,n.y2),zo.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return Ho[t]}needUpdateTags(t){return super.needUpdateTags(t,rc)}needUpdateTag(t){return super.needUpdateTag(t,rc)}clone(){return new t(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return t.NOWORK_ANIMATE_ATTR}};function lc(t){return new sc(t)}sc.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Rr);class ac extends sc{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=Qn(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(et(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Qn(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=Ho.width,height:e=Ho.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:o=e}=this.attribute,n=(i-t)/2,r=(o-e)/2;return this._AABBBounds.expand([0,2*n,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class hc{constructor(t,e,i,o,n,r,s,l){this.left=t,this.width=e,this.baseline=i,this.ascent=o,this.descent=n,this.top=i-o,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof ac?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=s,this.directionKey=Io[this.direction],this.actualWidth=0;let a=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof nc){const e=Go.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],a=Math.max(t[this.directionKey.height],a)})),this.height=a,this.blankWidth=l?0:this.width-this.actualWidth,this.calcOffset(e,l)}calcOffset(t,e){const i=this.directionKey,o=this.height;let n=this.left,r=0;this.actualWidth<t&&!e&&("right"===this.textAlign||"end"===this.textAlign?n=t-this.actualWidth:"center"===this.textAlign?n=(t-this.actualWidth)/2:"justify"===this.textAlign&&(this.paragraphs.length<2?n=(t-this.actualWidth)/2:r=(t-this.actualWidth)/(this.paragraphs.length-1))),this.paragraphs.map((function(t){t instanceof ac?(t["_"+i.x]=n,n+=t[i.width]+r,t["_"+i.y]="top"===t.attribute.textBaseline?0:"bottom"===t.attribute.textBaseline?o-t.height:(o-t.height)/2):(t[i.left]=n,n+=t[i.width]+r)}))}draw(t,e,i,o,n,r){if(n&&(e||this.paragraphs.some((t=>t.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const o=this.paragraphs[e];if(o.overflow)t=t&&""===o.text;else if(t){i=!0;break}}let o=0;if(!i)for(let t=this.paragraphs.length-1;t>=0;t--){const i=this.paragraphs[t];if(i.overflow){if(""===i.text)break;continue}if(i instanceof ac)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const r=!0===n?"...":n||"";i.ellipsisStr=r;const{width:s}=Yo(r,i.character),l=s||0;if(l<=this.blankWidth+o){e&&(i.ellipsis="add");break}if(l<=this.blankWidth+o+i.width){i.ellipsis="replace",i.ellipsisWidth=l,i.ellipsisOtherParagraphWidth=this.blankWidth+o;break}i.ellipsis="hide",o+=i.width}}this.paragraphs.map(((e,n)=>{if(e instanceof ac)return e.setAttributes({x:i+e._x,y:o+e._y}),void r(e,t,i+e._x,o+e._y,this.ascent);e.draw(t,o+this.ascent,i,0===n,this.textAlign)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const o=this.paragraphs[i];if(o instanceof ac)break;const{width:n}=Yo(t,o.character),r=n||0;if(r<=this.blankWidth+e){o.ellipsis="add",o.ellipsisWidth=r;break}if(r<=this.blankWidth+e+o.width){o.ellipsis="replace",o.ellipsisWidth=r,o.ellipsisOtherParagraphWidth=this.blankWidth+e;break}o.ellipsis="hide",e+=o.width}let i=0;return this.paragraphs.map(((t,e)=>{i+=t instanceof ac?t.width:t.getWidthWithEllips(this.direction)})),i}}class dc{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=Io[this.direction]}store(t){if(t instanceof ac){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new hc(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t instanceof ac?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const i=this[this.directionKey.width]-this.lineWidth||0,o=Math.ceil(i/t[this.directionKey.width]*t.length)||0,n=Uo(t.text,i,t.character,o,"break-word"===this.frame.wordBreak);if(0!==n){const[i,o]=function(t,e){const i=t.text.slice(0,e),o=t.text.slice(e);return[new nc(i,t.newLine,t.character),new nc(o,!0,t.character)]}(t,n);this.store(i),e?this.send():this.deal(o)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const cc=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize",...wr];class uc extends Br{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=os,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const o=this._frameCache.icons.get(t[i]);this.updateHoverIconState(o)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:Lo.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:Lo.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:Lo.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:Lo.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:Lo.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:Lo.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:Lo.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:Lo.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return _n(this).richtext}updateAABBBounds(t,e,i){const{width:o=e.width,height:n=e.height,maxWidth:r=e.maxWidth,maxHeight:s=e.maxHeight,textAlign:l=e.textAlign,textBaseline:a=e.textBaseline}=t;if(o>0&&n>0)i.set(0,0,o,n);else{const t=this.getFrameCache(),{width:e,height:l}=t.getActualSize();let a=o||e||0,h=n||l||0;h="number"==typeof s&&h>s?s:h||0,a="number"==typeof r&&a>r?r:a||0,i.set(0,0,a,h)}let h=0;switch(a){case"top":h=0;break;case"middle":h=-i.height()/2;break;case"bottom":h=-i.height()}let d=0;switch(l){case"left":d=0;break;case"center":d=-i.width()/2;break;case"right":d=-i.width()}return i.translate(d,h),zo.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||zo.graphicService.updateHTMLTextAABBBounds(t,e,i),zo.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,cc)}needUpdateTag(t){return super.needUpdateTag(t,cc)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e<t.lines.length;e++){const i=t.lines[e];for(let t=0;t<i.paragraphs.length;t++){const e=i.paragraphs[t];if(e.overflow&&""!==e.text)return!0}}return!1}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:o,fontFamily:n,fontStyle:r,fontWeight:s,lineWidth:l,opacity:a,fillOpacity:h,strokeOpacity:d}=this.attribute;return Object.assign({fill:e,stroke:i,fontSize:o,fontFamily:n,fontStyle:r,fontWeight:s,lineWidth:l,opacity:a,fillOpacity:h,strokeOpacity:d},t)}doUpdateFrameCache(t){var e;const{textConfig:i=[],maxWidth:o,maxHeight:n,width:r,height:s,ellipsis:l,wordBreak:a,verticalDirection:h,textAlign:d,textBaseline:c,layoutDirection:u,singleLine:g,disableAutoWrapLine:p}=this.attribute,f=[],v=null!=t?t:i;for(let t=0;t<v.length;t++)if("image"in v[t]){const e=this.combinedStyleToCharacter(v[t]);e.lineWidth=void 0;const i=e.id&&this._frameCache&&this._frameCache.icons&&this._frameCache.icons.get(e.id);if(i)f.push(i);else{const t=new ac(e);t.successCallback=()=>{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,f.push(t)}}else{const e=this.combinedStyleToCharacter(v[t]);if(nt(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const t=e.text.split("\n");for(let i=0;i<t.length;i++)f.push(new nc(t[i],0!==i,e))}else e.text&&f.push(new nc(e.text,!1,e))}const m="number"==typeof o&&Number.isFinite(o)&&o>0,b="number"==typeof n&&Number.isFinite(n)&&n>0,C="number"==typeof r&&Number.isFinite(r)&&r>0&&(!m||r<=o),y="number"==typeof s&&Number.isFinite(s)&&s>0&&(!b||s<=n),w=new oc(0,0,(C?r:m?o:0)||0,(y?s:b?n:0)||0,l,a,h,d,c,u||"horizontal",!C&&m,!y&&b,g||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),x=new dc(w);if(p){let t=0,e=!1;for(let i=0;i<f.length;i++){const o=f[i];e?(o.overflow=!0,o.left=1/0,o.top=1/0,!o.newLine&&w.lines[w.lines.length-1].paragraphs.push(o)):x.deal(o,!0),w.lines.length!==t&&(t=w.lines.length,x.lineBuffer.length=0,o.overflow=!0,o.left=1e3,o.top=1e3,w.lines[w.lines.length-1].paragraphs.push(o),e=!0),o.newLine&&(e=!1,x.lineWidth=0),x.send()}}else for(let t=0;t<f.length;t++)x.deal(f[t]);if(x.send(),!("horizontal"===w.layoutDirection?C:y)){const t=w.getActualSizeWidthEllipsis();let e="horizontal"===w.layoutDirection?t.width:t.height;("horizontal"===w.layoutDirection?m:b)&&(e=Math.min(e,"horizontal"===w.layoutDirection?o:n)),w.lines.forEach((function(t){t.calcOffset(e,!1)}))}this._frameCache=w}clone(){return new uc(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?this.setAttribute("hoverIconId",e.richtextId):!e&&this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0)}))}updateHoverIconState(t){var e,i,o,n,r;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(t.attribute.cursor),null===(o=this.stage)||void 0===o||o.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(n=this.stage)||void 0===n||n.setCursor(),null===(r=this.stage)||void 0===r||r.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:o}=this.globalTransMatrix;let n;return e.icons.forEach(((e,r)=>{var s,l;const a=e.AABBBounds.clone();a.translate(e._marginArray[3],e._marginArray[0]),a.containsPoint({x:t.x-i,y:t.y-o})&&(n=e,n.globalX=(null!==(s=n.attribute.x)&&void 0!==s?s:0)+i+e._marginArray[3],n.globalY=(null!==(l=n.attribute.y)&&void 0!==l?l:0)+o+e._marginArray[0])})),n}getNoWorkAnimateAttr(){return uc.NOWORK_ANIMATE_ATTR}}function gc(t){return new uc(t)}uc.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Rr);const pc=["path","customPath",...wr];class fc extends Br{constructor(t){super(t),this.type="path",this.numberType=ts}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof co?e.path:(X(this.cache)&&this.doUpdatePathShape(),this.cache instanceof co?this.cache:t.path)}getGraphicTheme(){return _n(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:o,tb2:n}=zo.graphicService.updateTempAABBBounds(i);Eh(t,e,o),i.union(o),o.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:r=e.lineJoin}=t;return zo.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;tt(t.path,!0)?this.cache=(new co).fromString(t.path):t.customPath&&(this.cache=new co,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,pc)}needUpdateTag(t){return super.needUpdateTag(t,pc)}toCustomPath(){return(new co).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new fc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return fc.NOWORK_ANIMATE_ATTR}}function vc(t){return new fc(t)}fc.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Rr);const mc=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...wr];class bc extends Br{constructor(t){super(t),this.type="arc",this.numberType=Yr}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:o}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(o)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:o=t.outerPadding}=this.attribute;let{outerRadius:n=t.outerRadius,innerRadius:r=t.innerRadius}=this.attribute;if(n+=o,r-=i,0===e||"0%"===e)return 0;const s=Math.abs(n-r),l=t=>Math.min(nt(t,!0)?t:s*parseFloat(t)/100,s/2);if(et(e)){const t=e.map((t=>l(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return l(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:o=t.cap}=this.attribute,n=i-e>=0?1:-1,r=i-e;if(e=ve(e),i=e+r,o&&oe(r)<ie-Jt){let r=1,s=1;o.length&&(r=Number(o[0]),s=Number(o[1]));let{outerRadius:l=t.outerRadius,innerRadius:a=t.innerRadius}=this.attribute;const{outerPadding:h=t.outerPadding,innerPadding:d=t.innerPadding}=this.attribute;l+=h,a-=d;const c=Math.abs(l-a)/2,u=c/l;if(c>Jt&&l>Jt)return{startAngle:e-n*u*r,endAngle:i+n*u*s,sc:n*u*r,ec:n*u*s}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:o=i.innerPadding,outerPadding:n=i.outerPadding,padAngle:r=i.padAngle}=this.attribute;let{outerRadius:s=i.outerRadius,innerRadius:l=i.innerRadius}=this.attribute;s+=n,l-=o;const{padRadius:a=he(s*s+l*l)}=this.attribute,h=oe(e-t);let d=t,c=e,u=t,g=e;const p=r/2;let f=h,v=h;if(p>Jt&&a>Jt){const i=e>t?1:-1;let o=ce(Number(a)/l*ae(p)),n=ce(Number(a)/s*ae(p));return(f-=2*o)>Jt?(o*=i,u+=o,g-=o):(f=0,u=g=(t+e)/2),(v-=2*n)>Jt?(n*=i,d+=n,c-=n):(v=0,d=c=(t+e)/2),{outerStartAngle:d,outerEndAngle:c,innerStartAngle:u,innerEndAngle:g,innerDeltaAngle:f,outerDeltaAngle:v}}return{outerStartAngle:d,outerEndAngle:c,innerStartAngle:u,innerEndAngle:g,innerDeltaAngle:f,outerDeltaAngle:v}}getGraphicTheme(){return _n(this).arc}updateAABBBounds(t,e,i,o){this.updatePathProxyAABBBounds(i)||(o?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=zo.graphicService.updateTempAABBBounds(i);Eh(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:s=e.lineJoin}=t;return zo.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:o=e.outerRadius,innerRadius:n=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:s=e.innerPadding}=t;return o+=r,n-=s,o<n&&(o=n),i.set(-o,-o,o,o),i}updateArcAABBBoundsAccurate(t,e,i){let{outerRadius:o=e.outerRadius,innerRadius:n=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:s=e.innerPadding}=t;if(o+=r,n-=s,o<n){const t=o;o=n,n=t}let{endAngle:l=e.endAngle,startAngle:a=e.startAngle}=t;if(a>l){const t=a;a=l,l=t}return o<=Jt?i.set(0,0,0,0):Math.abs(l-a)>ie-Jt?i.set(-o,-o,o,o):(ir(a,l,o,i),ir(a,l,n,i)),i}needUpdateTags(t){return super.needUpdateTags(t,mc)}needUpdateTag(t){return super.needUpdateTag(t,mc)}toCustomPath(){var t,e,i,o;const n=this.attribute,{startAngle:r,endAngle:s}=this.getParsedAngle();let l=(null!==(t=n.innerRadius)&&void 0!==t?t:0)-(null!==(e=n.innerPadding)&&void 0!==e?e:0),a=(null!==(i=n.outerRadius)&&void 0!==i?i:0)-(null!==(o=n.outerPadding)&&void 0!==o?o:0);const h=oe(s-r),d=s>r;if(a<l){const t=a;a=l,l=t}const c=new co;if(a<=Jt)c.moveTo(0,0);else if(h>=ie-Jt)c.moveTo(0+a*re(r),0+a*ae(r)),c.arc(0,0,a,r,s,!d),l>Jt&&(c.moveTo(0+l*re(s),0+l*ae(s)),c.arc(0,0,l,s,r,d));else{const t=a*re(r),e=a*ae(r),i=l*re(s),o=l*ae(s);c.moveTo(0+t,0+e),c.arc(0,0,a,r,s,!d),c.lineTo(0+i,0+o),c.arc(0,0,l,s,r,d),c.closePath()}return c}clone(){return new bc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return bc.NOWORK_ANIMATE_ATTR}}function Cc(t){return new bc(t)}bc.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Rr);const yc=["points","cornerRadius",...wr];class wc extends Br{constructor(t){super(t),this.type="polygon",this.numberType=es}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return _n(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),zo.graphicService.updateTempAABBBounds(i);const{lineJoin:o=e.lineJoin}=t;return zo.graphicService.transformAABBBounds(t,i,e,"miter"===o,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:o=e.points}=t;return o.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,o,n){"points"===t&&(n.points=nr(i,o,e))}needUpdateTags(t){return super.needUpdateTags(t,yc)}needUpdateTag(t){return super.needUpdateTag(t,yc)}toCustomPath(){const t=this.attribute.points,e=new co;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new wc(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return wc.NOWORK_ANIMATE_ATTR}}function xc(t){return new wc(t)}wc.NOWORK_ANIMATE_ATTR=Rr;class _c extends cs{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}clearUpdateBoundTag(){super.clearUpdateBoundTag(),this.shadowHost&&this.shadowHost.clearUpdateBoundTag()}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function Sc(t){return new _c(t)}var Ac=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const Rc=Symbol.for("PickItemInterceptor");let Bc=class{constructor(){this.order=1}afterPickItem(t,e,i,o,n){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,o,n):null}beforePickItem(t,e,i,o,n){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,o,n):null}_pickItem(t,e,i,o,n){var r;if(!t.shadowRoot)return null;const{parentMatrix:s}=n||{};if(!s)return null;const l=e.pickContext;l.highPerformanceSave();const a=null===(r=_n(t))||void 0===r?void 0:r[t.type],{shadowPickMode:h=(null==a?void 0:a.shadowPickMode)}=t.attribute,d=t.shadowRoot,c=il.allocateByObj(s),u=new ge(c.a*i.x+c.c*i.y+c.e,c.b*i.x+c.d*i.y+c.f),g=e.pickGroup(d,u,c,o);return l.highPerformanceRestore(),!g.graphic&&g.group&&"full"===h&&(g.graphic=g.group),g}};Bc=Ac([f()],Bc);let Mc=class{constructor(){this.order=1}beforePickItem(t,e,i,o,n){const r=t.baseGraphic;if(r&&r.parent){const t=new ge(i.x,i.y),n=e.pickContext;n.highPerformanceSave();const s=r.parent.globalTransMatrix;s.transformPoint(t,t);const l=r.isContainer?e.pickGroup(r,t.clone(),s,o):e.pickItem(r,t.clone(),s,o);return n.highPerformanceRestore(),l}return null}};Mc=Ac([f()],Mc);let Tc=class{constructor(){this.order=1}beforePickItem(t,e,i,o,n){if(!t.in3dMode||o.in3dInterceptor)return null;const r=e.pickContext,s=t.stage;if(!r||!s)return null;if(o.in3dInterceptor=!0,r.save(),this.initCanvasCtx(r),r.camera=s.camera,t.isContainer){const s=uh(r,t,(()=>e.pickGroup(t,i,n.parentMatrix,o)),o);return r.camera=null,o.in3dInterceptor=!1,r.restore(),s}return r.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};Tc=Ac([f()],Tc);var Pc=new i(((t,e,i)=>{i(Th)||(t(Ph).toSelf(),t(Th).toService(Ph)),t(Tc).toSelf().inSingletonScope(),t(Rc).toService(Tc),t(Bc).toSelf().inSingletonScope(),t(Rc).toService(Bc),t(Mc).toSelf().inSingletonScope(),t(Rc).toService(Mc),L(t,Rc)})),Ec=new i((t=>{t(ss).to(al).inSingletonScope(),t(ls).toConstantValue(Ra)}));const kc=Symbol.for("AutoEnablePlugins"),Lc=Symbol.for("PluginService");var Hc=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Fc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zc=function(t,e){return function(i,o){e(i,o,t)}};let Ic=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&&Qo.isBound(kc)&&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=[]}};Ic=Hc([f(),zc(0,g(E)),zc(0,v(kc)),Fc("design:paramtypes",[Object])],Ic);var Oc=new i((t=>{t(Lc).to(Ic),function(t,e){t(E).toDynamicValue((t=>{let{container:i}=t;return new k(e,i)})).whenTargetNamed(e)}(t,kc)})),Dc=new i((t=>{L(t,z)})),Wc=new i((t=>{t(qo).to(Jo).inSingletonScope(),L(t,qo)})),Nc=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Gc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let jc=class{constructor(){this.type="static",this.offscreen=!1,this.global=zo.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 o=e.getContext().getCanvas().nativeCanvas,n=on({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:o.offsetLeft,y:o.offsetTop});n.applyPosition(),this.canvas=n,this.context=n.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var o;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!==(o=e.background)&&void 0!==o?o:"#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 o;const n=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:n},i),{clear:i.clear?null!==(o=i.background)&&void 0!==o?o:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};jc=Nc([f(),Gc("design:paramtypes",[])],jc);var Uc=new i((t=>{t(jc).toSelf(),t(ms).toService(jc)}));var Vc=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function $c(t,e,i){const o={},n=[];return t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;o[i]?o[i].push(t):(o[i]=[t],n.push(i))}),i),n.sort(((t,e)=>i?e-t:t-e)),{childMap:o,zIdxArray:n}}function Yc(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=!1;if(n)r=!0;else{let i;t.forEachChildren(((t,o)=>{const{zIndex:n=e}=t.attribute;if(0===o)i=n;else if(i!==n)return r=!0,!0;return!1}),o)}if(r){const{childMap:r,zIdxArray:s}=$c(t,e,o);let l=!1;for(let t=0;t<s.length&&!l;t++){const e=r[s[t]];n&&e.sort(((t,e)=>{var i,n;return(o?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(n=t.attribute.z)&&void 0!==n?n:0))}));for(let t=0;t<e.length;t++)if(i(e[t],t)){l=!0;break}}}else t.forEachChildren(i,o)}function Xc(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Vc(this,void 0,void 0,(function*(){yield t.forEachChildrenAsync(i,o)}))}function Kc(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=!1;t.forEachChildren(((t,e)=>{const{zIndex:o=i}=t.attribute;if(0===e);else if(void 0!==o)return n=!0,!0;return!1}),o);let r=null,s=!1;if(n){const{childMap:n,zIdxArray:l}=$c(t,i,o);let a=!1;for(let t=0;t<l.length&&!a;t++){const i=n[l[t]];for(let t=0;t<i.length;t++){if(s){a=!0,r=i[t];break}i[t]._uid!==e||(s=!0)}}}else t.forEachChildren((t=>s?(r=t,!0):(t._uid===e&&(s=!0),!1)),o);return r}var Zc=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},qc=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Jc=function(t,e){return function(i,o){e(i,o,t)}};let Qc=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 ke,this.backupDirtyBounds=new ke,this.global=zo.global,this.layerService=zo.layerService,this.init()}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}prepareForDraw(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(t,e){this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:o,viewBox:n,transMatrix:r}=e;if(!i)return;const s=this.dirtyBounds.setValue(0,0,n.width(),n.height());if(o.dirtyBounds&&!o.dirtyBounds.empty()){const t=be(s,o.dirtyBounds,!1);s.x1=Math.floor(t.x1),s.y1=Math.floor(t.y1),s.x2=Math.ceil(t.x2),s.y2=Math.ceil(t.y2)}const l=i.dpr%1;(l||.5!==l)&&(s.x1=Math.floor(s.x1*i.dpr)/i.dpr,s.y1=Math.floor(s.y1*i.dpr)/i.dpr,s.x2=Math.ceil(s.x2*i.dpr)/i.dpr,s.y2=Math.ceil(s.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(s),i.inuse=!0,i.setClearMatrix(r.a,r.b,r.c,r.d,r.e,r.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(n.x1,n.y1,!0),i.beginPath(),i.rect(s.x1,s.y1,s.width(),s.height()),i.clip(),o.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,o;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:wo.zIndex)-(null!==(o=e.attribute.zIndex)&&void 0!==o?o:wo.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,e,il.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=Kc(e,i,wo.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i,o){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&&!xe(t.AABBBounds,this.dirtyBounds,!1))return;let n,r=i;if(this.useDirtyBounds){n=Aa.allocateByObj(this.dirtyBounds);const e=t.transMatrix;r=il.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;o?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))})):Yc(t,wo.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(n),Aa.free(n),il.free(r))}_increaseRender(t,e){const{layer:i,stage:o}=e,{subLayers:n}=i;let r=n.get(t._uid);r||(r={layer:this.layerService.createLayer(o),zIndex:n.size,group:t},n.set(t._uid,r));const s=r.layer.getNativeHandler().getContext(),l=r.drawContribution||Qo.get(Ja);l.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),l.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),l.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:l,clear:"transparent",layer:r.layer,context:s,startAtId:t._uid,break:!1})),r.drawContribution=l;const a=this._findNextGraphic(t);if(a)if(a.isContainer&&a.incremental)this._increaseRender(a,e);else{let t=n.get(a._uid);t||(t={layer:this.layerService.createLayer(o),zIndex:n.size},n.set(a._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:l,clear:"transparent",layer:t.layer,context:i,startAtId:a._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 o=0;o<this.InterceptorContributions.length;o++){const n=this.InterceptorContributions[o];if(n.beforeDrawItem&&n.beforeDrawItem(t,this.currentRenderService,e,this,i))return}const o=this.getRenderContribution(t);if(!o)return;let n,r=!1;if(t.parent){const{scrollX:e=0,scrollY:i=0}=t.parent.attribute;if(r=!(!e&&!i),r){n=this.dirtyBounds.clone();const o=t.globalTransMatrix.getInverse();this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(o),this.dirtyBounds.translate(-e,-i)}}if(this.useDirtyBounds&&!t.isContainer&&!xe(t.AABBBounds,this.dirtyBounds,!1))return void(r&&this.dirtyBounds.copy(n));const s=null!=e.startAtId&&t._uid!==e.startAtId;if(t._uid===e.startAtId&&(e.startAtId=null),i&&(i.skipDraw=s),s?t.isContainer&&o.draw(t,this.currentRenderService,e,i):o.draw(t,this.currentRenderService,e,i),r&&this.dirtyBounds.copy(n),this.InterceptorContributions.length)for(let i=0;i<this.InterceptorContributions.length;i++){const o=this.InterceptorContributions[i];if(o.afterDrawItem&&o.afterDrawItem(t,this.currentRenderService,e,this))return}}selectRenderByType(t){return It.getInstance().warn("未知错误,不应该走到这里"),null}selectRenderByNumberType(t,e){let i;if(e.attribute.renderStyle){const o=this.styleRenderMap.get(e.attribute.renderStyle);i=o&&o.get(t)}return i||this.currentRenderMap.get(t)||this.defaultRenderMap.get(t)}clearScreen(t,e,i){var o,n;const{clear:r,viewBox:s}=i,l=s.width(),a=s.height();if(r){e.clearRect(0,0,l,a);const i=null===(o=t.drawParams)||void 0===o?void 0:o.stage;if(i&&(e.globalAlpha=null!==(n=i.attribute.opacity)&&void 0!==n?n:1),i&&i.backgroundImg&&i.resources){const t=i.resources.get(r);t&&"success"===t.state&&t.data&&e.drawImage(t.data,0,0,l,a)}else e.fillStyle=pl(e,r,{AABBBounds:{x1:0,y1:0,x2:0+l,y2:0+a}},0,0),e.fillRect(0,0,l,a)}}afterDraw(t,e){}};Qc=Zc([f(),Jc(0,p(eh)),Jc(1,g(E)),Jc(1,v(fh)),qc("design:paramtypes",[Array,Object])],Qc);var tu=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let eu=class extends ia{constructor(){super(...arguments),this.numberType=Qr}drawShape(t,e,i,o,n,r,s,l){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:e,length:r}=n.multiGraphicOptions,{segments:a=[]}=t.attribute;if(e>a.length)return;const h=_n(t).line,{fill:d=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:g=h.fillOpacity,strokeOpacity:p=h.strokeOpacity,lineWidth:f=h.lineWidth,visible:v=h.visible}=t.attribute,m=Bs(u,g,d),b=Ts(u,p),C=As(d),y=Rs(c,f);if(!t.valid||!v)return;if(!C&&!y)return;if(!(m||b||s||l))return;const{context:w}=n;for(let n=e;n<e+r;n++)this.drawIncreaseSegment(t,w,a[n-1],a[n],t.attribute.segments[n],[h,t.attribute],i,o)}else super.drawShape(t,e,i,o,n,r,s,l)}drawIncreaseSegment(t,e,i,o,n,r,s,l){o&&(e.beginPath(),function(t,e,i,o){const{offsetX:n=0,offsetY:r=0}=o||{},s=e?e.points[e.points.length-1]:i.points[0];t.moveTo(s.x+n,s.y+r),i.points.forEach((e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}))}(e.nativeContext,i,o,{offsetX:s,offsetY:l}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setStrokeStyle(t,n,s,l,r),e.stroke())}};eu=tu([f()],eu);var iu=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let ou=class extends da{constructor(){super(...arguments),this.numberType=Kr}drawShape(t,e,i,o,n,r,s){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:r,length:l}=n.multiGraphicOptions,{segments:a=[]}=t.attribute;if(r>a.length)return;const h=_n(t).area,{fill:d=h.fill,fillOpacity:c=h.fillOpacity,opacity:u=h.opacity,visible:g=h.visible}=t.attribute,p=Bs(u,c,d),f=As(d);if(!t.valid||!g)return;if(!f)return;if(!p&&!s)return;for(let n=r;n<r+l;n++)this.drawIncreaseSegment(t,e,a[n-1],a[n],t.attribute.segments[n],[h,t.attribute],i,o)}else super.drawShape(t,e,i,o,n,r,s)}drawIncreaseSegment(t,e,i,o,n,r,s,l){o&&(e.beginPath(),function(t,e,i,o){const{offsetX:n=0,offsetY:r=0}=o||{},{points:s}=i,l=[];for(let t=0;t<s.length;t++)s[t].defined;l.push(s),l.forEach(((i,o)=>{var s,l,a,h;const d=e&&0===o?e.points[e.points.length-1]:i[0];t.moveTo(d.x+n,d.y+r),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}));for(let e=i.length-1;e>=0;e--){const o=i[e];t.lineTo(null!==(s=o.x1)&&void 0!==s?s:o.x,null!==(l=o.y1)&&void 0!==l?l:o.y)}t.lineTo(null!==(a=d.x1)&&void 0!==a?a:d.x,null!==(h=d.y1)&&void 0!==h?h:d.y),t.closePath()}))}(e.camera?e:e.nativeContext,i,o,{offsetX:s,offsetY:l}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setCommonStyle(t,n,s,l,r),e.fill())}};ou=iu([f()],ou);var nu,ru=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},su=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},lu=function(t,e){return function(i,o){e(i,o,t)}},au=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(nu||(nu={}));let hu=class extends Qc{constructor(t,e,i,o){super(t,o),this.contributions=t,this.lineRender=e,this.areaRender=i,this.drawItemInterceptorContributions=o,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=nu.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new F([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return au(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:o,viewBox:n}=e;o&&(o.inuse=!0,o.clearMatrix(),o.setTransformForCurrent(!0),o.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,o,e),o.translate(n.x1,n.y1,!0),o.save(),t.renderTreeRoots.sort(((t,e)=>{var i,o;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:wo.zIndex)-(null!==(o=e.attribute.zIndex)&&void 0!==o?o:wo.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{o.restore(),o.restore(),o.draw(),o.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return au(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return au(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>au(this,void 0,void 0,(function*(){if(2!==t.count)yield Xc(t,wo.zIndex,((i,o)=>{if(this.status===nu.STOP)return!0;if(i.isContainer)return!1;if(o<this.currentIdx)return!1;const n=this.currFrameStartAt+t.incremental;return o<n&&(this.currentIdx=o+1,this.renderItem(i,e)),o===n-1&&(this.currFrameStartAt=this.currentIdx,this.waitToNextFrame())})),i(!1);else{const o=t.getChildAt(0);if(o.incremental&&o.attribute.segments)for(o.incrementalAt||(o.incrementalAt=0);o.incrementalAt<o.attribute.segments.length;)e.multiGraphicOptions={startAtIdx:o.incrementalAt,length:o.incremental},this.renderItem(o,e),o.incrementalAt+=o.incremental,yield this.waitToNextFrame();else this.renderItem(o,e);i(!1)}}))})})),this.hooks.completeDraw.call()}))}waitToNextFrame(){return au(this,void 0,void 0,(function*(){return new Promise((t=>{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return au(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return au(this,void 0,void 0,(function*(){this.rendering&&(this.status=nu.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=nu.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 au(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:()=>au(this,void 0,void 0,(function*(){yield Xc(t,wo.zIndex,(t=>au(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};hu=ru([f(),lu(0,p(eh)),lu(1,g(eu)),lu(2,g(ou)),lu(3,g(E)),lu(3,v(fh)),su("design:paramtypes",[Array,Object,Object,Object])],hu);var du=new i((t=>{t(bl).toSelf().inSingletonScope(),t(wl).toSelf().inSingletonScope(),t(ch).to(Qc),t(Ja).to(hu),t(ih).to($a).inSingletonScope(),t(eh).toService(ih),L(t,Ws),t(yl).toSelf().inSingletonScope(),L(t,Ys),L(t,eh),t(yh).toSelf().inSingletonScope(),t(fh).toService(yh),L(t,fh)}));function cu(){cu.__loaded||(cu.__loaded=!0,Qo.load(Ss),Qo.load(Ec),Qo.load(Mh),Qo.load(Pc),Qo.load(Oc),function(t){t.load(Dc),t.load(Wc),t.load(Uc)}(Qo),function(t){t.load(du)}(Qo))}cu.__loaded=!1,cu();const uu=Qo.get(I);zo.global=uu;const gu=Qo.get(fs);zo.graphicUtil=gu;const pu=Qo.get(ps);zo.transformUtil=pu;const fu=Qo.get(ss);zo.graphicService=fu;const vu=Qo.get(vs);zo.layerService=vu;class mu{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.handleChange=t=>{t.glyphHost&&(t=t.glyphHost),t.stage===this.pluginService.stage&&null!=t.stage&&t.stage.renderNextFrame()}}activate(t){this.pluginService=t,zo.graphicService.hooks.onAttributeUpdate.tap(this.key,this.handleChange),zo.graphicService.hooks.onSetStage.tap(this.key,this.handleChange),zo.graphicService.hooks.onRemove.tap(this.key,this.handleChange)}deactivate(t){const e=t=>t.filter((t=>t.name!==this.key));zo.graphicService.hooks.onAttributeUpdate.taps=e(zo.graphicService.hooks.onAttributeUpdate.taps),zo.graphicService.hooks.onSetStage.taps=e(zo.graphicService.hooks.onSetStage.taps),zo.graphicService.hooks.onRemove.taps=e(zo.graphicService.hooks.onRemove.taps)}}class bu{constructor(){this.name="AutoRefreshPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid,this.handleChange=t=>{t.glyphHost&&(t=t.glyphHost),t.stage===this.pluginService.stage&&null!=t.stage&&t.stage.renderNextFrame()}}activate(t){this.pluginService=t,this.dpr=zo.global.devicePixelRatio,this.refresh()}refresh(){this._refreshByMediaQuery()||this._refreshByRaf()}_refreshByRaf(){const t=zo.global.getRequestAnimationFrame();this.rafId=t((()=>{zo.global.devicePixelRatio!==this.dpr&&(this.dpr=zo.global.devicePixelRatio,this.pluginService.stage.setDpr(this.dpr,!0)),this.refresh()}))}_refreshByMediaQuery(){try{const t=`(resolution: ${window.devicePixelRatio}dppx)`,e=()=>{window.devicePixelRatio!==this.dpr&&(this.dpr=window.devicePixelRatio,this.pluginService.stage.setDpr(this.dpr,!0))};matchMedia(t).addEventListener("change",e)}catch(t){return!1}return!0}deactivate(t){const e=zo.global.getCancelAnimationFrame();e&&this.rafId&&e(this.rafId)}}class Cu{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,zo.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,o)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),zo.graphicService.hooks.onClearIncremental.tap(this.key,((e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))}))}deactivate(t){zo.graphicService.hooks.onAddIncremental.taps=zo.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),zo.graphicService.hooks.onClearIncremental.taps=zo.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,zo.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const o=e.layer.subLayers.get(e._uid);o&&o.drawContribution&&o.drawContribution.draw(t.renderService,Object.assign({stage:t,layer:i,viewBox:t.window.getViewBox(),transMatrix:t.window.getViewBoxTransform(),clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:o.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}const yu=new Le;class wu{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),zo.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,o)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(yu.setValue(o.x1,o.y1,o.x2,o.y2),e.dirty(yu,t.parent&&t.parent.globalTransMatrix)))})),zo.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,o,n)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!n||e.dirty(o.globalAABBBounds))})),zo.graphicService.hooks.clearAABBBounds.tap(this.key,((t,e,i)=>{e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(i)})),zo.graphicService.hooks.onRemove.tap(this.key,(t=>{const e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){zo.graphicService.hooks.beforeUpdateAABBBounds.taps=zo.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),zo.graphicService.hooks.afterUpdateAABBBounds.taps=zo.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),zo.graphicService.hooks.clearAABBBounds.taps=zo.graphicService.hooks.clearAABBBounds.taps.filter((t=>t.name!==this.key)),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),zo.graphicService.hooks.onRemove.taps=zo.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}const xu=new Dn;let _u;function Su(){if(null==_u)try{const t=document.createElement("canvas"),e=t.getContext("2d");_u=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),_u&&(_u=!!document.createElement)}catch(t){_u=!1}}function Au(){Su();const t=zo.global&&zo.global.env;return t?"browser"===t:_u}xu.addTimeline(Gn),xu.setFPS(60);let Ru=class t{static registerPlugin(e,i){t._pluginClasses[e]=i}static getPlugin(e){return t._pluginClasses[e]}};Ru._pluginClasses={};const Bu="white";class Mu extends cs{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){const e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){const e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this.window.getViewBox().width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this.window.getViewBox().height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return null!==(t=this._background)&&void 0!==t?t:Bu}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;super({}),this._onVisibleChange=t=>{if(!(this._skipRender<0))if(t){if(this.dirtyBounds){const t=this.window.getViewBox();this.dirtyBounds.setValue(t.x1,t.y1,t.width(),t.height())}this._skipRender>1&&this.renderNextFrame(),this._skipRender=0}else this._skipRender=1},this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null},this.params=t,this.theme=new wn,this.hooks={beforeRender:new F(["stage"]),afterRender:new F(["stage"])},this.global=zo.global,!this.global.env&&Au()&&this.global.setEnv("browser"),this.window=Qo.get(ln),this.renderService=Qo.get(Rh),this.pluginService=Qo.get(Lc),this.layerService=Qo.get(vs),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,viewBox:t.viewBox,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._background=null!==(e=t.background)&&void 0!==e?e:Bu,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),t.autoRefresh&&this.enableAutoRefresh(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.ReactDOM&&this.enableReactAttribute(t.ReactDOM),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||xu,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new Nn,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&tt(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background})}pauseRender(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this._skipRender=t}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new Fn(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}preventRender(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:o=0,beta:n=0,camera:r,fieldRatio:s=1,fieldDepth:l}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:o,beta:n,camera:r,fieldRatio:s,fieldDepth:l})}set3dOptions(t){var e,i,o,n,r,s;this.option3d=t;const l=this.get3dOptions(t),{light:a,center:h,camera:d,alpha:c,beta:u,fieldRatio:g,fieldDepth:p}=l,{dir:f=[1,1,-1],color:v="white",ambient:m}=a,b=(null!==(e=h.x)&&void 0!==e?e:this.width/2)+(null!==(i=h.dx)&&void 0!==i?i:0),C=(null!==(o=h.y)&&void 0!==o?o:this.height/2)+(null!==(n=h.dy)&&void 0!==n?n:0),y=[b,C,(null!==(r=h.z)&&void 0!==r?r:0)+(null!==(s=h.dz)&&void 0!==s?s:0)];let w=0,x=0,_=0;d||(w=Math.sin(c)+b,x=Math.sin(u)+C,_=Math.cos(c)*Math.cos(u)*1);const S=Ru.getPlugin("DirectionalLight");S&&(this.light=new S(f,v,m));const A={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:g,fieldDepth:p,viewParams:{pos:[w,x,_],center:y,up:[0,1,0]}};if(this.camera)this.camera.params=A;else{const t=Ru.getPlugin("OrthoCamera");t&&(this.camera=new t(A))}t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){if(this.view3dTranform)return;this.view3dTranform=!0;const t=Ru.getPlugin("ViewTransform3dPlugin");t&&this.pluginService.register(new t)}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new mu))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRefresh(){this.autoRefresh||(this.autoRefresh=!0,this.pluginService.register(new bu))}disableAutoRefresh(){this.autoRefresh&&(this.autoRefresh=!1,this.pluginService.findPluginsByName("AutoRefreshPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new Cu))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new ke;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new wu,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableLayout(){if(this._enableLayout)return;this._enableLayout=!0;const t=Ru.getPlugin("FlexLayoutPlugin");t&&this.pluginService.register(new t)}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableHtmlAttribute(t){if(this.htmlAttribute)return;const e=Ru.getPlugin("HtmlAttributePlugin");e&&(this.htmlAttribute=t,this.pluginService.register(new e))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableReactAttribute(t){if(this.reactAttribute)return;const e=Ru.getPlugin("ReactAttributePlugin");e&&(this.reactAttribute=t,this.pluginService.register(new e))}disableReactAttribute(){this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}getPluginsByName(t){return this.pluginService.findPluginsByName(t)}tryUpdateAABBBounds(){const t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){if("released"===this.releaseStatus)return;const i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){"released"!==this.releaseStatus&&this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(t)}render(t,e){if("released"===this.releaseStatus)return;this.ticker.start(),this.timeline.resume();const i=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){if("harmony"===this.global.env){const t=this.window.getContext().nativeContext;this.forEachChildren(((e,i)=>{if(i>0){const i=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(i)}}))}}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){if("released"===this.releaseStatus)return;this.timeline.resume(),this.ticker.start();const t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let e=0;e<t.length;e++){let o=t[e];"virtual"===o.layerMode&&(o=o.getNativeHandler().mainHandler.layer),i.includes(o)||i.push(o)}i.forEach((t=>{t.renderCount>this.renderCount||(t.renderCount=this.renderCount+1,t===this.interactiveLayer&&this.dirtyBounds&&this.dirtyBounds.clear(),t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&(this.dirtyBounds&&this.dirtyBounds.clear(),this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))}resizeWindow(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.window.resize(t,e),i&&this.render()}resize(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render())}resizeView(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"released"!==this.releaseStatus&&(this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render())}setViewBox(t,e,i,o,n){let r=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(r=!1)):(this.viewBox.setValue(t,e,t+i,e+o),!1===n&&(r=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),r&&this.render()}setDpr(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){if("released"===this.releaseStatus)return;const i=this.getPickerService().pick(this.children,new ge(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&(this.interactiveLayer.forEachChildren((t=>{t.setStage&&t.setStage(null,null),this.interactiveLayer.removeChild(t)})),this.interactiveLayer.release()),this.window.release(),this.ticker.remTimeline(this.timeline),this.renderService.renderTreeRoots=[]}setStage(t){}dirty(t,e){"released"!==this.releaseStatus&&(e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t))}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t){"released"!==this.releaseStatus&&this.forEachChildren(((e,i)=>{e.drawTo(t,{renderService:this.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:e===this.defaultLayer?this.background:void 0,clear:0===i,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())})}))}renderToNewWindow(){let t=arguments.length>1?arguments[1]:void 0;if("released"===this.releaseStatus)return;const e=Qo.get(ln),i=t?-t.x1:0,o=t?-t.y1:0,n=t?t.x2:this.viewWidth,r=t?t.y2:this.viewHeight,s=t?t.width():this.viewWidth,l=t?t.height():this.viewHeight;return e.create({viewBox:{x1:i,y1:o,x2:n,y2:r},width:s,height:l,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(e),e}toCanvas(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;if("released"===this.releaseStatus)return;const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}eventPointTransform(t){const e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}pauseTriggerEvent(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}resumeTriggerEvent(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}getPickerService(){return this.pickerService||(this.pickerService=Qo.get(Th)),this.pickerService}}const Tu={WIDTH:500,HEIGHT:500,DPR:1};class Pu{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){var e;const{nativeCanvas:i,width:o=Tu.WIDTH,height:n=Tu.HEIGHT,dpr:r=Tu.DPR,x:s,y:l,id:a,canvasControled:h=!0}=t;this._x=null!=s?s:0,this._y=null!=l?l:0,this._pixelWidth=o*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this.controled=h,this._displayWidth=o,this._displayHeight=n,this._dpr=r,this._nativeCanvas=i,this._id=null!==(e=i.id)&&void 0!==e?e:a,a&&(i.id=a),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,o){return this._context.getImageData(t,e,i,o)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}Pu.env="browser";var Eu=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let ku=class{configure(t){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new Le}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}};ku=Eu([f()],ku);var Lu=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Hu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Fu=class{constructor(){this._uid=e.GenAutoIncrementId(),this.viewBox=new Le,this.modelMatrix=new Fe(1,0,0,1,0,0)}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}setViewBox(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}getViewBox(){return this.viewBox}setViewBoxTransform(t,e,i,o,n,r){this.modelMatrix.setValue(t,e,i,o,n,r)}getViewBoxTransform(){return this.modelMatrix}};Fu=Lu([f(),Hu("design:paramtypes",[])],Fu);var zu=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Iu=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ou=function(t,e){return function(i,o){e(i,o,t)}};let Du=class{constructor(t){this.pickItemInterceptorContributions=t,this.type="default",this.global=zo.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let o={graphic:null,group:null};i.pickerService=this;const n=i.bounds.width(),r=i.bounds.height();if(!(new Le).setValue(0,0,n,r).containsPoint(e))return o;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const s=new Fe(1,0,0,1,0,0);let l;for(let n=t.length-1;n>=0&&(o=t[n].isContainer?this.pickGroup(t[n],e,s,i):this.pickItem(t[n],e,s,i),!o.graphic);n--)l||(l=o.group);if(o.graphic||(o.group=l),this.pickContext&&(this.pickContext.inuse=!1),o.graphic){let t=o.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(o.params={shadowTarget:o.graphic},o.graphic=t.shadowHost)}return o}containsPoint(t,e,i){var o;return!!(null===(o=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===o?void 0:o.graphic)}pickGroup(t,e,i,o){let n={group:null,graphic:null};if(!1===t.attribute.visibleAll)return n;const r=o.pickContext,s=r.modelMatrix;if(r.camera){const e=t.transMatrix,i=ol.allocate();if(Js(i,e),s){if(i){const t=ol.allocate();r.modelMatrix=Qs(t,s,i),ol.free(i)}}else Js(i,t.globalTransMatrix),r.modelMatrix=i}if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const l=this.InterceptorContributions[n];if(l.beforePickItem){const n=l.beforePickItem(t,this,e,o,{parentMatrix:i});if(n)return r.modelMatrix!==s&&ol.free(r.modelMatrix),r.modelMatrix=s,n}}const l=t.transMatrix,a=il.allocateByObj(i),h=new ge(e.x,e.y);a.transformPoint(h,h);const d=t.AABBBounds.containsPoint(h);if(!d&&!t.stage.camera)return n;const c=this.pickItem(t,h.clone(),i,o);c&&c.graphic&&(n.graphic=c.graphic,n.params=c.params);const u=!1!==t.attribute.pickable&&d;return a.multiply(l.a,l.b,l.c,l.d,l.e,l.f),!1===t.attribute.childrenPickable||c&&c.graphic||Yc(t,wo.zIndex,(r=>{if(r.isContainer){const i=new ge(e.x,e.y),s=_n(t).group,{scrollX:l=s.scrollX,scrollY:h=s.scrollY}=t.attribute;i.x-=l,i.y-=h,n=this.pickGroup(r,i,a,o)}else{const s=new ge(e.x,e.y);a.transformPoint(s,s);const l=_n(t).group,{scrollX:h=l.scrollX,scrollY:d=l.scrollY}=t.attribute;s.x-=h,s.y-=d;const c=this.pickItem(r,s,i,o);c&&c.graphic&&(n.graphic=c.graphic,n.params=c.params)}return!!n.graphic||!!n.group}),!0,!!r.camera),r.modelMatrix!==s&&ol.free(r.modelMatrix),r.modelMatrix=s,n.graphic||n.group||!u||t.stage.camera||(n.group=t),il.free(a),n}selectPicker(t){return this.pickerMap.get(t.numberType)||null}};Du=zu([f(),Ou(0,g(E)),Ou(0,v(Rc)),Iu("design:paramtypes",[Object])],Du);let Wu=!1;const Nu=new i((t=>{Wu||(Wu=!0,t(Yl).toSelf().inSingletonScope(),t(Qa).to(Yl).inSingletonScope(),t(eh).toService(Qa),t(Is).toService(yl),L(t,Is))}));let Gu=!1;const ju=new i((t=>{Gu||(Gu=!0,t(ya).toSelf().inSingletonScope(),t(sh).to(ya).inSingletonScope(),t(eh).toService(sh),t(Fl).toSelf(),t(Hl).toSelf(),t(Us).toService(Fl),t(Us).toService(Hl),t(Us).toService(yl),L(t,Us))}));let Uu=!1;const Vu=new i((t=>{Uu||(Uu=!0,t(ia).toSelf().inSingletonScope(),t(eu).toSelf().inSingletonScope(),t(oh).to(ia).inSingletonScope(),t(eh).toService(oh))}));let $u=!1;const Yu=new i((t=>{$u||($u=!0,t(Sa).toSelf().inSingletonScope(),t(lh).to(Sa).inSingletonScope(),t(eh).toService(lh),t(Vs).toService(yl),L(t,Vs))}));let Xu=!1;const Ku=new i((t=>{Xu||(Xu=!0,t(ql).toSelf().inSingletonScope(),t(th).to(ql).inSingletonScope(),t(eh).toService(th),t(Ds).toService(yl),L(t,Ds))}));let Zu=!1;const qu=new i((t=>{Zu||(Zu=!0,t(ah).to(La).inSingletonScope(),t(eh).toService(ah),t($s).toService(yl),L(t,$s))}));let Ju=!1;const Qu=new i((t=>{Ju||(Ju=!0,t(va).toSelf().inSingletonScope(),t(nh).to(va).inSingletonScope(),t(eh).toService(nh),t(Gs).toService(yl),L(t,Gs))}));let tg=!1;const eg=new i((t=>{tg||(tg=!0,t(rh).to(Ga).inSingletonScope(),t(eh).toService(rh),t(js).toService(yl),L(t,js))}));var ig=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},og=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let ng=class extends dl{constructor(){super(),this.numberType=os,this.builtinContributions=[Ta],this.init()}drawShape(t,e,i,o,n){const r=_n(t).richtext,{strokeOpacity:s=r.strokeOpacity,opacity:l=r.opacity,fillOpacity:a=r.fillOpacity,visible:h=r.visible}=t.attribute;if(!t.valid||!h)return;const d=Bs(l,a,!0),c=Bs(l,s,!0);d&&(e.translate(i,o),this.beforeRenderStep(t,e,i,o,d,c,d,c,r,n),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,o,d,c,d,c,r,n))}drawIcon(t,e,i,o,n){var r;const s=_n(t).richtextIcon,{width:l=s.width,height:a=s.height,opacity:h=s.opacity,image:d,backgroundFill:c=s.backgroundFill,backgroundFillOpacity:u=s.backgroundFillOpacity,backgroundStroke:g=s.backgroundStroke,backgroundStrokeOpacity:p=s.backgroundStrokeOpacity,backgroundRadius:f=s.backgroundRadius,margin:v}=t.attribute,{backgroundWidth:m=l,backgroundHeight:b=a}=t.attribute;if(v&&(i+=t._marginArray[3],o+=t._marginArray[0]),t._hovered){const t=(m-l)/2,n=(b-a)/2;0===f?(e.beginPath(),e.rect(i-t,o-n,m,b)):(e.beginPath(),El(e,i-t,o-n,m,b,f)),c&&(e.globalAlpha=u,e.fillStyle=c,e.fill()),g&&(e.globalAlpha=p,e.strokeStyle=g,e.stroke())}const C=d&&(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.get(d));C&&"success"===C.state&&(e.globalAlpha=h,e.drawImage(C.data,i,o,l,a))}draw(t,e,i){const o=_n(t).richtext;this._draw(t,o,!1,i)}};ng=ig([f(),og("design:paramtypes",[])],ng);let rg=!1;const sg=new i((t=>{rg||(rg=!0,t(hh).to(ng).inSingletonScope(),t(eh).toService(hh))}));let lg=!1;const ag=new i((t=>{lg||(lg=!0,t(dh).to(qa).inSingletonScope(),t(eh).toService(dh),t(Ns).toService(yl),L(t,Ns))}));const hg=new Le;class dg{constructor(){this.name="FlexLayoutPlugin",this.activeEvent="onRegister",this.id=e.GenAutoIncrementId(),this.key=this.name+this.id,this.tempBounds=new Le}pauseLayout(t){this.pause=t}tryLayoutChildren(t){t.firstChild&&this.tryLayout(t.firstChild)}tryLayout(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.pause)return;const i=t.parent;if(!(e||i&&t.needUpdateLayout()))return;const o=_n(i).group,{display:n=o.display}=i.attribute;if("flex"!==n)return;const{flexDirection:r=o.flexDirection,flexWrap:s=o.flexWrap,alignItems:l=o.alignItems,clip:a=o.clip}=i.attribute,{alignContent:h=(null!=l?l:o.alignContent)}=i.attribute;let{width:d,height:c,justifyContent:u=o.justifyContent}=i.attribute;const g=i.getChildren();if(null==d||null==c){let t=0,e=0,i=0;if(g.forEach((o=>{const n=this.getAABBBounds(o);n.empty()||("column"===r||"column-reverse"===r?(e+=n.height(),t=Math.max(t,n.width())):(t+=n.width(),e=Math.max(e,n.height())),i+=n.x1,i+=n.y1,i+=n.x2,i+=n.y2)})),!isFinite(i))return;d=t,c=e}null==i.attribute.width?i.attribute.width=d:d=i.attribute.width,null==i.attribute.height?i.attribute.height=c:c=i.attribute.height,this.tempBounds.copy(i._AABBBounds);const p={main:{len:d,field:"x"},cross:{len:c,field:"y"}},f=p.main,v=p.cross;"column"!==r&&"column-reverse"!==r||(f.len=c,v.len=d,f.field="y",v.field="x"),"row-reverse"!==r&&"column-reverse"!==r||("flex-start"===u?u="flex-end":"flex-end"===u?u="flex-start":g.reverse());let m=0,b=0;const C=[];g.forEach((t=>{const e=this.getAABBBounds(t);if(e.empty())return;const i="x"===f.field?e.width():e.height(),o="x"===v.field?e.width():e.height();C.push({mainLen:i,crossLen:o}),m+=i,b=Math.max(b,o)}));const y=[];if(m>f.len&&"wrap"===s){let t=0,e=0;C.forEach(((i,o)=>{let{mainLen:n,crossLen:r}=i;t+n>f.len?0===t?(y.push({idx:o,mainLen:t+n,crossLen:r}),t=0,e=0):(y.push({idx:o-1,mainLen:t,crossLen:e}),t=n,e=r):(t+=n,e=Math.max(e,r))})),y.push({idx:C.length-1,mainLen:t,crossLen:e})}else y.push({idx:C.length-1,mainLen:m,crossLen:b});let w=0;if(y.forEach((t=>{this.layoutMain(i,g,u,f,C,w,t),w=t.idx+1})),b=y.reduce(((t,e)=>t+e.crossLen),0),1===y.length){const t={"flex-start":0,"flex-end":v.len,center:v.len/2};this.layoutCross(g,l,v,t,C,y[0],0)}else if("flex-start"===h){w=0;let t=0;y.forEach(((e,i)=>{const o={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(g,"flex-start",v,o,C,y[i],w),w=e.idx+1,t+=e.crossLen}))}else if("center"===h){w=0;let t=Math.max(0,(v.len-b)/2);y.forEach(((e,i)=>{const o={"flex-start":t,"flex-end":t+e.crossLen,center:t+e.crossLen/2};this.layoutCross(g,"center",v,o,C,y[i],w),w=e.idx+1,t+=e.crossLen}))}else if("space-around"===h){w=0;const t=Math.max(0,(v.len-b)/y.length/2);let e=t;y.forEach(((i,o)=>{const n={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(g,"flex-start",v,n,C,y[o],w),w=i.idx+1,e+=i.crossLen+2*t}))}else if("space-between"===h){w=0;const t=Math.max(0,(v.len-b)/(2*y.length-2));let e=0;y.forEach(((i,o)=>{const n={"flex-start":e,"flex-end":e+i.crossLen,center:e+i.crossLen/2};this.layoutCross(g,"flex-start",v,n,C,y[o],w),w=i.idx+1,e+=i.crossLen+2*t}))}g.forEach(((t,e)=>{t.addUpdateBoundTag(),t.addUpdatePositionTag(),t.clearUpdateLayoutTag()})),i.addUpdateLayoutTag();const x=this.getAABBBounds(i);a||this.tempBounds.equals(x)||this.tryLayout(i,!1)}getAABBBounds(t){this.skipBoundsTrigger=!0;const e=t.AABBBounds;return this.skipBoundsTrigger=!1,e}updateChildPos(t,e,i){return t+(null!=e?e:0)-i}layoutMain(t,e,i,o,n,r,s){if("flex-start"===i){let t=0;for(let i=r;i<=s.idx;i++){const r=t+(e[i],o.field,0),s=this.getAABBBounds(e[i]);!s.empty()&&(e[i].attribute[o.field]=this.updateChildPos(r,e[i].attribute[o.field],s[`${o.field}1`])),t+=n[i].mainLen}}else if("flex-end"===i){let t=o.len;for(let i=s.idx;i>=r;i--){t-=n[i].mainLen;const r=t+(e[i],o.field,0),s=this.getAABBBounds(e[i]);!s.empty()&&(e[i].attribute[o.field]=this.updateChildPos(r,e[i].attribute[o.field],s[`${o.field}1`]))}}else if("space-around"===i)if(s.mainLen>=o.len){let t=0;for(let i=r;i<=s.idx;i++){const r=t+(e[i],o.field,0),s=this.getAABBBounds(e[i]);!s.empty()&&(e[i].attribute[o.field]=this.updateChildPos(r,e[i].attribute[o.field],s[`${o.field}1`])),t+=n[i].mainLen}}else{const t=s.idx-r+1,i=(o.len-s.mainLen)/t/2;let l=i;for(let t=r;t<=s.idx;t++){const r=l+(e[t],o.field,0),s=this.getAABBBounds(e[t]);!s.empty()&&(e[t].attribute[o.field]=this.updateChildPos(r,e[t].attribute[o.field],s[`${o.field}1`])),l+=n[t].mainLen+2*i}}else if("space-between"===i)if(s.mainLen>=o.len){let t=0;for(let i=r;i<=s.idx;i++){const r=t+(e[i],o.field,0),s=this.getAABBBounds(e[i]);!s.empty()&&(e[i].attribute[o.field]=this.updateChildPos(r,e[i].attribute[o.field],s[`${o.field}1`])),t+=n[i].mainLen}}else{const t=s.idx-r+1,i=(o.len-s.mainLen)/(2*t-2);let l=0;for(let t=r;t<=s.idx;t++){const r=l+(e[t],o.field,0),s=this.getAABBBounds(e[t]);!s.empty()&&(e[t].attribute[o.field]=this.updateChildPos(r,e[t].attribute[o.field],s[`${o.field}1`])),l+=n[t].mainLen+2*i}}else if("center"===i){let t=(o.len-s.mainLen)/2;for(let i=r;i<=s.idx;i++){const r=t+(e[i],o.field,0),s=this.getAABBBounds(e[i]);!s.empty()&&(e[i].attribute[o.field]=this.updateChildPos(r,e[i].attribute[o.field],s[`${o.field}1`])),t+=n[i].mainLen}}}layoutCross(t,e,i,o,n,r,s){var l;for(let a=s;a<=r.idx;a++){const r=t[a];let{alignSelf:s}=r.attribute;s&&"auto"!==s||(s=e);const h=this.getAABBBounds(r),d=null!==(l=o[s])&&void 0!==l?l:o["flex-start"];"flex-end"===s?!h.empty()&&(r.attribute[i.field]=this.updateChildPos(d-n[a].crossLen+(i.field,0),r.attribute[i.field],h[`${i.field}1`])):"center"===s?!h.empty()&&(r.attribute[i.field]=this.updateChildPos(d-n[a].crossLen/2+(i.field,0),r.attribute[i.field],h[`${i.field}1`])):!h.empty()&&(r.attribute[i.field]=this.updateChildPos(d+(i.field,0),r.attribute[i.field],h[`${i.field}1`]))}}activate(t){this.pluginService=t,zo.graphicService.hooks.onAttributeUpdate.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),t.stage&&t.stage===this.pluginService.stage&&this.tryLayout(t,!1)})),zo.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,o)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&hg.copy(o)})),zo.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,o,n)=>{e&&e===this.pluginService.stage&&t.isContainer&&!this.skipBoundsTrigger&&(hg.equals(i)||this.tryLayout(t,!1))})),zo.graphicService.hooks.onSetStage.tap(this.key,(t=>{t.glyphHost&&(t=t.glyphHost),this.tryLayout(t,!1)}))}deactivate(t){zo.graphicService.hooks.onAttributeUpdate.taps=zo.graphicService.hooks.onAttributeUpdate.taps.filter((t=>t.name!==this.key)),zo.graphicService.hooks.beforeUpdateAABBBounds.taps=zo.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),zo.graphicService.hooks.afterUpdateAABBBounds.taps=zo.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),zo.graphicService.hooks.onSetStage.taps=zo.graphicService.hooks.onSetStage.taps.filter((t=>t.name!==this.key))}}const cg=()=>{Ru.registerPlugin("FlexLayoutPlugin",dg)},ug=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class gg extends cs{constructor(t,e){super(t),(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,i){J(this.attribute[t])&&J(e)&&!Y(this.attribute[t])&&!Y(e)?yt(this.attribute[t],e):this.attribute[t]=e,ug.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>ug.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){X(e)&&(e=Object.keys(t));for(let i=0;i<e.length;i++){const o=e[i];!J(this.attribute[o])||Y(this.attribute[o])||Y(t[o])?this.attribute[o]=t[o]:yt(this.attribute[o],t[o])}}bindEvents(){}_getNodeId(t){var e;return`${null!==(e=this.id)&&void 0!==e?e:this._uid}-${this.name}-${t}`}_dispatchEvent(t,e){var i;const o=new Pn(t,e);o.manager=null===(i=this.stage)||void 0===i?void 0:i.eventSystem.manager,this.dispatchEvent(o)}}const pg=Symbol.for("MathPickerContribution"),fg=Symbol.for("MathArcPicker"),vg=Symbol.for("MathCirclePicker"),mg=Symbol.for("MathImagePicker"),bg=Symbol.for("MathLinePicker"),Cg=Symbol.for("MathPathPicker"),yg=Symbol.for("MathRectPicker"),wg=Symbol.for("MathSymbolPicker"),xg=Symbol.for("MathTextPicker"),_g=Symbol.for("MathPolygonPicker"),Sg=Symbol.for("CanvasArcPicker"),Ag=Symbol.for("CanvasCirclePicker"),Rg=Symbol.for("CanvasImagePicker"),Bg=Symbol.for("CanvasLinePicker"),Mg=Symbol.for("CanvasPathPicker"),Tg=Symbol.for("CanvasRectPicker"),Pg=Symbol.for("CanvasSymbolPicker"),Eg=Symbol.for("CanvasTextPicker"),kg=Symbol.for("CanvasPolygonPicker"),Lg=Symbol.for("CanvasRichTextPicker"),Hg=Symbol.for("CanvasGroupPicker"),Fg=Symbol.for("CanvasPickerContribution"),zg={onPointerDown:"pointerdown",onPointerUp:"pointerup",onPointerUpOutside:"pointerupoutside",onPointerTap:"pointertap",onPointerOver:"pointerover",onPointerMove:"pointermove",onPointerEnter:"pointerenter",onPointerLeave:"pointerleave",onPointerOut:"pointerout",onMouseDown:"mousedown",onMouseUp:"mouseup",onMouseUpOutside:"mouseupoutside",onMouseMove:"mousemove",onMouseOver:"mouseover",onMouseOut:"mouseout",onMouseEnter:"mouseenter",onMouseLeave:"mouseleave",onPinch:"pinch",onPinchStart:"pinchstart",onPinchEnd:"pinchend",onPan:"pan",onPanStart:"panstart",onPanEnd:"panend",onDrag:"drag",onDragStart:"dragstart",onDragEnter:"dragenter",onDragLeave:"dragleave",onDragOver:"dragover",onDragEnd:"dragend",onRightDown:"rightdown",onRightUp:"rightup",onRightUpOutside:"rightupoutside",onTouchStart:"touchstart",onTouchEnd:"touchend",onTouchEndOutside:"touchendoutside",onTouchMove:"touchmove",onTouchCancel:"touchcancel",onPress:"press",onPressUp:"pressup",onPressEnd:"pressend",onSwipe:"swipe",onDrop:"drop",onWeel:"wheel",onClick:"click",onDblClick:"dblclick"},Ig=(t,e)=>{const i=e.x-t.x,o=e.y-t.y;return Math.abs(i)>Math.abs(o)?i>0?"right":"left":o>0?"down":"up"},Og=(t,e)=>{const i=Math.abs(e.x-t.x),o=Math.abs(e.y-t.y);return Math.sqrt(i*i+o*o)};class Dg extends U{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=t=>{this.cachedEvents=[],this.startPoints=[],this.reset(),this.startTime=En.now();const{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t<e.length;t++){const{x:o,y:n}=e[t],r={x:o,y:n};i[t]=r}if(1!==i.length)this.startDistance=Og(i[0],i[1]),this.center=(t=>{const e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,o=0,n=0;for(;n<e;)i+=t[n].x,o+=t[n].y,n++;return{x:Math.round(i/e),y:Math.round(o/e)}})([i[0],i[1]]);else{const t=e[0];this.pressTimeout=setTimeout((()=>{t.direction="none",t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent("press",t),this.triggerEvent("press",t),this.eventType="press",this.direction="none",this.pressTimeout=null}),this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const o=t.clone(),{x:n,y:r,pointerId:s}=o;for(let t=0,e=i.length;t<e;t++)if(s===i[t].pointerId){i[t]=o;break}const l={x:n,y:r},a=i.map((t=>({x:t.x,y:t.y}))),h=En.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=h,this.lastMovePoint=l,1===e.length){const t=e[0],i=n-t.x,s=r-t.y,h=this.direction||Ig(t,l);this.direction=h;const d=this.getEventType(l);return o.direction=h,o.deltaX=i,o.deltaY=s,o.points=a,this.triggerStartEvent(d,o),void this.triggerEvent(d,o)}const{startDistance:d}=this,c=Og(a[0],a[1]);o.scale=c/d,o.center=this.center,o.points=a,this.triggerStartEvent("pinch",o),this.triggerEvent("pinch",o)},this.onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:o}=this,n=i.map((t=>({x:t.x,y:t.y})));if(e.points=n,this.triggerEndEvent(e),1===i.length){const i=En.now(),n=this.lastMoveTime;if(i-n<100){const t=n-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||o[0],n=this.lastMovePoint||o[0],r=Og(i,n),s=r/t;if(s>this.config.swipe.velocity&&r>this.config.swipe.threshold)return e.velocity=s,e.direction=Ig(i,n),this.triggerEvent("swipe",e),this.cachedEvents=[],this.startPoints=[],void this.reset()}}i-this.startTime<this.config.press.time&&(i-this.lastTapTime<this.config.tap.interval&&t.target===this.lastTapTarget?this.tapCount++:this.tapCount=1,this.lastTapTime=i,this.lastTapTarget=t.target,1===this.tapCount?this.triggerEvent("tap",e):2===this.tapCount&&(this.triggerEvent("doubletap",e),this.tapCount=0))}for(let t=0,n=i.length;t<n;t++)if(i[t].pointerId===e.pointerId){i.splice(t,1),o.splice(t,1);break}this.reset(),i.length>0&&this.onStart()},this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:null!==(o=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==o?o:251,threshold:null!==(r=null===(n=null==e?void 0:e.press)||void 0===n?void 0:n.threshold)&&void 0!==r?r:9},swipe:{threshold:null!==(l=null===(s=null==e?void 0:e.swipe)||void 0===s?void 0:s.threshold)&&void 0!==l?l:10,velocity:null!==(h=null===(a=null==e?void 0:e.swipe)||void 0===a?void 0:a.velocity)&&void 0!==h?h:.3},tap:{interval:null!==(c=null===(d=null==e?void 0:e.tap)||void 0===d?void 0:d.interval)&&void 0!==c?c:300}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){const{eventType:e,startTime:i,startPoints:o}=this;if(e)return e;let n;return n=En.now()-i>this.config.press.time&&Og(o[0],t)<this.config.press.threshold?"press":"pan",this.eventType=n,n}enable(t){this.processEvent[t]=!0}isProcess(t){return this.processEvent[t]}pushEvent(t,e){const{emitThrottles:i}=this,o={type:t,ev:e};for(let e=0,n=i.length;e<n;e++)if(i[e].type===t)return void i.splice(e,1,o);i.push(o)}clearPressTimeout(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)}reset(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null}triggerEvent(t,e){this.pushEvent(t,e);const{throttleTimer:i,emitThrottles:o}=this;i||(this.throttleTimer=zo.global.getRequestAnimationFrame()((()=>{zo.global.getCancelAnimationFrame()(this.throttleTimer),this.throttleTimer=null;for(let t=0,e=o.length;t<e;t++){const{type:e,ev:i}=o[t];this.emitEvent(e,i)}this.emitThrottles.length=0})))}triggerStartEvent(t,e){this.isProcess(t)||(this.enable(t),this.triggerEvent(`${t}start`,e))}triggerEndEvent(t){const e=this.processEvent;Object.keys(e).forEach((i=>{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]}))}emitEvent(t,e){const i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let o=0,n=i.length;o<n&&!e.propagationImmediatelyStopped;o++)i[o].fn.call(i[o].context,e,t);this.emit(t,e)}}var Wg=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Ng=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};const Gg=[0,0,0];let jg=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},fo),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},mo),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},bo),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Fe(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Fe(1,0,0,1,0,0),this._clearMatrix=new Fe(1,0,0,1,0,0),this.baseGlobalAlpha=1}reset(){this.stack.length&&It.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Fe(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return il.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(il.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(il.free(this.matrix),this.matrix=this.stack.pop())}rotate(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,o){let n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.translate(i,o,!1),this.scale(t,e,!1),this.translate(-i,-o,!1),n&&this.setTransformForCurrent()}setTransform(t,e,i,o,n,r){let s=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:this.dpr;this.matrix.setValue(l*t,l*e,l*i,l*o,l*n,l*r),s&&this.setTransformForCurrent()}setTransformFromMatrix(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.dpr;this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,o,n,r){let s=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.matrix.multiply(t,e,i,o,n,r),s&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),o&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),o&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,o,n,r,s){if(s=s||0,this.camera){const l=[];((t,e,i,o,n,r,s,l)=>{if(l)for(;i>e;)i-=ie;else for(;i<e;)i+=ie;const a=Qt/3*(i>e?1:-1);let h=e,d=h;for(;d!==i;){d=a>0?Math.min(d+a,i):Math.max(d+a,i);const e=Math.abs(d-h),l=4*Math.tan(e/4)/3,c=d<h?-1:1,u=Math.cos(h),g=Math.sin(h),p=Math.cos(d),f=Math.sin(d),v=u*r+o,m=g*s+n,b=p*r+o,C=f*s+n,y=r*l*c,w=s*l*c;t.push([v-y*g,m+w*u,b+y*f,C-w*p,b,C]),h=d}})(l,o,n,t,e,i,i,r);for(let t=0;t<l.length;++t){const e=l[t];this.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5],s)}}else this.nativeContext.arc(t,e,Math.max(0,i),o,n,r)}arcTo(t,e,i,o,n){this.nativeContext.arcTo(t,e,i,o,n)}bezierCurveTo(t,e,i,o,n,r,s){if(s=s||0,this.camera){let l=s,a=s;this.modelMatrix&&(tl(Gg,[t,e,s],this.modelMatrix),t=Gg[0],e=Gg[1],l=Gg[2],tl(Gg,[i,o,s],this.modelMatrix),i=Gg[0],o=Gg[1],a=Gg[2],tl(Gg,[n,r,s],this.modelMatrix),n=Gg[0],r=Gg[1],s=Gg[2]);let h=this.camera.vp(n,r,s);n=h.x,r=h.y,h=this.camera.vp(t,e,l),t=h.x,e=h.y,h=this.camera.vp(i,o,a),i=h.x,o=h.y}this.nativeContext.bezierCurveTo(t,e,i,o,n,r)}closePath(){this.nativeContext.closePath()}ellipse(t,e,i,o,n,r,s,l){null==l?this.nativeContext.ellipse(t,e,i,o,n,r,s):this.nativeContext.ellipse(t,e,i,o,n,r,s,l)}lineTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(tl(Gg,[t,e,i],this.modelMatrix),t=Gg[0],e=Gg[1],i=Gg[2]);const o=this.camera.vp(t,e,i);t=o.x,e=o.y}this.nativeContext.lineTo(t,e)}moveTo(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(tl(Gg,[t,e,i],this.modelMatrix),t=Gg[0],e=Gg[1],i=Gg[2]);const o=this.camera.vp(t,e,i);t=o.x,e=o.y}this.nativeContext.moveTo(t,e)}quadraticCurveTo(t,e,i,o,n){if(n=n||0,this.camera){let r=n;this.modelMatrix&&(tl(Gg,[t,e,n],this.modelMatrix),t=Gg[0],e=Gg[1],r=Gg[2],tl(Gg,[i,o,n],this.modelMatrix),i=Gg[0],o=Gg[1],n=Gg[2]);let s=this.camera.vp(i,o,n);i=s.x,o=s.y,s=this.camera.vp(t,e,r),t=s.x,e=s.y}this.nativeContext.quadraticCurveTo(t,e,i,o)}rect(t,e,i,o,n){n=n||0,this.camera?(this.moveTo(t,e,n),this.lineTo(t+i,e,n),this.lineTo(t+i,e+o,n),this.lineTo(t,e+o,n),this.closePath()):this.nativeContext.rect(t,e,i,o)}createImageData(){const t=arguments;return 2===t.length?this.nativeContext.createImageData(t[0],t[1]):1===t.length?this.nativeContext.createImageData(t[0]):null}createLinearGradient(t,e,i,o){return isFinite(t+e+i+o)||(t=0,e=0,i=0,o=0),this.nativeContext.createLinearGradient(t,e,i,o)}createPattern(t,e){return 0===t.width||0===t.height?null:this.nativeContext.createPattern(t,e)}createRadialGradient(t,e,i,o,n,r){return this.nativeContext.createRadialGradient(t,e,i,o,n,r)}createConicGradient(t,e,i,o){let n,r=!1;const s=this;return{stops:[],addColorStop(t,e){this.stops.push([t,e]),r=!0},GetPattern(l,a,h){return r&&(h||(h=o-i),n=function(t,e,i,o,n,r,s,l,a){const h=Math.floor(180*n/Math.PI),d=Hs.GetCanvas(),c=Hs.GetCtx();if(!c)return null;const u=zs.GetSize(l),g=zs.GetSize(a);let p=zs.Get(e,i,o,r,s,u,g);if(p)return p;const f=Math.sqrt(Math.max(Math.max(Math.pow(i,2)+Math.pow(o,2),Math.pow(u-i,2)+Math.pow(o,2)),Math.max(Math.pow(u-i,2)+Math.pow(g-o,2),Math.pow(i,2)+Math.pow(g-o,2)))),v=h+1,m=n/Math.max(1,v-1),b=Fs.getInstance().GetOrCreate(i,o,u,g,e,v),C=2*Math.PI*f/360;d.width=u,d.height=g,c.setTransform(1,0,0,1,0,0),c.clearRect(0,0,u,g),c.translate(i,o),c.rotate(r);for(let t=0,e=v-1;t<e&&!(r+t*m>s);t++){const e=b.getColor(t);c.beginPath(),c.rotate(m),c.moveTo(0,0),c.lineTo(f,-2*C),c.lineTo(f,0),c.fillStyle=e,c.closePath(),c.fill()}const y=c.getImageData(0,0,u,g);return d.width=y.width,d.height=y.height,c.putImageData(y,0,0),p=t.createPattern(d,"no-repeat"),p&&zs.Set(e,i,o,r,s,p,u,g),p}(s,this.stops,t,e,h,i,o,l,a),r=!1),n}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,o){this.nativeContext.fillRect(t,e,i,o)}clearRect(t,e,i,o){this.nativeContext.clearRect(t,e,i,o)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(tl(Gg,[t,e,i],this.modelMatrix),t=Gg[0],e=Gg[1],i=Gg[2]);const o=this.camera.vp(t,e,i);t=o.x,e=o.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(tl(Gg,[t,e,i],this.modelMatrix),t=Gg[0],e=Gg[1],i=Gg[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,o){if(o=o||0,this.camera){this.modelMatrix&&(tl(Gg,[e,i,o],this.modelMatrix),e=Gg[0],i=Gg[1],o=Gg[2]);const t=this.camera.vp(e,i,o);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,o){return this.nativeContext.getImageData(t,e,i,o)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:zo.global.measureTextMethod;var i,o;if(!e||"native"===e)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=zo.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas.nativeCanvas)));const n=null!==(i=this.fontFamily)&&void 0!==i?i:bo.fontFamily,r=null!==(o=this.fontSize)&&void 0!==o?o:bo.fontSize;return this.mathTextMeasure.textSpec.fontFamily===n&&this.mathTextMeasure.textSpec.fontSize===r||(this.mathTextMeasure.textSpec.fontFamily=n,this.mathTextMeasure.textSpec.fontSize=r,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,e)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?e[0]&&i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,o){this.nativeContext.strokeRect(t,e,i,o)}strokeText(t,e,i,o){if(o=o||0,this.camera){this.modelMatrix&&(tl(Gg,[e,i,o],this.modelMatrix),e=Gg[0],i=Gg[1],o=Gg[2]);const t=this.camera.vp(e,i,o);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}setCommonStyle(t,e,i,o,n){if(Array.isArray(n)){if(n.length<=1)return this._setCommonStyle(t,e,i,o,n[0]);const r=Object.create(n[0]);return n.forEach(((t,e)=>{0!==e&&Object.assign(r,t)})),this._setCommonStyle(t,e,i,o,r)}return this._setCommonStyle(t,e,i,o,n)}_setCommonStyle(t,e,i,o,n){const r=this.nativeContext;n||(n=this.fillAttributes);const{fillOpacity:s=n.fillOpacity,opacity:l=n.opacity,fill:a=n.fill}=e;r.globalAlpha=s*l*this.baseGlobalAlpha,s>1e-12&&l>1e-12&&(r.fillStyle=pl(this,a,t,i,o))}setShadowBlendStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);const o=Object.create(i[0]);return i.forEach(((t,e)=>{0!==e&&Object.assign(o,t)})),this._setShadowBlendStyle(t,e,o)}return this._setShadowBlendStyle(t,e,i)}_setShadowBlendStyle(t,e,i){const o=this.nativeContext;i||(i=this.fillAttributes);const{opacity:n=i.opacity,shadowBlur:r=i.shadowBlur,shadowColor:s=i.shadowColor,shadowOffsetX:l=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY,blur:h=i.blur,globalCompositeOperation:d=i.globalCompositeOperation}=e;n<=1e-12||(r||l||a?(o.shadowBlur=r*this.dpr,o.shadowColor=s,o.shadowOffsetX=l*this.dpr,o.shadowOffsetY=a*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(o.shadowBlur=0,o.shadowOffsetX=0,o.shadowOffsetY=0),h?(o.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(o.filter="blur(0px)",this._clearFilterStyle=!1),d?(o.globalCompositeOperation=d,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(o.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(t,e,i,o,n){if(Array.isArray(n)){if(n.length<=1)return this._setStrokeStyle(t,e,i,o,n[0]);const r=Object.create(n[0]);return n.forEach(((t,e)=>{0!==e&&Object.assign(r,t)})),this._setStrokeStyle(t,e,i,o,r)}return this._setStrokeStyle(t,e,i,o,n)}_setStrokeStyle(t,e,i,o,n){const r=this.nativeContext;n||(n=this.strokeAttributes);const{strokeOpacity:s=n.strokeOpacity,opacity:l=n.opacity}=e;if(r.globalAlpha=s*l*this.baseGlobalAlpha,s>1e-12&&l>1e-12){const{lineWidth:s=n.lineWidth,stroke:l=n.stroke,lineJoin:a=n.lineJoin,lineDash:h=n.lineDash,lineCap:d=n.lineCap,miterLimit:c=n.miterLimit}=e;r.lineWidth=gl(this,s,this.dpr),r.strokeStyle=pl(this,l,t,i,o),r.lineJoin=a,h&&r.setLineDash(h),r.lineCap=d,r.miterLimit=c}}setTextStyleWithoutAlignBaseline(t,e,i){const o=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:n=e.scaleIn3d}=t;t.font?o.font=t.font:o.font=Te(t,e,n&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:r=e.fontFamily,fontSize:s=e.fontSize}=t;this.fontFamily=r,this.fontSize=s,o.textAlign="left",o.textBaseline="alphabetic"}setTextStyle(t,e,i){var o,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=Te(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:s=e.fontFamily,fontSize:l=e.fontSize}=t;this.fontFamily=s,this.fontSize=l,r.textAlign=null!==(o=t.textAlign)&&void 0!==o?o:e.textAlign,r.textBaseline=null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline}draw(){}clearMatrix(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.dpr;this.setTransformFromMatrix(this._clearMatrix,t,e)}setClearMatrix(t,e,i,o,n,r){this._clearMatrix.setValue(t,e,i,o,n,r)}onlyTranslate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dpr;return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(){this.stack.forEach((t=>il.free(t))),this.stack.length=0}};jg.env="browser",jg=Wg([f(),Ng("design:paramtypes",[Object,Number])],jg);var Ug=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Vg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let $g=class extends Pu{constructor(t){super(t)}init(t){const{container:e}=t;if("string"==typeof e){const t=zo.global.getElementById(e);t&&(this._container=t)}else this._container=e;this._context=new jg(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:i=this._displayHeight,dpr:o=this._dpr,x:n=this._x,y:r=this._y}=t,{nativeCanvas:s}=this;s.width=e*o,s.height=i*o,!s.style||this.setCanvasStyle(s,n,r,e,i),t.id&&(s.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,o,n){this.controled&&(t.style.width=`${o}px`,t.style.height=`${n}px`)}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}resize(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}};function Yg(t,e){return new i((i=>{i(tn).toDynamicValue((()=>e=>new t(e))).whenTargetNamed(t.env),i(en).toDynamicValue((()=>(t,i)=>new e(t,i))).whenTargetNamed(e.env)}))}$g.env="browser",$g=Ug([f(),Vg("design:paramtypes",[Object])],$g);const Xg=Yg($g,jg);var Kg=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Zg=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},qg=function(t,e){return function(i,o){e(i,o,t)}};let Jg=class extends Du{constructor(t,e,i){super(i),this.contributions=t,this.drawContribution=e,this.pickItemInterceptorContributions=i,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(t,e){this.pickCanvas=nn.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i,o){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.beforePickItem){const n=r.beforePickItem(t,this,e,o,{parentMatrix:i});if(n)return n}}const n=this.pickerMap.get(t.numberType);if(!n)return null;const r=n.contains(t,e,o),s=r?t:null,l={graphic:s,params:r};if(s)return l;if(this.InterceptorContributions.length)for(let n=0;n<this.InterceptorContributions.length;n++){const r=this.InterceptorContributions[n];if(r.afterPickItem){const n=r.afterPickItem(t,this,e,o,{parentMatrix:i});if(n)return n}}return l}};Jg=Kg([f(),qg(0,g(E)),qg(0,v(Fg)),qg(1,g(ch)),qg(2,g(E)),qg(2,v(Rc)),Zg("design:paramtypes",[Object,Object,Object])],Jg);var Qg=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let tp=class{constructor(){this.type="group",this.numberType=qr}contains(t,e,i){return!1}};tp=Qg([f()],tp);const ep=new i(((t,e,i,o)=>{ep.__vloaded||(ep.__vloaded=!0,t(Hg).to(tp).inSingletonScope(),t(Fg).toService(Hg),L(t,Fg))}));ep.__vloaded=!1;var ip=ep;const op=new i(((t,e,i,o)=>{i(Jg)||t(Jg).toSelf().inSingletonScope(),i(Th)?o(Th).toService(Jg):t(Th).toService(Jg)}));var np,rp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},sp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let lp=np=class extends Fu{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${np.idprefix}_${np.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=zo.global,this.viewBox=new Le,this.modelMatrix=new Fe(1,0,0,1,0,0)}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){}}isElementVisible(t){const e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>o)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let i;if(i="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!i)throw new Error("发生错误,containerId可能传入有误");t.offscreen?i=null:i.appendChild(e);const o={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:i,id:np.GenerateCanvasId(),canvasControled:!0};this.canvas=new $g(o)}createWindowByCanvas(t){var e;let i;if("string"==typeof t.canvas){if(i=this.global.getElementById(t.canvas),!i)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=t.canvas;if(!i)throw new Error("发生错误,传入的canvas不正确");let o=t.width,n=t.height;if(null==o||null==n||!t.canvasControled){const t=i.getBoundingClientRect();o=t.width,n=t.height}let r=t.dpr;null==r&&(r=null!==(e=i.getContext("2d").pixelRatio)&&void 0!==e?e:i.width/o),this.canvas=new $g({width:o,height:n,dpr:r,nativeCanvas:i,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){var t;return null!==(t=this.canvas.nativeCanvas.style)&&void 0!==t?t:{}}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),o=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(o,0,0,o,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};lp.env="browser",lp.idprefix="visactor_window",lp.prefix_count=0,lp=np=rp([f(),sp("design:paramtypes",[])],lp);const ap=new i((t=>{t(lp).toSelf(),t(an).toDynamicValue((t=>t.container.get(lp))).whenTargetNamed(lp.env)}));var hp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},dp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class cp{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function up(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=document.createElement("img");if(i.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return i.src=t,i.complete?Promise.resolve(i):new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}))}let gp=class extends ku{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var i,o;let n=0,r=0,s=0,l=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};n=e.clientX||0,r=e.clientY||0,s=n,l=r}else n=t.clientX||0,r=t.clientY||0,s=t.offsetX||0,l=t.offsetY||0;if(e){const t=n,i=r,s=e.getBoundingClientRect(),l=null===(o=e.getNativeHandler)||void 0===o?void 0:o.call(e).nativeCanvas;let a,h;return l&&(a=s.width/l.offsetWidth,h=s.height/l.offsetHeight),{x:(t-s.left)/(rt(a)?a:1),y:(i-s.top)/(rt(h)?h:1)}}return{x:s,y:l}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new cp(t)}return new Le}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:i,height:o,style:n}=e;return n&&(tt(n)?t.setAttribute("style",n):Object.keys(n).forEach((e=>{t.style[e]=n[e]}))),null!=i&&(t.style.width=`${i}px`),null!=o&&(t.style.height=`${o}px`),!0}createDom(t){const{tagName:e="div",parent:i}=t,o=document.createElement(e);if(this.updateDom(o,t),i){const t=tt(i)?this.getElementById(i):i;t&&t.appendChild&&t.appendChild(o)}return o}loadImage(t){return up(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return up(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var i,o;const n=document.createElement("canvas");t.id&&(n.id=null!==(i=t.id)&&void 0!==i?i:e.GenAutoIncrementId().toString());const r=null!==(o=t.dpr)&&void 0!==o?o:window.devicePixelRatio;return t.width&&t.height&&(n.style.width=`${t.width}px`,n.style.height=`${t.height}px`,n.width=t.width*r,n.height=t.height*r),n}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(){}getElementTop(t,e){let i=t.offsetTop,o=t.offsetParent;for(;null!==o;)i+=o.offsetTop,o=o.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,o=t.offsetParent;for(;null!==o;)i+=o.offsetLeft,o=o.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,o=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,o+=n.offsetLeft,n=n.offsetParent;return{top:i,left:o}}};gp=hp([f(),dp("design:paramtypes",[])],gp);const pp=new i((t=>{pp.isBrowserBound||(pp.isBrowserBound=!0,t(gp).toSelf().inSingletonScope(),t(z).toService(gp))}));function fp(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];fp.__loaded||(fp.__loaded=!0,t.load(pp),t.load(Xg),t.load(ap),e&&function(t){t.load(ip),t.load(op)}(t))}pp.isBrowserBound=!1,fp.__loaded=!1;class vp{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=t.getGraphicTheme();o.highPerformanceSave();let{x:r=n.x,y:s=n.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,s+=e.y,o.setTransformForCurrent()}else r=0,s=0,o.transformFromMatrix(t.transMatrix,!0);let l=!1;return this.canvasRenderer.drawShape(t,o,r,s,{},null,((t,i,o)=>!!l||(l=t.isPointInPath(e.x,e.y),l)),((t,i,n)=>{if(l)return!0;const r=i.lineWidth||n.lineWidth,s=i.pickStrokeBuffer||n.pickStrokeBuffer;return o.lineWidth=gl(o,r+s,o.dpr),l=t.isPointInStroke(e.x,e.y),l})),o.highPerformanceRestore(),l}}var mp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},bp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Cp=function(t,e){return function(i,o){e(i,o,t)}};let yp=class extends vp{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Yr}};yp=mp([f(),Cp(0,g(Qa)),bp("design:paramtypes",[Object])],yp);let wp=!1;const xp=new i(((t,e,i,o)=>{wp||(wp=!0,t(fg).to(yp).inSingletonScope(),t(pg).toService(fg))}));var _p=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Sp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ap=function(t,e){return function(i,o){e(i,o,t)}};let Rp=class extends vp{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=Zr}};Rp=_p([f(),Ap(0,g(th)),Sp("design:paramtypes",[Object])],Rp);let Bp=!1;const Mp=new i(((t,e,i,o)=>{Bp||(Bp=!0,t(vg).to(Rp).inSingletonScope(),t(pg).toService(vg))}));var Tp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Pp=class{constructor(){this.type="image",this.numberType=Jr}contains(t,e,i){const{pickContext:o}=null!=i?i:{};return!!o&&!!t.AABBBounds.containsPoint(e)}};Pp=Tp([f()],Pp);let Ep=!1;const kp=new i(((t,e,i,o)=>{Ep||(Ep=!0,t(mg).to(Pp).inSingletonScope(),t(Pp).toService(mg))}));var Lp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Hp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Fp=function(t,e){return function(i,o){e(i,o,t)}};let zp=class extends vp{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Qr}};zp=Lp([f(),Fp(0,g(oh)),Hp("design:paramtypes",[Object])],zp);let Ip=!1;const Op=new i(((t,e,i,o)=>{Ip||(Ip=!0,t(bg).to(zp).inSingletonScope(),t(pg).toService(bg))}));var Dp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Wp=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Np=function(t,e){return function(i,o){e(i,o,t)}};let Gp=class extends vp{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=es}};Gp=Dp([f(),Np(0,g(rh)),Wp("design:paramtypes",[Object])],Gp);let jp=!1;const Up=new i(((t,e,i,o)=>{jp||(jp=!0,t(_g).to(Gp).inSingletonScope(),t(pg).toService(_g))}));var Vp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},$p=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Yp=function(t,e){return function(i,o){e(i,o,t)}};let Xp=class extends vp{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=ts}};Xp=Vp([f(),Yp(0,g(nh)),$p("design:paramtypes",[Object])],Xp);let Kp=!1;const Zp=new i(((t,e,i,o)=>{Kp||(Kp=!0,t(Cg).to(Xp).inSingletonScope(),t(pg).toService(Cg))})),qp=new Le;class Jp{constructor(){this.type="rect",this.numberType=is}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=t.getGraphicTheme(),{cornerRadius:r=n.cornerRadius}=t.attribute;let{x:s=n.x,y:l=n.y}=t.attribute;o.highPerformanceSave();let a=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);s+=e.x,l+=e.y,o.setTransformForCurrent()}else s=0,l=0,a=!1,o.transformFromMatrix(t.transMatrix,!0);let h=!0;if(!a||t.shadowRoot||nt(r,!0)&&0!==r||et(r)&&r.some((t=>0!==t)))h=!1,this.canvasRenderer.drawShape(t,o,s,l,{},null,((t,i,o)=>!!h||(h=t.isPointInPath(e.x,e.y),h)),((t,i,n)=>{if(h)return!0;const r=i.lineWidth||n.lineWidth,s=i.pickStrokeBuffer||n.pickStrokeBuffer;return o.lineWidth=gl(o,r+s,o.dpr),h=t.isPointInStroke(e.x,e.y),h}));else{const{fill:i=n.fill,stroke:o=n.stroke,lineWidth:r=n.lineWidth}=t.attribute;if(i)h=!0;else if(o){const i=t.AABBBounds;qp.setValue(i.x1,i.y1,i.x2,i.y2),qp.expand(-r/2),h=!qp.containsPoint(e)}}return o.highPerformanceRestore(),h}}var Qp=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},tf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},ef=function(t,e){return function(i,o){e(i,o,t)}};let of=class extends Jp{constructor(t){super(),this.canvasRenderer=t}};of=Qp([f(),ef(0,g(sh)),tf("design:paramtypes",[Object])],of);let nf=!1;const rf=new i(((t,e,i,o)=>{nf||(nf=!0,t(yg).to(of).inSingletonScope(),t(pg).toService(yg))}));let sf=!1;const lf=new i(((t,e,i,o)=>{sf||(sf=!0,t(mg).to(Pp).inSingletonScope(),t(Pp).toService(mg))}));var af=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},hf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},df=function(t,e){return function(i,o){e(i,o,t)}};let cf=class extends vp{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=ns}};cf=af([f(),df(0,g(lh)),hf("design:paramtypes",[Object])],cf);let uf=!1;const gf=new i(((t,e,i,o)=>{uf||(uf=!0,t(wg).to(cf).inSingletonScope(),t(pg).toService(wg))}));var pf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let ff=class{constructor(){this.type="text",this.numberType=rs}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};ff=pf([f()],ff);let vf=!1;const mf=new i(((t,e,i,o)=>{vf||(vf=!0,t(xg).to(ff).inSingletonScope(),t(pg).toService(xg))}));var bf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Cf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let yf=class extends jg{constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Fe(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(){}};yf.env="node",yf=bf([f(),Cf("design:paramtypes",[Object,Number])],yf);var wf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},xf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let _f=class extends Pu{constructor(t){super(t)}init(){this._context=new yf(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(){this._nativeCanvas.release&&Y(this._nativeCanvas.release)&&this._nativeCanvas.release()}};_f.env="node",_f=wf([f(),xf("design:paramtypes",[Object])],_f);const Sf=Yg(_f,yf);var Af=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Rf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Bf=function(t,e){return function(i,o){e(i,o,t)}};let Mf=class extends Fu{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const i=this.global.createCanvas({width:t.width,height:t.height}),o={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:i,id:e.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new _f(o)}createWindowByCanvas(t){const e=t.canvas;let i=t.width,o=t.height;null!=i&&null!=o&&t.canvasControled||(i=e.width,o=e.height),this.canvas=new _f({width:i,height:o,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t){}};Mf.env="node",Mf=Af([f(),Bf(0,g(I)),Rf("design:paramtypes",[Object])],Mf);const Tf=new i((t=>{t(Mf).toSelf(),t(an).toDynamicValue((t=>t.container.get(Mf))).whenTargetNamed(Mf.env)}));var Pf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Ef=class extends ku{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return lr.call(t)}}getCancelAnimationFrame(){return t=>{lr.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(){}createOffscreenCanvas(t){}};Ef=Pf([f()],Ef);const kf=new i((t=>{kf.isNodeBound||(kf.isNodeBound=!0,t(Ef).toSelf().inSingletonScope(),t(z).toService(Ef))}));function Lf(t){Lf.__loaded||(Lf.__loaded=!0,t.load(kf),t.load(Sf),t.load(Tf))}kf.isNodeBound=!1,Lf.__loaded=!1;var Hf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Ff=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},zf=function(t,e){return function(i,o){e(i,o,t)}};let If=class extends vp{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Yr}};If=Hf([f(),zf(0,g(Qa)),Ff("design:paramtypes",[Object])],If);let Of=!1;const Df=new i(((t,e,i,o)=>{Of||(Of=!0,t(Sg).to(If).inSingletonScope(),t(Fg).toService(Sg))}));var Wf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Nf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Gf=function(t,e){return function(i,o){e(i,o,t)}};let jf=class extends Jp{constructor(t){super(),this.canvasRenderer=t}};jf=Wf([f(),Gf(0,g(sh)),Nf("design:paramtypes",[Object])],jf);let Uf=!1;const Vf=new i(((t,e,i,o)=>{Uf||(Uf=!0,t(Tg).to(jf).inSingletonScope(),t(Fg).toService(Tg))}));class $f extends dl{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:o}=null!=i?i:{};if(!o)return!1;o.highPerformanceSave();const n=t.getGraphicTheme(),r=this.transform(t,n,o),{x:s,y:l,z:a,lastModelMatrix:h}=r;let d=e;if(o.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=a;let c=!1;return this.canvasRenderer.drawShape(t,o,s,l,{},null,(t=>!!c||(c=t.isPointInPath(d.x,d.y),c)),((t,e,i)=>{if(c)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer;return o.lineWidth=gl(o,n+r,o.dpr),c=t.isPointInStroke(d.x,d.y),c})),this.canvasRenderer.z=0,o.modelMatrix!==h&&ol.free(o.modelMatrix),o.modelMatrix=h,o.highPerformanceRestore(),c}}var Yf=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Xf=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Kf=function(t,e){return function(i,o){e(i,o,t)}};let Zf=class extends $f{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=Qr}};Zf=Yf([f(),Kf(0,g(oh)),Xf("design:paramtypes",[Object])],Zf);let qf=!1;const Jf=new i(((t,e,i,o)=>{qf||(qf=!0,t(Bg).to(Zf).inSingletonScope(),t(Fg).toService(Bg))}));class Qf extends dl{contains(t,e,i){const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=t.getGraphicTheme();o.highPerformanceSave();const r=this.transform(t,n,o),{x:s,y:l,z:a,lastModelMatrix:h}=r;let d=e;if(o.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=a;let c=!1;return this.canvasRenderer.drawShape(t,o,s,l,i,null,((t,e,i)=>!!c||(c=t.isPointInPath(d.x,d.y),c))),this.canvasRenderer.z=0,o.modelMatrix!==h&&ol.free(o.modelMatrix),o.modelMatrix=h,o.highPerformanceRestore(),c}}var tv=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},ev=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},iv=function(t,e){return function(i,o){e(i,o,t)}};let ov=class extends Qf{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=ns}contains(t,e,i){const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=t.getParsedPath();if(!o.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(n.isSvg||"imprecise"===t.attribute.pickMode)return!0}o.highPerformanceSave();const r=t.getGraphicTheme(),s=this.transform(t,r,o),{x:l,y:a,z:h,lastModelMatrix:d}=s;let c=e;if(o.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,o,l,a,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer;return o.lineWidth=gl(o,n+r,o.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,o.modelMatrix!==d&&ol.free(o.modelMatrix),o.modelMatrix=d,o.highPerformanceRestore(),u}};ov=tv([f(),iv(0,g(lh)),ev("design:paramtypes",[Object])],ov);let nv=!1;const rv=new i(((t,e,i,o)=>{nv||(nv=!0,t(Pg).to(ov).inSingletonScope(),t(Fg).toService(Pg))}));var sv=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},lv=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},av=function(t,e){return function(i,o){e(i,o,t)}};let hv=class extends vp{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=Zr}};hv=sv([f(),av(0,g(th)),lv("design:paramtypes",[Object])],hv);let dv=!1;const cv=new i(((t,e,i,o)=>{dv||(dv=!0,t(Ag).to(hv).inSingletonScope(),t(Fg).toService(Ag))}));var uv=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},gv=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},pv=function(t,e){return function(i,o){e(i,o,t)}};let fv=class extends Qf{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=rs}contains(t,e,i){const{pickContext:o}=null!=i?i:{};if(!o)return!1;const n=t.AABBBounds;if(!o.camera)return!!n.containsPoint(e);o.highPerformanceSave();const r=t.getGraphicTheme(),{keepDirIn3d:s=r.keepDirIn3d}=t.attribute,l=!s,a=this.transform(t,r,o,l),{x:h,y:d,z:c,lastModelMatrix:u}=a;this.canvasRenderer.z=c;let g=e;if(o.camera){g=e.clone();const i=t.parent.globalTransMatrix;g.x=i.a*e.x+i.c*e.y+i.e,g.y=i.b*e.x+i.d*e.y+i.f}let p=!1;return this.canvasRenderer.drawShape(t,o,h,d,{},null,((e,i,o)=>{if(p)return!0;const{fontSize:n=r.fontSize,textBaseline:s=r.textBaseline,textAlign:l=r.textAlign}=t.attribute,a=t.AABBBounds,u=a.height(),f=a.width(),v=Ks(s,u,n),m=Xs(l,f);return e.rect(m+h,v+d,f,u,c),p=e.isPointInPath(g.x,g.y),p}),((t,e,i)=>p)),this.canvasRenderer.z=0,o.modelMatrix!==u&&ol.free(o.modelMatrix),o.modelMatrix=u,o.highPerformanceRestore(),p}};fv=uv([f(),pv(0,g(ah)),gv("design:paramtypes",[Object])],fv);let vv=!1;const mv=new i(((t,e,i,o)=>{vv||(vv=!0,t(Eg).to(fv).inSingletonScope(),t(Fg).toService(Eg))}));var bv=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Cv=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},yv=function(t,e){return function(i,o){e(i,o,t)}};let wv=class extends $f{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=ts}};wv=bv([f(),yv(0,g(nh)),Cv("design:paramtypes",[Object])],wv);let xv=!1;const _v=new i(((t,e,i,o)=>{xv||(xv=!0,t(Mg).to(wv).inSingletonScope(),t(Fg).toService(Mg))}));var Sv=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Av=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Rv=function(t,e){return function(i,o){e(i,o,t)}};let Bv=class extends vp{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=es}};Bv=Sv([f(),Rv(0,g(rh)),Av("design:paramtypes",[Object])],Bv);let Mv=!1;const Tv=new i(((t,e,i,o)=>{Mv||(Mv=!0,t(kg).to(Bv).inSingletonScope(),t(Fg).toService(kg))}));var Pv=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},Ev=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},kv=function(t,e){return function(i,o){e(i,o,t)}};let Lv=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=os}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};Lv=Pv([f(),kv(0,g(hh)),Ev("design:paramtypes",[Object])],Lv);let Hv=!1;const Fv=new i(((t,e,i,o)=>{Hv||(Hv=!0,t(Lg).to(Lv).inSingletonScope(),t(Fg).toService(Lg))}));var zv=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Iv=class{constructor(){this.type="image",this.numberType=Jr}contains(t,e,i){const{pickContext:o}=null!=i?i:{};return!!o&&!!t.AABBBounds.containsPoint(e)}};Iv=zv([f()],Iv);let Ov=!1;const Dv=new i(((t,e,i,o)=>{Ov||(Ov=!0,t(Rg).to(Iv).inSingletonScope(),t(Fg).toService(Rg))})),Wv=Au();function Nv(){Nv.__loaded||(Nv.__loaded=!0,Ra.RegisterGraphicCreator("arc",Cc),Qo.load(Nu),Qo.load(Wv?Df:xp))}Nv.__loaded=!1;const Gv=Nv;function jv(){jv.__loaded||(jv.__loaded=!0,Ra.RegisterGraphicCreator("circle",Hh),Qo.load(Ku),Qo.load(Wv?cv:Mp))}jv.__loaded=!1;const Uv=jv;function Vv(){Vv.__loaded||(Vv.__loaded=!0,Ra.RegisterGraphicCreator("group",us))}Vv.__loaded=!1;const $v=Vv;function Yv(){Yv.__loaded||(Yv.__loaded=!0,Ra.RegisterGraphicCreator("image",lc),Qo.load(ag),Qo.load(Wv?Dv:kp))}Yv.__loaded=!1;const Xv=Yv;function Kv(){Kv.__loaded||(Kv.__loaded=!0,Ra.RegisterGraphicCreator("line",Qd),Qo.load(Vu),Qo.load(Wv?Jf:Op))}Kv.__loaded=!1;const Zv=Kv;function qv(){qv.__loaded||(qv.__loaded=!0,Ra.RegisterGraphicCreator("path",vc),Qo.load(Qu),Qo.load(Wv?_v:Zp))}qv.__loaded=!1;const Jv=qv;function Qv(){Qv.__loaded||(Qv.__loaded=!0,Ra.RegisterGraphicCreator("polygon",xc),Qo.load(eg),Qo.load(Wv?Tv:Up))}Qv.__loaded=!1;const tm=Qv;function em(){em.__loaded||(em.__loaded=!0,Ra.RegisterGraphicCreator("rect",ic),Qo.load(ju),Qo.load(Wv?Vf:rf))}em.__loaded=!1;const im=em;function om(){om.__loaded||(om.__loaded=!0,Ra.RegisterGraphicCreator("richtext",gc),Qo.load(sg),Qo.load(Wv?Fv:lf))}om.__loaded=!1;const nm=om;function rm(){rm.__loaded||(rm.__loaded=!0,Ra.RegisterGraphicCreator("shadowRoot",Sc))}rm.__loaded=!1;const sm=rm;function lm(){lm.__loaded||(lm.__loaded=!0,Ra.RegisterGraphicCreator("symbol",Zd),Qo.load(Yu),Qo.load(Wv?rv:gf))}lm.__loaded=!1;const am=lm;function hm(){hm.__loaded||(hm.__loaded=!0,Ra.RegisterGraphicCreator("text",Oh),Qo.load(qu),Qo.load(Wv?mv:mf))}hm.__loaded=!1;const dm=hm;function cm(){cm.__loaded||(cm.__loaded=!0,Ra.RegisterGraphicCreator("wrapText",Nh))}cm.__loaded=!1;const um=cm;function gm(){$v(),im()}const pm="PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";var fm;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(fm||(fm={}));const vm={[fm.selectedReverse]:{},[fm.selected]:{},[fm.hover]:{},[fm.hoverReverse]:{}},mm={container:"",width:30,height:30,style:{}},bm={debounce:Xt,throttle:Kt};gm();class Cm extends gg{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:yt({},Cm.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=t=>{const{viewX:e,viewY:i}=t,{direction:o,width:n,height:r,range:s}=this.attribute,l=this._sliderSize,[a,h]=this._getScrollRange();let d;if("vertical"===o){const t=i-this._viewPosition.y,e=Ut(t-l/2,a,h);d=t/r,this._slider.setAttribute("y",e,!0)}else{const t=e-this._viewPosition.x,i=Ut(t-l/2,a,h);d=t/n,this._slider.setAttribute("x",i,!0)}this.setScrollRange([d-(s[1]-s[0])/2,d+(s[1]-s[0])/2],!1),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()},this._onSliderPointerDown=t=>{const{stopSliderDownPropagation:e=!0}=this.attribute;e&&t.stopPropagation();const{direction:i}=this.attribute,{x:o,y:n}=this.stage.eventPointTransform(t);this._prePos="horizontal"===i?o:n,this._dispatchEvent("scrollDown",{pos:this._prePos,event:t}),"browser"===uu.env?(uu.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),uu.addEventListener("pointerup",this._onSliderPointerUp)):(this.stage.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.addEventListener("pointerup",this._onSliderPointerUp),this.stage.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._computeScrollValue=t=>{const{direction:e}=this.attribute,{x:i,y:o}=this.stage.eventPointTransform(t);let n,r,s=0;const{width:l,height:a}=this.getSliderRenderBounds();return"vertical"===e?(r=o,s=r-this._prePos,n=s/a):(r=i,s=r-this._prePos,n=s/l),[r,n]},this._onSliderPointerMove=t=>{const{stopSliderMovePropagation:e=!0}=this.attribute;e&&t.stopPropagation();const i=this.getScrollRange(),[o,n]=this._computeScrollValue(t);this.setScrollRange([i[0]+n,i[1]+n],!0),this._prePos=o},this._onSliderPointerMoveWithDelay=0===this.attribute.delayTime?this._onSliderPointerMove:bm[this.attribute.delayType](this._onSliderPointerMove,this.attribute.delayTime),this._onSliderPointerUp=t=>{t.preventDefault();const{realTime:e=!0,range:i,limitRange:o=[0,1]}=this.attribute,n=this.getScrollRange(),[r,s]=this._computeScrollValue(t),l=[n[0]+s,n[1]+s];this._dispatchEvent("scrollUp",{pre:i,value:Vt(l,o[0],o[1])}),"browser"===uu.env?(uu.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),uu.removeEventListener("pointerup",this._onSliderPointerUp)):(this.stage.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.removeEventListener("pointerup",this._onSliderPointerUp),this.stage.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{direction:i="horizontal",limitRange:o=[0,1],range:n,realTime:r=!0}=this.attribute,s=Vt(t,o[0],o[1]);if(e){const t=this._getSliderPos(s);if(this._slider){const e=t[1]-t[0];this._sliderSize=e,"horizontal"===i?this._slider.setAttributes({x:t[0],width:e},!0):this._slider.setAttributes({y:t[0],height:e},!0),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()}}this.attribute.range=s,r&&this._dispatchEvent("scrollDrag",{pre:n,value:s})}getScrollRange(){return this.attribute.range}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0}=this.attribute;this._rail&&this._rail.addEventListener("pointerdown",bm[t](this._onRailPointerDown,e)),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){this._reset();const{direction:t="horizontal",width:e,height:i,range:o,limitRange:n=[0,1],railStyle:r,sliderStyle:s,padding:l=2}=this.attribute,a=this.createOrUpdateChild("scrollbar-container",{},"group"),h=a.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:e,height:i},r),"rect");this._rail=h;const d=this.getSliderRenderBounds(),c=this._getSliderPos(Vt(o,n[0],n[1])),u=c[1]-c[0];let g;this._sliderSize=u,g="horizontal"===t?{x:c[0],y:d.y1,width:u,height:d.height}:{x:d.x1,y:c[0],width:d.width,height:u};const p=a.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},g),{cornerRadius:this._getDefaultSliderCornerRadius()}),s),{boundsPadding:Ze(l),pickMode:"imprecise"}),"rect");this._slider=p,this._container=a;const f=this._container.AABBBounds;this._viewPosition={x:f.x1,y:f.y1}}getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;const{width:t,height:e,padding:i=2}=this.attribute,[o,n,r,s]=Ze(i),l={x1:s,y1:o,x2:t-n,y2:e-r,width:Math.max(0,t-(s+n)),height:Math.max(0,e-(o+r))};return this._sliderRenderBounds=l,l}_getDefaultSliderCornerRadius(){const{direction:t,round:e}=this.attribute;if(e){const{width:e,height:i}=this.getSliderRenderBounds();return"horizontal"===t?i:e}return 0}_getSliderPos(t){const{direction:e}=this.attribute,{width:i,height:o,x1:n,y1:r}=this.getSliderRenderBounds();return"horizontal"===e?[i*t[0]+n,i*t[1]+n]:[o*t[0]+r,o*t[1]+r]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;const{limitRange:t=[0,1],direction:e}=this.attribute,[i,o]=Vt(t,0,1),{width:n,height:r,x1:s,y1:l}=this.getSliderRenderBounds(),a=this._sliderSize;return"horizontal"===e?Vt([s+i*n,s+o*n],s,n-a):Vt([l+i*r,l+o*r],l,r-a)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}function ym(t,e){t.forEachChildren((t=>{const i=e(t);t.isContainer&&!i&&ym(t,e)}))}function wm(t,e){return[t[0]*e,t[1]*e]}function xm(t){const[e,i]=t;return Math.sqrt(e*e+i*i)}function _m(t,e,i){const o=function(t,e){const[i,o]=t,[n,r]=e,s=Math.sqrt((i*i+o*o)*(n*n+r*r)),l=s&&(i*n+o*r)/s;return Math.acos(Math.min(Math.max(l,-1),1))}(t,e),n=(s=e,(r=t)[0]*s[1]-r[1]*s[0]>=0);var r,s;return i?n?2*Math.PI-o:o:n?o:2*Math.PI-o}Cm.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1],delayType:"throttle",delayTime:0,realTime:!0};const Sm=(t,e,i,o)=>new Pe(Object.assign({defaultFontParams:Object.assign({fontFamily:pm,fontSize:14},o),getTextBounds:i?void 0:Ma,specialCharSet:"-/: .,@%'\"~"+Pe.ALPHABET_CHAR_SET+Pe.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t);function Am(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return{width:0,height:0};const o=Ma({text:t,fontFamily:e.fontFamily||i.fontFamily||pm,fontSize:e.fontSize||i.fontSize||12,fontWeight:e.fontWeight||i.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||i.fontSize||12});return{width:o.width(),height:o.height()}}function Rm(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type";var i,o;return Z(t.text)&&"type"in t.text?null!==(i=t.text.type)&&void 0!==i?i:"text":e in t&&null!==(o=t[e])&&void 0!==o?o:"text"}function Bm(t){var e,i;return K(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0,t.textConfig=t.text.text||t.text,t}function Mm(t){const e=Rm(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type");return"rich"===e?Ra.richtext(Bm(t)):("html"===e?t=function(t){const{text:e,_originText:i}=t,{text:o}=e;return t.html=o,t.text=i,t.renderable=!1,t}(t):"react"===e&&(t=function(t){const{text:e,_originText:i}=t,{text:o}=e;return t.react=o,t.text=i,t.renderable=!1,t}(t)),Ra.text(t))}function Tm(){$v(),im(),am(),nm(),dm()}var Pm=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};Tm();class Em extends gg{getBgRect(){return this._bgRect}getTextShape(){return this._textShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:yt({},Em.defaultAttributes,t)),this.name="tag",this._tagStates=[],this._rectStates=[],this._symbolStates=[],this._textStates=[]}render(){var t,e,i;this.cacheStates();const{text:o="",textStyle:n={},shape:r={},panel:s={},space:l=4,minWidth:a,maxWidth:h,padding:d=4,visible:c,state:u,type:g,textAlwaysCenter:p,containerTextAlign:f}=this.attribute,v=Ze(d),m=this.createOrUpdateChild("tag-content",{x:0,y:0,zIndex:1},"group");let b,C=-v[3],y=-v[0],w=v[1]+v[3],x=v[0]+v[2],_=0,S=0;const{visible:A}=r,R=Pm(r,["visible"]);if($(A)){const t=(null==R?void 0:R.size)||10,e=nt(t)?t:Math.max(t[0],t[1]);b=m.createOrUpdateChild("tag-shape",Object.assign(Object.assign({symbolType:"circle",size:t,strokeBoundsBuffer:0},R),{visible:A,x:e/2,y:e/2}),"symbol"),ut(null==u?void 0:u.shape)||(b.states=u.shape),A&&(S=e+l)}let B;if(w+=S,_+=S,function(t){return"rich"===Rm(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type")}({text:o})||"rich"===g){const t=Object.assign(Object.assign(Object.assign({},Bm(Object.assign({type:g,text:o},n))),n),{visible:K(o)&&!1!==c,x:_,y:0});B=m.createOrUpdateChild("tag-text",t,"richtext"),w+=B.AABBBounds.width(),x+=B.AABBBounds.height(),C+=B.AABBBounds.x1,y+=B.AABBBounds.y1}else{const s=Object.assign(Object.assign({text:Z(o)&&"type"in o&&"text"===o.type?o.text:o,visible:K(o)&&!1!==c,lineHeight:null==n?void 0:n.fontSize},n),{x:_,y:0});X(s.lineHeight)&&(s.lineHeight=n.fontSize),B=m.createOrUpdateChild("tag-text",s,"text"),ut(null==u?void 0:u.text)||(B.states=u.text);const l=Am(s.text,n,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text),d=l.width,g=l.height;w+=d;const A=null!==(i=r.size)&&void 0!==i?i:10,R=nt(A)?A:Math.max(A[0],A[1]);x+=Math.max(g,r.visible?R:0);const{textAlign:M,textBaseline:T}=n;(K(a)||K(h))&&(K(a)&&w<a&&(w=a),K(h)&&w>h&&(w=h,B.setAttribute("maxLineWidth",h-v[1]-v[2]))),C=0,y=0;let P=0;"left"===M||"start"===M?P=1:"right"===M||"end"===M?P=-1:"center"===M&&(P=0),P?P<0?(C-=w,b&&b.setAttribute("x",(b.attribute.x||0)-d),m.setAttribute("x",-v[1]-S)):P>0&&m.setAttribute("x",v[3]):(C-=w/2,b&&b.setAttribute("x",(b.attribute.x||0)-d/2),m.setAttribute("x",-S/2));const E="right"===f||"end"===f,k="left"===f||"start"===f;if((f?"center"===f:p)&&P){const t=w-v[1]-v[3],e=d+S,i=1===P?(t-e)/2+S+d/2:v[0]+S-(w/2+e/2-S)+d/2;if(B.setAttributes({x:i,textAlign:"center"}),b){const t=i-d/2-S+R/2;b.setAttributes({x:t})}}if(k&&1!==P){const t=w-v[1]-v[3],e=0===P?-t/2+S/2:-w+v[3]+v[1]+S,i=e+S;if(B.setAttributes({x:i,textAlign:"left"}),b){const t=e+R/2;b.setAttributes({x:t})}}if(E&&-1!==P){const t=w-v[1]-v[3],e=0===P?t/2+S/2:t;if(B.setAttributes({x:e,textAlign:"right"}),b){const t=e-d-S+R/2;b.setAttributes({x:t})}}"middle"===T?(y-=x/2,b&&b.setAttribute("y",0)):"bottom"===T?(y-=x,b&&b.setAttribute("y",-g/2),m.setAttribute("y",-v[2])):"top"===T&&(m.setAttribute("y",v[0]),b&&b.setAttribute("y",g/2))}const{visible:M}=s,T=Pm(s,["visible"]);if(c&&$(M)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},T),{visible:M&&!!o,width:w,height:x,x:C,y:y}),"rect");if(ut(null==u?void 0:u.panel)||(t.states=u.panel),T.customShape){const e=T.customShape;t.pathProxy=t=>e(this,t,new co)}this._bgRect=t}this._textShape=B,this._symbol=b,this.resetStates()}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:yt({},Em.defaultAttributes,t),super.initAttributes(t),this.render()}addState(t,e,i){super.addState(t,e,i),this._textShape&&this._textShape.addState(t,e,i),this._bgRect&&this._bgRect.addState(t,e,i),this._symbol&&this._symbol.addState(t,e,i)}removeState(t,e){super.removeState(t,e),this._textShape&&this._textShape.removeState(t,e),this._bgRect&&this._bgRect.removeState(t,e),this._symbol&&this._symbol.removeState(t,e)}cacheStates(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(n=null===(o=null===(i=this._bgRect)||void 0===i?void 0:i.currentStates)||void 0===o?void 0:o.slice())&&void 0!==n?n:[],this._symbolStates=null!==(l=null===(s=null===(r=this._symbol)||void 0===r?void 0:r.currentStates)||void 0===s?void 0:s.slice())&&void 0!==l?l:[],this._textStates=null!==(d=null===(h=null===(a=this._textShape)||void 0===a?void 0:a.currentStates)||void 0===h?void 0:h.slice())&&void 0!==d?d:[],this.clearStates(),null===(c=this._bgRect)||void 0===c||c.clearStates(),null===(u=this._symbol)||void 0===u||u.clearStates(),null===(g=this._textShape)||void 0===g||g.clearStates()}resetStates(){var t,e,i;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&(null===(t=this._bgRect)||void 0===t||t.useStates(this._rectStates)),this._symbolStates.length&&(null===(e=this._symbol)||void 0===e||e.useStates(this._symbolStates)),this._textStates.length&&(null===(i=this._textShape)||void 0===i||i.useStates(this._textStates))}}Em.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};const km={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},Lm={poptip:yt({},km)};var Hm=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};const Fm=new Le;$v(),dm(),am(),im();class zm extends gg{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:yt({},zm.defaultAttributes,t)),this.name="poptip",this.positionList=["top","tl","tr","bottom","bl","br","left","lt","lb","right","rt","rb"]}render(){var t,e,i,o,n,r,s,l;const{titleStyle:a={},position:h,contentStyle:d={},panel:c={},space:u=4,minWidth:g=0,maxWidth:p=1/0,padding:f=4,maxWidthPercent:v,visible:m,state:b,dx:C=0,dy:y=0}=this.attribute;let{title:w="",content:x=""}=this.attribute;w=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(w):w,x=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(x):x;const _=Ze(f),S=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),A=p-_[1]-_[3],R=K(w)&&!1!==m,B=Object.assign(Object.assign({text:et(w)?w:[w],visible:R,wrap:!0},a),{x:_[3],y:_[0],maxLineWidth:A,textAlign:"left",textBaseline:"top"}),M=S.createOrUpdateChild("poptip-title",B,"text");ut(null==b?void 0:b.title)||(M.states=b.title);const T=M.AABBBounds,P=T.height(),E=T.width();let k=P+u;R||(k=0);const L=K(x)&&!1!==m,H=Object.assign(Object.assign({text:et(x)?x:[x],visible:L,wrap:!0},d),{x:_[3],y:_[0]+k,maxLineWidth:A,textAlign:"left",textBaseline:"top"}),F=S.createOrUpdateChild("poptip-content",H,"text");ut(null==b?void 0:b.content)||(F.states=b.content);const z=F.AABBBounds,I=z.height(),O=z.width();L&&(k+=I);let D=se(E+_[1]+_[3],O+_[1]+_[3]);D>p?D=p:D<g&&(D=g);let W=_[0]+_[2]+k;const{visible:N}=c,G=Hm(c,["visible"]),j=null!==(t=G.size)&&void 0!==t?t:12,U=et(j)?[j[0]+(null!==(e=G.space)&&void 0!==e?e:0),j[1]+(null!==(i=G.space)&&void 0!==i?i:0)]:j+(null!==(o=G.space)&&void 0!==o?o:0),V=null!==(n=G.lineWidth)&&void 0!==n?n:1,Y=this.stage?[null!==(r=this.stage.viewWidth)&&void 0!==r?r:this.stage.width,null!==(s=this.stage.viewHeight)&&void 0!==s?s:this.stage.height]:void 0;if(Y){const t=this.AABBBounds,e=null!==(l=this.attribute.x)&&void 0!==l?l:t.x1,i=Y[0]-t.x1;let o=Math.max(e,i);const n=(et(j)?j[0]:12)+3;if(o=Math.min(o-n,o*v),o<D){D=o;const t=_[1]+_[3];M.setAttribute("maxLineWidth",o-t),F.setAttribute("maxLineWidth",o-t),W=_[0]+_[2],R&&(W+=M.AABBBounds.height()+u),W+=F.AABBBounds.height()}}const X="auto"===h;let Z,q=-1/0;for(let t=0;t<this.positionList.length+1;t++){const e=X?this.positionList[t===this.positionList.length?Z:t]:h,{angle:i,offset:o,rectOffset:n}=this.getAngleAndOffset(e,D,W,et(U)?U:[U,U-V]);if($(N)){const t=(et(j)?j[0]:j)/4,e=S.createOrUpdateChild("poptip-symbol-panel",Object.assign(Object.assign({},G),{visible:N&&(L||R),x:t,y:0,strokeBoundsBuffer:-1,boundsPadding:-2,anchor:[0,0],symbolType:"arrow2Left",angle:i,dx:o[0],dy:o[1],size:j,zIndex:-9}),"symbol");ut(null==b?void 0:b.panel)||(e.states=b.panel);const n=S.createOrUpdateChild("poptip-rect-panel",Object.assign(Object.assign({},G),{visible:N&&(L||R),x:0,y:0,width:D,height:W,zIndex:-8}),"rect");ut(null==b?void 0:b.panel)||(n.states=b.panel)}if(S.setAttributes({x:-o[0]+C,y:-o[1]+y}),!X||!Y)break;{Fm.setValue(0,0,D,W).transformWithMatrix(S.globalTransMatrix);const e=Fm,i=(new ke).setValue(0,0,Y[0],Y[1]);if(we(e,i,!1))break;{const o=be(e,i,!1),n=(o.x2-o.x1)*(o.y2-o.y1);n>q&&(q=n,Z=t)}}}}getAngleAndOffset(t,e,i,o){const n=o[1]/2;switch(t){case"tl":return{angle:Qt/2*3,offset:[e/4,i+n],rectOffset:[-e/4,-i-o[1]]};case"top":return{angle:Qt/2*3,offset:[e/2,i+n],rectOffset:[0,-i-o[1]]};case"tr":return{angle:Qt/2*3,offset:[e/4*3,i+n],rectOffset:[e/4*3,-i-o[1]]};case"rt":return{angle:0,offset:[-n,i/5],rectOffset:[e/4*3,-i-o[1]]};case"right":return{angle:0,offset:[-n,i/2],rectOffset:[e/4*3,-i-o[1]]};case"rb":return{angle:0,offset:[-n,i/5*4],rectOffset:[e/4*3,-i-o[1]]};case"bl":return{angle:Qt/2,offset:[e/4,-n],rectOffset:[-e/4,-i-o[1]]};case"bottom":return{angle:Qt/2,offset:[e/2,-n],rectOffset:[0,-i-o[1]]};case"br":return{angle:Qt/2,offset:[e/4*3,-n],rectOffset:[e/4*3,-i-o[1]]};case"lt":return{angle:Qt,offset:[e+n,i/5],rectOffset:[-e/4,-i-o[1]]};case"left":return{angle:Qt,offset:[e+n,i/2],rectOffset:[0,-i-o[1]]};case"lb":return{angle:Qt,offset:[e+n,i/5*4],rectOffset:[e/4*3,-i-o[1]]}}}}zm.defaultAttributes={position:"rt",visible:!0,title:null,content:null,titleStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},contentStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},maxWidthPercent:.8,space:8,padding:10};var Im=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let Om=class{render(t,e,i,o,n,r,s,l,a,h,d,c,u){var g,p;if(1===t._showPoptip){const{visible:e,visibleCb:i}=t.attribute.poptip||{};if(!1===e||i&&!1===i(t))return;const o={};yt(o,zm.defaultAttributes,t.attribute.poptip?t.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(o):this.poptipComponent=new zm(o);let n=t.attribute.poptip||{};if("text"===t.type&&null==n.title&&null==n.content){const e={};yt(e,Lm.poptip,n),n=e,n.content=null!==(g=n.content)&&void 0!==g?g:t.attribute.text}const r=t.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1},n),{x:r.e,y:r.f})),h.stage.tryInitInteractiveLayer();const s=h.stage.getLayer("_builtin_interactive");s&&s.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&(this.poptipComponent.setAttributes({visibleAll:!1}),null===(p=this.poptipComponent.parent)||void 0===p||p.removeChild(this.poptipComponent),this.poptipComponent=null))}};Om=Im([f()],Om);var Dm=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};class Wm{constructor(){this.activeEvent="onRegister",this._uid=e.GenAutoIncrementId(),this.poptip=t=>{const e=t.target;this.needHide(e)?this.unpoptip(t):e!==this.activeGraphic&&(this.needShow(e)&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0))},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}needHide(t){return t.isContainer||!t.attribute}needShow(t){return!!t.attribute.poptip}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}}let Nm=class extends Wm{constructor(){super(...arguments),this.name="poptip",this.key=this.name+this._uid}};Nm=Dm([f()],Nm);let Gm=class extends Wm{constructor(){super(...arguments),this.name="poptipForText",this.key=this.name+this._uid,this.pointerlave=t=>{const{stage:e}=this.pluginService;t.target===e&&this.unpoptip(t)}}activate(t){super.activate(t);const{stage:e}=this.pluginService;e.addEventListener("pointerleave",this.pointerlave)}needHide(t){return"text"!==t.type||!t.cliped||t.isContainer||!t.attribute||t.attribute.disableAutoClipedPoptip}needShow(t){return!0}deactivate(t){const{stage:e}=this.pluginService;super.deactivate(t),e.removeEventListener("pointerleave",this.pointerlave)}};Gm=Dm([f()],Gm);const jm=new i(((t,e,i,o)=>{i(Om)||(t(Om).toSelf().inSingletonScope(),t(Ys).toService(Om)),i(Nm)||(t(Nm).toSelf(),t(kc).toService(Nm)),i(Gm)||(t(Gm).toSelf(),t(kc).toService(Gm))}));$v(),Zv(),tm(),am();class Um extends gg{getStartAngle(){return me(this._startAngle)}getEndAngle(){return me(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:yt({},Um.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:o,visible:n=!0,multiSegment:r,mainSegmentIndex:s}=this.attribute;if(!n)return;this._computeLineAngle();const l=this._getMainSegmentPoints(),a=this._renderSymbol(t,l,"start"),h=this._renderSymbol(e,l,"end");if(this.startSymbol=a,this.endSymbol=h,r){const t=[...this.attribute.points];if(rt(s))t[s]=this._clipPoints(t[s]);else{const e=this._clipPoints(Et(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach(((t,e)=>{var n,r;const s=Ra.line(Object.assign(Object.assign({points:t},et(i)?null!==(n=i[e])&&void 0!==n?n:i[i.length-1]:i),{fill:!1}));s.name=`${this.name}-line`,s.id=this._getNodeId("line"+e),ut(null==o?void 0:o.line)||(s.states=et(o.line)?null!==(r=o.line[e])&&void 0!==r?r:o.line[o.line.length-1]:o.line),this.add(s),this.lines.push(s)}))}else{let t=Ra.line;Rt(i)[0].cornerRadius&&(t=Ra.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},Rt(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),ut(null==o?void 0:o.line)||(e.states=[].concat(o.line)[0]),this.add(e),this.lines.push(e)}}_computeStartRotate(t){return t+Math.PI/2}_computeEndRotate(t){return t+Math.PI/2}_renderSymbol(t,e,i){if(!e.length)return;const{autoRotate:o=!0}=t;let n;if(t&&t.visible){const r=this.getStartAngle(),s=this.getEndAngle(),{state:l}=this.attribute,a=e[0],h=e[e.length-1],{refX:d=0,refY:c=0,refAngle:u=0,style:g,symbolType:p,size:f=12}=t;let v,m;"start"===i?(v={x:a.x+(rt(r)?d*Math.cos(r)+c*Math.cos(r-Math.PI/2):0),y:a.y+(rt(r)?d*Math.sin(r)+c*Math.sin(r-Math.PI/2):0)},m=this._computeStartRotate(this._startAngle)):(v={x:h.x+(rt(s)?d*Math.cos(s)+c*Math.cos(s-Math.PI/2):0),y:h.y+(rt(s)?d*Math.sin(s)+c*Math.sin(s-Math.PI/2):0)},m=this._computeEndRotate(this._endAngle)),n=Ra.symbol(Object.assign(Object.assign(Object.assign({},v),{symbolType:p,size:f,angle:o?m+u:0,strokeBoundsBuffer:0}),g)),n.name=`${this.name}-${i}-symbol`,n.id=this._getNodeId(`${i}-symbol`),ut(null==l?void 0:l.symbol)||(n.states=l.symbol),"start"===i?ut(null==l?void 0:l.startSymbol)||(n.states=l.startSymbol):ut(null==l?void 0:l.endSymbol)||(n.states=l.endSymbol),this.add(n)}return n}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let o;return o=e?rt(i)?t[i]:Et(t):t,this._mainSegmentPoints=o,o}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let o=t;if(e.visible){const i=e.clip?e.size||10:0;o=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...o.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,n={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};o=[...o.slice(0,o.length-1),n]}return o}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],o=t[t.length-2],n=t[t.length-1],r=[e.x-i.x,e.y-i.y],s=Math.atan2(r[1],r[0]),l=[n.x-o.x,n.y-o.y],a=Math.atan2(l[1],l[0]);this._startAngle=s,this._endAngle=a}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}var Vm,$m;Um.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},function(t){t.innerView="inner-view",t.axisContainer="axis-container",t.labelContainer="axis-label-container",t.tickContainer="axis-tick-container",t.tick="axis-tick",t.subTick="axis-sub-tick",t.label="axis-label",t.title="axis-title",t.gridContainer="axis-grid-container",t.grid="axis-grid",t.gridRegion="axis-grid-region",t.line="axis-line",t.background="axis-background",t.axisLabelBackground="axis-label-background",t.axisBreak="axis-break",t.axisBreakSymbol="axis-break-symbol"}(Vm||(Vm={})),function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}($m||($m={}));const Ym={[$m.selectedReverse]:{},[$m.selected]:{},[$m.hover]:{},[$m.hoverReverse]:{}},Xm={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}}},Km={size:8,stroke:"#000",lineWidth:1,zIndex:1};function Zm(t,e){return{x:t.x+e[0],y:t.y+e[1]}}function qm(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const r=[e.x-i.x,e.y-i.y];return wm(r,(o?-1:1)*(n?-1:1)*t/xm(r))}function Jm(t,e,i,o,n){const r=function(t,e,i){return e?{x:t.x+e*Math.cos(i),y:t.y+e*Math.sin(i)}:{x:t.x,y:t.y}}({x:0,y:0},i,t),s=Zm(r,qm(o,r,e,n));return l=s,a=qm(o||1,s,e,n),{x:l.x+a[0],y:l.y+a[1]};var l,a}function Qm(t,e,i){let o=t.OBBBounds,n=e.OBBBounds;return o&&n&&!o.empty()&&!n.empty()?o.intersects(n):(o=t.AABBBounds,n=e.AABBBounds,i>Math.max(n.x1-o.x2,o.x1-n.x2,n.y1-o.y2,o.y1-n.y2))}function tb(t,e){for(let i,o=1,n=t.length,r=t[0];o<n;r=i,++o)if(i=t[o],Qm(r,i,e))return!0;return!1}class eb extends gg{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{this._lastHover=((t,e,i)=>{const o=t.target;return o!==i&&o.name&&!ut(o.states)?(o.addState(fm.hover,!0),ym(e,(t=>{t!==o&&t.name&&!ut(t.states)&&t.addState(fm.hoverReverse,!0)})),o):i})(t,this.axisContainer,this._lastHover)},this._onUnHover=t=>{this._lastHover=((t,e,i)=>i?(ym(e,(t=>{t.name&&!ut(t.states)&&(t.removeState(fm.hoverReverse),t.removeState(fm.hover))})),null):i)(0,this.axisContainer,this._lastHover)},this._onClick=t=>{this._lastSelect=((t,e,i)=>{const o=t.target;return i===o&&o.hasState(fm.selected)?(ym(e,(t=>{t.name&&!ut(t.states)&&(t.removeState(fm.selectedReverse),t.removeState(fm.selected))})),null):o.name&&!ut(o.states)?(o.addState(fm.selected,!0),ym(e,(t=>{t!==o&&t.name&&!ut(t.states)&&t.addState(fm.selectedReverse,!0)})),o):i})(t,this.axisContainer,this._lastSelect)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){const e=vt(this.attribute);yt(this.attribute,t);const i=Ra.group({x:this.attribute.x,y:this.attribute.y});return this.add(i),this._renderInner(i),this.removeChild(i),this.attribute=e,i.AABBBounds}render(){this._prevInnerView=this._innerView&&function(t){const e={};return ym(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}(this._innerView),this.removeAllChild(!0),this._innerView=Ra.group({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){if(this.attribute.disableTriggerEvent)return;const{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(t){const{title:e,label:i,tick:o,line:n,items:r}=this.attribute,s=Ra.group({x:0,y:0,zIndex:1,pickable:!1});if(s.name=Vm.axisContainer,s.id=this._getNodeId("container"),s.setMode(this.mode),this.axisContainer=s,t.add(s),n&&n.visible&&this.renderLine(s),r&&r.length&&(this.data=this._transformItems(r[0]),o&&o.visible&&this.renderTicks(s),i&&i.visible)){const t=Ra.group({x:0,y:0,pickable:!1});t.name=Vm.labelContainer,t.id=this._getNodeId("label-container"),this.axisLabelsContainer=t,s.add(t),r.forEach(((e,i)=>{const o=this.renderLabels(t,e,i),n=o.getChildren();this.beforeLabelsOverlap(n,e,o,i,r.length),this.handleLabelsOverlap(n,e,o,i,r.length),this.afterLabelsOverlap(n,e,o,i,r.length);let s=0,l=0,a="center",h="middle",d=0;n.forEach(((t,e)=>{var i;const o=t.attribute,n=null!==(i=o.angle)&&void 0!==i?i:0,r=t.AABBBounds;let c=r.width(),u=r.height();n&&(c=Math.abs(c*Math.cos(n)),u=Math.abs(u*Math.sin(n))),s=Math.max(s,c),l=Math.max(l,u),a=o.textAlign,h=o.textBaseline,0===e&&(d=o.x)})),this.axisLabelLayerSize[i]={width:s,height:l,labelPos:d,textAlign:a,textBaseline:h}}))}e&&e.visible&&this.renderTitle(s)}renderTicks(t){const e=this.getTickLineItems(),i=Ra.group({x:0,y:0,pickable:!1});i.name=Vm.tickContainer,i.id=this._getNodeId("tick-container"),t.add(i),e.forEach(((t,o)=>{var n;const r=Ra.line(Object.assign({},this._getTickLineAttribute("tick",t,o,e)));if(r.name=Vm.tick,r.id=this._getNodeId(t.id),ut(null===(n=this.attribute.tick)||void 0===n?void 0:n.state))r.states=vm;else{const t=this.data[o],e=yt({},vm,this.attribute.tick.state);Object.keys(e).forEach((i=>{Y(e[i])&&(e[i]=e[i](t.rawValue,o,t,this.data))})),r.states=e}i.add(r)})),this.tickLineItems=e;const{subTick:o}=this.attribute;if(o&&o.visible){const t=this.getSubTickLineItems();t.length&&t.forEach(((t,n)=>{const r=Ra.line(Object.assign({},this._getTickLineAttribute("subTick",t,n,e)));if(r.name=Vm.subTick,r.id=this._getNodeId(`${n}`),ut(o.state))r.states=vm;else{const i=yt({},vm,o.state);Object.keys(i).forEach((o=>{Y(i[o])&&(i[o]=i[o](t.value,n,t,e))})),r.states=i}i.add(r)})),this.subTickLineItems=t}}renderLabels(t,e,i){const{dataFilter:o}=this.attribute.label;o&&Y(o)&&(e=o(e,i));const n=this._transformItems(e),r=Ra.group({x:0,y:0,pickable:!1});return r.name=`${Vm.labelContainer}-layer-${i}`,r.id=this._getNodeId(`label-container-layer-${i}`),t.add(r),n.forEach(((t,e)=>{var o;const s=Mm(this._getLabelAttribute(t,e,n,i));if(s.name=Vm.label,s.id=this._getNodeId(`layer${i}-label-${t.id}`),ut(null===(o=this.attribute.label)||void 0===o?void 0:o.state))s.states=vm;else{const o=yt({},vm,this.attribute.label.state);Object.keys(o).forEach((r=>{Y(o[r])&&(o[r]=o[r](t,e,n,i))})),s.states=o}r.add(s)})),r}renderTitle(t){const e=this.getTitleAttribute(),i=new Em(Object.assign({},e));i.name=Vm.title,i.id=this._getNodeId("title"),t.add(i)}getVerticalCoord(t,e,i){return Zm(t,this.getVerticalVector(e,i,t))}getTickLineItems(){const{tick:t}=this.attribute,e=this.data,i=[],{alignWithLabel:o,inside:n=!1,length:r,dataFilter:s}=t;let l=1;return e.length>=2&&(l=e[1].value-e[0].value),(s&&Y(s)?s(e):e).forEach((t=>{let e=t.point,s=t.value;if(!o){const i=t.value-l/2;if(this.isInValidValue(i))return;e=this.getTickCoord(i),s=i}const a=this.getVerticalCoord(e,r,n);if("3d"===this.mode){const o=this.getVerticalVector(r,n,e);let l=0,h=0;oe(o[0])>oe(o[1])?l=Qt/2*(a.x>e.x?1:-1):h=Qt/2*(a.y>e.y?-1:1),i.push({start:e,end:a,value:s,id:`tick-${t.id}`,anchor:[e.x,e.y],alpha:l,beta:h})}else i.push({start:e,end:a,value:s,id:`tick-${t.id}`})})),i}getSubTickLineItems(){const{subTick:t}=this.attribute,e=[],{count:i=4,inside:o=!1,length:n=2}=t,r=this.tickLineItems,s=r.length;if(s>=2)for(let t=0;t<s-1;t++){const s=r[t],l=r[t+1];for(let t=0;t<i;t++){const r=(t+1)/(i+1),a=(1-r)*s.value+r*l.value,h=this.getTickCoord(a),d=this.getVerticalCoord(h,n,o);e.push({start:h,end:d,value:a,id:`sub-tick-${a}`})}}return e}_getTickLineAttribute(t,e,i,o){let n=gt(this.attribute,`${t}.style`);const r=this.data[i];n=Y(n)?yt({},gt(Xm,`${t}.style`),"tick"===t?n(r.rawValue,i,r,this.data):n(e.value,i,e,o)):n;const{start:s,end:l,anchor:a,alpha:h,beta:d}=e;return Object.assign({points:[s,l],anchor:a,alpha:h,beta:d},n)}_getLabelAttribute(t,e,i,o){var n,r;const{space:s=4,inside:l=!1,formatMethod:a,type:h="text",text:d}=this.attribute.label;let c=s,u=0;(null===(n=this.attribute.tick)||void 0===n?void 0:n.visible)&&this.attribute.tick.inside===l&&(u=this.attribute.tick.length||4),(null===(r=this.attribute.subTick)||void 0===r?void 0:r.visible)&&this.attribute.subTick.inside===l&&(u=Math.max(u,this.attribute.subTick.length||2)),c+=u;const g=this.getRelativeVector(t.point);o>0&&(0===g[1]?c+=(this.axisLabelLayerSize[o-1].height+gt(this.attribute,"label.space",4))*o:c+=(this.axisLabelLayerSize[o-1].width+gt(this.attribute,"label.space",4))*o);const p=this.getVerticalCoord(t.point,c,l),f=this.getVerticalVector(c||1,l,p),v=a?a(`${t.label}`,t,e,i,o):t.label;let{style:m}=this.attribute.label;m=Y(m)?yt({},Xm.label.style,m(t,e,i,o)):m;return m=yt(this.getLabelAlign(f,l,m.angle),m),Y(m.text)&&(m.text=m.text({label:t.label,value:t.rawValue,index:t.index,layer:o})),Object.assign(Object.assign(Object.assign({},this.getLabelPosition(p,f,v,m)),{text:null!=d?d:v,_originText:t.label,lineHeight:null==m?void 0:m.fontSize,type:h}),m)}getLabelPosition(t,e,i,o){return t}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}release(){super.release(),this._prevInnerView=null,this._innerView=null}}const ib={parity:function(t){return t.filter(((t,e)=>e%2?t.setAttribute("opacity",0):1))},greedy:function(t,e){let i;return t.filter(((t,o)=>o&&Qm(i,t,e)?t.setAttribute("opacity",0):(i=t,1)))}};function ob(t){let e;return e=t.OBBBounds.empty()?t.AABBBounds:t.OBBBounds,e.width()>1&&e.height()>1}function nb(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(i&&!t.attribute.opacity){const i=e.length;if(i>1){t.setAttribute("opacity",1);for(let t=0;t<i;t++){const r=n?e[i-1-t]:e[t];if(!o(r))break;r.setAttribute("opacity",0)}}}}const rb=Math.sin(Math.PI/10);function sb(t){const e=!X(t)&&0!==t,i=e?Math.cos(t):1;return e&&Math.abs(i)<=rb}function lb(t){const e=!X(t)&&0!==t,i=e?Math.sin(t):0;return!e||Math.abs(i)<=rb}function ab(t){for(let r=1;r<t.length;r++)if(e=t[r-1],i=t[r],o=void 0,n=void 0,(null===(o=e.OBBBounds)||void 0===o?void 0:o.empty())||(null===(n=i.OBBBounds)||void 0===n?void 0:n.empty())?xe(e.AABBBounds,i.AABBBounds,!1)&&(!e.rotatedBounds||!i.rotatedBounds||Be(e.rotatedBounds,i.rotatedBounds,!0)):e.OBBBounds.intersects(i.OBBBounds))return!0;var e,i,o,n;return!1}function hb(t,e){"bottom"!==t&&"top"!==t||function(t,e){e.forEach((e=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},cb(t,e.attribute.angle)),{angle:db(e.attribute.angle)}))}))}(t,e),"left"!==t&&"right"!==t||function(t,e){e.forEach(((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},ub(t,e.attribute.angle)),{angle:db(e.attribute.angle)}))}))}(t,e),function(t){t.forEach((t=>{if(t.rotatedBounds||!t.attribute.angle)return;const e=function(t){const e=t.AABBBounds;return{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,centerX:t.attribute.x,centerY:t.attribute.y,angle:t.attribute.angle}}(t),i=Se({x:t.attribute.x,y:t.attribute.y},e.angle,{x:e.centerX,y:e.centerY}),o=i.x-e.centerX,n=i.y-e.centerY;e.x1+=o,e.x2+=o,e.y1+=n,e.y2+=n,e.centerX+=o,e.centerY+=n,t.rotatedBounds=e}))}(e)}function db(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(t<0)for(;t<0;)t+=2*Math.PI;if(t>0)for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function cb(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=["center","left","left","left","center","right","right","right","left"],o=["top","top","middle","bottom","bottom","bottom","middle","top","top"];"top"===t&&(i=["center","right","right","right","center","left","left","left","right"],o=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]);const n=(e=db(e))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:i[r],textBaseline:o[r]}}function ub(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=["right","right","center","left","left","left","center","right","right"],o=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];"right"===t&&(i=["left","left","center","right","right","right","center","left","left"],o=["middle","middle","bottom","bottom","middle","middle","top","middle","middle"]);const n=(e=db(e))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:i[r],textBaseline:o[r]}}function gb(t,e){const{limitLength:i,verticalLimitLength:o,ellipsis:n="...",orient:r,axisLength:s}=e;if(ut(t)||!rt(i))return;const l=function(t){return rt(t)?{left:t,right:t}:Z(t)?{left:t.left||0,right:t.right||0}:{left:0,right:0}}(e.overflowLimitLength),a=t[0],h=a.attribute.angle,d=!X(h),c=d?Math.cos(h):1,u=d?Math.sin(h):0,g=lb(h),p=sb(h),f="top"===r||"bottom"===r,v=a.attribute.direction,m=!g&&!p&&f&&(t.length<2||t.some((t=>Math.abs(t.AABBBounds.width()-a.AABBBounds.width())>=2)))&&a.AABBBounds.width()>Math.abs(i/u);t.forEach((t=>{var e;if(f){if(p&&Math.floor(t.AABBBounds.height())<=i)return;if(g&&Math.floor(t.AABBBounds.width())<=o)return}if(!f){if("vertical"===v&&Math.floor(t.AABBBounds.height())<=o)return;if("vertical"!==v){if(g&&Math.floor(t.AABBBounds.width())<=i)return;if(p&&Math.floor(t.AABBBounds.height())<=o)return}}let r=null;if(g||p)r=f?g?o:i:"vertical"===v||p?o:i;else if(f){const{x1:e,x2:o}=t.AABBBounds,n=u/c,a=Math.abs(i/u);if(m&&n>0&&e<=s+l.right&&i/n+e>s+l.right){const t=(s-e+l.right)/Math.abs(c);r=Math.min(t,a)}else if(m&&n<0&&o>=-l.left&&i/n+o<-l.left){const t=(o+l.left)/Math.abs(c);r=Math.min(t,a)}else r=a}else r=Math.abs(i/c);rt(t.attribute.maxLineWidth)&&(r=rt(r)?Math.min(t.attribute.maxLineWidth,r):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:r,ellipsis:null!==(e=t.attribute.ellipsis)&&void 0!==e?e:n})}))}function pb(t,e,i){let o;return rt(e)&&(o=Math.abs(e-t)),rt(i)&&(o=rt(o)?Math.min(Math.abs(t-i),o):Math.abs(t-i)),o}var fb=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};$v(),Zv(),nm(),dm(),im();class vb extends eb{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:yt({},vb.defaultAttributes,t),e)}_renderInner(t){var e;if(this._breaks=null,this.attribute.breaks&&this.attribute.breaks.length){const t=[];for(let e=0;e<this.attribute.breaks.length;e++){const i=this.attribute.breaks[e],{range:o,breakSymbol:n,rawRange:r}=i;t.push({startPoint:this.getTickCoord(o[0]),endPoint:this.getTickCoord(o[1]),range:o,breakSymbol:n,rawRange:r})}this._breaks=t}super._renderInner(t),this._breaks&&this._breaks.length&&this._breaks.forEach(((e,i)=>{const{startPoint:o,endPoint:n,breakSymbol:r,rawRange:s}=e;if(!1!==(null==r?void 0:r.visible)){const e=Ra.group({zIndex:999});e.name=Vm.axisBreak,e.id=this._getNodeId(`${Vm.axisBreak}-${i}`),e.data=s;const l=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e,i;const{style:o={},angle:n=.5*Math.PI}=t,r=yt({},Km,o),s=null!==(e=r.size)&&void 0!==e?e:Km.size;return Object.assign(Object.assign({},r),{symbolType:null!==(i=r.symbolType)&&void 0!==i?i:`M ${-s/2} ${s*Math.sin(n)} L ${s/2} ${-s*Math.sin(n)}`,symbolSize:s})}(r),a=Ra.symbol(Object.assign({x:o.x,y:o.y},l));a.name=Vm.axisBreakSymbol;const h=Ra.symbol(Object.assign({x:n.x,y:n.y},l));h.name=Vm.axisBreakSymbol,e.add(a),e.add(h),t.add(e)}}));const{panel:i}=this.attribute;if(i&&i.visible){const t=this.axisContainer,o=t.AABBBounds,n=Ra.rect(Object.assign({x:o.x1,y:o.y1,width:o.width(),height:o.height()},i.style));n.name=Vm.background,n.id=this._getNodeId("background"),n.states=yt({},Ym,null!==(e=i.state)&&void 0!==e?e:{}),t.insertBefore(n,t.firstChild)}}renderLine(t){const{start:e,end:i,line:o}=this.attribute,n=o,{startSymbol:r,endSymbol:s,style:l,state:a}=n,h=fb(n,["startSymbol","endSymbol","style","state"]),d=Object.assign({startSymbol:r,endSymbol:s,lineStyle:l},h);if(this._breaks&&this._breaks.length){const t=[];let o=e;this._breaks.forEach((e=>{const{startPoint:i,endPoint:n}=e;t.push([o,i]),o=n})),t.push([o,i]),d.points=t,d.multiSegment=!0}else d.points=[e,i];ut(a)||(d.state={line:yt({},Ym,a),symbol:yt({},Ym,a)});const c=new Um(d);c.name=Vm.line,c.id=this._getNodeId("line"),t.add(c)}getTextAlign(t){let e="center";return Wt(t[0],0)?Wt(t[1],0)?Object.is(t[1],-0)?e="start":Object.is(t[0],-0)&&(e="end"):e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e}getTitleAttribute(){var t,e,i;const o=this.attribute.title,{position:n="middle",space:r=4,textStyle:s={},autoRotate:l=!0,shape:a,background:h,state:d={},maxWidth:c}=o,u=fb(o,["position","space","textStyle","autoRotate","shape","background","state","maxWidth"]);let g=.5;"start"===n?g=0:"end"===n&&(g=1);const{verticalFactor:p=1}=this.attribute,f=-1*p,v=this.getTickCoord(g),m=this.getRelativeVector();let b=0;if((null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===this.attribute.label.inside){const t=+gt(this.attribute,"label.space",4);b+=t;const e=Object.keys(this.axisLabelLayerSize).length;if(0===m[1]){const i=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.height():0;isFinite(i)?b+=i+(e-1)*t:b=0}else if(0===m[0])if(this.axisLabelsContainer&&this.axisLabelsContainer.AABBBounds&&!this.axisLabelsContainer.AABBBounds.empty()){const i=this.axisLabelLayerSize[0].labelPos,o=this.axisLabelsContainer.AABBBounds;b+=(1===f?o.x2>i?Math.min(o.x2-i,o.width()):0:o.x1<i?Math.min(i-o.x1,o.width()):0)+(e-1)*t}else b=0;else Object.keys(this.axisLabelLayerSize).forEach(((e,i)=>{b+=this.axisLabelLayerSize[e].width+(i>0?t:0)}))}let C=0;(null===(e=this.attribute.tick)||void 0===e?void 0:e.visible)&&!1===this.attribute.tick.inside&&(C=this.attribute.tick.length||4),(null===(i=this.attribute.subTick)||void 0===i?void 0:i.visible)&&!1===this.attribute.subTick.inside&&(C=Math.max(C,this.attribute.subTick.length||2));const y=C+b+r,w=this.getVerticalCoord(v,y,!1),x=this.getVerticalVector(y,!1,{x:0,y:0});let _,S,{angle:A}=u;if(_="start"===n?"start":"end"===n?"end":"center",X(A)&&l){A=_m(m,[1,0],!0);const{verticalFactor:t=1}=this.attribute;S=1==-1*t?"bottom":"top"}else _=this.getTextAlign(x),S=this.getTextBaseline(x,!1);let R=c;if(X(R)){const{verticalLimitSize:t,verticalMinSize:e,orient:i}=this.attribute,o=Math.min(t||1/0,e||1/0);if(rt(o))if("bottom"===i||"top"===i)if(A!==Math.PI/2){const t=Math.abs(Math.cos(null!=A?A:0));R=t<1e-6?1/0:this.attribute.end.x/t}else R=o-y;else if(A&&0!==A){const t=Math.abs(Math.sin(A));R=t<1e-6?1/0:this.attribute.end.y/t}else R=o-y}const B=Object.assign(Object.assign(Object.assign({},w),u),{maxWidth:R,textStyle:Object.assign({textAlign:_,textBaseline:S},s),state:{text:yt({},Ym,d.text),shape:yt({},Ym,d.shape),panel:yt({},Ym,d.background)}});return B.angle=A,a&&a.visible&&(B.shape=Object.assign({visible:!0},a.style),a.space&&(B.space=a.space)),h&&h.visible&&(B.panel=Object.assign({visible:!0},h.style)),B}getTextBaseline(t,e){let i="middle";const{verticalFactor:o=1}=this.attribute,n=(e?1:-1)*o;return Wt(t[1],0)?i=!Wt(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":1===n?"bottom":"top":t[1]>0?i="top":t[1]<0&&(i="bottom"),i}getLabelAlign(t,e,i){const o=this.attribute.orient;if(["top","bottom","right","left"].includes(o)||0===t[0]&&0===t[1]){if("top"===o||"bottom"===o)return cb(e?"bottom"===o?"top":"bottom":o,i);if("left"===o||"right"===o)return ub(e?"left"===o?"right":"left":o,i)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,e)}}beforeLabelsOverlap(t,e,i,o,n){var r,s,l,a;const{flush:h=!1}=this.attribute.label||{};if(h&&t.length){const{orient:e,start:i,end:o}=this.attribute,n="bottom"===e||"top"===e,h=t[0],d=Bt(t),c=n?h.attribute.x>d.attribute.x:h.attribute.y<d.attribute.y;if(n){const t=c?d:h,e=c?h:d,n=i.x,l=o.x,a=t.AABBBounds.x1,u=e.AABBBounds.x2;a<n&&(t.attribute.angle?t.setAttributes({dx:(null!==(r=t.attribute.dx)&&void 0!==r?r:0)+n-a}):t.setAttributes({x:n,textAlign:"left"})),u>l&&(e.attribute.angle?e.setAttributes({dx:(null!==(s=e.attribute.dx)&&void 0!==s?s:0)+l-u}):e.setAttributes({x:l,textAlign:"right"}))}else{const t=c?d:h,e=c?h:d,n=t.AABBBounds.y2,r=e.AABBBounds.y1,s=i.y,u=o.y;r<s&&(e.attribute.angle?e.setAttributes({dy:(null!==(l=e.attribute.dy)&&void 0!==l?l:0)+s-r}):e.setAttributes({y:s,textBaseline:"top"})),n>u&&(t.attribute.angle?t.setAttributes({dy:(null!==(a=t.attribute.dy)&&void 0!==a?a:0)+u-n}):t.setAttributes({y:u,textBaseline:"bottom"}))}}}handleLabelsOverlap(t,e,i,o,n){if(ut(t))return;const{verticalLimitSize:r,label:s,orient:l}=this.attribute,a=this._getAxisLabelLimitLength(r,n),{layoutFunc:h,autoRotate:d,autoRotateAngle:c,autoLimit:u,limitEllipsis:g,autoHide:p,autoHideMethod:f,autoHideSeparation:v,lastVisible:m,firstVisible:b,autoWrap:C,overflowLimitLength:y}=s;if(Y(h))h(t,e,o,this);else{if(d)!function(t,e){if(ut(t))return;const{orient:i,labelRotateAngle:o=[0,45,90]}=e;if(0===o.length||t.some((t=>!!t.attribute.angle)))return;let n=0,r=0;for(o&&o.length>0&&(r=o.length);n<r;){const e=o[n++];if(t.forEach((t=>{t.attribute.angle=fe(e)})),hb(i,t),!ab(t))break}}(t,{labelRotateAngle:c,orient:l});else if(C){!function(t,e){const{limitLength:i,axisLength:o,ellipsis:n="...",orient:r}=e;if(ut(t)||!rt(i))return;const s=t[0].attribute.angle,l=lb(s),a=sb(s),h="top"===r||"bottom"===r;let d=o/t.length;t.forEach(((e,o)=>{var r,s,c,u,g;if(h){if(a&&Math.floor(e.AABBBounds.height())<=i)return;if(l){const i=pb(e.attribute.x,null===(r=t[o+1])||void 0===r?void 0:r.attribute.x,null===(s=t[o-1])||void 0===s?void 0:s.attribute.x);rt(i)&&(d=le(d,i))}}else{if(a){const i=pb(e.attribute.y,null===(c=t[o+1])||void 0===c?void 0:c.attribute.y,null===(u=t[o-1])||void 0===u?void 0:u.attribute.y);rt(i)&&(d=le(d,i))}if(l&&Math.floor(e.AABBBounds.width())<=i)return}let p=null,f=null;h?a?(p=i,f=d):(p=d,f=i):a?(p=d,f=i):(p=i,f=d),e.setAttributes({maxLineWidth:p,ellipsis:null!==(g=e.attribute.ellipsis)&&void 0!==g?g:n,whiteSpace:"normal",heightLimit:f})}))}(t,{orient:l,limitLength:a,axisLength:"left"===l||"right"===l?Math.abs(this.attribute.start.y-this.attribute.end.y):Math.abs(this.attribute.start.x-this.attribute.end.x),ellipsis:g})}if(!C&&u&&rt(a)&&a>0){const e="left"===l||"right"===l,i=e?Math.abs(this.attribute.start.y-this.attribute.end.y):Math.abs(this.attribute.start.x-this.attribute.end.x);gb(t,{limitLength:a,verticalLimitLength:e?i/t.length:p||d?1/0:i/t.length,ellipsis:g,orient:l,axisLength:i,overflowLimitLength:y})}p&&function(t,e){if(ut(t))return;const i=t.filter(ob);if(ut(i))return;let o;o=function(t){return t.forEach((t=>t.setAttribute("opacity",1))),t}(i);const{method:n="parity",separation:r=0}=e,s=Y(n)?n:ib[n]||ib.parity;if(o.length>=3&&tb(o,r)){do{o=s(o,r)}while(o.length>=3&&tb(o,r));const t=function(t,e){return(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&t<3||e},n=t(o.length,e.firstVisible,!1);let l=t(o.length,e.lastVisible);const a=i[0],h=Bt(i);Qm(a,h,r)&&n&&l&&(h.setAttribute("opacity",0),l=!1),nb(a,o,n,(t=>Qm(t,a,r))),nb(h,o,l,(t=>Qm(t,h,r)||!(!n||t===a)&&Qm(t,a,r)),!0)}i.forEach((t=>{t.setAttribute("visible",!!t.attribute.opacity)}))}(t,{orient:l,method:f,separation:v,lastVisible:m,firstVisible:b})}}afterLabelsOverlap(t,e,i,o,n){const{verticalLimitSize:r,orient:s}=this.attribute,l="bottom"===s||"top"===s,a=i.AABBBounds;let h=l?a.height():a.width();const{verticalMinSize:d}=this.attribute;if(rt(d)&&(!rt(r)||d<=r)){const t=this._getAxisLabelLimitLength(d,n);let e,o;h=Math.max(h,t),"left"===s?(e=a.x2-h,o=a.y1):"right"===s?(e=a.x1,o=a.y1):"top"===s?(e=a.x1,o=a.y2-h):"bottom"===s&&(e=a.x1,o=a.y1);const r=Ra.rect({x:e,y:o,width:l?a.width():h,height:l?h:a.height(),pickable:!1});r.name=Vm.axisLabelBackground,r.id=this._getNodeId("axis-label-background"),i.insertBefore(r,i.firstChild)}if(K(this.attribute.label.containerAlign)){let e;"left"===s?e=a.x2-h:"right"===s?e=a.x1:"top"===s?e=a.y2-h:"bottom"===s&&(e=a.y1),function(t,e,i,o,n){"left"===o||"right"===o?"left"===n?t.forEach((t=>{var i;t.setAttributes({dx:(null!==(i=t.attribute.dx)&&void 0!==i?i:0)+e-t.AABBBounds.x1})})):"right"===n?t.forEach((t=>{var o;t.setAttributes({dx:(null!==(o=t.attribute.dx)&&void 0!==o?o:0)+e+i-t.AABBBounds.x2})})):"center"===n&&t.forEach((t=>{var o;t.setAttributes({dx:(null!==(o=t.attribute.dx)&&void 0!==o?o:0)+e+i/2-(t.AABBBounds.x1+t.AABBBounds.x2)/2})})):"bottom"!==o&&"top"!==o||("top"===n?t.forEach((t=>{var i;t.setAttributes({dy:(null!==(i=t.attribute.dy)&&void 0!==i?i:0)+e-t.AABBBounds.y1})})):"bottom"===n?t.forEach((t=>{var o;t.setAttributes({dy:(null!==(o=t.attribute.dy)&&void 0!==o?o:0)+e+i-t.AABBBounds.y2})})):"middle"===n&&t.forEach((t=>{var o;t.setAttributes({dy:(null!==(o=t.attribute.dy)&&void 0!==o?o:0)+e+i/2-(t.AABBBounds.y1+t.AABBBounds.y2)/2})})))}(t,e,h,s,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,e){var i,o,n,r,s;const{label:l,title:a,line:h,tick:d}=this.attribute,c=null!==(i=l.space)&&void 0!==i?i:4;let u=t,g=0,p=0;const f=h&&h.visible?null!==(o=h.style.lineWidth)&&void 0!==o?o:1:0,v=d&&d.visible?null!==(n=d.length)&&void 0!==n?n:4:0;if(a&&a.visible&&"string"==typeof a.text){g=Am(a.text,a.textStyle,null===(s=null===(r=this.stage)||void 0===r?void 0:r.getTheme())||void 0===s?void 0:s.text).height;const t=Ze(a.padding);p=a.space+t[0]+t[2]}return u&&(u=(u-c-p-g-f-v)/e),u}release(){super.release(),this._breaks=null}}vb.defaultAttributes=Xm,At(vb,class{isInValidValue(t){return t<0||t>1}getTickCoord(t){const{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(t){const{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{verticalFactor:i=1}=this.attribute,o=function(t){let e=xm(t);return e>0&&(e=1/e),[t[0]*e,t[1]*e]}(this.getRelativeVector());return wm([o[1],-1*o[0]],t*(e?1:-1)*i)}});const mb=t=>t.map(((t,e)=>({index:e,value:t}))),bb=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const o=new Le(t).expand(i/2),n=new Le(e).expand(i/2);return o.intersects(n)},Cb=(t,e,i,o)=>i<t?Math.max(t-e/2,i):i>t?Math.min(t-e/2,i-e):i<o?i:i-e,yb=(t,e,i)=>{var o;const{labelStyle:n,axisOrientType:r,labelFlush:s,labelFormatter:l,startAngle:a=0}=i;let h=null!==(o=n.angle)&&void 0!==o?o:0;"vertical"===n.direction&&(h+=fe(90));const d=["bottom","top"].includes(r),c=["left","right"].includes(r);let u=1,g=0;d||(c?(u=0,g=1):a&&(u=Math.cos(a),g=-Math.sin(a)));const p=Sm(n),f=t.range(),v=e.map(((i,o)=>{var r,a;const v=l?l(i):`${i}`,{width:m,height:b}=p.quickMeasure(v),C=Math.max(m,12),y=Math.max(b,12),w=t.scale(i),x=u*w,_=g*w;let S,A,R=x,B=_;s&&d&&0===o?R=Cb(x,C,f[0],f[f.length-1]):s&&d&&o===e.length-1?R=Cb(x,C,f[f.length-1],f[0]):S=null!==(r=n.textAlign)&&void 0!==r?r:"center","right"===S?R-=C:"center"===S&&(R-=C/2),s&&c&&0===o?B=Cb(_,y,f[0],f[f.length-1]):s&&c&&o===e.length-1?B=Cb(_,y,f[f.length-1],f[0]):A=null!==(a=n.textBaseline)&&void 0!==a?a:"middle","bottom"===A?B-=y:"middle"===A&&(B-=y/2);const M=(new Le).set(R,B,R+C,B+y);return h&&M.rotate(h,x,_),M}));return v};var wb;function xb(t){switch(t){case wb.Linear:case wb.Log:case wb.Pow:case wb.Sqrt:case wb.Symlog:case wb.Time:return!0;default:return!1}}function _b(t){return t}!function(t){t.Identity="identity",t.Linear="linear",t.Log="log",t.Pow="pow",t.Sqrt="sqrt",t.Symlog="symlog",t.Time="time",t.Quantile="quantile",t.Quantize="quantize",t.Threshold="threshold",t.Ordinal="ordinal",t.Point="point",t.Band="band"}(wb||(wb={})),Object.values(wb).forEach((t=>{}));const Sb=t=>-Math.log(-t),Ab=t=>-Math.exp(-t),Rb=t=>isFinite(t)?Math.pow(10,t):t<0?0:t,Bb=t=>10===t?Rb:t===Math.E?Math.exp:e=>Math.pow(t,e),Mb=t=>t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:(t=Math.log(t),e=>Math.log(e)/t),Tb=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),Pb=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t;function Eb(t,e){if(t=Number(t),e=Number(e),e-=t)return i=>(i-t)/e;const i=Number.isNaN(e)?NaN:.5;return()=>i}function kb(t,e,i){const o=t[0],n=t[1],r=e[0],s=e[1];let l,a;return n<o?(l=Eb(n,o),a=i(s,r)):(l=Eb(o,n),a=i(r,s)),t=>a(l(t))}function Lb(t,e,i){let o;return o=1===t?t+2*i:t-e+2*i,t?o>0?o:1:0}function Hb(t,e){const i=(t[1]-t[0])/(e[1]-e[0]),o=t[0]-i*e[0];return[o,i+o]}function Fb(t,e,i){const o=Math.min(t.length,e.length)-1,n=new Array(o),r=new Array(o);let s=-1;for(t[o]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++s<o;)n[s]=Eb(t[s],t[s+1]),r[s]=i(e[s],e[s+1]);return function(e){const i=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0;for(X(o)&&(o=t.length);i<o;){const n=i+o>>>1;kt(t[n],e)>0?o=n:i=n+1}return i}(t,e,1,o)-1;return r[i](n[i](e))}}const zb=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=Math.floor(Math.log10(t)),o=t/Math.pow(10,i);let n;return n=e?o<1.5?1:o<3?2:o<7?5:10:o<=1?1:o<=2?2:o<=5?5:10,n*Math.pow(10,i)};class Ib{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:K(this._rangeFactorStart)&&K(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=Hb(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):K(this._rangeFactorStart)&&K(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return X(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!X(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return X(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!X(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:i=.1,radius:o}=this._fishEyeOptions,n=this.range(),r=n[0],s=n[n.length-1],l=Math.min(r,s),a=Math.max(r,s),h=Ut(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,l,a),d=X(o)?(a-l)*i:o;let c=Math.exp(e);c=c/(c-1)*d;const u=e/d;this._fishEyeTransform=t=>{const e=Math.abs(t-h);if(e>=d)return t;if(e<=1e-6)return h;const i=c*(1-Math.exp(-e*u))/e*.75+.25;return h+(t-h)*i}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}get(t,e){var i;return null!==(i=null==this?void 0:this[t])&&void 0!==i?i:e}}const Ob=Symbol("implicit");class Db extends Ib{specified(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}constructor(){super(),this.type=wb.Ordinal,this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=Ob}clone(){const t=(new Db).domain(this._domain).range(this._ordinalRange).unknown(this._unknown);return this._specified&&t.specified(this._specified),t}calculateVisibleDomain(t){return K(this._rangeFactorStart)&&K(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:this._domain}scale(t){const e=`${t}`,i=this._getSpecifiedValue(e);if(void 0!==i)return i;let o=this._index.get(e);if(!o){if(this._unknown!==Ob)return this._unknown;o=this._domain.push(t),this._index.set(e,o)}const n=this._ordinalRange[(o-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(n):n}invert(t){let e=0;for(;e<this._ordinalRange.length&&this._ordinalRange[e]!==t;)e++;return this._domain[(e-1)%this._domain.length]}domain(t){if(!t)return this._domain.slice();this._domain=[],this._index=new Map;for(const e of t){const t=`${e}`;this._index.has(t)||this._index.set(t,this._domain.push(e))}return this}range(t){if(!t)return this._ordinalRange.slice();const e=Array.from(t);return this._ordinalRange=e,this}index(t){var e;return this._index&&null!==(e=this._index.get(`${t}`))&&void 0!==e?e:-1}}function Wb(t,e,i,o){const n=[];let r=t;for(;r<=e;)n.push(r),r+=i;return o&&n.reverse(),n}function Nb(t,e,i,o){let n,r;if(e=Math.floor(+e),t=Math.floor(+t),!(i=Math.floor(+i)))return[];if(t===e)return[t];if(n=e<t){const i=t;t=e,e=i}let s=$t(1,e-t+1)(i);if(r=Math.floor((e-t+1)/s),!o)for(;Math.ceil((e-t+1)/r)>i&&s>1;)s-=1,r=Math.floor((e-t)/s);return Wb(t,e,r,n)}class Gb extends Db{constructor(t){super(),this.type=wb.Band,this._range=[0,1],this._step=void 0,this._bandwidth=void 0,this._isFixed=!1,this._round=!1,this._paddingInner=0,this._paddingOuter=0,this._align=.5,this._unknown=void 0,delete this.unknown,this.rescale(t)}rescale(t,e){if(t)return this;this._wholeRange=null;const i=this._calculateWholeRange(this._range,e),o=super.domain().length,n=i[1]<i[0];let r=i[Number(n)-0];const s=i[1-Number(n)],l=Lb(o,this._paddingInner,this._paddingOuter);return this._step=(s-r)/Math.max(1,l||1),this._round&&(this._step=Math.floor(this._step)),r+=(s-r-this._step*(o-this._paddingInner))*this._align,this.isBandwidthFixed()||(this._bandwidth=this._step*(1-this._paddingInner)),this._round&&(r=Math.round(r),this.isBandwidthFixed()||(this._bandwidth=Math.round(this._bandwidth))),this._bandRangeState={reverse:n,start:n?r+this._step*(o-1):r,count:o},this.generateFishEyeTransform(),this}scale(t){if(!this._bandRangeState)return;const e=`${t}`,i=this._getSpecifiedValue(e);if(void 0!==i)return i;let o=this._index.get(e);if(!o){if(this._unknown!==Ob)return this._unknown;o=this._domain.push(t),this._index.set(e,o)}const{count:n,start:r,reverse:s}=this._bandRangeState,l=r+(o-1)%n*(s?-1:1)*this._step;return this._fishEyeTransform?this._fishEyeTransform(l):l}_calculateWholeRange(t,e){if(this._wholeRange)return this._wholeRange;if((this._minBandwidth||this._maxBandwidth)&&!this._isBandwidthFixedByUser()){let e;if(K(this._rangeFactorStart)&&K(this._rangeFactorEnd)&&2===t.length){const i=Hb(t,[this._rangeFactorStart,this._rangeFactorEnd]);e=Math.abs(i[1]-i[0])}else e=Math.abs(t[1]-t[0]);const i=function(t,e,i,o,n){const r=Lb(t,i,o);let s=e/Math.max(1,r||1);n&&(s=Math.floor(s));let l=s*(1-i);return n&&(l=Math.round(l)),l}(super.domain().length,e,this._paddingInner,this._paddingOuter,this._round);i<this._minBandwidth?(this._bandwidth=this._minBandwidth,this._isFixed=!0):i>this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=i,this._isFixed=!1)}if(this.isBandwidthFixed()){const s=(i=super.domain().length,o=this._bandwidth,n=this._paddingInner,r=this._paddingOuter,1===n&&(n=0),Lb(i,n,r)*(o/(1-n))*Math.sign(t[1]-t[0])),l=Math.min((t[1]-t[0])/s,1);if(K(this._rangeFactorStart)&&K(this._rangeFactorEnd)){if(s>0){const e=t[0]-s*this._rangeFactorStart,i=e+s;this._wholeRange=[e,i]}else{const e=t[1]+s*(1-this._rangeFactorEnd),i=e-s;this._wholeRange=[i,e]}const i=this._rangeFactorStart+l<=1,o=this._rangeFactorEnd-l>=0;"rangeFactorStart"===e&&i?this._rangeFactorEnd=this._rangeFactorStart+l:"rangeFactorEnd"===e&&o?this._rangeFactorStart=this._rangeFactorEnd-l:t[0]<=t[1]?i?this._rangeFactorEnd=this._rangeFactorStart+l:o?this._rangeFactorStart=this._rangeFactorEnd-l:(this._rangeFactorStart=0,this._rangeFactorEnd=l):o?this._rangeFactorStart=this._rangeFactorEnd-l:i?this._rangeFactorEnd=this._rangeFactorStart+l:(this._rangeFactorStart=1-l,this._rangeFactorEnd=1)}else this._rangeFactorStart=0,this._rangeFactorEnd=l,this._wholeRange=[t[0],t[0]+s];return this._wholeRange}var i,o,n,r;return super._calculateWholeRange(t)}calculateWholeRangeSize(){const t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}calculateVisibleDomain(t){const e=this._domain;if(K(this._rangeFactorStart)&&K(this._rangeFactorEnd)&&e.length){const i=this._getInvertIndex(t[0]),o=this._getInvertIndex(t[1]);return e.slice(Math.min(i,o),Math.max(i,o)+1)}return e}domain(t,e){return t?(super.domain(t),this.rescale(e)):super.domain()}range(t,e){return t?(this._range=[Lt(t[0]),Lt(t[1])],this.rescale(e)):this._range}rangeRound(t,e){return this._range=[Lt(t[0]),Lt(t[1])],this._round=!0,this.rescale(e)}ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return-1===t?e:Nb(0,e.length-1,t,!1).map((t=>e[t]))}tickData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this.ticks(t).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0]+this._bandwidth/2)/(this._range[1]-this._range[0])})))}forceTicks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return Nb(0,e.length-1,t,!0).filter((t=>t<e.length)).map((t=>e[t]))}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return function(t,e,i){let o;if(i=$t(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+i)),o=e<t){const i=t;t=e,e=i}return Wb(t,e,i,o)}(0,e.length-1,t).map((t=>e[t]))}_getInvertIndex(t){let e=0;const i=this.step()/2,o=this.bandwidth()/2,n=this._domain.length,r=this.range(),s=r[0]>r[r.length-1];for(e=0;e<n;e++){const r=this.scale(this._domain[e])+o;if(0===e&&(!s&&!Nt(t,r+i)||s&&!Gt(t,r-i)))break;if(e===n-1)break;if(!Gt(t,r-i)&&!Nt(t,r+i))break}return e>=0&&e<=n-1?e:n-1}invert(t){return this._domain[this._getInvertIndex(t)]}padding(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}paddingInner(t,e){return void 0!==t?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}paddingOuter(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}step(){return this._step}round(t,e){return void 0!==t?(this._round=t,this.rescale(e)):this._round}align(t,e){return void 0!==t?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}rangeFactor(t,e){return t?(super.rangeFactor(t),this.rescale(e)):super.rangeFactor()}rangeFactorStart(t,e){return X(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this.rescale(e,"rangeFactorStart"))}rangeFactorEnd(t,e){return X(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this.rescale(e,"rangeFactorEnd"))}bandwidth(t,e){return t?("auto"===t?(this._bandwidth=void 0,this._isFixed=!1):(this._bandwidth=t,this._isFixed=!0),this._userBandwidth=t,this.rescale(e)):this._bandwidth}maxBandwidth(t,e){return t?(this._maxBandwidth="auto"===t?void 0:t,this.rescale(e)):this._maxBandwidth}minBandwidth(t,e){return t?(this._minBandwidth="auto"===t?void 0:t,this.rescale(e)):this._minBandwidth}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}isBandwidthFixed(){return this._isFixed&&!!this._bandwidth}_isBandwidthFixedByUser(){return this._isFixed&&this._userBandwidth&&nt(this._userBandwidth)}clone(){var t,e,i;return new Gb(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align,!0).bandwidth(null!==(t=this._userBandwidth)&&void 0!==t?t:"auto",!0).maxBandwidth(null!==(e=this._maxBandwidth)&&void 0!==e?e:"auto",!0).minBandwidth(null!==(i=this._maxBandwidth)&&void 0!==i?i:"auto")}}const{interpolateRgb:jb}=Ke;function Ub(t,e){const i=typeof e;let o;if(X(e)||"boolean"===i)return()=>e;if("number"===i)return Zt(t,e);if("string"===i){if(o=Ye.parseColorString(e)){const e=jb(Ye.parseColorString(t),o);return t=>e(t).formatRgb()}return Zt(Number(t),Number(e))}return e instanceof Xe?jb(t,e):e instanceof Ye?jb(t.color,e.color):e instanceof Date?function(t,e){const i=t.valueOf(),o=e.valueOf(),n=new Date;return t=>(n.setTime(i*(1-t)+o*t),n)}(t,e):Zt(Number(t),Number(e))}class Vb extends Ib{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_b,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_b;super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=_b,this._piecewise=kb,this._interpolate=Ub}calculateVisibleDomain(t){var e;return K(this._rangeFactorStart)&&K(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),Zt)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const o=Array.from(t,Lt);return this._domain=o,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){const i=Array.from(t);return this._range=i,this._interpolate=qt,this.rescale(e)}rescale(t){var e;if(t)return this;const i=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,o=i.length,n=this._range.length;let r=Math.min(o,n);if(o&&o<n&&this._forceAlign){const t=n-o+1,e=i[o-1],s=o>=2?(e-i[o-2])/t:0;for(let n=1;n<=t;n++)i[o-2+n]=e-s*(t-n);r=n}return this._autoClamp&&(this._clamp=$t(i[0],i[r-1])),this._piecewise=r>2?Fb:kb,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:_b),this.rescale(i)):this._clamp!==_b}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(){return[]}tickData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.ticks(t);return(null!=e?e:[]).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])})))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return X(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return X(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}const $b=Math.sqrt(50),Yb=Math.sqrt(10),Xb=Math.sqrt(2),Kb=[1,2,5,10],Zb=(t,e,i)=>{let o=1,n=t;const r=Math.floor((e-1)/2),s=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?n=0:t<0&&t>=-Number.MIN_VALUE?n=-(e-1):!i&&s<1?o=tC(s).step:(i||s>1)&&(n=Math.floor(t)-r*o),o>0?(t>0?n=Math.max(n,0):t<0&&(n=Math.min(n,-(e-1)*o)),function(t,e,i){K(e)||(e=t,t=0),K(i)||(i=1);let o=-1;const n=0|Math.max(0,Math.ceil((e-t)/i)),r=new Array(n);for(;++o<n;)r[o]=t+o*i;return r}(0,e).map((t=>n+t*o))):t>0?Jb(0,-(e-1)/o,o):Jb((e-1)/o,0,o)},qb=jt(((t,e,i,o)=>{let n,r,s,l,a=-1;if(i=+i,(t=+t)==(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((n=e<t)&&(r=t,t=e,e=r),l=eC(t,e,i).step,!isFinite(l))return[];if(l>0){let i=Math.round(t/l),o=Math.round(e/l);for(i*l<t&&++i,o*l>e&&--o,s=new Array(r=o-i+1);++a<r;)s[a]=(i+a)*l}else if(l<0&&(null==o?void 0:o.noDecimals)){l=1;const i=Math.ceil(t),o=Math.floor(e);if(!(i<=o))return[];for(s=new Array(r=o-i+1);++a<r;)s[a]=i+a}else{l=-l;let i=Math.round(t*l),o=Math.round(e*l);for(i/l<t&&++i,o/l>e&&--o,s=new Array(r=o-i+1);++a<r;)s[a]=(i+a)/l}return n&&s.reverse(),s})),Jb=(t,e,i)=>{let o,n,r=-1;if(i>0){let s=Math.floor(t/i),l=Math.ceil(e/i);for((s+1)*i<t&&++s,(l-1)*i>e&&--l,n=new Array(o=l-s+1);++r<o;)n[r]=(s+r)*i}else{i=-i;let s=Math.floor(t*i),l=Math.ceil(e*i);for((s+1)/i<t&&++s,(l-1)/i>e&&--l,n=new Array(o=l-s+1);++r<o;)n[r]=(s+r)/i}return n},Qb=jt(((t,e,i,o)=>{let n,r,s;if(i=+i,(t=+t)==(e=+e))return Zb(t,i,null==o?void 0:o.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return Zb(t,i,null==o?void 0:o.noDecimals);(n=e<t)&&(s=t,t=e,e=s);const l=eC(t,e,i);let a=l.step;if(!isFinite(a))return[];if(a>0){let o=1;const{power:n,gap:s}=l,h=10===s?2*10**n:1*10**n;for(;o<=5&&(r=Jb(t,e,a),r.length>i+1)&&i>2;)a+=h,o+=1;i>2&&r.length<i-1&&(r=((t,e,i)=>{let o;const n=t[0],r=t[t.length-1],s=e-t.length;if(r<=0){const e=[];for(o=s;o>=1;o--)e.push(n-o*i);return e.concat(t)}if(n>=0){for(o=1;o<=s;o++)t.push(r+o*i);return t}let l=[];const a=[];for(o=1;o<=s;o++)o%2==0?l=[n-Math.floor(o/2)*i].concat(l):a.push(r+Math.ceil(o/2)*i);return l.concat(t).concat(a)})(r,i,a))}else(null==o?void 0:o.noDecimals)&&a<0&&(a=1),r=Jb(t,e,a);return n&&r.reverse(),r})),tC=t=>{const e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e;let o=Kb[0];return i>=$b?o=Kb[3]:i>=Yb?o=Kb[2]:i>=Xb&&(o=Kb[1]),e>=0?{step:o*10**e,gap:o,power:e}:{step:-(10**-e)/o,gap:o,power:e}};function eC(t,e,i){const o=(e-t)/Math.max(0,i);return tC(o)}function iC(t,e,i){let o;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(o=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(o))return[];const n=new Array(i);for(let e=0;e<i;e++)n[e]=t+e*o;return n}function oC(t){let e,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=0,r=t.length-1,s=t[n],l=t[r],a=10;for(l<s&&(i=s,s=l,l=i,i=n,n=r,r=i);a-- >0;){if(i=eC(s,l,o).step,i===e)return t[n]=s,t[r]=l,t;if(i>0)s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i;else{if(!(i<0))break;s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i}e=i}}function nC(t,e){const i=nt(e.forceMin),o=nt(e.forceMax);let n=null;const r=[];let s=null;const l=i&&o?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:o?t=>t<=e.forceMax:null;return i?r[0]=e.forceMin:nt(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(r[0]=e.min),o?r[1]=e.forceMax:nt(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(r[1]=e.max),nt(r[0])&&nt(r[1])?(s=t.slice(),s[0]=r[0],s[s.length-1]=r[1]):n=nt(r[0])||nt(r[1])?nt(r[0])?"max":"min":"all",{niceType:n,niceDomain:s,niceMinMax:r,domainValidator:l}}const rC=(t,e,i)=>Math.abs(e-t)<1?+i.toFixed(1):Math.round(+i),sC=jt(((t,e,i,o,n,r,s)=>{let l=t,a=e;const h=a<l;h&&([l,a]=[a,l]);let d,c,u=n(l),g=n(a),p=[];if(!(o%1)&&g-u<i){if(u=Math.floor(u),g=Math.ceil(g),l>0){for(;u<=g;++u)for(d=1;d<o;++d)if(c=u<0?d/r(-u):d*r(u),!(c<l)){if(c>a)break;p.push(c)}}else for(;u<=g;++u)for(d=o-1;d>=1;--d)if(c=u>0?d/r(-u):d*r(u),!(c<l)){if(c>a)break;p.push(c)}2*p.length<i&&(p=Qb(l,a,i))}else p=Qb(u,g,Math.min(g-u,i)).map(r);return p=p.filter((t=>0!==t)),(null==s?void 0:s.noDecimals)&&(p=Array.from(new Set(p.map((t=>Math.floor(t)))))),h?p.reverse():p})),lC=jt(((t,e,i,o,n,r)=>{const s=[],l={},a=n(t),h=n(e);let d=[];if(Number.isInteger(o))d=Qb(a,h,i);else{const t=(h-a)/(i-1);for(let e=0;e<i;e++)d.push(a+e*t)}return d.forEach((i=>{const n=r(i),a=Number.isInteger(o)?rC(t,e,n):rC(t,e,zb(n)),h=rC(t,e,((t,e)=>{let i,o;return e[0]<e[1]?(i=e[0],o=e[1]):(i=e[1],o=e[0]),Math.min(Math.max(t,i),o)})(a,[t,e]));!l[h]&&!isNaN(h)&&d.length>1&&(l[h]=1,s.push(h))})),s})),aC=jt(((t,e,i,o,n)=>iC(o(t),o(e),i).map((t=>zb(n(t))))));class hC extends Vb{constructor(){super(...arguments),this.type=wb.Linear}clone(){return(new hC).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}d3Ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;const i=this.calculateVisibleDomain(this._range);return qb(i[0],i[i.length-1],t,e)}ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;var i;if(Y(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(K(this._rangeFactorStart)&&K(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const o=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,n=this._domain,r=o[0],s=o[o.length-1];let l=Qb(n[0],n[n.length-1],t,e);if(!l.length)return l;if(this._domainValidator)l=l.filter(this._domainValidator);else if((l[0]!==r||l[l.length-1]!==s)&&this._niceType){const t=o.slice();if("all"===this._niceType?(t[0]=l[0],t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&l[0]!==r?(t[0]=l[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&l[l.length-1]!==s&&(t[t.length-1]=l[l.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){const e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);l=l.filter((t=>t>=e&&t<=i))}}return l}forceTicks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return iC(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return function(t,e,i){let o,n,r=-1;if(i=+i,(n=(e=+e)<(t=+t))&&(o=t,t=e,e=o),!isFinite(i)||e-t<=i)return[t];const s=Math.floor((e-t)/i+1),l=new Array(s);for(;++r<s;)l[r]=t+r*i;return n&&l.reverse(),l}(e[0],e[e.length-1],t)}nice(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;var i,o;const n=this._domain;let r=[];if(e){const t=nC(n,e);if(r=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const e=oC(n.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(i=r[1])&&void 0!==i?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(o=r[0])&&void 0!==o?o:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="min";const e=this._domain[this._domain.length-1],i=oC(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;this._niceType="max";const e=this._domain[0],i=oC(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}class dC{nice(){let t=arguments.length>1?arguments[1]:void 0;var e,i,o,n;const r=this._domain;let s=[],l=null;if(t){const e=nC(r,t);if(s=e.niceMinMax,this._domainValidator=e.domainValidator,l=e.niceType,e.niceDomain)return this._niceDomain=e.niceDomain,this.rescale(),this}else l="all";if(l){const t=((t,e)=>{const i=t.slice();let o=0,n=i.length-1,r=i[o],s=i[n];return s<r&&([o,n]=[n,o],[r,s]=[s,r]),i[o]=e.floor(r),i[n]=e.ceil(s),i})(r.slice(),null!==(i=null===(e=this.getNiceConfig)||void 0===e?void 0:e.call(this))&&void 0!==i?i:{floor:t=>Math.floor(t),ceil:t=>Math.ceil(t)});return"min"===l?t[t.length-1]=null!==(o=s[1])&&void 0!==o?o:t[t.length-1]:"max"===l&&(t[0]=null!==(n=s[0])&&void 0!==n?n:t[0]),this._niceDomain=t,this.rescale(),this}return this}niceMin(){const t=this._domain[this._domain.length-1];this.nice();const e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){const t=this._domain[0];this.nice();const e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}function cC(t){return e=>-t(-e)}function uC(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.EPSILON;return e=>Math.max(e,t)}class gC extends Vb{constructor(){super(Mb(10),Bb(10)),this.type=wb.Log,this._limit=uC(),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return(new gC).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).base(this._base)}rescale(t){var e;if(t)return this;super.rescale();const i=Mb(this._base),o=Bb(this._base);return(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain)[0]<0?(this._logs=cC(i),this._pows=cC(o),this._limit=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.EPSILON;return e=>Math.min(e,-t)}(),this.transformer=Sb,this.untransformer=Ab):(this._logs=i,this._pows=o,this._limit=uC(),this.transformer=this._logs,this.untransformer=o),this}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this._limit).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._limit(this._clamp(t))));return this._fishEyeTransform?this._fishEyeTransform(i):i}base(t,e){return arguments.length?(this._base=t,this.rescale(e)):this._base}tickFormat(){return _b}d3Ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;const i=this.domain(),o=this._limit(i[0]),n=this._limit(i[i.length-1]);return sC(o,n,t,this._base,this.transformer,this.untransformer,e)}ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return lC(this._limit(e[0]),this._limit(e[e.length-1]),t,this._base,this.transformer,this.untransformer)}forceTicks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return aC(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return aC(this._limit(e[0]),this._limit(e[e.length-1]),t,this.transformer,this.untransformer)}getNiceConfig(){return{floor:t=>this._pows(Math.floor(this._logs(this._limit(t)))),ceil:t=>Math.abs(t)>=1?Math.ceil(t):this._pows(Math.ceil(this._logs(this._limit(t))))}}}At(gC,dC);class pC extends hC{constructor(){super(Tb(1),Pb(1)),this.type=wb.Symlog,this._const=1}clone(){return(new pC).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).constant(this._const)}constant(t,e){return arguments.length?(this._const=t,this.transformer=Tb(t),this.untransformer=Pb(t),this.rescale(e)):this._const}d3Ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,e=arguments.length>1?arguments[1]:void 0;const i=this.domain(),o=i[0],n=i[i.length-1];return sC(o,n,t,this._const,this.transformer,this.untransformer,e)}ticks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return lC(e[0],e[e.length-1],t,this._const,this.transformer,this.untransformer)}forceTicks(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;const e=this.calculateVisibleDomain(this._range);return aC(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return aC(e[0],e[e.length-1],t,this.transformer,this.untransformer)}}function fC(t,e,i,o){let n;const{breakData:r}=t;if(r&&r()){const{breakDomains:t}=r(),s=e.domain();n=[];for(let e=0;e<s.length-1;e++)o(i,[s[e],s[e+1]]).forEach((e=>{t.some((t=>e>=t[0]&&e<=t[1]))||n.push(e)}));e.domain(s)}else n=o(i);return n}function vC(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(i&&!e.includes(t)){let i=e.length;if(i>1){n?e.push(t):e.unshift(t);for(let t=0;t<i;t++){const r=n?i-1-t:t;if(!o(e[r]))break;e.splice(r,1),t--,i--}}}}At(pC,dC);const mC={parity:function(t){return t.filter(((t,e)=>e%2==0))},greedy:function(t,e){let i;return t.filter(((t,o)=>!(o&&Qm(i,t,e)||(i=t,0))))}},bC=(t,e,i,o)=>yb(t,e,i).map((t=>o?[t.x1,t.x2,t.width()]:[t.y1,t.y2,t.height()])),CC=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.max(t[0],e[0])-i/2<=Math.min(t[1],e[1])+i/2},yC=(t,e)=>t[1]<e[0]?e[0]-t[1]:e[1]<t[0]?t[0]-e[1]:0,wC=(t,e,i,o,n,r)=>{let s=0,l=0,a=-1,h=Number.MAX_VALUE;const d=o=>{let n=!0,r=0;do{r+o<t.length&&CC(e[r],e[r+o],i)&&(n=!1),r+=o}while(n&&r<t.length);return n},c=((t,e,i)=>{let o=t,n=e;for(;o<n;){const t=Math.floor((o+n)/2);i(t)>=0?n=t:o=t+1}return o})(n,t.length,(t=>d(t)?1:-1));let u=c;do{if(u>c&&!r&&!d(u))u++;else{if(!o){l=u;break}{const o=t.length-1;let n,r=0;n=t.length%u>0?t.length-t.length%u+u:t.length;do{if(n-=u,n!==o&&!CC(e[n],e[o],i))break;r++}while(n>0);if(n===o){l=u,s=r;break}{const i=Math.floor(t.length/u)-r+1;if(i<a)break;{a=i;const t=yC(e[n],e[o]),d=n-u>=0?yC(e[n-u],e[n]):t,c=Math.abs(t-d);if(c<h&&(h=c,l=u,s=r),t<=d)break}}}u++}}while(u<=t.length);return{step:l,delCount:s}},xC=(t,e)=>{const{tickCount:i,forceTickCount:o,tickStep:n,getRadius:r,labelOffset:s,labelGap:l=0,labelStyle:a}=e,h=null==r?void 0:r();if(!h)return mb(t.domain());let d;if(K(n))d=t.stepTicks(n);else if(K(o))d=t.forceTicks(o);else if(K(i)){const e=t.range(),o=Math.abs(e[e.length-1]-e[0]),n=Y(i)?i({axisLength:o,labelStyle:a}):i;d=t.ticks(n)}else if(e.sampling){const i=t.domain(),o=t.range(),n=((t,e,i)=>{var o;const{labelStyle:n,getRadius:r,labelOffset:s,labelFormatter:l,inside:a}=i,h=null==r?void 0:r(),d=null!==(o=n.angle)&&void 0!==o?o:0,c=Sm(n);return e.map((e=>{const i=l?l(e):`${e}`,{width:o,height:r}=c.quickMeasure(i),u=Math.max(o,12),g=Math.max(r,12),p=t.scale(e),f={x:0,y:0};let v=0,m=0;const b={align:n.textAlign,baseline:n.textBaseline},{x:C,y:y}=Jm(p,f,h,s,a);return b.align||(Wt(C,f.x)?b.baseline||(b.baseline=y>f.y?"top":"bottom"):C>f.x?b.align="left":C<f.x&&(b.align="right")),v=C+("right"===b.align?-u:"left"===b.align?0:-u/2),m=y+("bottom"===b.baseline?-g:"top"===b.baseline?0:-g/2),(new Le).set(v,m,v+u,m+g).rotate(d,v+u/2,m+g/2)}))})(t,i,e),r=Tt(o),a=Mt(o),c=Math.abs(a-r)*(h+s)/i.length,{step:u,delCount:g}=_C(i,n,l,Math.floor(n.reduce(((t,e)=>Math.min(t,e.width(),e.height())),Number.MAX_VALUE)/c));d=t.stepTicks(u),d=d.slice(0,d.length-g)}else d=t.domain();return mb(d)},_C=(t,e,i,o)=>{let n=o;do{let o=!0;n++;let r=0;do{r+n<t.length&&bb(e[r],e[r+n],i)&&(o=!1),r+=n}while(o&&r<t.length);if(o)break}while(n<=t.length);let r=0;if(t.length>2){let i=t.length-t.length%n;for(i>=t.length&&(i-=n);i>0&&bb(e[0],e[i]);)r++,i-=n}return{step:n,delCount:r}},SC=(t,e)=>{if(xb(t.type))return((t,e)=>{var i,o;if(!xb(t.type))return mb(t.domain());const n=t.range(),r=Math.abs(n[n.length-1]-n[0]);if(r<2)return mb([t.domain()[0]]);const{tickCount:s,forceTickCount:l,tickStep:a,noDecimals:h=!1,labelStyle:d,breakData:c}=e;let u;if(K(a))u=t.stepTicks(a);else if(K(l))u=fC(e,t,l,((e,i)=>i&&i.length?t.domain(i,!0).forceTicks(e):t.forceTicks(e)));else if("d3"===e.tickMode){const o=null!==(i=Y(s)?s({axisLength:r,labelStyle:d}):s)&&void 0!==i?i:5;u=fC(e,t,o,((e,i)=>i&&i.length?t.domain(i,!0).d3Ticks(e,{noDecimals:h}):t.d3Ticks(e,{noDecimals:h})))}else{const i=null!==(o=Y(s)?s({axisLength:r,labelStyle:d}):s)&&void 0!==o?o:5,n=Y(e.tickMode)?e.tickMode:void 0;u=fC(e,t,i,((e,i)=>i&&i.length?t.domain(i,!0).ticks(e,{noDecimals:h,customTicks:n}):t.ticks(e,{noDecimals:h,customTicks:n})))}const g=t.domain();if(e.labelFirstVisible&&g[0]!==u[0]&&!u.includes(g[0])&&u.unshift(g[0]),e.labelLastVisible&&g[g.length-1]!==u[u.length-1]&&!u.includes(g[g.length-1])&&u.push(g[g.length-1]),e.sampling&&u.length>1&&("cartesian"===e.coordinateType||"polar"===e.coordinateType&&"radius"===e.axisOrientType)){const{labelGap:i=4,labelFlush:o}=e;let n=yb(t,u,e).map(((t,e)=>({AABBBounds:t,value:u[e]})));const r=[...n],s=r[0],l=Bt(r),a=c&&c()?mC.greedy:mC.parity;for(;n.length>=3&&tb(n,i);)n=a(n,i);const h=e.labelFirstVisible;let d=e.labelLastVisible;Qm(s,l,i)&&n.includes(l)&&n.length>1&&h&&d&&(n.splice(n.indexOf(l),1),d=!1),vC(s,n,h,(t=>Qm(t,s,i))),vC(l,n,d,(t=>Qm(t,l,i)||!(!h||t===s)&&Qm(t,s,i)),!0);const g=n.map((t=>t.value));g.length<3&&o&&(g.length>1&&g.pop(),Bt(g)!==Bt(u)&&g.push(Bt(u))),u=g}return mb(u)})(t,e);if(function(t){switch(t){case wb.Ordinal:case wb.Point:case wb.Band:return!0;default:return!1}}(t.type)){if("cartesian"===e.coordinateType)return((t,e)=>{var i;const o=t.domain();if(!o.length)return[];const{tickCount:n,forceTickCount:r,tickStep:s,labelGap:l=4,axisOrientType:a,labelStyle:h}=e,d=(t=>["bottom","top","z"].includes(t))(a),c=t.range(),u=t.calculateWholeRangeSize();if(u<2)return e.labelLastVisible?mb([o[o.length-1]]):mb([o[0]]);let g;if(K(s))g=t.stepTicks(s);else if(K(r))g=t.forceTicks(r);else if(K(n)){const e=Y(n)?n({axisLength:u,labelStyle:h}):n;g=t.ticks(e)}else if(e.sampling){const n=(null!==(i=e.labelStyle.fontSize)&&void 0!==i?i:12)+2,r=Tt(c),s=Mt(c);if(o.length<=u/n){const i=(s-r)/o.length,n=bC(t,o,e,d),a=Math.min(...n.map((t=>t[2]))),h=wC(o,n,l,e.labelLastVisible,Math.floor(a/i),!1);g=t.stepTicks(h.step),e.labelLastVisible&&(h.delCount&&(g=g.slice(0,g.length-h.delCount)),g.push(o[o.length-1]))}else{const i=[o[0],o[Math.floor(o.length/2)],o[o.length-1]],n=bC(t,i,e,d);let a=null;n.forEach((t=>{a?a[2]<t[2]&&(a=t):a=t}));const h=s-r-l>0?Math.ceil(o.length*(l+a[2])/(s-r-l)):o.length-1;g=t.stepTicks(h),!e.labelLastVisible||g.length&&g[g.length-1]===o[o.length-1]||(g.length&&Math.abs(t.scale(g[g.length-1])-t.scale(o[o.length-1]))<a[2]&&(g=g.slice(0,-1)),g.push(o[o.length-1]))}}else g=t.domain();return mb(g)})(t,e);if("polar"===e.coordinateType&&"angle"===e.axisOrientType)return xC(t,e)}return mb(t.domain())};function AC(){$v(),am(),dm()}const RC={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};AC();class BC extends gg{getCurrent(){return this._current}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:yt({},BC.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=t=>{const e=t.target;e.hasState("disable")||e.addState("hover")},this._onUnHover=t=>{t.target.removeState("hover")},this._onClick=t=>{const e=t.target;if("preHandler"===e.name){if(1===this._current)return;this._current-=1,1===this._current?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toPrev",{current:this._current,total:this._total,direction:"pre",event:t})}if("nextHandler"===e.name){if(this._current===this._total)return;this._current+=1,this._current===this._total?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toNext",{current:this._current,total:this._total,direction:"next",event:t})}this._current>1&&this.preHandler.removeState("disable"),this._current<this._total&&this.nextHandler.removeState("disable"),this.text.setAttribute("text",this._getPageText(this._current))}}render(){var t,e,i;this._reset();const{layout:o="horizontal",handler:n=RC,total:r,defaultCurrent:s=1,textStyle:l,padding:a=0}=this.attribute;this._current=s;const h=Ze(a),d="horizontal"===o,c=Ra.group({x:0,y:0}),u=n.style||{},g=u.size||15,p=null!==(t=n.space)&&void 0!==t?t:8,f=n.state||{};let{preShape:v,nextShape:m}=n;v||(v=d?"triangleLeft":"triangleUp"),m||(m=d?"triangleRight":"triangleDown");const b=Ra.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},u),{x:0,y:0,symbolType:v,size:g}));b.states=f,b.name="preHandler",this.preHandler=b,c.add(b);const{width:C,height:y}=Am(this._getPageText(r),Object.assign({textAlign:"center",textBaseline:"middle"},l),null===(i=null===(e=this.stage)||void 0===e?void 0:e.getTheme())||void 0===i?void 0:i.text),w=nt(g)?g:g[0],x=nt(g)?g:g[1],_=Ra.text(Object.assign({x:d?w/2+p+C/2:0,y:d?0:x/2+p+y/2,text:this._getPageText(s),textAlign:"center",textBaseline:"middle",lineHeight:null==l?void 0:l.fontSize},l));this.text=_,c.add(_);const S=Ra.symbol(Object.assign(Object.assign({strokeBoundsBuffer:0,pickMode:"imprecise"},u),{x:d?w+2*p+C:0,y:d?0:x+2*p+y,symbolType:m,size:g}));S.name="nextHandler",S.states=f,this.nextHandler=S,c.add(S),1===this._total?(b.addState("disable"),S.addState("disable")):1===this._current?b.addState("disable"):this._current===r&&S.addState("disable");const A=c.AABBBounds,R=A.width(),B=A.height();c.translateTo(0-A.x1+h[3],0-A.y1+h[0]),this.add(c),this.attribute.width=R+h[1]+h[3],this.attribute.height=B+h[0]+h[2],this._bindEvents()}_bindEvents(){this.attribute.disableTriggerEvent||(this.preHandler&&(this.preHandler.addEventListener("pointerenter",this._onHover),this.preHandler.addEventListener("pointerleave",this._onUnHover),this.preHandler.addEventListener("pointerdown",this._onClick)),this.nextHandler&&(this.nextHandler.addEventListener("pointerenter",this._onHover),this.nextHandler.addEventListener("pointerleave",this._onUnHover),this.nextHandler.addEventListener("pointerdown",this._onClick)))}_reset(){this.removeAllChild(!0),this._current=1,this._total=this.attribute.total,this.preHandler=this.nextHandler=this.text=null}_getPageText(t){const{pageFormatter:e}=this.attribute;return e?Y(e)?e(t,this._total):`${e}`.replace("{current}",`${t}`).replace("{total}",`${this._total}`):`${t}/${this._total}`}setTotal(t){t!==this.attribute.total&&(this._total=t,1!==this._current&&this._current<=t?this.setAttributes({total:t,defaultCurrent:this._current}):this.setAttribute("total",t))}}BC.defaultAttributes={handler:RC,textStyle:{fill:"rgb(51, 51, 51)",fontSize:12}};const MC=16,TC=8,PC=12;var EC,kC,LC;!function(t){t.selected="selected",t.unSelected="unSelected",t.selectedHover="selectedHover",t.unSelectedHover="unSelectedHover",t.focus="focus"}(EC||(EC={})),function(t){t.legendItemHover="legendItemHover",t.legendItemUnHover="legendItemUnHover",t.legendItemClick="legendItemClick",t.legendItemAttributeUpdate="legendItemAttributeUpdate"}(kC||(kC={})),function(t){t.innerView="innerView",t.title="legendTitle",t.item="legendItem",t.itemShape="legendItemShape",t.itemLabel="legendItemLabel",t.itemValue="legendItemValue",t.focus="legendItemFocus"}(LC||(LC={}));class HC extends gg{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild(!0);const{interactive:t=!0,title:e,padding:i=0}=this.attribute;this._parsedPadding=Ze(i);const o=Ra.group({x:this._parsedPadding[3],y:this._parsedPadding[0],pickable:t,childrenPickable:t});o.name=LC.innerView,this.add(o),this._innerView=o,(null==e?void 0:e.visible)&&this._renderTitle(e),this._renderContent(),this._adjustLayout(),t&&this._bindEvents();const n=this._innerView.AABBBounds;this.attribute.width=n.width()+this._parsedPadding[1]+this._parsedPadding[3],this.attribute.height=n.height()+this._parsedPadding[0]+this._parsedPadding[2]}_renderTitle(t){const{text:e="",textStyle:i,padding:o=0,background:n,minWidth:r,maxWidth:s,shape:l}=t,a={x:0,y:0,text:e,textStyle:i,padding:Ze(o),minWidth:r,maxWidth:s};l&&l.visible&&(a.shape=Object.assign({visible:!0},l.style),K(l.space)&&(a.space=l.space)),n&&n.visible&&(a.panel=Object.assign({visible:!0},n.style));const h=new Em(a);h.name=LC.title,this._title=h,this._innerView.add(h)}_adjustLayout(){var t;if(this._title){const e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),o=null===(t=this.attribute.title)||void 0===t?void 0:t.align;"center"===o?this._title.setAttribute("x",(e-i)/2):"end"===o&&this._title.setAttribute("x",e-i)}}}function FC(){$v(),dm(),im(),am()}function zC(){$v(),Tm()}var IC=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};const OC={[EC.focus]:{},[EC.selected]:{},[EC.selectedHover]:{},[EC.unSelected]:{},[EC.unSelectedHover]:{}};zC(),AC(),gm();class DC extends HC{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:yt({},DC.defaultAttributes,t)),this.name="discreteLegend",this._itemsContainer=null,this._itemHeightByUser=void 0,this._itemHeight=0,this._itemMaxWidth=0,this._contentMaxHeight=0,this._onHover=t=>{const e=t.target;if(e&&e.name&&e.name.startsWith(LC.item)){const i=e.delegate;if(this._lastActiveItem){if(this._lastActiveItem.id===i.id)return;this._unHover(this._lastActiveItem,t)}this._hover(i,t)}else this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onUnHover=t=>{this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onClick=t=>{var e,i,o,n;const r=t.target;if(r&&r.name&&r.name.startsWith(LC.item)){const s=r.delegate,{selectMode:l="multiple"}=this.attribute;if(r.name===LC.focus||"focus"===l){const o=s.hasState(EC.focus);s.toggleState(EC.focus),o?null===(e=this._itemsContainer)||void 0===e||e.getChildren().forEach((e=>{this._removeLegendItemState(e,[EC.unSelected,EC.unSelectedHover,EC.focus],t),this._setLegendItemState(e,EC.selected,t)})):(this._setLegendItemState(s,EC.selected,t),this._removeLegendItemState(s,[EC.unSelected,EC.unSelectedHover],t),null===(i=this._itemsContainer)||void 0===i||i.getChildren().forEach((e=>{s!==e&&(this._removeLegendItemState(e,[EC.selected,EC.selectedHover,EC.focus],t),this._setLegendItemState(e,EC.unSelected,t))})))}else{null===(o=this._itemsContainer)||void 0===o||o.getChildren().forEach((t=>{t.removeState(EC.focus)}));const{allowAllCanceled:e=!0}=this.attribute,i=s.hasState(EC.selected),r=this._getSelectedLegends();if("multiple"===l){if(!1===e&&i&&1===r.length)return void this._dispatchLegendEvent(kC.legendItemClick,s,t);i?(this._removeLegendItemState(s,[EC.selected,EC.selectedHover],t),this._setLegendItemState(s,EC.unSelected,t)):(this._setLegendItemState(s,EC.selected,t),this._removeLegendItemState(s,[EC.unSelected,EC.unSelectedHover],t))}else this._setLegendItemState(s,EC.selected,t),this._removeLegendItemState(s,[EC.unSelected,EC.unSelectedHover],t),null===(n=this._itemsContainer)||void 0===n||n.getChildren().forEach((e=>{s!==e&&(this._removeLegendItemState(e,[EC.selected,EC.selectedHover],t),this._setLegendItemState(e,EC.unSelected,t))}))}this._dispatchLegendEvent(kC.legendItemClick,s,t)}}}render(){super.render(),this._lastActiveItem=null}setSelected(t){var e;(null===(e=this._itemsContainer)||void 0===e?void 0:e.getChildren()).forEach((e=>{const i=e.data;t.includes(i.label)?(this._setLegendItemState(e,EC.selected),this._removeLegendItemState(e,[EC.unSelected,EC.unSelectedHover])):(this._removeLegendItemState(e,[EC.selected,EC.selectedHover]),this._setLegendItemState(e,EC.unSelected))}))}_renderItems(){const{item:t={},maxCol:e=1,maxRow:i=2,maxWidth:o,defaultSelected:n,lazyload:r,autoPage:s}=this.attribute,{spaceCol:l=MC,spaceRow:a=TC}=t,h=this._itemsContainer,{items:d,isHorizontal:c,startIndex:u,isScrollbar:g}=this._itemContext,p=g?1:c?i:e,f=this._contentMaxHeight;let v,{doWrap:m,maxWidthInCol:b,startX:C,startY:y,pages:w}=this._itemContext,x=0;for(let t=u,e=d.length;t<e&&!(r&&w>this._itemContext.currentPage*p);t++){r&&(this._itemContext.startIndex=t+1),v=d[t],v.id||(v.id=v.label),v.index=t;let e=!0;et(n)&&(e=n.includes(v.label));const i=this._renderEachItem(v,e,t,d),u=i.attribute.width,p=i.attribute.height;this._itemHeight=Math.max(this._itemHeight,p),b=Math.max(u,b),this._itemMaxWidth=Math.max(u,this._itemMaxWidth),c?(K(o)&&(g&&s?(w=Math.ceil((C+u)/o),m=w>1):C+u>o&&(m=!0,C>0&&(w+=1,C=0,y+=p+a))),0===C&&0===y||i.setAttributes({x:C,y:y}),C+=l+u):(K(f)&&(g&&s?(w=Math.ceil((y+p)/f),m=w>1):f<=p?(w+=1,m=!0,y=0,t>0&&(C+=x+l)):f<y+p&&(w+=1,m=!0,y=0,C+=b+l,b=0)),0===C&&0===y||i.setAttributes({x:C,y:y}),y+=a+p),h.add(i),x=u}return this._itemContext.doWrap=m,this._itemContext.startX=C,this._itemContext.startY=y,this._itemContext.maxWidthInCol=b,this._itemContext.pages=w,this._itemContext.maxPages=p,g&&(this._itemContext.totalPage=w),r||(this._itemContext.startIndex=d.length),this._itemContext}_renderContent(){const{item:t={},items:e,reversed:i,maxWidth:o,maxHeight:n}=this.attribute;if(!1===t.visible||ut(e))return;let r=e;i&&(r=null==e?void 0:e.reverse()),this._contentMaxHeight=Math.max(0,n-this._parsedPadding[0]-this._parsedPadding[2]);const s=Ra.group({x:0,y:0});this._itemsContainer=s;const{layout:l,autoPage:a}=this.attribute,h="horizontal"===l,{maxWidth:d,width:c,height:u}=t,g=[];K(d)&&g.push(d),K(c)&&g.push(c),g.length&&(K(o)&&g.push(o),this._itemWidthByUser=Tt(g)),K(u)&&(this._itemHeightByUser=u);const p=this.attribute.pager;this._itemContext={currentPage:p&&p.defaultCurrent||1,doWrap:!1,maxWidthInCol:0,maxPages:1,pages:1,startX:0,startY:0,startIndex:0,items:r,isHorizontal:h,totalPage:1/0,isScrollbar:p&&"scrollbar"===p.type,clipContainer:void 0},this._itemContext=this._renderItems();let f=!1;this._itemContext.doWrap&&a&&this._itemContext.pages>this._itemContext.maxPages&&(f=this._renderPagerComponent()),f||(s.setAttribute("y",this._title?this._title.AABBBounds.height()+gt(this.attribute,"title.space",8):0),this._innerView.add(s))}_bindEvents(){if(this.attribute.disableTriggerEvent)return;if(!this._itemsContainer)return;const{hover:t=!0,select:e=!0}=this.attribute;if(t){let e="pointermove",i="pointerleave";Z(t)&&(t.trigger&&(e=t.trigger),t.triggerOff&&(i=t.triggerOff)),this._itemsContainer.addEventListener(e,this._onHover),this._itemsContainer.addEventListener(i,this._onUnHover)}if(e){let t="pointerdown";Z(e)&&e.trigger&&(t=e.trigger),this._itemsContainer.addEventListener(t,this._onClick)}}_autoEllipsis(t,e,i,o){var n,r;const{label:s,value:l}=this.attribute.item,a=o.AABBBounds,h=i.AABBBounds,d=a.width(),c=h.width();let u=!1;"labelFirst"===t?c>e?u=!0:o.setAttribute("maxLineWidth",e-c):"valueFirst"===t?d>e?u=!0:i.setAttribute("maxLineWidth",e-d):d+c>e&&(u=!0),u&&(o.setAttribute("maxLineWidth",Math.max(e*(null!==(n=s.widthRatio)&&void 0!==n?n:.5),e-c)),i.setAttribute("maxLineWidth",Math.max(e*(null!==(r=l.widthRatio)&&void 0!==r?r:.5),e-d)))}_renderEachItem(t,e,i,o){var n,r;const{id:s,label:l,value:a,shape:h}=t,{padding:d=0,focus:c,focusIconStyle:u,align:g,autoEllipsisStrategy:p}=this.attribute.item,{shape:f,label:v,value:m,background:b}=this.attribute.item,C=this._handleStyle(f,t,e,i,o),y=this._handleStyle(v,t,e,i,o),w=this._handleStyle(m,t,e,i,o),x=this._handleStyle(b,t,e,i,o),_=Ze(d);let S;!1===b.visible?(S=Ra.group({x:0,y:0,cursor:null===(n=x.style)||void 0===n?void 0:n.cursor}),this._appendDataToShape(S,LC.item,t,S)):(S=Ra.group(Object.assign({x:0,y:0},x.style)),this._appendDataToShape(S,LC.item,t,S,x.state)),S.id=`${null!=s?s:l}-${i}`,S.addState(e?EC.selected:EC.unSelected);const A=Ra.group({x:0,y:0,pickable:!1});S.add(A);let R,B=0,M=0,T=0;if(f&&!1!==f.visible){const i=gt(C,"style.size",10);M=et(i)?i[0]||0:i,T=gt(f,"space",8);const o=Ra.symbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},h),C.style));Object.keys(C.state||{}).forEach((t=>{const e=C.state[t].fill||C.state[t].stroke;h.fill&&X(C.state[t].fill)&&e&&(C.state[t].fill=e),h.stroke&&X(C.state[t].stroke)&&e&&(C.state[t].stroke=e)})),this._appendDataToShape(o,LC.itemShape,t,S,C.state),o.addState(e?EC.selected:EC.unSelected),A.add(o)}let P=0;if(c){const e=gt(u,"size",10);R=Ra.symbol(Object.assign(Object.assign({x:0,y:-e/2-1,strokeBoundsBuffer:0,boundsPadding:_},u),{visible:!0,pickMode:"imprecise"})),this._appendDataToShape(R,LC.focus,t,S),P=e}const E=v.formatMethod?v.formatMethod(l,t,i):l,k=Mm(Object.assign(Object.assign({x:M/2+T,y:0,textAlign:"start",textBaseline:"middle",lineHeight:null===(r=y.style)||void 0===r?void 0:r.fontSize},y.style),{text:E,_originText:v.formatMethod?l:void 0}));this._appendDataToShape(k,LC.itemLabel,t,S,y.state),k.addState(e?EC.selected:EC.unSelected),A.add(k);const L=gt(v,"space",8);if(K(a)){const o=gt(m,"space",c?8:0),n=m.formatMethod?m.formatMethod(a,t,i):a,r=Mm(Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:w.style.fontSize},w.style),{text:n,_originText:m.formatMethod?a:void 0}));if(this._appendDataToShape(r,LC.itemValue,t,S,w.state),r.addState(e?EC.selected:EC.unSelected),this._itemWidthByUser){const t=this._itemWidthByUser-_[1]-_[3]-M-T-L-P-o;this._autoEllipsis(p,t,k,r),m.alignRight?r.setAttributes({textAlign:"right",x:this._itemWidthByUser-M/2-_[1]-_[3]-P-o}):r.setAttribute("x",L+(k.AABBBounds.empty()?0:k.AABBBounds.x2))}else r.setAttribute("x",L+(k.AABBBounds.empty()?0:k.AABBBounds.x2));B=o+(r.AABBBounds.empty()?0:r.AABBBounds.x2),A.add(r)}else this._itemWidthByUser?(k.setAttribute("maxLineWidth",this._itemWidthByUser-_[1]-_[3]-M-T-P),B=L+(k.AABBBounds.empty()?0:k.AABBBounds.x2)):B=L+(k.AABBBounds.empty()?0:k.AABBBounds.x2);R&&(R.setAttribute("x",B),A.add(R));const H=A.AABBBounds,F=H.width();if("right"===g){const t=H.x2,e=H.x1;A.forEachChildren(((i,o)=>{"symbol"!==i.type&&"right"!==i.attribute.textAlign||i===R?i.setAttribute("x",e+t-i.attribute.x-i.AABBBounds.width()):"symbol"!==i.type?i.setAttributes({x:e+t-i.attribute.x,textAlign:"left"}):i.setAttribute("x",e+t-i.attribute.x)}))}const z=H.height(),I=K(this.attribute.item.width)?this.attribute.item.width:F+_[1]+_[3],O=this._itemHeightByUser||z+_[0]+_[2];return S.attribute.width=I,S.attribute.height=O,R&&R.setAttribute("visible",!1),A.translateTo(-H.x1+_[3],-H.y1+_[0]),S}_createPager(t){var e,i;const{disableTriggerEvent:o,maxRow:n}=this.attribute,r=t=>t<=99?99:t<=999?999:9999;return this._itemContext.isHorizontal?new BC(Object.assign(Object.assign({layout:1===n?"horizontal":"vertical",total:r(this._itemContext.pages)},yt({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},t)),{defaultCurrent:null===(e=this.attribute.pager)||void 0===e?void 0:e.defaultCurrent,disableTriggerEvent:o})):new BC(Object.assign({layout:"horizontal",total:r(this._itemContext.pages),disableTriggerEvent:o,defaultCurrent:null===(i=this.attribute.pager)||void 0===i?void 0:i.defaultCurrent},t))}_createScrollbar(t,e){const{disableTriggerEvent:i}=this.attribute;return this._itemContext.isHorizontal?new Cm(Object.assign(Object.assign({direction:"horizontal",disableTriggerEvent:i,range:[0,.5],height:!1===t.visible?0:12},t),{width:e})):new Cm(Object.assign(Object.assign({direction:"vertical",width:!1===t.visible?0:12,range:[0,.5]},t),{height:e,disableTriggerEvent:i}))}_updatePositionOfPager(t,e,i){const{pager:o}=this.attribute,{totalPage:n,isHorizontal:r}=this._itemContext,s=o&&o.position||"middle";if(this._pagerComponent.setTotal(n),r){let o;o="start"===s?t:"end"===s?t+i-this._pagerComponent.AABBBounds.height()/2:t+i/2-this._pagerComponent.AABBBounds.height()/2,this._pagerComponent.setAttributes({x:e-this._pagerComponent.AABBBounds.width(),y:o})}else{let t;t="start"===s?0:"end"===s?e-this._pagerComponent.AABBBounds.width():(e-this._pagerComponent.AABBBounds.width())/2,this._pagerComponent.setAttributes({x:t,y:i-this._pagerComponent.AABBBounds.height()})}}_computeScrollbarDelta(){const{isHorizontal:t,clipContainer:e}=this._itemContext,i=this._itemsContainer.AABBBounds,o=e.AABBBounds;let n,r;return t?(r=o.width(),n=r/i.width()):(r=o.height(),n=r/i.height()),n}_updatePositionOfScrollbar(t,e,i){const{isHorizontal:o,currentPage:n,totalPage:r}=this._itemContext,s=(n-1)/r;this._pagerComponent.setScrollRange([s,s+this._computeScrollbarDelta()]),o?this._pagerComponent.setAttributes({x:0,y:i+e}):this._pagerComponent.setAttributes({x:t,y:i})}_bindEventsOfPager(t,e){const i=this.attribute.pager||{},{animation:o=!0,animationDuration:n=450,animationEasing:r="quadIn"}=i,s=this._itemContext.isScrollbar?t=>{const{value:e}=t.detail;let i;return i=0===e[0]?1:1===e[1]?this._itemContext.totalPage:e[0]*this._itemContext.totalPage+1,i}:t=>t.detail.current,l=t=>{const e=this._pagerComponent,i=e.getScrollRange(),{direction:o}=e.attribute,{width:n,height:r}=e.getSliderRenderBounds(),s="vertical"===o?t.deltaY/r:t.deltaX/n;e.setScrollRange([i[0]+s,i[1]+s],!0),this.updateScrollMask()},a=i=>{const l=s(i);if(l!==this._itemContext.currentPage){if(this._itemContext.currentPage=l,this._itemContext&&this._itemContext.startIndex<this._itemContext.items.length){this._renderItems();const t=Math.ceil(this._itemContext.pages/this._itemContext.maxPages);if(this._itemContext.totalPage=t,this._itemContext.isScrollbar&&this._pagerComponent){const t=this._computeScrollbarDelta(),[e]=this._pagerComponent.getScrollRange();this._pagerComponent.setScrollRange([e,e+t])}}if(this._itemContext.isScrollbar){const[t]=this._pagerComponent.getScrollRange();let i;i=this._itemContext.isHorizontal?this._itemsContainer.AABBBounds.width():this._itemsContainer.AABBBounds.height();const s=i*t;this.updateScrollMask(),o?this._itemsContainer.animate().to({[e]:-s},n,r):this._itemsContainer.setAttribute(e,-s)}else o?this._itemsContainer.animate().to({[e]:-(l-1)*t},n,r):this._itemsContainer.setAttribute(e,-(l-1)*t)}};if(this._itemContext.isScrollbar){if(this._pagerComponent.addEventListener("scrollDrag",a),this._pagerComponent.addEventListener("scrollUp",a),this.attribute.pager.roamScroll){const t=50;this.addEventListener("wheel",(t=>t.nativeEvent.preventDefault())),this.addEventListener("wheel",Kt(l,t))}}else this._pagerComponent.addEventListener("toPrev",a),this._pagerComponent.addEventListener("toNext",a)}_renderPager(){const t=this._title?this._title.AABBBounds.height()+gt(this.attribute,"title.space",8):0,{maxWidth:e,maxCol:i=1,maxRow:o=2,item:n={},pager:r={}}=this.attribute,{spaceCol:s=MC,spaceRow:l=TC}=n,a=this._itemsContainer,{space:h=PC,defaultCurrent:d=1}=r,c=IC(r,["space","defaultCurrent"]),{isHorizontal:u}=this._itemContext,g=this._contentMaxHeight;let p,f=0,v=0,m=0,b=0,C=0,y=0,w=1;if(u){if(v=(o-1)*l+this._itemHeight*o,f=e,p=this._createPager(c),this._pagerComponent=p,this._innerView.add(p),m=e-p.AABBBounds.width()-h,m<=0)return this._innerView.removeChild(p),!1;a.getChildren().forEach(((t,e)=>{const{width:i,height:o}=t.attribute;m<C+i&&(C=0,y+=o+l,w+=1),e>0&&t.setAttributes({x:C,y:y}),C+=s+i})),this._itemContext.startX=C,this._itemContext.startY=y,this._itemContext.pages=w;const i=Math.ceil(w/o);this._itemContext.totalPage=i,this._updatePositionOfPager(t,f,v)}else{if(f=this._itemMaxWidth*i+(i-1)*s,v=g,m=f,p=this._createPager(c),this._pagerComponent=p,this._innerView.add(p),b=g-p.AABBBounds.height()-h-t,b<=0)return this._innerView.removeChild(p),!1;a.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;b<y+i&&(y=0,C+=this._itemMaxWidth+s,w+=1),e>0&&t.setAttributes({x:C,y:y}),y+=l+i}));const e=Math.ceil(w/i);this._itemContext.totalPage=e,this._updatePositionOfPager(t,f,v)}d>1&&(u?a.setAttribute("y",-(d-1)*(v+l)):a.setAttribute("x",-(d-1)*(f+s)));const x=Ra.group({x:0,y:t,width:u?m:f,height:u?v:b,clip:!0,pickable:!1});return x.add(a),this._innerView.add(x),this._itemContext.clipContainer=x,this._bindEventsOfPager(u?v+l:f+s,u?"y":"x"),!0}_renderScrollbar(){var t;const e=this._title?this._title.AABBBounds.height()+gt(this.attribute,"title.space",8):0,{maxWidth:i,item:o={},pager:n={}}=this.attribute,{spaceCol:r=MC,spaceRow:s=TC}=o,l=this._itemsContainer,{space:a=PC,defaultCurrent:h=1}=n,d=IC(n,["space","defaultCurrent"]),{isHorizontal:c}=this._itemContext,u=this._contentMaxHeight;let g,p=0,f=0,v=0,m=1;if(c)p=i,f=this._itemHeight,g=this._createScrollbar(d,p),this._pagerComponent=g,this._innerView.add(g);else{if(f=u-e,p=this._itemMaxWidth,g=this._createScrollbar(d,f),this._pagerComponent=g,this._innerView.add(g),f<=0)return this._innerView.removeChild(g),!1;const t=l.getChildren(),i=t.map((t=>t.attribute.height));if(1===i.length||i.every((t=>t===i[0]))){const e=i[0],o=f,n=Math.floor(o/(s+e));f=n*(s+e),m=Math.ceil(t.length/n)}else t.forEach(((t,e)=>{const{height:i}=t.attribute,o=m,n=v;m=Math.floor((v+i)/f)+1,v+=s+i,o!==m&&e===l.getChildren().length-1&&v-f>=1/3*i&&(f=n+i,m-=1)}));this._itemContext.totalPage=m,this._itemContext.pages=m}if(h>1)if(c){const t=this._itemsContainer.AABBBounds.width()-p;l.setAttribute("x",-Math.min((h-1)*(p+r),t))}else{const t=this._itemsContainer.AABBBounds.height()-f;l.setAttribute("y",-Math.min((h-1)*(f+s),t))}const b=Ra.group({x:0,y:e,width:p,height:f,clip:!0,pickable:!1});return b.add(l),this._innerView.add(b),this._itemContext.clipContainer=b,this._updatePositionOfScrollbar(p,f,e),(null===(t=n.scrollMask)||void 0===t?void 0:t.visible)&&this.renderScrollMask(b),this._bindEventsOfPager(c?p:f,c?"x":"y"),!0}renderScrollMask(t){const{scrollMask:e={}}=this.attribute.pager,{visible:i=!0,gradientLength:o=16,gradientStops:n}=e;if(!i||!n)return;const r=t.AABBBounds.width(),s=t.AABBBounds.height(),l=this._itemContext.isHorizontal?r:s,a=n.map((t=>({offset:o*t.offset/l,color:t.color}))),h=n.map((t=>({offset:(l-o*t.offset)/l,color:t.color}))),d=Ra.rect({x:0,y:0,width:r,height:s});this._scrollMask=d,this._scrollMaskContext={startStops:a,endStops:h},this.updateScrollMask(),t.add(d)}updateScrollMask(){if(!this._scrollMask||!this._pagerComponent)return;if(!this._itemContext.isScrollbar)return;const[t,e]=this._pagerComponent.getScrollRange(),i=[];Wt(Ut(e,0,1),1)||i.push(...this._scrollMaskContext.endStops),Wt(Ut(t,0,1),0)||i.push(...this._scrollMaskContext.startStops),i.length&&(this._itemContext.isHorizontal?this._scrollMask.setAttributes({fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:i}}):this._scrollMask.setAttributes({fill:{gradient:"linear",x0:0,y0:0,x1:0,y1:1,stops:i}}))}_renderPagerComponent(){return this._itemContext.isScrollbar?this._renderScrollbar():this._renderPager(),!0}_hover(t,e){this._lastActiveItem=t,t.hasState(EC.selected)?this._setLegendItemState(t,EC.selectedHover,e):this._setLegendItemState(t,EC.unSelectedHover,e);const i=t.getChildren()[0].find((t=>t.name===LC.focus),!1);i&&i.setAttribute("visible",!0),this._dispatchLegendEvent(kC.legendItemHover,t,e)}_unHover(t,e){let i=!1;(t.hasState(EC.unSelectedHover)||t.hasState(EC.selectedHover))&&(i=!0),t.removeState(EC.unSelectedHover),t.removeState(EC.selectedHover),t.getChildren()[0].getChildren().forEach((t=>{i||!t.hasState(EC.unSelectedHover)&&!t.hasState(EC.selectedHover)||(i=!0),t.removeState(EC.unSelectedHover),t.removeState(EC.selectedHover)}));const o=t.getChildren()[0].find((t=>t.name===LC.focus),!1);o&&o.setAttribute("visible",!1),i&&this._dispatchLegendEvent(kC.legendItemAttributeUpdate,t,e),this._dispatchLegendEvent(kC.legendItemUnHover,t,e)}_setLegendItemState(t,e,i){let o=!1;t.hasState(e)||(o=!0),t.addState(e,!0),t.getChildren()[0].getChildren().forEach((t=>{t.name!==LC.focus&&(o||t.hasState(e)||(o=!0),t.addState(e,!0))})),o&&this._dispatchLegendEvent(kC.legendItemAttributeUpdate,t,i)}_removeLegendItemState(t,e,i){let o=!1;e.forEach((e=>{!o&&t.hasState(e)&&(o=!0),t.removeState(e)})),t.getChildren()[0].getChildren().forEach((t=>{t.name!==LC.focus&&e.forEach((e=>{!o&&t.hasState(e)&&(o=!0),t.removeState(e)}))})),o&&this._dispatchLegendEvent(kC.legendItemAttributeUpdate,t,i)}_getSelectedLegends(){var t;const e=[];return null===(t=this._itemsContainer)||void 0===t||t.getChildren().forEach((t=>{t.hasState(EC.selected)&&e.push(t.data)})),e}_appendDataToShape(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};t.name=e,t.data=i,t.delegate=o,t.states=yt({},OC,n)}_dispatchLegendEvent(t,e,i){const o=this._getSelectedLegends();o.sort(((t,e)=>t.index-e.index));const n=o.map((t=>t.label));this._dispatchEvent(t,{item:e,data:e.data,selected:e.hasState(EC.selected),currentSelectedItems:o,currentSelected:n,event:i})}_handleStyle(t,e,i,o,n){const r={};return t.style&&(Y(t.style)?r.style=t.style(e,i,o,n):r.style=t.style),t.state&&(r.state={},Object.keys(t.state).forEach((s=>{t.state[s]&&(Y(t.state[s])?r.state[s]=t.state[s](e,i,o,n):r.state[s]=t.state[s])}))),r}release(){super.release(),this.removeAllEventListeners()}}var WC;function NC(t){return et(t)?t:[t,t]}function GC(t){return t?"ew-resize":"ns-resize"}DC.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:MC,spaceRow:TC,shape:{space:8,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{opacity:.5}}},label:{space:8,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:10,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:PC,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0},function(t){t.innerView="innerView",t.railContainer="sliderRailContainer",t.rail="sliderRail",t.startText="sliderStartText",t.endText="sliderEndText",t.startHandler="sliderStartHandler",t.startHandlerText="startHandlerText",t.endHandler="sliderEndHandler",t.endHandlerText="sliderEndHandlerText",t.track="sliderTrack",t.trackContainer="sliderTrackContainer"}(WC||(WC={})),FC();class jC extends gg{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}get tooltipShape(){return this._tooltipShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:yt({},jC.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onTooltipShow=t=>{this._isChanging||this._tooltipState&&this._tooltipState.isActive||(this._tooltipState?this._tooltipState.isActive=!0:this._tooltipState={isActive:!0},this._onTooltipUpdate(t),this._dispatchTooltipEvent("sliderTooltipShow"))},this._onTooltipUpdate=t=>{if(this._isChanging||!this._tooltipState||!this._tooltipState.isActive)return;const e=this._isHorizontal?this._rail.globalAABBBounds.width():this._rail.globalAABBBounds.height(),i=Ut(this._isHorizontal?(t.viewX-this._rail.globalAABBBounds.x1)/e:(t.viewY-this._rail.globalAABBBounds.y1)/e,0,1);i!==this._tooltipState.pos&&(this._tooltipState.pos=i,this._tooltipState.value=this.calculateValueByPos(i*e),this._updateTooltip(),this._dispatchTooltipEvent("sliderTooltipUpdate"))},this._onTooltipHide=()=>{const{tooltip:t}=this.attribute;t&&t.alwaysShow||(this._tooltipState=null,this._tooltipShape&&this._tooltipShape.setAttribute("visible",!1),this._tooltipText&&this._tooltipText.setAttribute("visible",!1),this._dispatchTooltipEvent("sliderTooltipHide"))},this._onHandlerPointerdown=t=>{t.stopPropagation(),this._isChanging=!0;const{x:e,y:i}=this.stage.eventPointTransform(t);this._currentHandler=t.target,this._prePos=this._isHorizontal?e:i,"browser"===uu.env?(uu.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),uu.addEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onHandlerPointerUp),this.stage.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=t=>{var e,i;t.stopPropagation(),this._isChanging=!0;const{railWidth:o,railHeight:n,min:r,max:s}=this.attribute;if(s===r)return;const{x:l,y:a}=this.stage.eventPointTransform(t);let h,d,c,u=0;this._isHorizontal?(h=l,u=h-this._prePos,d=null===(i=this._currentHandler)||void 0===i?void 0:i.attribute.x,c=o):(h=a,u=h-this._prePos,d=null===(e=this._currentHandler)||void 0===e?void 0:e.attribute.y,c=n);const g=Ut(d+u,0,c),p=this.calculateValueByPos(g);"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,g,p):this._updateHandler(this._currentHandler,g,p),this._updateTrack(),this._prePos=h,this._dispatchChangeEvent()},this._onHandlerPointerUp=t=>{t.preventDefault(),this._isChanging=!1,this._currentHandler=null,"browser"===uu.env?(uu.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),uu.removeEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onHandlerPointerUp),this.stage.removeEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onTrackPointerdown=t=>{t.stopPropagation(),this._isChanging=!0;const{x:e,y:i}=this.stage.eventPointTransform(t);this._prePos=this._isHorizontal?e:i,"browser"===uu.env?(uu.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),uu.addEventListener("pointerup",this._onTrackPointerUp)):(this.stage.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onTrackPointerUp),this.stage.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=t=>{t.stopPropagation(),this._isChanging=!0;const{railWidth:e,railHeight:i,min:o,max:n,inverse:r}=this.attribute;if(n===o)return;const{startHandler:s,endHandler:l}=this._getHandlers();let a,h,d;const{x:c,y:u}=this.stage.eventPointTransform(t);this._isHorizontal?(a=c,h=this._track.attribute.width,d=e):(a=u,h=this._track.attribute.height,d=i);const g=a-this._prePos;if(s){const t=this._isHorizontal?s.attribute.x:s.attribute.y,e=r?Ut(t+g,h,d):Ut(t+g,0,d-h),i=this.calculateValueByPos(e);this._updateHandler(s,e,i)}if(l){const t=this._isHorizontal?l.attribute.x:l.attribute.y,e=r?Ut(t+g,0,d-h):Ut(t+g,h,d),i=this.calculateValueByPos(e),o=null==s?void 0:s.attribute;this._updateHandler(l,e,i),this._track.setAttributes(this._isHorizontal?{x:Math.min(o.x,l.attribute.x),width:Math.abs(o.x-l.attribute.x)}:{y:Math.min(o.y,l.attribute.y),height:Math.abs(o.y-l.attribute.y)})}this._prePos=a,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{t.preventDefault(),this._isChanging=!1,"browser"===uu.env?(uu.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),uu.removeEventListener("pointerup",this._onTrackPointerUp)):(this.stage.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onTrackPointerUp),this.stage.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=t=>{t.stopPropagation(),this._isChanging=!0;const{railWidth:e,railHeight:i,min:o,max:n}=this.attribute;if(n===o)return;const r=this._startHandler,s=this._endHandler;let l,a,h;this._isHorizontal?(l=t.viewX-this._rail.globalAABBBounds.x1,a=null==r?void 0:r.attribute.x,h=null==s?void 0:s.attribute.x):(l=t.viewY-this._rail.globalAABBBounds.y1,a=null==r?void 0:r.attribute.y,h=null==s?void 0:s.attribute.y);const d=this.calculateValueByPos(l);if(K(h)){const t=Math.abs(l-a)>Math.abs(l-h)?s:r;this._updateHandler(t,l,d)}else this._updateHandler(r,l,d);this._updateTrack(),this._dispatchChangeEvent()}}calculatePosByValue(t,e){const{layout:i,railWidth:o,railHeight:n,min:r,max:s,inverse:l}=this.attribute;let a=0;return a=r===s?"start"===e?0:"end"===e?1:0:(t-r)/(s-r),(l?1-a:a)*("vertical"===i?n:o)}calculateValueByPos(t){const{layout:e,railWidth:i,railHeight:o,min:n,max:r,inverse:s}=this.attribute,l="vertical"===e?o:i;return n+(r-n)*(s?1-t/l:t/l)}setValue(t){const{min:e,max:i}=this.attribute;if(i===e)return;const[o,n]=Rt(t),{startHandler:r,endHandler:s}=this._getHandlers();r&&this._updateHandler(r,this.calculatePosByValue(o),o),s&&this._updateHandler(s,this.calculatePosByValue(n),n),this._updateTrack()}render(){var t,e;this.removeAllChild(!0);const{layout:i="horizontal",railWidth:o,railHeight:n,startText:r,endText:s,min:l,max:a,showHandler:h=!0,showTooltip:d}=this.attribute;let{value:c}=this.attribute;X(c)&&(c=[l,a]),this._currentValue={startValue:NC(c)[0],endValue:NC(c)[1]};const u="horizontal"===i;this._isHorizontal=u;const g=Ra.group({x:0,y:0});g.name=WC.innerView,this.add(g),this._innerView=g;let p,f=0;if(r&&r.visible){p=Ra.text(Object.assign({x:u?0:o/2,y:u?n/2:0,textAlign:u?"start":"center",textBaseline:u?"middle":"top",text:r.text,lineHeight:null===(t=r.style)||void 0===t?void 0:t.fontSize},r.style)),p.name=WC.startText,g.add(p);const e=K(r.space)?r.space:0;f+=(u?p.AABBBounds.width():p.AABBBounds.height())+e}const v=Ra.group({x:u?f:0,y:u?0:f});g.add(v);const m=Ra.group({x:0,y:0});let b;if(m.name=WC.railContainer,this._railContainer=m,v.add(m),this._mainContainer=v,this._renderRail(m),f+=u?o:n,s&&s.visible){const t=K(s.space)?s.space:0;b=Ra.text(Object.assign({x:u?f+t:o/2,y:u?n/2:f+t,textAlign:u?"start":"center",textBaseline:u?"middle":"top",text:s.text,lineHeight:null===(e=s.style)||void 0===e?void 0:e.fontSize},s.style)),b.name=WC.endText,g.add(b)}this._renderTrack(m),h&&(this._renderHandlers(v),this._bindEvents()),d&&(this._renderTooltip(),this._bindTooltipEvents())}_renderRail(t){const{railWidth:e,railHeight:i,railStyle:o,slidable:n}=this.attribute;let r="default";!1!==n&&(r="pointer");const s=Ra.rect(Object.assign({x:0,y:0,width:e,height:i,cursor:r},o));return s.name=WC.rail,t.add(s),this._rail=s,s}_renderHandlers(t){const{range:e,min:i,max:o,handlerSize:n=14,handlerStyle:r,handlerText:s,railHeight:l,railWidth:a,slidable:h}=this.attribute;let{value:d}=this.attribute;X(d)&&(d=[i,o]);const c=s&&s.visible,u=this._isHorizontal,[g,p]=NC(d),f=this.calculatePosByValue(g,e?"start":"end"),v=this._renderHandler(Object.assign({x:u?f:a/2,y:u?l/2:f,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":GC(u)},r));if(v.name=WC.startHandler,this._startHandler=v,t.add(v),this._currentValue.startPos=f,c){const i=this._renderHandlerText(g,e?"start":"end");i.name=WC.startHandlerText,t.add(i),this._startHandlerText=i}if(e){const e=this.calculatePosByValue(p,"end"),i=this._renderHandler(Object.assign({x:u?e:a/2,y:u?l/2:e,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":GC(u)},r));if(i.name=WC.endHandler,this._endHandler=i,t.add(i),this._currentValue.endPos=e,c){const e=this._renderHandlerText(p,"end");e.name=WC.endHandlerText,t.add(e),this._endHandlerText=e}}}_renderTrack(t){const{range:e,min:i,max:o,railHeight:n,railWidth:r,trackStyle:s,railStyle:l,slidable:a,value:h}=this.attribute;let d,c;if(X(h))e?(d=i,c=o):d=c=i;else if(e){const t=Vt(h,i,o);d=t[0],c=t[1]}else d=i,c=Ut(h,i,o);const u=this._isHorizontal;e||(d=i);const g=Ra.group({x:0,y:0,width:r,height:n,cornerRadius:null==l?void 0:l.cornerRadius,clip:!0,pickable:!1});g.name=WC.trackContainer;const p=Z(e)&&!0===e.draggableTrack;let f;f=!1===a?"default":!1===e||!1===p?"pointer":GC(u);const v=this.calculatePosByValue(d,"start"),m=this.calculatePosByValue(c,e?"end":"start"),b=Ra.rect(Object.assign({x:u?Math.min(v,m):0,y:u?0:Math.min(v,m),width:u?Math.abs(m-v):r,height:u?n:Math.abs(m-v),cursor:f},s));b.name=WC.track,this._track=b,g.add(b),t.add(g)}_renderHandler(t){return Ra.symbol(t)}_renderHandlerText(t,e){var i,o,n;const{align:r,handlerSize:s=14,handlerText:l={},railHeight:a,railWidth:h,slidable:d}=this.attribute,c=this._isHorizontal,u=this.calculatePosByValue(t,e),g=null!==(i=l.space)&&void 0!==i?i:4,p={text:l.formatter?l.formatter(t):t.toFixed(null!==(o=l.precision)&&void 0!==o?o:0),lineHeight:null===(n=l.style)||void 0===n?void 0:n.lineHeight,cursor:!1===d?"default":GC(c)};return c?"top"===r?(p.textBaseline="bottom",p.textAlign="center",p.x=u,p.y=(a-s)/2-g):(p.textBaseline="top",p.textAlign="center",p.x=u,p.y=(a+s)/2+g):"left"===r?(p.textBaseline="middle",p.textAlign="end",p.x=(h-s)/2-g,p.y=u):(p.textBaseline="middle",p.textAlign="start",p.x=(h+s)/2+g,p.y=u),Ra.text(Object.assign(Object.assign({},p),l.style))}_renderTooltip(){var t;const{tooltip:e,railHeight:i,railWidth:o,align:n}=this.attribute;e&&e.alwaysShow?this._tooltipState={value:this._currentValue.startValue,pos:this._currentValue.startPos}:this._tooltipState=null;const r=this._isHorizontal?0:o/2,s=this._isHorizontal?i/2:0;if(e&&e.shape){const t=Ra.symbol(Object.assign({pickable:!1,visible:!!this._tooltipState,x:r,y:s,symbolType:"circle"},e.shapeStyle));this._tooltipShape=t,this._mainContainer.add(t)}const l=e&&e.text||{},a=null!==(t=l.space)&&void 0!==t?t:6,h={pickable:!1,visible:!!this._tooltipState,text:""};this._isHorizontal?(h.x=r,h.y="top"===n?s-i/2-a:s+i/2+a,h.textAlign="center",h.textBaseline="top"===n?"bottom":"top"):(h.y=s,h.x="left"===n?r-o/2-a:s+o/2+a,h.textAlign="left"===n?"end":"start",h.textBaseline="middle");const d=Ra.text(Object.assign(Object.assign({},h),l.style));this._mainContainer.add(d),this._tooltipText=d,this._tooltipState&&this._updateTooltip()}_updateTooltip(){var t,e;if(!this._tooltipShape&&!this._tooltipText||!this._tooltipState)return;const{railWidth:i,railHeight:o}=this.attribute,n=this._isHorizontal?i:o,r=this._tooltipState.pos*n,s=this._isHorizontal?"x":"y";this._tooltipShape&&this._tooltipShape.setAttributes({visible:!0,[s]:r});const{align:l}=this.attribute;if(this._tooltipText){const i=this.attribute.tooltip&&this.attribute.tooltip.text||{};this._tooltipText.setAttributes({visible:!0,[s]:r,text:i.formatter?i.formatter(this._tooltipState.value):this._isHorizontal||"left"!==l?`≈ ${this._tooltipState.value.toFixed(null!==(e=i.precision)&&void 0!==e?e:0)}`:`${this._tooltipState.value.toFixed(null!==(t=i.precision)&&void 0!==t?t:0)} ≈`})}}_bindEvents(){if(this.attribute.disableTriggerEvent)return;const{slidable:t,range:e}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),Z(e)&&e.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_bindTooltipEvents(){this.attribute.disableTriggerEvent||(this._mainContainer.addEventListener("pointerenter",this._onTooltipShow),this._mainContainer.addEventListener("pointermove",this._onTooltipUpdate),this._mainContainer.addEventListener("pointerleave",this._onTooltipHide))}_updateTrack(){const{inverse:t,railWidth:e,railHeight:i}=this.attribute,o=this._startHandler,n=this._endHandler;if(this._isHorizontal){const i=null==o?void 0:o.attribute.x;if(n){const t=null==n?void 0:n.attribute.x;this._track.setAttributes({x:Math.min(i,t),width:Math.abs(i-t)})}else t?this._track.setAttributes({x:i,width:e-i}):this._track.setAttributes({width:i})}else{const e=null==o?void 0:o.attribute.y;if(n){const t=null==n?void 0:n.attribute.y;this._track.setAttributes({y:Math.min(e,t),height:Math.abs(e-t)})}else t?this._track.setAttributes({y:e,height:i-e}):this._track.setAttributes({height:e})}}_updateHandler(t,e,i){var o;const n=this._isHorizontal;t.setAttribute(n?"x":"y",e);const r=t.name===WC.startHandler?this._startHandlerText:this._endHandlerText;if(r){const{handlerText:t={}}=this.attribute;r.setAttributes({text:t.formatter?t.formatter(i):i.toFixed(null!==(o=t.precision)&&void 0!==o?o:0),[n?"x":"y"]:e})}t.name===WC.startHandler?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_updateHandlerText(t,e,i){var o;const n=this._isHorizontal,{handlerText:r={}}=this.attribute;t.setAttributes({[n?"x":"y"]:e,text:r.formatter?r.formatter(i):i.toFixed(null!==(o=r.precision)&&void 0!==o?o:0)});const s=t.name===WC.startHandlerText?this._startHandler:this._endHandler;s&&s.setAttributes({[n?"x":"y"]:e}),t.name===WC.startHandlerText?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_dispatchChangeEvent(){const t=!!this.attribute.range,e=this._currentValue;this._dispatchEvent("change",{value:t?[Math.min(e.endValue,e.startValue),Math.max(e.endValue,e.startValue)]:e.startValue,position:t?[Math.min(e.endPos,e.startPos),Math.max(e.endPos,e.startPos)]:e.startPos})}_dispatchTooltipEvent(t){this._dispatchEvent("sliderTooltip",{type:t,position:this._tooltipState&&this._tooltipState.pos,value:this._tooltipState&&this._tooltipState.value})}_getHandlers(){const{inverse:t}=this.attribute;let e=this._startHandler,i=this._endHandler;return i?(this._isHorizontal?(!t&&i.attribute.x<(null==e?void 0:e.attribute.x)||t&&i.attribute.x>(null==e?void 0:e.attribute.x))&&([e,i]=[i,e]):(!t&&i.attribute.y<(null==e?void 0:e.attribute.y)||t&&i.attribute.y>(null==e?void 0:e.attribute.y))&&([e,i]=[i,e]),{startHandler:e,endHandler:i}):{startHandler:e,endHandler:i}}}jC.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},tooltip:{shapeStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},text:{style:{fill:"#2C3542",fontSize:12}}},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}},zC(),FC();class UC extends HC{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:yt({},UC.defaultAttributes,t)),this.name="colorLegend",this._onSliderToolipChange=t=>{const e=this._slider.tooltipShape;if(e&&t.detail&&!X(t.detail.value)){const i=this._colorScale.scale(t.detail.value);e.setAttribute("fill",i)}this.dispatchEvent(t)},this._onSliderChange=t=>{this._updateColor(),this.dispatchEvent(t)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){const{colors:t,slidable:e,layout:i,align:o,min:n,max:r,value:s,railWidth:l,railHeight:a,showHandler:h=!0,handlerSize:d,handlerStyle:c,railStyle:u,trackStyle:g,startText:p,endText:f,handlerText:v,showTooltip:m,tooltip:b,inverse:C,disableTriggerEvent:y}=this.attribute,w=[],x=(r-n)/(t.length-1);for(let e=0;e<t.length;e++)w.push(n+x*e);this._colorScale=(new hC).domain(w,!0).range(t),this._color=this._getTrackColor();const _=new jC({x:0,y:0,range:{draggableTrack:!0},slidable:e,layout:i,align:o,min:n,max:r,value:s,railWidth:l,railHeight:a,showHandler:h,handlerSize:d,handlerStyle:c,railStyle:u,trackStyle:Object.assign({fill:this._color},g),startText:p,endText:f,handlerText:v,showTooltip:m,tooltip:b,disableTriggerEvent:y,inverse:C});this._innerView.add(_),this._slider=_,_.translateTo(0-_.AABBBounds.x1,(this._title?this._title.AABBBounds.height()+gt(this.attribute,"title.space",12):0)-_.AABBBounds.y1),this._updateColor()}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&(this._slider.addEventListener("change",this._onSliderChange),this._slider.addEventListener("sliderTooltip",this._onSliderToolipChange))}_getTrackColor(){const{colors:t,layout:e,inverse:i}=this.attribute;if(ut(t))return;const o=t.length;if(1===o)return t[0];const n=[];for(let e=0;e<o;e++){const i=e/(o-1);n.push({offset:i,color:t[e]})}const r="horizontal"===e,s={gradient:"linear",stops:n,x0:0,y0:0,x1:r?1:0,y1:r?0:1};return i&&(r?(s.x0=1,s.x1=0):(s.y0=1,s.y1=0)),s}_updateColor(){var t;const{layout:e="horizontal",colors:i,railWidth:o,railHeight:n}=this.attribute,{startHandler:r,endHandler:s,track:l,attribute:a}=this._slider,{startValue:h,endValue:d,startPos:c,endPos:u}=this._slider.currentValue,g=null===(t=a.handlerStyle)||void 0===t?void 0:t.fill;if(r&&!g){const t=this._colorScale.scale(h);r.setAttribute("fill",t)}if(s&&!g){const t=this._colorScale.scale(d);s.setAttribute("fill",t)}const p="horizontal"===e?o:n;if(Math.abs(c-u)!==p&&i&&i.length>1){const t=this._color.stops,e=Math.min(c,u),i=Math.max(c,u),o=e/p,n=i/p,r=n-o,s=t.filter((t=>t.offset>o&&t.offset<n)),a=Math.min(h,d),g=Math.max(h,d),f=this._colorScale.scale(a),v=this._colorScale.scale(g),m=[{offset:0,color:f}];s.forEach((t=>{m.push({offset:(t.offset-o)/r,color:t.color})})),m.push({offset:1,color:v}),l.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:m}))}}}function VC(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"bottom",e=0;return"top"===t?`\n M${e},-6L${e-3.5},-2.5\n v5\n h7\n v-5\n Z\n`:"left"===t?(e=1,`\n M${e-6},0L${e-6+2.5},-3.5\n h5\n v7\n h-5\n Z\n`):"right"===t?(e=-1,`\n M${e+6},0L${e+6-2.5},-3.5\n h-5\n v7\n h5\n Z\n `):`\n M${e},6L${e-3.5},2.5\n v-5\n h7\n v5\n Z\n`}UC.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{fill:null,lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}},tooltip:{shapeStyle:{lineWidth:4,stroke:"#fff"}}},zC(),FC(),Jv();class $C extends HC{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:yt({},$C.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=t=>{this.dispatchEvent(t)},this._onSliderToolipChange=t=>{this.dispatchEvent(t)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){const{slidable:t,layout:e,align:i,min:o,max:n,value:r,railWidth:s,railHeight:l,showHandler:a=!0,handlerSize:h,handlerStyle:d,railStyle:c,trackStyle:u,startText:g,endText:p,handlerText:f,showTooltip:v,tooltip:m,sizeBackground:b,disableTriggerEvent:C,inverse:y}=this.attribute,w=Ra.group({x:0,y:0});this._innerView.add(w);const x=new jC({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:e,align:i,min:o,max:n,value:r,railWidth:s,railHeight:l,showHandler:a,handlerSize:h,handlerStyle:Object.assign({symbolType:VC(i)},d),railStyle:c,trackStyle:u,startText:g,endText:p,handlerText:f,showTooltip:v,tooltip:m,disableTriggerEvent:C,inverse:y});w.add(x);let _,S=0;"horizontal"===e?"top"===i?(_=`M0,0L${s},0L${y?0:s},12Z`,S=l):(_=`M0,12L${s},12L${y?0:s},0Z`,x.setAttribute("y",12)):"left"===i?_=`M${s},0L${s+12},${y?0:l}L${s},${l}Z`:(_=`M0,${y?0:l}L12,${l}L12,0Z`,x.setAttribute("x",12));const A=Ra.path(Object.assign(Object.assign({x:0,y:S,path:_},b),{zIndex:0}));w.add(A);const R=this._title?this._title.AABBBounds.height()+gt(this.attribute,"title.space",12):0;w.translate(0-w.AABBBounds.x1,R-w.AABBBounds.y1),this._slider=x}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&(this._slider.addEventListener("change",this._onSliderChange),this._slider.addEventListener("sliderTooltip",this._onSliderToolipChange))}}$C.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}},$v(),dm(),nm();let YC=class t extends gg{constructor(e,i){super((null==i?void 0:i.skipDefault)?e:yt({},t.defaultAttributes,e)),this.name="title"}render(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;const{textType:b,text:C,subtextType:y,textStyle:w={},subtext:x,subtextStyle:_={},width:S,height:A,minWidth:R,maxWidth:B,minHeight:M,maxHeight:T,align:P,verticalAlign:E,padding:k=0}=this.attribute,L=Ze(k),H=this.createOrUpdateChild("title-container",{x:L[3],y:L[0],zIndex:1},"group");if(!1!==this.attribute.visible&&!1!==w.visible){const{width:l,height:a,maxHeight:h,maxWidth:d,x:c=0,y:u=0,ellipsis:g=!0,wordBreak:p="break-word",maxWidth:f,lineClamp:v}=w;if("rich"===b||K(w.character)){const o=Object.assign({x:c,y:u,width:null!==(t=null!=l?l:S)&&void 0!==t?t:0,height:null!==(e=null!=a?a:A)&&void 0!==e?e:0,ellipsis:null==g||g,wordBreak:null!=p?p:"break-word",maxHeight:null!=h?h:T,maxWidth:null!=d?d:f,textConfig:null!==(i=w.character)&&void 0!==i?i:C},w);this._mainTitle=H.createOrUpdateChild("mainTitle",o,"richtext")}else if("html"===b){const t=Object.assign({html:Object.assign(Object.assign({dom:C},mm),w),x:c,y:u,width:null!==(o=null!=l?l:S)&&void 0!==o?o:0,height:null!==(n=null!=a?a:A)&&void 0!==n?n:0,ellipsis:g,wordBreak:p,maxHeight:null!=h?h:T,maxWidth:null!=d?d:f,textConfig:[]},w);this._mainTitle=H.createOrUpdateChild("mainTitle",t,"richtext")}else K(C)&&(this._mainTitle=H.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:et(C)?C:[C],whiteSpace:"normal"},w),{maxLineWidth:null!==(s=null!==(r=w.maxLineWidth)&&void 0!==r?r:l)&&void 0!==s?s:S,heightLimit:null!=a?a:T,lineClamp:v,ellipsis:g,x:c,y:u}),"text"))}const F=this._mainTitle?this._mainTitle.AABBBounds.height():0,z=this._mainTitle?this._mainTitle.AABBBounds.width():0;if(!1!==this.attribute.visible&&!1!==_.visible){const{width:t,height:e,maxWidth:i,maxHeight:o,x:n=0,y:r=0,ellipsis:s=!0,wordBreak:p="break-word",lineClamp:f}=_,v=Math.max(Number.MIN_VALUE,T-F);if("rich"===y||K(_.character)){const d=Object.assign({x:n,y:r,width:null!==(l=null!=t?t:S)&&void 0!==l?l:0,height:null!==(a=null!=e?e:A)&&void 0!==a?a:0,ellipsis:s,wordBreak:p,maxHeight:null!=o?o:v,maxWidth:null!=i?i:B,textConfig:null!==(h=_.character)&&void 0!==h?h:x},_);this._subTitle=H.createOrUpdateChild("subTitle",d,"richtext")}else if("html"===y){const l=Object.assign({html:Object.assign(Object.assign({dom:x},mm),_),x:n,y:r,width:null!==(d=null!=t?t:S)&&void 0!==d?d:0,height:null!==(c=null!=e?e:A)&&void 0!==c?c:0,ellipsis:s,wordBreak:p,maxHeight:null!=o?o:v,maxWidth:null!=i?i:B,textConfig:[]},_);this._subTitle=H.createOrUpdateChild("subTitle",l,"richtext")}else K(x)&&(this._subTitle=H.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:et(x)?x:[x],whiteSpace:"normal"},_),{maxLineWidth:null!==(u=_.maxLineWidth)&&void 0!==u?u:S,heightLimit:null!==(g=_.heightLimit)&&void 0!==g?g:v,lineClamp:f,ellipsis:s,x:0,y:F}),"text"))}const I=this._subTitle?this._subTitle.AABBBounds.height():0,O=this._subTitle?this._subTitle.AABBBounds.width():0;let D=Math.max(z,O),W=F+(null!==(p=_.height)&&void 0!==p?p:I);if(K(S)&&(D=S),K(A)&&(W=A),K(R)&&D<R&&(D=R),K(B)&&D>B&&(D=B),K(M)&&W<M&&(W=M),K(T)&&W>T&&(W=T),H.attribute.width=D,H.attribute.height=W,H.attribute.boundsPadding=L,this._mainTitle){if(K(P)||K(w.align)){const t=w.align?w.align:P,e=null!==(f=w.width)&&void 0!==f?f:z;"left"===t?(this._mainTitle.setAttribute("x",0),this._mainTitle.setAttribute("textAlign","left")):"center"===t?(this._mainTitle.setAttribute("x",e/2),this._mainTitle.setAttribute("textAlign","center")):"right"===t&&(this._mainTitle.setAttribute("x",e),this._mainTitle.setAttribute("textAlign","right"))}if(K(E)||K(w.verticalAlign)){const t=w.verticalAlign?w.verticalAlign:E,e=w.height?w.height:W;"top"===t?(this._mainTitle.setAttribute("y",0),this._mainTitle.setAttribute("textBaseline","top")):"middle"===t?(this._mainTitle.setAttribute("y",e/2),this._mainTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._mainTitle.setAttribute("y",e),this._mainTitle.setAttribute("textBaseline","bottom"))}}if(this._subTitle){if(K(P)||K(_.align)){const t=_.align?_.align:P,e=null!==(v=_.width)&&void 0!==v?v:O;"left"===t?(this._subTitle.setAttribute("x",0),this._subTitle.setAttribute("textAlign","left")):"center"===t?(this._subTitle.setAttribute("x",e/2),this._subTitle.setAttribute("textAlign","center")):"right"===t&&(this._subTitle.setAttribute("x",e),this._subTitle.setAttribute("textAlign","right"))}if(K(E)||K(w.verticalAlign)){const t=_.verticalAlign?_.verticalAlign:E,e=F,i=null!==(m=_.height)&&void 0!==m?m:0;"top"===t?(this._subTitle.setAttribute("y",e),this._subTitle.setAttribute("textBaseline","top")):"middle"===t?(this._subTitle.setAttribute("y",e+i/2),this._subTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._subTitle.setAttribute("y",e+i),this._subTitle.setAttribute("textBaseline","bottom"))}}}};YC.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};$v(),im(),dm(),Xv();class XC extends gg{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:yt({},XC.defaultAttributes,t)),this._handlePointerUp=()=>{this.attribute.disabled||(this.attribute.checked?(this.setAttribute("checked",!1),this.setAttribute("indeterminate",!1)):(this.setAttribute("checked",!0),this.setAttribute("indeterminate",!1)),this._dispatchEvent("checkbox_state_change",{eventType:"checkbox_state_change",checked:this.attribute.checked}),this.stage.renderNextFrame())},this.renderGroup(),this.onBeforeAttributeUpdate=(t,e,i)=>{"interactive"in t&&this.setAttribute("pickable",t.interactive),"disabled"in t&&this.setAttribute("cursor",t.disable?this.attribute.disableCursor:this.attribute.cursor)},this.addEventListener("pointerup",this._handlePointerUp)}render(){this.removeAllChild(!0),this.renderBox(),this.renderIcon(),this.renderText(),this.layout()}renderBox(){this._box=new ec(yt({},this.attribute.box));const t=this.attribute.checked||this.attribute.indeterminate;t&&this.attribute.disabled?this._box.setAttributes({fill:this.attribute.box.disableCheckedFill,stroke:this.attribute.box.disableCheckedStroke}):t?this._box.setAttributes({fill:this.attribute.box.checkedFill,stroke:this.attribute.box.checkedStroke}):this.attribute.disabled&&this._box.setAttributes({fill:this.attribute.box.disableFill}),this.appendChild(this._box)}renderIcon(){this._checkIcon=new sc(yt({image:this.attribute.icon.checkIconImage},this.attribute.icon)),this.appendChild(this._checkIcon),this._indeterminateIcon=new sc(yt({image:this.attribute.icon.indeterminateIconImage},this.attribute.icon)),this.appendChild(this._indeterminateIcon),this.attribute.checked?(this._checkIcon.setAttribute("visible",!0),this._indeterminateIcon.setAttribute("visible",!1)):this.attribute.indeterminate?(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!0)):(this._checkIcon.setAttribute("visible",!1),this._indeterminateIcon.setAttribute("visible",!1))}renderText(){this._text=new Ih(yt({wrap:!0},this.attribute.text)),this.attribute.disabled&&this._text.setAttribute("fill",this.attribute.text.disableFill),this.appendChild(this._text)}renderGroup(){this.attribute.interactive||this.setAttribute("pickable",!1),this.attribute.disabled&&this.setAttribute("cursor",this.attribute.disableCursor)}layout(){const t=this.attribute.box.height,e=this.attribute.icon.height,i=this._text.AABBBounds.height(),o=Math.max(t,e,i),n=o/2-t/2,r=o/2-e/2,s=o/2-i/2,l=this.attribute.box.width,a=this.attribute.icon.width,h=Math.max(l,a),d=h/2-l/2,c=h/2-a/2,u=h+this.attribute.spaceBetweenTextAndIcon;this._box.setAttributes({x:d,y:n}),this._checkIcon.setAttributes({x:c,y:r}),this._indeterminateIcon.setAttributes({x:c,y:r}),this._text.setAttributes({x:u,y:s})}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:yt({},XC.defaultAttributes,t),super.initAttributes(t),this.renderGroup(),this.render()}}XC.defaultAttributes={interactive:!0,disabled:!1,checked:!1,indeterminate:!1,cursor:"pointer",disableCursor:"not-allowed",spaceBetweenTextAndIcon:8,text:{text:"text",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",textBaseline:"top",pickable:!1},icon:{checkIconImage:'<svg width="200" height="200" viewBox="0 0 1024 1024" fill="#fff" xmlns="http://www.w3.org/2000/svg"><path d="M877.44815445 206.10060629a64.72691371 64.72691371 0 0 0-95.14856334 4.01306852L380.73381888 685.46812814 235.22771741 533.48933518a64.72691371 64.72691371 0 0 0-92.43003222-1.03563036l-45.82665557 45.82665443a64.72691371 64.72691371 0 0 0-0.90617629 90.61767965l239.61903446 250.10479331a64.72691371 64.72691371 0 0 0 71.19960405 15.14609778 64.33855261 64.33855261 0 0 0 35.08198741-21.23042702l36.24707186-42.71976334 40.5190474-40.77795556-3.36579926-3.49525333 411.40426297-486.74638962a64.72691371 64.72691371 0 0 0-3.88361443-87.64024149l-45.3088404-45.43829334z"></path></svg>',indeterminateIconImage:'<svg width="200" height="200" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="none"><path stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="5" d="M5 12h14"/></svg>',width:10,height:10,pickable:!1},box:{width:14,height:14,cornerRadius:2,fill:"#fff",stroke:"rgb(229,230,235)",disableFill:"rgb(242,243,245)",checkedFill:"rgb(22, 93, 255)",checkedStroke:"rgb(22, 93, 255)",disableCheckedFill:"rgb(148, 191, 255)",disableCheckedStroke:"rgb(148, 191, 255)",pickable:!1}},$v(),im(),um(),Xv();class KC extends gg{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:yt({},KC.defaultAttributes,t)),this._handlePointerUp=()=>{this.attribute.disabled||this.attribute.checked||(this.setAttribute("checked",!0),this._dispatchEvent("radio_checked",{eventType:"radio_checked",target:this}),this.stage.renderNextFrame())},this.renderGroup(),this.onBeforeAttributeUpdate=(t,e,i)=>{"interactive"in t&&this.setAttribute("pickable",t.interactive),"disabled"in t&&this.setAttribute("cursor",t.disable?this.attribute.disableCursor:this.attribute.cursor)},this.addEventListener("pointerup",this._handlePointerUp)}render(){this.removeAllChild(!0),this.renderCircle(),this.renderText(),this.layout()}renderCircle(){this._circle=new bc(yt({},this.attribute.circle));const t=this.attribute.checked;t&&this.attribute.disabled?this._circle.setAttributes({fill:this.attribute.circle.disableCheckedFill,stroke:this.attribute.circle.disableCheckedStroke}):t?this._circle.setAttributes({fill:this.attribute.circle.checkedFill,stroke:this.attribute.circle.checkedStroke}):this.attribute.disabled&&this._circle.setAttributes({fill:this.attribute.circle.disableFill}),this.appendChild(this._circle)}renderText(){this._text=new Wh(yt({},this.attribute.text)),this.attribute.disabled&&this._text.setAttribute("fill",this.attribute.text.disableFill),this.appendChild(this._text)}renderGroup(){this.attribute.interactive||this.setAttribute("pickable",!1),this.attribute.disabled&&this.setAttribute("cursor",this.attribute.disableCursor)}layout(){const t=2*(this.attribute.circle.outerRadius+this.attribute.circle.lineWidth),e=this._text.AABBBounds.height(),i=Math.max(t,e),o=i/2-t/2+this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,n=i/2-e/2,r=2*(this.attribute.circle.outerRadius+this.attribute.circle.lineWidth),s=this.attribute.circle.outerRadius+this.attribute.circle.lineWidth,l=r+this.attribute.spaceBetweenTextAndIcon;this._circle.setAttributes({x:s,y:o}),this._text.setAttributes({x:l,y:n})}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:yt({},KC.defaultAttributes,t),super.initAttributes(t),this.renderGroup(),this.render()}}KC.defaultAttributes={interactive:!0,disabled:!1,checked:!1,cursor:"pointer",disableCursor:"not-allowed",spaceBetweenTextAndIcon:8,text:{text:"text",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",textBaseline:"top",pickable:!1},circle:{outerRadius:7,innerRadius:3,startAngle:0,endAngle:2*Math.PI,lineWidth:1,fill:"#fff",stroke:"rgb(229,230,235)",disableFill:"rgb(242,243,245)",checkedFill:"rgb(22, 93, 255)",checkedStroke:"rgb(22, 93, 255)",disableCheckedFill:"rgb(148, 191, 255)",disableCheckedStroke:"rgb(148, 191, 255)",pickable:!1}};$v(),dm(),Xv();let ZC=class t extends gg{constructor(e,i){super((null==i?void 0:i.skipDefault)?e:yt({},t.defaultAttributes,e))}render(){this.removeAllChild(!0),this.renderIcon(),this.renderText(),this.layout()}renderIcon(){this._emptyTipIcon=new sc(yt({image:this.attribute.icon.image},this.attribute.icon)),this.appendChild(this._emptyTipIcon)}renderText(){this._text=new Ih(yt({wrap:!0},this.attribute.text)),this.appendChild(this._text)}layout(){const t=this.attribute.icon.height,e=this._text.AABBBounds.height(),i=this.attribute.icon.width,{width:o,height:n,spaceBetweenTextAndIcon:r}=this.attribute;this._emptyTipIcon.setAttribute("x",o/2-i/2),this._emptyTipIcon.setAttribute("y",n/2-t/2-e/2-r/2),this._text.setAttribute("x",o/2),this._text.setAttribute("textAlign","center"),this._text.setAttribute("y",n/2+t/2+r/2),this._text.setAttribute("textBaseline","middle")}};ZC.defaultAttributes={spaceBetweenTextAndIcon:20,text:{text:"no data",fontSize:14,fill:"#000",disableFill:"rgb(201,205,212)",pickable:!1},icon:{image:'<svg t="1716726614852" class="icon" viewBox="0 0 1194 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2621" width="200" height="200"><path d="M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z" fill="#8a8a8a" p-id="2622"></path></svg>',width:100,height:100,pickable:!1}};var qC={},JC={},QC={};Object.defineProperty(QC,"__esModule",{value:!0}),QC.loop=QC.conditional=QC.parse=void 0;QC.parse=function t(e,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o;if(Array.isArray(i))i.forEach((function(i){return t(e,i,o,n)}));else if("function"==typeof i)i(e,o,n,t);else{var r=Object.keys(i)[0];Array.isArray(i[r])?(n[r]={},t(e,i[r],o,n[r])):n[r]=i[r](e,o,n,t)}return o};QC.conditional=function(t,e){return function(i,o,n,r){e(i,o,n)&&r(i,t,o,n)}};QC.loop=function(t,e){return function(i,o,n,r){for(var s=[],l=i.pos;e(i,o,n);){var a={};if(r(i,t,o,a),i.pos===l)break;l=i.pos,s.push(a)}return s}};var ty={};Object.defineProperty(ty,"__esModule",{value:!0}),ty.readBits=ty.readArray=ty.readUnsigned=ty.readString=ty.peekBytes=ty.readBytes=ty.peekByte=ty.readByte=ty.buildStream=void 0;ty.buildStream=function(t){return{data:t,pos:0}};var ey=function(){return function(t){return t.data[t.pos++]}};ty.readByte=ey;ty.peekByte=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return function(e){return e.data[e.pos+t]}};var iy=function(t){return function(e){return e.data.subarray(e.pos,e.pos+=t)}};ty.readBytes=iy;ty.peekBytes=function(t){return function(e){return e.data.subarray(e.pos,e.pos+t)}};ty.readString=function(t){return function(e){return Array.from(iy(t)(e)).map((function(t){return String.fromCharCode(t)})).join("")}};ty.readUnsigned=function(t){return function(e){var i=iy(2)(e);return t?(i[1]<<8)+i[0]:(i[0]<<8)+i[1]}};ty.readArray=function(t,e){return function(i,o,n){for(var r="function"==typeof e?e(i,o,n):e,s=iy(t),l=new Array(r),a=0;a<r;a++)l[a]=s(i);return l}};ty.readBits=function(t){return function(e){for(var i=function(t){return t.data[t.pos++]}(e),o=new Array(8),n=0;n<8;n++)o[7-n]=!!(i&1<<n);return Object.keys(t).reduce((function(e,i){var n=t[i];return n.length?e[i]=function(t,e,i){for(var o=0,n=0;n<i;n++)o+=t[e+n]&&Math.pow(2,i-n-1);return o}(o,n.index,n.length):e[i]=o[n.index],e}),{})}},function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=QC,i=ty,o={blocks:function(t){for(var e=[],o=t.data.length,n=0,r=(0,i.readByte)()(t);0!==r&&r;r=(0,i.readByte)()(t)){if(t.pos+r>=o){var s=o-t.pos;e.push((0,i.readBytes)(s)(t)),n+=s;break}e.push((0,i.readBytes)(r)(t)),n+=r}for(var l=new Uint8Array(n),a=0,h=0;h<e.length;h++)l.set(e[h],a),a+=e[h].length;return l}},n=(0,e.conditional)({gce:[{codes:(0,i.readBytes)(2)},{byteSize:(0,i.readByte)()},{extras:(0,i.readBits)({future:{index:0,length:3},disposal:{index:3,length:3},userInput:{index:6},transparentColorGiven:{index:7}})},{delay:(0,i.readUnsigned)(!0)},{transparentColorIndex:(0,i.readByte)()},{terminator:(0,i.readByte)()}]},(function(t){var e=(0,i.peekBytes)(2)(t);return 33===e[0]&&249===e[1]})),r=(0,e.conditional)({image:[{code:(0,i.readByte)()},{descriptor:[{left:(0,i.readUnsigned)(!0)},{top:(0,i.readUnsigned)(!0)},{width:(0,i.readUnsigned)(!0)},{height:(0,i.readUnsigned)(!0)},{lct:(0,i.readBits)({exists:{index:0},interlaced:{index:1},sort:{index:2},future:{index:3,length:2},size:{index:5,length:3}})}]},(0,e.conditional)({lct:(0,i.readArray)(3,(function(t,e,i){return Math.pow(2,i.descriptor.lct.size+1)}))},(function(t,e,i){return i.descriptor.lct.exists})),{data:[{minCodeSize:(0,i.readByte)()},o]}]},(function(t){return 44===(0,i.peekByte)()(t)})),s=(0,e.conditional)({text:[{codes:(0,i.readBytes)(2)},{blockSize:(0,i.readByte)()},{preData:function(t,e,o){return(0,i.readBytes)(o.text.blockSize)(t)}},o]},(function(t){var e=(0,i.peekBytes)(2)(t);return 33===e[0]&&1===e[1]})),l=(0,e.conditional)({application:[{codes:(0,i.readBytes)(2)},{blockSize:(0,i.readByte)()},{id:function(t,e,o){return(0,i.readString)(o.blockSize)(t)}},o]},(function(t){var e=(0,i.peekBytes)(2)(t);return 33===e[0]&&255===e[1]})),a=(0,e.conditional)({comment:[{codes:(0,i.readBytes)(2)},o]},(function(t){var e=(0,i.peekBytes)(2)(t);return 33===e[0]&&254===e[1]})),h=[{header:[{signature:(0,i.readString)(3)},{version:(0,i.readString)(3)}]},{lsd:[{width:(0,i.readUnsigned)(!0)},{height:(0,i.readUnsigned)(!0)},{gct:(0,i.readBits)({exists:{index:0},resolution:{index:1,length:3},sort:{index:4},size:{index:5,length:3}})},{backgroundColorIndex:(0,i.readByte)()},{pixelAspectRatio:(0,i.readByte)()}]},(0,e.conditional)({gct:(0,i.readArray)(3,(function(t,e){return Math.pow(2,e.lsd.gct.size+1)}))},(function(t,e){return e.lsd.gct.exists})),{frames:(0,e.loop)([n,l,a,r,s],(function(t){var e=(0,i.peekByte)()(t);return 33===e||44===e}))}],d=h;t.default=d}(JC);var oy={};Object.defineProperty(oy,"__esModule",{value:!0}),oy.deinterlace=void 0;oy.deinterlace=function(t,e){for(var i=new Array(t.length),o=t.length/e,n=function(o,n){var r=t.slice(n*e,(n+1)*e);i.splice.apply(i,[o*e,e].concat(r))},r=[0,4,2,1],s=[8,8,4,2],l=0,a=0;a<4;a++)for(var h=r[a];h<o;h+=s[a])n(h,l),l++;return i};var ny={};Object.defineProperty(ny,"__esModule",{value:!0}),ny.lzw=void 0;ny.lzw=function(t,e,i){var o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,C=4096,y=i,w=new Array(i),x=new Array(C),_=new Array(C),S=new Array(4097);for(l=(n=1<<(u=t))+1,o=n+2,h=-1,r=(1<<(s=u+1))-1,d=0;d<n;d++)x[d]=0,_[d]=d;for(g=p=f=v=m=b=0,c=0;c<y;){if(0===v){if(p<s){g+=e[b]<<p,p+=8,b++;continue}if(d=g&r,g>>=s,p-=s,d>o||d==l)break;if(d==n){r=(1<<(s=u+1))-1,o=n+2,h=-1;continue}if(-1==h){S[v++]=_[d],h=d,f=d;continue}for(a=d,d==o&&(S[v++]=f,d=h);d>n;)S[v++]=_[d],d=x[d];f=255&_[d],S[v++]=f,o<C&&(x[o]=h,_[o]=f,0==(++o&r)&&o<C&&(s++,r+=o)),h=a}v--,w[m++]=S[v],c++}for(c=m;c<y;c++)w[c]=0;return w},Object.defineProperty(qC,"__esModule",{value:!0});var ry=qC.decompressFrames=qC.decompressFrame=cy=qC.parseGIF=void 0,sy=function(t){return t&&t.__esModule?t:{default:t}}(JC),ly=QC,ay=ty,hy=oy,dy=ny;var cy=qC.parseGIF=function(t){var e=new Uint8Array(t);return(0,ly.parse)((0,ay.buildStream)(e),sy.default)},uy=function(t,e,i){if(t.image){var o=t.image,n=o.descriptor.width*o.descriptor.height,r=(0,dy.lzw)(o.data.minCodeSize,o.data.blocks,n);o.descriptor.lct.interlaced&&(r=(0,hy.deinterlace)(r,o.descriptor.width));var s={pixels:r,dims:{top:t.image.descriptor.top,left:t.image.descriptor.left,width:t.image.descriptor.width,height:t.image.descriptor.height}};return o.descriptor.lct&&o.descriptor.lct.exists?s.colorTable=o.lct:s.colorTable=e,t.gce&&(s.delay=10*(t.gce.delay||10),s.disposalType=t.gce.extras.disposal,t.gce.extras.transparentColorGiven&&(s.transparentIndex=t.gce.transparentColorIndex)),i&&(s.patch=function(t){for(var e=t.pixels.length,i=new Uint8ClampedArray(4*e),o=0;o<e;o++){var n=4*o,r=t.pixels[o],s=t.colorTable[r]||[0,0,0];i[n]=s[0],i[n+1]=s[1],i[n+2]=s[2],i[n+3]=r!==t.transparentIndex?255:0}return i}(s)),s}};qC.decompressFrame=uy;ry=qC.decompressFrames=function(t,e){return t.frames.filter((function(t){return t.image})).map((function(i){return uy(i,t.gct,e)}))};let gy=!1;function py(){gy||(gy=!0,cu(),Au()?fp(Qo):function(){Su();const t=zo.global&&zo.global.env;return t?"node"===t:!_u}()&&Lf(Qo),Gv(),Uv(),$v(),Xv(),Zv(),im(),nm(),sm(),am(),dm(),cg(),Qo.load(jm),cg())}var fy,vy,my,by,Cy,yy,wy,xy,_y;!function(t){t.default="default",t.grabing="grabing",t.scrolling="scrolling"}(fy||(fy={})),function(t){t.single="single",t.column="column",t.row="row",t.cross="cross",t.none="none"}(vy||(vy={})),function(t){t.top="top",t.bottom="bottom",t.left="left",t.right="right"}(my||(my={})),function(t){t.expand="expand",t.collapse="collapse",t.none="none",t.loading="loading"}(by||(by={})),function(t){t.RECORD="RECORD",t.NONE="NONE",t.SUM="SUM",t.MIN="MIN",t.MAX="MAX",t.AVG="AVG",t.COUNT="COUNT",t.CUSTOM="CUSTOM",t.RECALCULATE="RECALCULATE"}(Cy||(Cy={})),function(t){t.ASC="ASC",t.DESC="DESC",t.NORMAL="NORMAL",t.desc="desc",t.asc="asc",t.normal="normal"}(yy||(yy={})),function(t){t.inlineFront="inlineFront",t.inlineEnd="inlineEnd",t.left="left",t.right="right",t.absoluteRight="absoluteRight",t.contentLeft="contentLeft",t.contentRight="contentRight",t.absolute="absolute"}(wy||(wy={})),function(t){t.frozen="frozen",t.sort="sort",t.dropDown="dropDown",t.dropDownState="dropDownState",t.play="play",t.damagePic="damagePic",t.expand="expand",t.collapse="collapse",t.drillDown="drillDown",t.drillUp="drillUp",t.dragReorder="dragReorder"}(xy||(xy={})),function(t){t.upwardIconName="sort_upward",t.downwardIconName="sort_downward",t.normalIconName="sort_normal",t.freezeIconName="freeze",t.frozenIconName="frozen",t.frozenCurrentIconName="frozenCurrent",t.dropdownIconName="dropdownIcon",t.expandIconName="expand",t.collapseIconName="collapse",t.dragReorderIconName="dragReorder",t.loadingIconName="loading"}(_y||(_y={}));let Sy,Ay=1,Ry=class{constructor(){this.listenersData={listeners:{},listenerData:{}}}on(t,e){const i=this.listenersData.listeners[t]||(this.listenersData.listeners[t]=[]);i.push(e);const o=Ay++;return this.listenersData.listenerData[o]={type:t,listener:e,remove:()=>{delete this.listenersData.listenerData[o];const n=i.indexOf(e);i.splice(n,1),this.listenersData.listeners[t].length||delete this.listenersData.listeners[t]}},o}off(t,e){var i;if(e){const i=t;this.removeEventListener(i,e)}else{const e=t;if(!this.listenersData)return;null===(i=this.listenersData.listenerData[e])||void 0===i||i.remove()}}addEventListener(t,e,i){this.on(t,e)}removeEventListener(t,e){if(this.listenersData)for(const i in this.listenersData.listenerData){const o=this.listenersData.listenerData[i];o.type===t&&o.listener===e&&this.off(i)}}hasListeners(t){return!!this.listenersData&&!!this.listenersData.listeners[t]}fireListeners(t,e){if(!this.listenersData)return[];const i=this.listenersData.listeners[t];return i?i.map((t=>t.call(this,e))).filter((t=>K(t))):[]}release(){delete this.listenersData}};const By={CHANGE_STYLE:"change_style"};let My,Ty,Py,Ey=class t extends Ry{static get EVENT_TYPE(){return By}static get DEFAULT(){return Sy||(Sy=new t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x,_,S,A,R,B,M,T,P,E,k;super(),this._defaultPadding=[10,16,10,16],this._textAlign=null!==(i=null==t?void 0:t.textAlign)&&void 0!==i?i:null==e?void 0:e.textAlign,this._textBaseline=null!==(o=null==t?void 0:t.textBaseline)&&void 0!==o?o:null==e?void 0:e.textBaseline,this._color=null!==(n=null==t?void 0:t.color)&&void 0!==n?n:null==e?void 0:e.color,this._strokeColor=null!==(r=null==t?void 0:t.strokeColor)&&void 0!==r?r:null==e?void 0:e.strokeColor,this._fontSize=null!==(s=t.fontSize)&&void 0!==s?s:null==e?void 0:e.fontSize,this._fontFamily=null!==(l=t.fontFamily)&&void 0!==l?l:null==e?void 0:e.fontFamily,this._fontWeight=null!==(a=t.fontWeight)&&void 0!==a?a:null==e?void 0:e.fontWeight,this._fontVariant=null!==(h=t.fontVariant)&&void 0!==h?h:null==e?void 0:e.fontVariant,this._fontStyle=null!==(d=t.fontStyle)&&void 0!==d?d:null==e?void 0:e.fontStyle,this._padding=null!==(u=null!==(c=null==t?void 0:t.padding)&&void 0!==c?c:null==e?void 0:e.padding)&&void 0!==u?u:this._defaultPadding,this._borderColor=null!==(g=null==t?void 0:t.borderColor)&&void 0!==g?g:null==e?void 0:e.borderColor,this._textOverflow=null!==(p=null==t?void 0:t.textOverflow)&&void 0!==p?p:null==e?void 0:e.textOverflow,this._textStick=null!==(v=null!==(f=t.textStick)&&void 0!==f?f:null==e?void 0:e.textStick)&&void 0!==v&&v,this._textStickBaseOnAlign=null!==(b=null!==(m=t.textStickBaseOnAlign)&&void 0!==m?m:null==e?void 0:e.textStickBaseOnAlign)&&void 0!==b&&b,this._bgColor=null!==(C=null==t?void 0:t.bgColor)&&void 0!==C?C:null==e?void 0:e.bgColor,this._lineHeight=null!==(y=null==t?void 0:t.lineHeight)&&void 0!==y?y:null==e?void 0:e.lineHeight,this._underline=null!==(w=null==t?void 0:t.underline)&&void 0!==w?w:null==e?void 0:e.underline,this._underlineColor=null!==(x=null==t?void 0:t.underlineColor)&&void 0!==x?x:null==e?void 0:e.underlineColor,this._underlineDash=null!==(_=null==t?void 0:t.underlineDash)&&void 0!==_?_:null==e?void 0:e.underlineDash,this._underlineOffset=null!==(S=null==t?void 0:t.underlineOffset)&&void 0!==S?S:null==e?void 0:e.underlineOffset,this._lineThrough=null!==(A=null==t?void 0:t.lineThrough)&&void 0!==A?A:null==e?void 0:e.lineThrough,this._lineThroughColor=null!==(R=null==t?void 0:t.lineThroughColor)&&void 0!==R?R:null==e?void 0:e.lineThroughColor,this._lineThroughDash=null!==(B=null==t?void 0:t.lineThroughDash)&&void 0!==B?B:null==e?void 0:e.lineThroughDash,this._linkColor=null!==(M=null==t?void 0:t.linkColor)&&void 0!==M?M:null==e?void 0:e.linkColor,this._cursor=null!==(T=t.cursor)&&void 0!==T?T:null==e?void 0:e.cursor,this._borderLineWidth=null!==(P=t.borderLineWidth)&&void 0!==P?P:null==e?void 0:e.borderLineWidth,this._borderLineDash=null!==(E=t.borderLineDash)&&void 0!==E?E:null==e?void 0:e.borderLineDash,this._marked=null!==(k=t.marked)&&void 0!==k?k:null==e?void 0:e.marked}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get padding(){return this._padding}set padding(t){this._padding=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}get marked(){return this._marked}set marked(t){this._marked=t}clone(){return new t(this,null)}},ky=class t extends Ey{static get DEFAULT(){return My||(My=new t)}constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}clone(){return new t(this,null)}};class Ly extends Ey{static get DEFAULT(){return Ty||(Ty=new Ly)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o;super(t,e),this._autoWrapText=null!==(i=null==t?void 0:t.autoWrapText)&&void 0!==i?i:null==e?void 0:e.autoWrapText,this._lineClamp=null!==(o=null==t?void 0:t.lineClamp)&&void 0!==o?o:null==e?void 0:e.lineClamp}clone(){return new Ly(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}let Hy,Fy=class t extends Ey{static get DEFAULT(){return Py||(Py=new t)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x,_,S;super(t,e),this._size=(null!==(n=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==n?n:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(r=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==r?r:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=null!==(a=null===(l=null==t?void 0:t.checkboxStyle)||void 0===l?void 0:l.defaultFill)&&void 0!==a?a:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(d=null===(h=null==t?void 0:t.checkboxStyle)||void 0===h?void 0:h.defaultStroke)&&void 0!==d?d:null==i?void 0:i.defaultStroke,this._disableFill=null!==(u=null===(c=null==t?void 0:t.checkboxStyle)||void 0===c?void 0:c.disableFill)&&void 0!==u?u:null==i?void 0:i.disableFill,this._checkedFill=null!==(p=null===(g=null==t?void 0:t.checkboxStyle)||void 0===g?void 0:g.checkedFill)&&void 0!==p?p:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(v=null===(f=null==t?void 0:t.checkboxStyle)||void 0===f?void 0:f.checkedStroke)&&void 0!==v?v:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(b=null===(m=null==t?void 0:t.checkboxStyle)||void 0===m?void 0:m.disableCheckedFill)&&void 0!==b?b:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(y=null===(C=null==t?void 0:t.checkboxStyle)||void 0===C?void 0:C.disableCheckedStroke)&&void 0!==y?y:null==i?void 0:i.disableCheckedStroke,this._checkIconImage=null!==(x=null===(w=null==t?void 0:t.checkboxStyle)||void 0===w?void 0:w.checkIconImage)&&void 0!==x?x:null==i?void 0:i.checkIconImage,this._indeterminateIconImage=null!==(S=null===(_=null==t?void 0:t.checkboxStyle)||void 0===_?void 0:_.indeterminateIconImage)&&void 0!==S?S:null==i?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(e){return new t(e,this)}clone(){return new t(this)}};class zy extends Ey{static get DEFAULT(){return Hy||(Hy=new zy)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x,_,S,A,R;super(t,e),this._size=(null!==(n=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==n?n:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(r=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==r?r:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._spaceBetweenRadio=(null!==(a=null!==(l=null==t?void 0:t.spaceBetweenRadio)&&void 0!==l?l:null==e?void 0:e.spaceBetweenRadio)&&void 0!==a?a:null==i?void 0:i.spaceBetweenRadio)||2,this._innerRadius=null!==(d=null===(h=null==t?void 0:t.radioStyle)||void 0===h?void 0:h.innerRadius)&&void 0!==d?d:null==i?void 0:i.innerRadius,this._outerRadius=null!==(u=null===(c=null==t?void 0:t.radioStyle)||void 0===c?void 0:c.outerRadius)&&void 0!==u?u:null==i?void 0:i.outerRadius,this._defaultFill=null!==(p=null===(g=null==t?void 0:t.radioStyle)||void 0===g?void 0:g.defaultFill)&&void 0!==p?p:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(v=null===(f=null==t?void 0:t.radioStyle)||void 0===f?void 0:f.defaultStroke)&&void 0!==v?v:null==i?void 0:i.defaultStroke,this._disableFill=null!==(b=null===(m=null==t?void 0:t.radioStyle)||void 0===m?void 0:m.disableFill)&&void 0!==b?b:null==i?void 0:i.disableFill,this._checkedFill=null!==(y=null===(C=null==t?void 0:t.radioStyle)||void 0===C?void 0:C.checkedFill)&&void 0!==y?y:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(x=null===(w=null==t?void 0:t.radioStyle)||void 0===w?void 0:w.checkedStroke)&&void 0!==x?x:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(S=null===(_=null==t?void 0:t.radioStyle)||void 0===_?void 0:_.disableCheckedFill)&&void 0!==S?S:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(R=null===(A=null==t?void 0:t.radioStyle)||void 0===A?void 0:A.disableCheckedStroke)&&void 0!==R?R:null==i?void 0:i.disableCheckedStroke}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get spaceBetweenRadio(){return this._spaceBetweenRadio}set spaceBetweenRadio(t){this._spaceBetweenRadio=t}get innerRadius(){return this._innerRadius}set innerRadius(t){this._innerRadius=t}get outerRadius(){return this._outerRadius}set outerRadius(t){this._outerRadius=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}getStyle(t){return new zy(t,this)}clone(){return new zy(this)}}function Iy(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ey,n=arguments.length>4?arguments[4]:void 0,r=arguments.length>5?arguments[5]:void 0;var s,l;return t||e?t instanceof Ey?t:"function"==typeof t?Iy(t(i),e,i,o,n,r):(t||(t={}),n&&!K(t.autoWrapText)&&(t.autoWrapText=!0),o===Fy?new Fy(null!=t?t:{},null!=e?e:{},null!==(s=r.checkboxStyle)&&void 0!==s?s:{}):o===zy?new zy(null!=t?t:{},null!=e?e:{},null!==(l=r.radioStyle)&&void 0!==l?l:{}):new o(null!=t?t:{},null!=e?e:{})):o.DEFAULT}class Oy{static get mode(){return Oy._mode||(Oy._mode=function(){let t="browser";try{"node"===window.type?t="node":"undefined"==typeof window||window.performance?"undefined"==typeof window&&(t="node"):t="miniApp"}catch(e){t="node"}return t}()),Oy._mode}static set mode(t){Oy._mode=t}static RegisterCreateCanvas(t){Oy.CreateCanvas=t}static RegisterLoadImage(t){Oy.LoadImage=t}static GetCreateCanvasFunc(){return Oy.CreateCanvas?Oy.CreateCanvas:"worker"===Oy.mode?function(){return new OffscreenCanvas(arguments.length>0&&void 0!==arguments[0]?arguments[0]:200,arguments.length>1&&void 0!==arguments[1]?arguments[1]:200)}:void 0}static RegisterRequestAnimationFrame(t){Oy.RequestAnimationFrame=t()}static GetRequestAnimationFrame(){if(Oy.RequestAnimationFrame)return Oy.RequestAnimationFrame}static RegisterCancelAnimationFrame(t){Oy.CancelAnimationFrame=t()}static GetCancelAnimationFrame(){if(Oy.CancelAnimationFrame)return Oy.CancelAnimationFrame}}Oy.dpr=0;const Dy=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e,Wy=t=>Dy(t,"object"),Ny=t=>Dy(t,"string"),Gy=t=>Dy(t,"number"),jy=t=>Dy(t,"boolean");function Uy(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];if(!i.length)return t||{};const n=i.shift();if(Wy(t)&&Wy(n))for(const e in n)Wy(n[e])?(t[e]||Object.assign(t,{[e]:{}}),Wy(t[e])||Object.assign(t,{[e]:n[e]}),Uy(t[e],n[e])):null!==n[e]&&void 0!==n[e]&&Object.assign(t,{[e]:n[e]});return Uy(t,...i)}function Vy(t){return"function"==typeof t&&(t=t()),K(t)?`${t}`:""}function $y(t,e){let i=null;return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];i||(t.apply(this,n),i=setTimeout((()=>{i=null}),e))}}function Yy(t,e){for(t=`${t}`;t.length<e;)t="0"+t;return t}function Xy(t,e,i){t=(t=t.replace(/^\s*|\s*$/,"")).replace(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i,"#$1$1$2$2$3$3");const o=Math.round(256*e)*(i?-1:1),n=t.match(new RegExp("^rgba?\\(\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])\\s*,\\s*(\\d|[1-9]\\d|1\\d{2}|2[0-4][0-9]|25[0-5])(?:\\s*,\\s*(0|1|0?\\.\\d+))?\\s*\\)$","i")),r=n&&K(n[4])?n[4]:null,s=n?[n[1],n[2],n[3]]:t.replace(/^#?([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])([a-f0-9][a-f0-9])/i,(function(){return`${parseInt(arguments[1],16)},${parseInt(arguments[2],16)},${parseInt(arguments[3],16)}`})).split(/,/);return n?`rgb${null!==r?"a":""}(${Math[i?"max":"min"](parseInt(s[0],10)+o,i?0:255)}, ${Math[i?"max":"min"](parseInt(s[1],10)+o,i?0:255)}, ${Math[i?"max":"min"](parseInt(s[2],10)+o,i?0:255)}${null!==r?`, ${r}`:""})`:["#",Yy(Math[i?"max":"min"](parseInt(s[0],10)+o,i?0:255).toString(16),2),Yy(Math[i?"max":"min"](parseInt(s[1],10)+o,i?0:255).toString(16),2),Yy(Math[i?"max":"min"](parseInt(s[2],10)+o,i?0:255).toString(16),2)].join("")}function Ky(t){return Ny(t)||Gy(t)||jy(t)?t.toString():""}function Zy(){return navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)}function qy(t,e,i){return"desc"!==i?t===e?0:t>e?1:-1:t===e?0:t<e?1:-1}function Jy(t){const e=[];for(let i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}function Qy(t,e,i){i(t),(null==t?void 0:t[e])&&Array.isArray(null==t?void 0:t[e])&&t[e].forEach((t=>Qy(t,e,i)))}const tw="undefined"==typeof window||void 0===window.window;let ew,iw;const ow={get find(){return ew||(ew=Array.prototype.find?(t,e)=>Array.prototype.find.call(t,e):(t,e)=>{const i=ow.findIndex(t,e);return i>=0?t[i]:void 0},ew)},get findIndex(){return iw||(iw=Array.prototype.findIndex?(t,e)=>Array.prototype.findIndex.call(t,e):(t,e)=>{const{length:i}=t;for(let o=0;o<i;o++)if(e(t[o],o,t))return o;return-1},iw)}};const{IE:nw,Chrome:rw,Firefox:sw,Edge:lw,Safari:aw}=function(){if(tw)return{IE:!1,Edge:!1,Chrome:!1,Firefox:!1,Safari:!1};const t=window.navigator.userAgent.toLowerCase();return{IE:!!/(msie|trident)/.exec(t),Edge:t.indexOf("edge")>-1,Chrome:t.indexOf("chrome")>-1&&-1===t.indexOf("edge"),Firefox:t.indexOf("firefox")>-1,Safari:t.indexOf("safari")>-1&&-1===t.indexOf("edge")}}();function hw(){const t={};for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];return i.forEach((e=>{for(const i in e)Object.defineProperty(t,i,{get:()=>e[i],set(t){e[i]=t},configurable:!0,enumerable:!0})})),t}function dw(t,e){let i=t;for(let t=0;t<(arguments.length<=2?0:arguments.length-2)&&null!=i;t++)i=e(i,t+2<2||arguments.length<=t+2?void 0:arguments[t+2]);return i}function cw(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return dw(t,((t,e)=>t[e]),...i)}function uw(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return"function"==typeof t?t(...i):t}function gw(t){return Boolean(t&&"function"==typeof t.then)}function pw(t,e){gw(t)?t.then((t=>{e(t)})).catch((t=>{})):e(t)}function fw(t){return Array.isArray(t)?3===t.length?[t[0],t[1],t[2],t[1]]:2===t.length?[t[0],t[1],t[0],t[1]]:1===t.length?[t[0],t[0],t[0],t[0]]:[t[0],t[1],t[2],t[3]]:[t,t,t,t]}function vw(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 mw(t){return{start:{col:Math.min(t.start.col,t.end.col),row:Math.min(t.start.row,t.end.row)},end:{col:Math.max(t.start.col,t.end.col),row:Math.max(t.start.row,t.end.row)}}}function bw(t,e){const i=mw(t),o=mw(e);return Math.max(i.start.col,o.start.col)<=Math.min(i.end.col,o.end.col)&&Math.max(i.start.row,o.start.row)<=Math.min(i.end.row,o.end.row)}const Cw=nw,yw={isObject:function(t){return t===Object(t)}},ww={endsWith:function(t,e,i){const o=Ky(t);("number"!=typeof i||!isFinite(i)||Math.floor(i)!==i||i>o.length)&&(i=o.length),i-=e.length;const n=o.lastIndexOf(e,i);return-1!==n&&n===i}},xw={isTouchEvent:function(t){return!!t.changedTouches}},_w={toBoxArray:fw},Sw=Function.prototype,Aw={CLICK_CELL:"click_cell",DBLCLICK_CELL:"dblclick_cell",MOUSEDOWN_CELL:"mousedown_cell",MOUSEUP_CELL:"mouseup_cell",SELECTED_CELL:"selected_cell",SELECTED_CLEAR:"selected_clear",KEYDOWN:"keydown",MOUSEENTER_TABLE:"mouseenter_table",MOUSELEAVE_TABLE:"mouseleave_table",MOUSEDOWN_TABLE:"mousedown_table",MOUSEMOVE_TABLE:"mousemove_table",MOUSEMOVE_CELL:"mousemove_cell",MOUSEENTER_CELL:"mouseenter_cell",MOUSELEAVE_CELL:"mouseleave_cell",CONTEXTMENU_CELL:"contextmenu_cell",RESIZE_COLUMN:"resize_column",RESIZE_COLUMN_END:"resize_column_end",RESIZE_ROW:"resize_row",RESIZE_ROW_END:"resize_row_end",CHANGE_HEADER_POSITION_START:"change_header_position_start",CHANGE_HEADER_POSITION:"change_header_position",CHANGING_HEADER_POSITION:"changing_header_position",CHANGE_HEADER_POSITION_FAIL:"change_header_position_fail",SORT_CLICK:"sort_click",AFTER_SORT:"after_sort",FREEZE_CLICK:"freeze_click",SCROLL:"scroll",SCROLL_HORIZONTAL_END:"scroll_horizontal_end",SCROLL_VERTICAL_END:"scroll_vertical_end",DROPDOWN_MENU_CLICK:"dropdown_menu_click",MOUSEOVER_CHART_SYMBOL:"mouseover_chart_symbol",DRAG_SELECT_END:"drag_select_end",COPY_DATA:"copy_data",DROPDOWN_ICON_CLICK:"dropdown_icon_click",DROPDOWN_MENU_CLEAR:"dropdown_menu_clear",TREE_HIERARCHY_STATE_CHANGE:"tree_hierarchy_state_change",SHOW_MENU:"show_menu",HIDE_MENU:"hide_menu",ICON_CLICK:"icon_click",LEGEND_ITEM_CLICK:"legend_item_click",LEGEND_ITEM_HOVER:"legend_item_hover",LEGEND_ITEM_UNHOVER:"legend_item_unHover",LEGEND_CHANGE:"legend_change",MOUSEENTER_AXIS:"mouseenter_axis",MOUSELEAVE_AXIS:"mouseleave_axis",CHECKBOX_STATE_CHANGE:"checkbox_state_change",RADIO_STATE_CHANGE:"radio_state_change",AFTER_RENDER:"after_render",INITIALIZED:"initialized",CHANGE_CELL_VALUE:"change_cell_value",DRAG_FILL_HANDLE_END:"drag_fill_handle_end",MOUSEDOWN_FILL_HANDLE:"mousedown_fill_handle",DBLCLICK_FILL_HANDLE:"dblclick_fill_handle"},Rw=(t,e)=>(t=>{switch(Object.prototype.toString.call(t)){case"[object Object]":return"object";case"[object Function]":return"function";case"[object Array]":return"array";case"[object String]":return"string";case"[object Number]":return"number";case"[object RegExp]":return"regExp";case"[object Boolean]":return"boolean";case"[object Symbol]":return"symbol";case"[object Date]":return"date";case"[object Undefined]":return"undefined";case"[object Null]":return"null";case"[object Error]":return"error";case"[object HTMLDocument]":return"document";case"[object global]":return"global";default:return null}})(t)===e;function Bw(t,e,i){let o,n,r,s,l,a,h=0,d=!1,c=!1,u=!0;const g=!e&&0!==e&&"function"==typeof requestAnimationFrame;if("function"!=typeof t)throw new TypeError("Expected a function");function p(e){const i=o,r=n;return n=void 0,o=void 0,h=e,s=t.apply(r,i),s}function f(t,e){return g?requestAnimationFrame(t):setTimeout(t,e)}function v(t){const i=t-a;return void 0===a||i>=e||i<0||d&&t-h>=r}function m(){const t=Date.now();if(v(t))return function(t){return l=void 0,u&&o?p(t):(n=void 0,o=void 0,s)}(t);l=f(m,function(t){const i=t-h,o=e&&-(t-a);return d?Math.min(o,r-i):o}(t))}return e=+e||0,Rw(i,"object")&&(c=!!i.leading,d="maxWait"in i,d&&(r=Math.max(+i.maxWait||0,e)),u="trailing"in i?!!i.trailing:u),function(){const t=Date.now(),i=v(t);for(var r=arguments.length,u=new Array(r),g=0;g<r;g++)u[g]=arguments[g];if(o=u,n=this,a=t,i){if(void 0===l)return function(t){return h=t,l=f(m,e),c?p(t):s}(a);if(d)return l=f(m,e),p(a)}return void 0===l&&(l=f(m,e)),s}}let Mw=1;class Tw{constructor(t,e,i){var o;if(this.resizeTime=100,this.lastSize={width:0,height:0},this.mutationResize=()=>{this.onResize()},this.callBack=()=>{const t=this.getSize();let e=!1;t.width===this.lastSize.width&&t.height===this.lastSize.height&&(e=!0),this.lastSize=t,this.cb&&this.cb(Object.assign(Object.assign({},this.lastSize),{windowSizeNotChange:e}))},this.onResize=()=>{this.callBackDebounce()},this.element=t,this.cb=e,this.lastSize=this.getSize(),i&&(this.resizeTime=Math.max(i,16)),this.callBackDebounce=Bw(this.callBack,this.resizeTime),null===window||void 0===window||window.addEventListener("resize",this.onResize),"ResizeObserver"in window){const t=window.ResizeObserver;this.observer=new t(this.mutationResize),null===(o=this.observer)||void 0===o||o.observe(this.element)}else"MutationObserver"in window&&(this.observer=new MutationObserver(this.mutationResize),this.observer.observe(this.element,{attributes:!0,attributeFilter:["style"]}))}disConnect(){window.removeEventListener("resize",this.onResize),this.observer&&(this.observer.disconnect(),this.observer=void 0)}setSize(t){this.lastSize=t}checkSize(){const t=this.getSize();return t.width!==this.lastSize.width||t.height!==this.lastSize.height}getSize(){return this.element?{width:Math.floor(this.element.clientWidth),height:Math.floor(this.element.clientHeight)}:Object.assign({},this.lastSize)}}class Pw{constructor(){this.listeners={},this.reseizeListeners={}}on(t,e,i){if("node"===Oy.mode)return-1;const o=Mw++;for(var n=arguments.length,r=new Array(n>3?n-3:0),s=3;s<n;s++)r[s-3]=arguments[s];if(null==t?void 0:t.addEventListener)if("resize"!==e||t===window)null==t||t.addEventListener(e,i,...r);else{const e=new Tw(t,i,this.resizeTime);this.reseizeListeners[o]=e}const l={target:t,type:e,listener:i,options:r};return this.listeners[o]=l,o}once(t,e,i){var o=this;if("node"===Oy.mode)return-1;for(var n=arguments.length,r=new Array(n>3?n-3:0),s=3;s<n;s++)r[s-3]=arguments[s];const l=this.on(t,e,(function(){o.off(l),i(...arguments)}),...r);return l}off(t){var e;if("node"===Oy.mode)return;if(null===t)return;const i=null===(e=this.listeners)||void 0===e?void 0:e[t];i&&(delete this.listeners[t],i.target.removeEventListener&&i.target.removeEventListener(i.type,i.listener,...i.options))}fire(t,e){if("node"!==Oy.mode){for(var i=arguments.length,o=new Array(i>2?i-2:0),n=2;n<i;n++)o[n-2]=arguments[n];for(const i in this.listeners){const n=this.listeners[i];n.target===t&&n.type===e&&n.listener.call(n.target,...o)}}}hasListener(t,e){if("node"===Oy.mode)return!1;let i=!1;for(const o in this.listeners){const n=this.listeners[o];n.target===t&&n.type===e&&(i=!0)}return i}clear(){if("node"!==Oy.mode){for(const t in this.listeners){const e=this.listeners[t];e.target.removeEventListener&&e.target.removeEventListener(e.type,e.listener,...e.options)}for(const t in this.reseizeListeners){const e=this.reseizeListeners[t];null==e||e.disConnect()}this.listeners={}}}release(){"node"!==Oy.mode&&(this.clear(),this.listeners={})}}const Ew=(t,e)=>{let i=0,o=t.length-1;for(;i<=o;){const n=Math.floor((i+o)/2);if(t[n]===e)return n;t[n]>e?o=n-1:i=n+1}return o<0?0:o};class kw{constructor(){this._keys=[],this._vals={},this._sorted=!1}count(){return this._keys.length}values(){return this._vals}valueArr(){return Object.values(this._vals)}adjustOrder(t,e,i){const{_keys:o}=this;if(this._sorted||(o.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>e){const n=[];for(let r=Ew(o,t+i-1);r>=0;r--){const s=o[r];if(s>=t)n.push(this.get(s));else if(e<=s&&s<t)this.put(s+i,this.get(s));else if(s<e)break}for(let t=0;t<i;t++)this.put(e+t,n[i-1-t])}const{length:n}=o;if(t<e){const r=[];for(let s=Ew(o,t);s<n;s++){const n=o[s];if(n>=t&&n<t+i)r.push(this.get(n));else if(t+i<=n&&n<=e)this.put(n-i,this.get(n));else if(n>e)break}for(let t=0;t<i;t++)this.put(e+t,r[t])}}exchangeOrder(t,e,i,o,n){const{_keys:r}=this;if(this._sorted||(r.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>i){const o=[],s=[];for(let n=Ew(r,i);n<t+e;n++){const i=r[n];i>=t&&i<t+e?s.push(this.get(i)):o.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,s[t]);for(let t=0;t<o.length;t++)this.put(n+e+t,o[t])}else{const s=[],l=[];for(let n=Ew(r,t);n<i+o;n++){const i=r[n];i>=t&&i<t+e?l.push(this.get(i)):s.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,l[t]);for(let e=0;e<s.length;e++)this.put(t+e,s[e])}}del(t){delete this._vals[t];const e=this._keys.indexOf(t);-1!==e&&this._keys.splice(e,1)}put(t,e){t in this._vals||(this._keys.push(t),this._sorted=!1),this._vals[t]=e}get(t){return this._vals[t]}has(t){return K(this._vals[t])}contain(t){return Object.values(this._vals).indexOf(t)>=0}each(t,e,i){const{_keys:o}=this,{length:n}=o;this._sorted||(o.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0);for(let r=Ew(o,t);r<n;r++){const n=o[r];if(t<=n&&n<=e){if(!1===i(this.get(n),n))break}else if(e<n)return}}clear(){this._keys.length=0,this._vals={},this._sorted=!1}getLastIndex(){return this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.del(t)}delAndReorder(t){if(!this.has(t))return;const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}addAndReorder(t,e){const i=this.getLastIndex();this.adjustOrder(t,t+1,i-t),K(e)&&this.put(t,e)}}class Lw{constructor(t,e,i,o){this.bounds=new ke,this.bounds.set(t,e,t+i,e+o)}static bounds(t,e,i,o){return new Lw(t,e,Math.round(i-t),Math.round(o-e))}get left(){return this.bounds.x1}set left(t){this.bounds.x1=t}get top(){return this.bounds.y1}set top(t){this.bounds.y1=t}get right(){return this.bounds.x2}set right(t){this.bounds.x2=t}get bottom(){return this.bounds.y2}set bottom(t){this.bounds.y2=t}get width(){return this.bounds.width()}set width(t){this.bounds.x2=this.bounds.x1+t}get height(){return this.bounds.height()}set height(t){this.bounds.y2=this.bounds.y1+t}offsetLeft(t){this.bounds.translate(t,0)}offsetTop(t){this.bounds.translate(0,t)}copy(){return new Lw(this.left,this.top,this.width,this.height)}contains(t){return this.bounds.encloses(t.bounds)}inPoint(t,e){return this.bounds.contains(t,e)}}var Hw={name:"DARK",underlayBackgroundColor:"transparent",defaultStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},headerStyle:{color:"#D3D5DA",bgColor:"#373b45",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#2F4774"}},rowHeaderStyle:{},cornerHeaderStyle:{},bodyStyle:{color:"#e5e7ea",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#282a2e":"#2d3137"},fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#444A54",padding:[8,12,8,12],hover:{cellBgColor:"#29364D"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:10,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(255, 255, 255, 0.1)",cellBorderColor:"#4284FF",cellBorderLineWidth:2},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"},functionalIconsStyle:{sort_color:"#FFFFFF",sort_color_opacity:"0.75",sort_color_2:"#416EFF",sort_color_opacity_2:"1",frozen_color:"#FFFFFF",frozen_color_opacity:"0.75",collapse_color:"#FFF",collapse_color_opacity:"0.75",expand_color:"#FFF",expand_color_opacity:"0.75",dragReorder_color:"#FFF",dragReorder_color_opacity:"0.75"}};var Fw={name:"BRIGHT",underlayBackgroundColor:"#FFF",defaultStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#5286FA",hover:{cellBgColor:"#2E67E3"}},headerStyle:{color:"#FFF",bgColor:"#5389FF",borderColor:"#A1C1FF",hover:{cellBgColor:"#2E67E3"}},bodyStyle:{color:"#000",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#FFF":"#F4F8FF"},borderColor:"#E0EAFE",hover:{cellBgColor:"#E9EFFD"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"#CBDCFE",endColor:"#CBDCFE"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var zw={name:"ARCO",underlayBackgroundColor:"#FFF",defaultStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12]},headerStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:600,lineHeight:14,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},rowHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},cornerHeaderStyle:{color:"#1B1F23",bgColor:"#EEF1F5",fontSize:12,fontFamily:"PingFang SC",fontWeight:500,lineHeight:12,borderColor:"#e1e4e8",padding:[8,12,8,12],hover:{cellBgColor:"#c8daf6"}},bodyStyle:{padding:[8,12,8,12],color:"#141414",fontSize:14,fontFamily:"Arial,sans-serif",fontWeight:400,textAlign:"left",bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#fbfbfc":"#FFF"},borderColor:"#e1e4e8",lineHeight:14,hover:{cellBgColor:"#F7F8FA",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#d1d5da",borderLineWidth:1,borderLineDash:[],cornerRadius:4,shadowBlur:6,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(00, 24, 47, 0.06)"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:4,startColor:"rgba(00, 24, 47, 0.05)",endColor:"rgba(00, 24, 47, 0)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#3073f2"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var Iw={name:"DEFAULT",underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:"#E1E4E8",color:"#000",bgColor:"#ECF1F5"},headerStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},rowHeaderStyle:{fontSize:16,fontWeight:"bold",bgColor:"#ECF1F5",hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},cornerHeaderStyle:{fontSize:16,fontWeight:"bold"},bodyStyle:{fontSize:14,bgColor:function(t){const{row:e,table:i}=t;return 1&e-i.frozenRowCount?"#FDFDFD":"#FAF9FB"},hover:{cellBgColor:"#CCE0FF",inlineRowBgColor:"#F3F8FF",inlineColumnBgColor:"#F3F8FF"}},frameStyle:{borderColor:"#E1E4E8",borderLineWidth:1,borderLineDash:[],cornerRadius:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black"},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF",width:3},frozenColumnLine:{shadow:{width:3,startColor:"rgba(225, 228, 232, 0.6)",endColor:"rgba(225, 228, 232, 0.6)"}},selectionStyle:{cellBgColor:"rgba(0, 0, 255,0.1)",cellBorderLineWidth:2,cellBorderColor:"#0000ff"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};var Ow={name:"SIMPLIFY",underlayBackgroundColor:"#FFF",defaultStyle:{borderColor:function(t){const{col:e,table:i}=t,{colCount:o,frozenColCount:n}=i,r="#ccc7c7";return n-1===e||o-1===e?[r,"#f2f2f2","#ccc7c7",null]:[r,null,"#ccc7c7",null]},hover:{cellBorderColor:"#0000FF",cellBgColor:"#D0E0E3"},bgColor:"#FFF"},headerStyle:{color:"rgba(0, 0, 0, 0.87)",borderColor:function(t){const{row:e,table:{frozenRowCount:i}}=t;return i-1===e?["#f2f2f2","#f2f2f2","#ccc7c7","#f2f2f2"]:["#f2f2f2"]}},bodyStyle:{color:"rgba(0, 0, 0, 0.87)"},frameStyle:{borderColor:"#f2f2f2",borderLineWidth:1},columnResize:{lineWidth:1,lineColor:"#416EFF",bgColor:"#D9E2FF"},selectionStyle:{cellBorderColor:"#FD5",cellBgColor:"rgba(111, 168, 220, 0.1)"},tooltipStyle:{bgColor:"#FFF",color:"#000",fontSize:12,fontFamily:"Arial,sans-serif"}};const Dw={},Ww="Arial,sans-serif",Nw=[],Gw=/^(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/,jw="$$indicator$$",Uw={type:"line"};function Vw(t){return t||{}}const $w={visible:!0,position:"auto",padding:8,titleStyle:{fontSize:12,fontWeight:"bold",fill:"#4E5969"},contentStyle:{fontSize:12,fill:"#4E5969"},panel:{visible:!0,fill:"#fff",stroke:"#ffffff",lineWidth:0,cornerRadius:3,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:"rgba(0, 0, 0, 0.1)",size:0,space:12}};function Yw(t,e,i,o){var n,r,s;return null!==(s=null!==(r=null!==(n=cw(t,...i))&&void 0!==n?n:cw(e,...i))&&void 0!==r?r:o&&cw(t,...o))&&void 0!==s?s:o&&cw(e,...o)}class Xw{constructor(t,e){this._defaultStyle=null,this._header=null,this._cornerHeader=null,this._cornerRightTopCell=null,this._cornerLeftBottomCell=null,this._cornerRightBottomCell=null,this._rightFrozen=null,this._bottomFrozen=null,this._rowHeader=null,this._body=null,this._groupTitle=null,this._scroll=null,this._tooltip=null,this._frameStyle=null,this._columnResize=null,this._dragHeaderSplitLine=null,this._frozenColumnLine=null,this._selectionStyle=null,this._axisStyle=null,this._checkboxStyle=null,this._radioStyle=null,this._textPopTipStyle=null,this._internalIconsStyle=null,this.isPivot=!1,this.name="",this.internalTheme={obj:t,superTheme:e},this.name=Yw(t,e,["name"])}getExtendTheme(){return this.internalTheme.obj}clearBodyStyleCache(){this._body=null}get font(){const{obj:t,superTheme:e}=this.internalTheme;return Yw(t,e,["font"],["bodyStyle","font"])}get underlayBackgroundColor(){const{obj:t,superTheme:e}=this.internalTheme;return Yw(t,e,["underlayBackgroundColor"])}get cellInnerBorder(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null===(t=Yw(e,i,["cellInnerBorder"]))||void 0===t||t}get cellBorderClipDirection(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null!==(t=Yw(e,i,["cellBorderClipDirection"]))&&void 0!==t?t:"top-left"}get _contentOffset(){var t;const{obj:e,superTheme:i}=this.internalTheme;return null!==(t=Yw(e,i,["_contentOffset"]))&&void 0!==t?t:0}get defaultStyle(){const t=this;if(!this._defaultStyle){const{obj:e,superTheme:i}=this.internalTheme,o=Uy({},i.defaultStyle,e.defaultStyle);this._defaultStyle={get fontSize(){var t;return null!==(t=o.fontSize)&&void 0!==t?t:16},get fontFamily(){var t;return null!==(t=o.fontFamily)&&void 0!==t?t:Ww},get fontWeight(){return o.fontWeight},get fontVariant(){return o.fontVariant},get fontStyle(){return o.fontStyle},get bgColor(){var t;return null!==(t=o.bgColor)&&void 0!==t?t:"#FFF"},get color(){var t;return null!==(t=o.color)&&void 0!==t?t:"#000"},get borderColor(){var t;return null!==(t=o.borderColor)&&void 0!==t?t:"#000"},get borderLineWidth(){var t;return null!==(t=o.borderLineWidth)&&void 0!==t?t:1},get borderLineDash(){var t;return null!==(t=o.borderLineDash)&&void 0!==t?t:Nw},get hover(){if(o.hover)return{get cellBgColor(){var t,e;return null!==(e=null===(t=o.hover)||void 0===t?void 0:t.cellBgColor)&&void 0!==e?e:void 0},get inlineColumnBgColor(){var t,e,i,n,r,s;return null!==(s=null!==(e=null===(t=o.hover)||void 0===t?void 0:t.inlineColumnBgColor)&&void 0!==e?e:(null===(i=o.hover)||void 0===i?void 0:i.cellBgColor)&&"string"==typeof(null===(n=o.hover)||void 0===n?void 0:n.cellBgColor)?Xy(null===(r=o.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get inlineRowBgColor(){var t,e,i,n,r,s;return null!==(s=null!==(e=null===(t=o.hover)||void 0===t?void 0:t.inlineRowBgColor)&&void 0!==e?e:(null===(i=o.hover)||void 0===i?void 0:i.cellBgColor)&&"string"==typeof(null===(n=o.hover)||void 0===n?void 0:n.cellBgColor)?Xy(null===(r=o.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get select(){if(o.select)return{get inlineColumnBgColor(){var e,i,n,r,s,l;return null!==(l=null!==(r=null!==(i=null===(e=o.select)||void 0===e?void 0:e.inlineColumnBgColor)&&void 0!==i?i:null===(n=t.selectionStyle)||void 0===n?void 0:n.inlineColumnBgColor)&&void 0!==r?r:(null===(s=t.selectionStyle)||void 0===s?void 0:s.cellBgColor)&&"string"==typeof t.selectionStyle.cellBgColor?Xy(t.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==l?l:void 0},get inlineRowBgColor(){var e,i,n,r,s;return null!==(s=null!==(n=null!==(i=null===(e=o.select)||void 0===e?void 0:e.inlineRowBgColor)&&void 0!==i?i:t.selectionStyle.inlineRowBgColor)&&void 0!==n?n:(null===(r=t.selectionStyle)||void 0===r?void 0:r.cellBgColor)&&"string"==typeof t.selectionStyle.cellBgColor?Xy(t.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get padding(){var t;return null!==(t=o.padding)&&void 0!==t?t:[10,16,10,16]},get textAlign(){var t;return null!==(t=o.textAlign)&&void 0!==t?t:"left"},get textBaseline(){var t;return null!==(t=o.textBaseline)&&void 0!==t?t:"middle"},get textOverflow(){var t;return null!==(t=o.textOverflow)&&void 0!==t?t:"ellipsis"},get lineHeight(){return o.lineHeight},get autoWrapText(){var t;return null!==(t=o.autoWrapText)&&void 0!==t&&t},get lineClamp(){var t;return null!==(t=o.lineClamp)&&void 0!==t?t:"auto"},get linkColor(){var t;return null!==(t=o.linkColor)&&void 0!==t?t:"#3772ff"},get cursor(){var t;return null!==(t=o.cursor)&&void 0!==t?t:"auto"},get marked(){var t;return null!==(t=o.marked)&&void 0!==t&&t},get underline(){var t;return null!==(t=o.underline)&&void 0!==t&&t},get underlineColor(){return o.underlineColor},get underlineDash(){return o.underlineDash},get underlineOffset(){return o.underlineOffset},get lineThrough(){var t;return null!==(t=o.lineThrough)&&void 0!==t&&t},get lineThroughColor(){return o.lineThroughColor},get lineThroughDash(){return o.lineThroughDash}}}return this._defaultStyle}get cornerHeaderStyle(){if(!this._cornerHeader){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},this.defaultStyle,e.cornerHeaderStyle,t.cornerHeaderStyle);this._cornerHeader=this.getStyle(i)}return this._cornerHeader}get cornerRightTopCellStyle(){if(!this._cornerRightTopCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightTopCellStyle&&!t.cornerRightTopCellStyle)return this._cornerRightTopCell;const i=Uy({},this.defaultStyle,e.cornerRightTopCellStyle,t.cornerRightTopCellStyle);this._cornerRightTopCell=this.getStyle(i)}return this._cornerRightTopCell}get cornerLeftBottomCellStyle(){if(!this._cornerLeftBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerLeftBottomCellStyle&&!t.cornerLeftBottomCellStyle)return this._cornerLeftBottomCell;const i=Uy({},this.defaultStyle,e.cornerLeftBottomCellStyle,t.cornerLeftBottomCellStyle);this._cornerLeftBottomCell=this.getStyle(i)}return this._cornerLeftBottomCell}get cornerRightBottomCellStyle(){if(!this._cornerRightBottomCell){const{obj:t,superTheme:e}=this.internalTheme;if(!e.cornerRightBottomCellStyle&&!t.cornerRightBottomCellStyle)return this._cornerRightBottomCell;const i=Uy({},this.defaultStyle,e.cornerRightBottomCellStyle,t.cornerRightBottomCellStyle);this._cornerRightBottomCell=this.getStyle(i)}return this._cornerRightBottomCell}get rightFrozenStyle(){if(!this._rightFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.rightFrozenStyle&&!t.rightFrozenStyle)return this._rightFrozen;const i=Uy({},this.defaultStyle,this.rowHeaderStyle,e.rightFrozenStyle,t.rightFrozenStyle);this._rightFrozen=this.getStyle(i)}return this._rightFrozen}get bottomFrozenStyle(){if(!this._bottomFrozen){const{obj:t,superTheme:e}=this.internalTheme;if(!e.bottomFrozenStyle&&!t.bottomFrozenStyle)return this._bottomFrozen;const i=Uy({},this.defaultStyle,this.headerStyle,e.bottomFrozenStyle,t.bottomFrozenStyle);this._bottomFrozen=this.getStyle(i)}return this._bottomFrozen}get rowHeaderStyle(){var t;if(!this._rowHeader){const{obj:e,superTheme:i}=this.internalTheme,o=Uy({},this.defaultStyle,i.rowHeaderStyle,null!==(t=e.rowHeaderStyle)&&void 0!==t?t:this.isPivot?null:e.headerStyle);this._rowHeader=this.getStyle(o)}return this._rowHeader}get headerStyle(){if(!this._header){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},this.defaultStyle,e.headerStyle,t.headerStyle);this._header=this.getStyle(i)}return this._header}get bodyStyle(){if(!this._body){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},this.defaultStyle,e.bodyStyle,t.bodyStyle);this._body=this.getStyle(i)}return this._body}get groupTitleStyle(){if(!this._groupTitle){const{obj:t,superTheme:e}=this.internalTheme;if(!e.groupTitleStyle&&!t.groupTitleStyle)return this._groupTitle;const i=Uy({},this.defaultStyle,e.groupTitleStyle,t.groupTitleStyle);this._groupTitle=this.getStyle(i)}return this._groupTitle}get frameStyle(){if(!this._frameStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},e.frameStyle,t.frameStyle);this._frameStyle={get borderColor(){return i.borderColor},get borderLineWidth(){return i.borderLineWidth},get borderLineDash(){return i.borderLineDash},get innerBorder(){return i.innerBorder},get shadowBlur(){return i.shadowBlur},get shadowColor(){return i.shadowColor},get shadowOffsetX(){return i.shadowOffsetX},get shadowOffsetY(){return i.shadowOffsetY},get cornerRadius(){return i.cornerRadius}}}return this._frameStyle}get scrollStyle(){if(!this._scroll){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},e.scrollStyle,t.scrollStyle);this._scroll={get scrollSliderColor(){var t;return null!==(t=i.scrollSliderColor)&&void 0!==t?t:"#C0C0C0"},get scrollSliderCornerRadius(){return i.scrollSliderCornerRadius},get scrollRailColor(){return i.scrollRailColor},get visible(){var t;return null!==(t=i.visible)&&void 0!==t?t:"scrolling"},get verticalVisible(){return i.verticalVisible},get horizontalVisible(){return i.horizontalVisible},get width(){var t;return null!==(t=i.width)&&void 0!==t?t:7},get hoverOn(){var t;return null===(t=i.hoverOn)||void 0===t||t},get barToSide(){var t;return null!==(t=i.barToSide)&&void 0!==t&&t},get horizontalPadding(){var t;return null!==(t=i.horizontalPadding)&&void 0!==t?t:0},get verticalPadding(){var t;return null!==(t=i.verticalPadding)&&void 0!==t?t:0}}}return this._scroll}get tooltipStyle(){if(!this._tooltip){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},e.tooltipStyle,t.tooltipStyle);this._tooltip={get fontFamily(){var t;return null!==(t=i.fontFamily)&&void 0!==t?t:Ww},get fontSize(){var t;return null!==(t=i.fontSize)&&void 0!==t?t:16},get bgColor(){var t;return null!==(t=i.bgColor)&&void 0!==t?t:"#000"},get padding(){var t;return null!==(t=i.padding)&&void 0!==t?t:[6,8]},get color(){var t;return null!==(t=i.color)&&void 0!==t?t:"#FFF"},get maxWidth(){return i.maxWidth},get maxHeight(){return i.maxHeight}}}return this._tooltip}get columnResize(){if(!this._columnResize){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},e.columnResize,t.columnResize);this._columnResize={get lineColor(){var t;return null!==(t=i.lineColor)&&void 0!==t?t:"#416EFF"},get bgColor(){var t;return null!==(t=i.bgColor)&&void 0!==t?t:"#D9E2FF"},get lineWidth(){var t;return null!==(t=i.lineWidth)&&void 0!==t?t:1},get width(){var t;return null!==(t=i.width)&&void 0!==t?t:i.lineWidth+2},get labelColor(){var t;return null!==(t=i.labelColor)&&void 0!==t?t:"#FFF"},get labelFontSize(){var t;return null!==(t=i.labelFontSize)&&void 0!==t?t:10},get labelFontFamily(){var t;return null!==(t=i.labelFontFamily)&&void 0!==t?t:"sans-serif"},get labelBackgroundFill(){var t;return null!==(t=i.labelBackgroundFill)&&void 0!==t?t:"#3073F2"},get labelBackgroundCornerRadius(){var t;return null!==(t=i.labelBackgroundCornerRadius)&&void 0!==t?t:5},get labelVisible(){var t;return null===(t=i.labelVisible)||void 0===t||t}}}return this._columnResize}get dragHeaderSplitLine(){if(!this._dragHeaderSplitLine){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},e.dragHeaderSplitLine,t.dragHeaderSplitLine);this._dragHeaderSplitLine={get lineColor(){var t;return null!==(t=i.lineColor)&&void 0!==t?t:"blue"},get lineWidth(){var t;return null!==(t=i.lineWidth)&&void 0!==t?t:2},get shadowBlockColor(){var t;return null!==(t=i.shadowBlockColor)&&void 0!==t?t:"rgba(204,204,204,0.3)"}}}return this._dragHeaderSplitLine}get frozenColumnLine(){if(!this._frozenColumnLine){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},e.frozenColumnLine,t.frozenColumnLine);this._frozenColumnLine={get shadow(){if(i.shadow)return{get width(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.width)&&void 0!==e?e:24},get startColor(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.startColor)&&void 0!==e?e:"rgba(00, 24, 47, 0.06)"},get endColor(){var t,e;return null!==(e=null===(t=i.shadow)||void 0===t?void 0:t.endColor)&&void 0!==e?e:"rgba(00, 24, 47, 0)"}}},get border(){if(i.border)return{get lineColor(){var t,e;return null!==(e=null===(t=i.border)||void 0===t?void 0:t.lineColor)&&void 0!==e?e:"rgba(00, 24, 47, 0.06)"},get bgColor(){var t,e,o,n;return null!==(n=null!==(e=null===(t=i.border)||void 0===t?void 0:t.bgColor)&&void 0!==e?e:null===(o=i.border)||void 0===o?void 0:o.lineColor)&&void 0!==n?n:"rgba(00, 24, 47, 0.06)"},get lineWidth(){var t,e;return null!==(e=null===(t=i.border)||void 0===t?void 0:t.lineWidth)&&void 0!==e?e:4},get width(){var t,e,o,n;return null!==(n=null!==(e=null===(t=i.border)||void 0===t?void 0:t.width)&&void 0!==e?e:null===(o=i.border)||void 0===o?void 0:o.lineWidth)&&void 0!==n?n:4}}}}}return this._frozenColumnLine}get selectionStyle(){if(!this._selectionStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},e.selectionStyle,t.selectionStyle);this._selectionStyle={get cellBgColor(){var t;return null!==(t=null==i?void 0:i.cellBgColor)&&void 0!==t?t:"rgba(0, 0, 255,0.1)"},get cellBorderColor(){var t;return null!==(t=null==i?void 0:i.cellBorderColor)&&void 0!==t?t:"#3073f2"},get cellBorderLineWidth(){var t;return null!==(t=null==i?void 0:i.cellBorderLineWidth)&&void 0!==t?t:2},get inlineColumnBgColor(){return null==i?void 0:i.inlineColumnBgColor},get inlineRowBgColor(){return null==i?void 0:i.inlineRowBgColor},get selectionFillMode(){var t;return null!==(t=null==i?void 0:i.selectionFillMode)&&void 0!==t?t:"overlay"}}}return this._selectionStyle}get axisStyle(){if(!this._axisStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},e.axisStyle,t.axisStyle);this._axisStyle=function(t){return{defaultAxisStyle:Vw(t.defaultAxisStyle),leftAxisStyle:Vw(t.leftAxisStyle),rightAxisStyle:Vw(t.rightAxisStyle),topAxisStyle:Vw(t.topAxisStyle),bottomAxisStyle:Vw(t.bottomAxisStyle)}}(i)}return this._axisStyle}get checkboxStyle(){if(!this._checkboxStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},e.checkboxStyle,t.checkboxStyle);this._checkboxStyle=i}return this._checkboxStyle}get radioStyle(){if(!this._radioStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},e.radioStyle,t.radioStyle);this._radioStyle=i}return this._radioStyle}get textPopTipStyle(){if(!this._textPopTipStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},$w,e.textPopTipStyle,t.textPopTipStyle);this._textPopTipStyle=i}return this._textPopTipStyle}get functionalIconsStyle(){if(!this._internalIconsStyle){const{obj:t,superTheme:e}=this.internalTheme,i=Uy({},e.functionalIconsStyle,t.functionalIconsStyle);this._internalIconsStyle=i}return this._internalIconsStyle}hasProperty(t){const{obj:e,superTheme:i}=this.internalTheme;return Kw(e,t)||Kw(i,t)}extends(t){return new Xw(Uy({},t),Uy(this.internalTheme.superTheme,this.internalTheme.obj))}getStyle(t){const e=this;return{get fontSize(){return t.fontSize},get fontFamily(){return t.fontFamily},get fontWeight(){return t.fontWeight},get fontVariant(){return t.fontVariant},get fontStyle(){return t.fontStyle},get bgColor(){return t.bgColor},get color(){return t.color},get strokeColor(){return t.strokeColor},get borderColor(){return t.borderColor},get borderLineWidth(){return t.borderLineWidth},get borderLineDash(){return t.borderLineDash},get hover(){if(t.hover)return{get cellBgColor(){var e,i;return null!==(i=null===(e=t.hover)||void 0===e?void 0:e.cellBgColor)&&void 0!==i?i:void 0},get inlineColumnBgColor(){var e,i,o,n,r,s;return null!==(s=null!==(i=null===(e=t.hover)||void 0===e?void 0:e.inlineColumnBgColor)&&void 0!==i?i:(null===(o=t.hover)||void 0===o?void 0:o.cellBgColor)&&"string"==typeof(null===(n=t.hover)||void 0===n?void 0:n.cellBgColor)?Xy(null===(r=t.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get inlineRowBgColor(){var e,i,o,n,r,s;return null!==(s=null!==(i=null===(e=t.hover)||void 0===e?void 0:e.inlineRowBgColor)&&void 0!==i?i:(null===(o=t.hover)||void 0===o?void 0:o.cellBgColor)&&"string"==typeof(null===(n=t.hover)||void 0===n?void 0:n.cellBgColor)?Xy(null===(r=t.hover)||void 0===r?void 0:r.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0}}},get select(){return{get inlineColumnBgColor(){var i,o,n,r,s,l;return null!==(l=null!==(r=null!==(o=null===(i=t.select)||void 0===i?void 0:i.inlineColumnBgColor)&&void 0!==o?o:null===(n=e.selectionStyle)||void 0===n?void 0:n.inlineColumnBgColor)&&void 0!==r?r:(null===(s=e.selectionStyle)||void 0===s?void 0:s.cellBgColor)&&"string"==typeof e.selectionStyle.cellBgColor?Xy(e.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==l?l:void 0},get inlineRowBgColor(){var i,o,n,r,s;return null!==(s=null!==(n=null!==(o=null===(i=t.select)||void 0===i?void 0:i.inlineRowBgColor)&&void 0!==o?o:e.selectionStyle.inlineRowBgColor)&&void 0!==n?n:(null===(r=e.selectionStyle)||void 0===r?void 0:r.cellBgColor)&&"string"==typeof e.selectionStyle.cellBgColor?Xy(e.selectionStyle.cellBgColor,.1,!1):void 0)&&void 0!==s?s:void 0},get cellBgColor(){var i,o,n;if("replace"===e.selectionStyle.selectionFillMode)return null!==(n=null!==(o=null===(i=t.select)||void 0===i?void 0:i.cellBgColor)&&void 0!==o?o:e.selectionStyle.cellBgColor)&&void 0!==n?n:void 0}}},get frameStyle(){if(t.frameStyle)return{get borderColor(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderColor)&&void 0!==i?i:void 0},get borderLineWidth(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderLineWidth)&&void 0!==i?i:void 0},get borderLineDash(){var e,i;return null!==(i=null===(e=t.frameStyle)||void 0===e?void 0:e.borderLineDash)&&void 0!==i?i:void 0}}},get padding(){return t.padding},get textAlign(){return t.textAlign},get textBaseline(){return t.textBaseline},get textOverflow(){return t.textOverflow},get lineHeight(){return t.lineHeight},get autoWrapText(){return t.autoWrapText},get lineClamp(){return t.lineClamp},get linkColor(){return t.linkColor},get cursor(){return t.cursor},get textStick(){return t.textStick},get marked(){return t.marked},get underline(){var e;return null!==(e=t.underline)&&void 0!==e&&e},get underlineColor(){return t.underlineColor},get underlineDash(){return t.underlineDash},get underlineOffset(){return t.underlineOffset},get lineThrough(){var e;return null!==(e=t.lineThrough)&&void 0!==e&&e},get lineThroughColor(){return t.lineThroughColor},get lineThroughDash(){return t.lineThroughDash}}}}function Kw(t,e){if(t instanceof Xw)return t.hasProperty(e);let i=t;if(!i)return!1;for(let t=0;t<e.length;t++)if(i=i[e[t]],!i)return!1;return!!i}const Zw=new Xw(Hw,Hw),qw=new Xw(Fw,Fw),Jw=new Xw(zw,zw),Qw=new Xw(Iw,Iw),tx=new Xw(Ow,Ow),ex={DEFAULT:Qw,SIMPLIFY:tx,ARCO:Jw,DARK:Zw,BRIGHT:qw};function ix(){return hw(ex,Dw)}var ox={DARK:Zw,BRIGHT:qw,ARCO:Jw,DEFAULT:Qw,SIMPLIFY:tx,theme:{TableTheme:Xw},of:function(t){if(!t)return null;if("string"==typeof t){const e=function(t,e){if(t[e])return t[e];const i=e.toLowerCase();if(t[i])return t[i];const o=e.toLowerCase();if(t[o])return t[o];for(const e in t)if(e.toLowerCase()===i)return t[e]}(ix(),t);return e?e instanceof Xw?e:new Xw(e,e):null}return t instanceof Xw?t:new Xw(t,t)},get:ix};function nx(t,e,i){var o;if(t.internalProps.customMergeCell){const o=t.getCustomMerge(e,i);if(o)return o.range}if(!t.internalProps.enableTreeNodeMerge&&!t.isHeader(e,i)&&!(null===(o=t.getBodyColumnDefine(e,i))||void 0===o?void 0:o.mergeCell))return!1;const n=t.getCellRange(e,i);return!(n.start.col===n.end.col&&n.start.row===n.end.row)&&n}class rx{static registerComponent(t,e){rx._components[t]=e}static getComponent(t){return rx._components[t]}static registerFunction(t,e){rx._functions[t]=e}static getFunction(t){return rx._functions[t]}static registerCellType(t,e){rx._cellTypes[t]=e}static getCellType(t){return rx._cellTypes[t]}}function sx(t,e,i,o,n,r){const s=function(t,e){const i=new Array(e);for(let o=0;o<e;o++)i[o]=t(o);return i}(t,i);s.sort(((t,e)=>o(r(t),r(e),n)));for(let t=0;t<i;t++)e(t,s[t])}rx._components={},rx._functions={},rx._cellTypes={};class lx{constructor(t){var e;this.className="Aggregator",this.isRecord=!0,this.records=[],this.key=t.key,this.field=t.dimension,this.formatFun=t.formatFun,this.isRecord=null!==(e=t.isRecord)&&void 0!==e?e:this.isRecord}clearCacheValue(){this._formatedValue=void 0}formatValue(t,e,i){return this._formatedValue||(this.formatFun?this._formatedValue=this.formatFun(this.value(),t,e,i):this._formatedValue=this.value()),this._formatedValue}reset(){this.records=[],this.clearCacheValue()}}class ax extends lx{constructor(){super(...arguments),this.type=Cy.RECORD,this.isRecord=!0}push(t){t&&this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),this.clearCacheValue()}deleteRecord(t){t&&this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.clearCacheValue())}value(){return this.records}reset(){this.records=[]}recalculate(){}}class hx extends lx{constructor(){super(...arguments),this.type=Cy.NONE,this.isRecord=!0}push(t){t&&(this.isRecord&&(this.records=[t]),this.field&&(this.fieldValue=t[this.field])),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.field&&this.records.length&&(this.fieldValue=this.records[this.records.length-1][this.field])),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.field&&this.records.length&&(this.fieldValue=this.records[this.records.length-1][this.field]),this.clearCacheValue())}value(){return this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class dx extends lx{constructor(t){super(t),this.type=Cy.CUSTOM,this.isRecord=!0,this.values=[],this.aggregationFun=t.aggregationFun}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),this.field&&this.values.push(t[this.field])),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.field&&this.records.length&&(this.values=this.records.map((t=>t[this.field]))),this.clearCacheValue())}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.field&&this.records.length&&(this.values=this.records.map((t=>t[this.field])))),this.clearCacheValue()}value(){var t;return this.fieldValue||(this.fieldValue=null===(t=this.aggregationFun)||void 0===t?void 0:t.call(this,this.values,this.records,this.field)),this.fieldValue}reset(){this.records=[],this.fieldValue=void 0}recalculate(){}}class cx extends lx{constructor(t){var e;super(t),this.type=Cy.SUM,this.sum=0,this.positiveSum=0,this.nagetiveSum=0,this.needSplitPositiveAndNegativeForSum=!1,this.needSplitPositiveAndNegativeForSum=null!==(e=t.needSplitPositiveAndNegative)&&void 0!==e&&e}push(t){if(t)if(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className){const e=t.value();this.sum+=null!=e?e:0,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const e=parseFloat(t[this.field]);this.sum+=e,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum+=e:e<0&&(this.nagetiveSum+=e))}this.clearCacheValue()}deleteRecord(t){if(t)if(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),"Aggregator"===t.className){const e=t.value();this.sum-=null!=e?e:0,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum-=e:e<0&&(this.nagetiveSum-=e))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const e=parseFloat(t[this.field]);this.sum-=e,this.needSplitPositiveAndNegativeForSum&&(e>0?this.positiveSum-=e:e<0&&(this.nagetiveSum-=e))}this.clearCacheValue()}updateRecord(t,e){if(t&&e){if(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),"Aggregator"===t.className){const i=t.value(),o=e.value();this.sum+=o-i,this.needSplitPositiveAndNegativeForSum&&(i>0?this.positiveSum-=i:i<0&&(this.nagetiveSum-=i),o>0?this.positiveSum+=o:o<0&&(this.nagetiveSum+=o))}else if(this.field&&!isNaN(parseFloat(t[this.field]))){const i=parseFloat(t[this.field]),o=parseFloat(e[this.field]);this.sum+=o-i,this.needSplitPositiveAndNegativeForSum&&(i>0?this.positiveSum-=i:i<0&&(this.nagetiveSum-=i),o>0?this.positiveSum+=o:o<0&&(this.nagetiveSum+=o))}this.clearCacheValue()}}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.sum:void 0}positiveValue(){return this.positiveSum}negativeValue(){return this.nagetiveSum}reset(){super.reset(),this.records=[],this.sum=0}recalculate(){if(this.sum=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];if("Aggregator"===e.className){const t=e.value();this.sum+=null!=t?t:0,this.needSplitPositiveAndNegativeForSum&&(t>0?this.positiveSum+=t:t<0&&(this.nagetiveSum+=t))}else if(this.field&&!isNaN(parseFloat(e[this.field]))){const t=parseFloat(e[this.field]);this.sum+=t,this.needSplitPositiveAndNegativeForSum&&(t>0?this.positiveSum+=t:t<0&&(this.nagetiveSum+=t))}}}}class ux extends lx{constructor(){super(...arguments),this.type=Cy.COUNT,this.count=0}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.count+=t.value():this.count++),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),"Aggregator"===t.className?this.count-=t.value():this.count--),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),"Aggregator"===t.className&&(this.count+=e.value()-t.value()))}value(){return this.count}reset(){this.records=[],this.count=0}recalculate(){if(this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.count+=e.value():this.count++}}}class gx extends lx{constructor(){super(...arguments),this.type=Cy.AVG,this.sum=0,this.count=0}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className&&t.type===Cy.AVG?(this.sum+=t.sum,this.count+=t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum+=parseFloat(t[this.field]),this.count++)),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),"Aggregator"===t.className&&t.type===Cy.AVG?(this.sum-=t.sum,this.count-=t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum-=parseFloat(t[this.field]),this.count--)),this.clearCacheValue()}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),"Aggregator"===t.className&&t.type===Cy.AVG?(this.sum+=e.sum-t.sum,this.count+=e.count-t.count):this.field&&!isNaN(parseFloat(t[this.field]))&&(this.sum+=parseFloat(e[this.field])-parseFloat(t[this.field])),this.clearCacheValue())}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.sum/this.count:void 0}reset(){this.records=[],this.sum=0,this.count=0}recalculate(){if(this.sum=0,this.count=0,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className&&e.type===Cy.AVG?(this.sum+=e.sum,this.count+=e.count):this.field&&!isNaN(parseFloat(e[this.field]))&&(this.sum+=parseFloat(e[this.field]),this.count++)}}}class px extends lx{constructor(){super(...arguments),this.type=Cy.MAX,this.max=Number.MIN_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.max=t.max>this.max?t.max:this.max:"number"==typeof t?this.max=t>this.max?t:this.max:this.field&&"number"==typeof t[this.field]?this.max=t[this.field]>this.max?t[this.field]:this.max:this.field&&!isNaN(t[this.field])&&(this.max=parseFloat(t[this.field])>this.max?parseFloat(t[this.field]):this.max)),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.recalculate())}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.recalculate())}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.max:void 0}reset(){this.records=[],this.max=Number.MIN_SAFE_INTEGER}recalculate(){if(this.max=Number.MIN_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.max=e.max>this.max?e.max:this.max:"number"==typeof e?this.max=e>this.max?e:this.max:this.field&&"number"==typeof e[this.field]?this.max=e[this.field]>this.max?e[this.field]:this.max:this.field&&!isNaN(e[this.field])&&(this.max=parseFloat(e[this.field])>this.max?parseFloat(e[this.field]):this.max)}}}class fx extends lx{constructor(){super(...arguments),this.type=Cy.MIN,this.min=Number.MAX_SAFE_INTEGER}push(t){t&&(this.isRecord&&this.records&&("Aggregator"===t.className?this.records.push(...t.records):this.records.push(t)),"Aggregator"===t.className?this.min=t.min<this.min?t.min:this.min:"number"==typeof t?this.min=t<this.min?t:this.min:this.field&&"number"==typeof t[this.field]?this.min=t[this.field]<this.min?t[this.field]:this.min:this.field&&!isNaN(t[this.field])&&(this.min=parseFloat(t[this.field])<this.min?parseFloat(t[this.field]):this.min)),this.clearCacheValue()}deleteRecord(t){t&&(this.isRecord&&this.records&&(this.records=this.records.filter((e=>e!==t))),this.recalculate())}updateRecord(t,e){t&&e&&(this.isRecord&&this.records&&(this.records=this.records.map((i=>i===t?e:i))),this.recalculate())}value(){var t;return(null===(t=this.records)||void 0===t?void 0:t.length)>=1?this.min:void 0}reset(){this.records=[],this.min=Number.MAX_SAFE_INTEGER}recalculate(){if(this.min=Number.MAX_SAFE_INTEGER,this._formatedValue=void 0,this.records)for(let t=0;t<this.records.length;t++){const e=this.records[t];"Aggregator"===e.className?this.min=e.min<this.min?e.min:this.min:"number"==typeof e?this.min=e<this.min?e:this.min:this.field&&"number"==typeof e[this.field]?this.min=e[this.field]<this.min?e[this.field]:this.min:this.field&&!isNaN(e[this.field])&&(this.min=parseFloat(e[this.field])<this.min?parseFloat(e[this.field]):this.min)}}}const vx={SOURCE_LENGTH_UPDATE:"source_length_update",CHANGE_ORDER:"change_order"};function mx(t,e){const i=uw(t);if(gw(i)){const t=i.then((t=>(e(t),t)));return e(t),t}return i}function bx(t,e,i,o,n,r){if(null==t)return;if(gw(t))return t.then((t=>bx(t,e,i,o,n,r)));const s=function(t){if(yw.isObject(t)){const e=t;if(K(e.get)&&K(e.set))return!0}return!1}(e)?e.get:e;if(s in t)return mx(t[s],r);if("function"==typeof s)return mx(s(t,i,o,n),r);if(Array.isArray(s))return mx(function(t,e){let i,o=t;for(;(i=e.shift())&&(o=o[i],o););return o}(t,[...s]),r);const l=`${s}`.split(".");return l.length<=1?mx(t[s],r):mx(dw(t,((t,e)=>bx(t,e,i,o,n,Sw)),...l),r)}function Cx(t,e){if(!t)return e;const i=t[e];return K(i)?i:e}class yx extends Ry{static get EVENT_TYPE(){return vx}constructor(t,e,i,o,n,r){var s;super(),this.currentIndexedData=[],this.hierarchyExpandLevel=0,this.hasHierarchyStateExpand=!1,this.beforeChangedRecordsMap={},this.registedAggregators={},this.fieldAggregators=[],this.registerAggregators(),this.dataSourceObj=t,this.dataConfig=e,this._get=null==t?void 0:t.get,this.columns=o,this._source=(null==t?void 0:t.records)?this.processRecords(null==t?void 0:t.records):t,this._sourceLength=(null===(s=this._source)||void 0===s?void 0:s.length)||0,this.sortedIndexMap=new Map,this._currentPagerIndexedData=[],this.userPagination=i,this.pagination=i||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},r>=1&&(this.hierarchyExpandLevel=r),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),"tree"===n&&this.initTreeHierarchyState(),this.rowHierarchyType=n,this.updatePagerData()}initTreeHierarchyState(){var t;this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e));let e=this._sourceLength;for(let i=0;i<e;i++){const o=this.currentIndexedData[i],n=this.getOriginalRecord(o),r=null!==(t=n.filteredChildren)&&void 0!==t?t:n.children;if((null==r?void 0:r.length)>0){if(this.hierarchyExpandLevel>1?!n.hierarchyState&&(n.hierarchyState=by.expand):!n.hierarchyState&&(n.hierarchyState=by.collapse),this.hasHierarchyStateExpand=!0,n.hierarchyState===by.collapse)continue;const t=this.initChildrenNodeHierarchy(o,this.hierarchyExpandLevel,2,n);i+=t,e+=t}else!0===n.children&&!n.hierarchyState&&(n.hierarchyState=by.collapse)}}registerAggregator(t,e){this.registedAggregators[t]=e}registerAggregators(){this.registerAggregator(Cy.RECORD,ax),this.registerAggregator(Cy.SUM,cx),this.registerAggregator(Cy.COUNT,ux),this.registerAggregator(Cy.MAX,px),this.registerAggregator(Cy.MIN,fx),this.registerAggregator(Cy.AVG,gx),this.registerAggregator(Cy.NONE,hx),this.registerAggregator(Cy.CUSTOM,dx)}updateColumns(t){this.columns=t}_generateFieldAggragations(){const t=this.columns;this.fieldAggregators=[];for(let e=0;e<(null==t?void 0:t.length);e++){delete t[e].vtable_aggregator;const i=t[e].field,o=t[e].aggregation;if(o)if(Array.isArray(o))for(let n=0;n<o.length;n++){const r=o[n],s=new this.registedAggregators[r.aggregationType]({dimension:i,formatFun:r.formatFun,isRecord:!0,aggregationFun:r.aggregationFun});this.fieldAggregators.push(s),t[e].vtable_aggregator||(t[e].vtable_aggregator=[]),t[e].vtable_aggregator.push(s)}else{const n=new this.registedAggregators[o.aggregationType]({dimension:i,formatFun:o.formatFun,isRecord:!0,aggregationFun:o.aggregationFun});this.fieldAggregators.push(n),t[e].vtable_aggregator=n}}}processRecords(t){var e,i,o,n,r,s,l,a;this._generateFieldAggragations();const h=[],d=this.fieldAggregators.length>=1;if((null===(i=null===(e=this.dataConfig)||void 0===e?void 0:e.filterRules)||void 0===i?void 0:i.length)>=1||(null===(o=this.lastFilterRules)||void 0===o?void 0:o.length)>=1||d){for(let e=0,i=t.length;e<i;e++){const i=t[e];(null===(r=null===(n=this.dataConfig)||void 0===n?void 0:n.filterRules)||void 0===r?void 0:r.length)>=1?this.filterRecord(i)&&(h.push(i),"tree"===this.rowHierarchyType&&i.children&&(i.filteredChildren=this.filteredChildren(i.children)),d&&this.processRecord(i)):(null===(s=this.lastFilterRules)||void 0===s?void 0:s.length)>=1?(this.clearFilteredChildren(i),d&&this.processRecord(i)):d&&this.processRecord(i)}if((null===(a=null===(l=this.dataConfig)||void 0===l?void 0:l.filterRules)||void 0===a?void 0:a.length)>=1)return h}return t}filteredChildren(t){const e=[];for(let i=0,o=t.length;i<o;i++){const o=t[i];this.filterRecord(o)&&(e.push(o),o.children&&(o.filteredChildren=this.filteredChildren(o.children)))}return e}processRecord(t){for(let e=0;e<this.fieldAggregators.length;e++)this.fieldAggregators[e].push(t)}initChildrenNodeHierarchy(t,e,i,o){var n,r,s;let l=0;const a=o.filteredChildren?o.filteredChildren.length:null!==(r=null===(n=o.children)||void 0===n?void 0:n.length)&&void 0!==r?r:0;for(let n=0;n<a;n++){(i<=e||o.hierarchyState===by.expand)&&(l+=1);const r=o.filteredChildren?o.filteredChildren[n]:o.children[n],a=Array.isArray(t)?t.concat(n):[t,n];(i<=e||o.hierarchyState===by.expand)&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+l,0,a),(r.filteredChildren?r.filteredChildren.length>0:(null===(s=r.children)||void 0===s?void 0:s.length)>0)&&(i<e||r.hierarchyState===by.expand?(!r.hierarchyState&&(r.hierarchyState=by.expand),this.hasHierarchyStateExpand=!0):!r.hierarchyState&&(r.hierarchyState=by.collapse)),r.hierarchyState===by.expand&&(l+=this.initChildrenNodeHierarchy(a,e,i+1,r)),!0===r.children&&!r.hierarchyState&&(r.hierarchyState=by.collapse)}return l}updatePagination(t){this.pagination=t||{totalCount:this._sourceLength,perPageCount:this._sourceLength,currentPage:0},this.updatePagerData()}updatePagerData(){const{currentIndexedData:t}=this,{perPageCount:e,currentPage:i}=this.pagination,o=e*(i||0),n=o+e;if(this._currentPagerIndexedData.length=0,t&&t.length>0){let e=-1;for(let i=0;i<t.length;i++)if((Array.isArray(t[i])&&1===t[i].length||!Array.isArray(t[i]))&&e++,e>=o&&e<n)this._currentPagerIndexedData.push(t[i]);else if(e>=n)break}else if(this._sourceLength>0)throw new Error("currentIndexedData should has values!")}get records(){return Array.isArray(this._source)?this._source:[]}get source(){return this._source}get(t){return this.getOriginalRecord(Cx(this.currentPagerIndexedData,t))}getRaw(t){return this.getRawRecord(Cx(this.currentPagerIndexedData,t))}getIndexKey(t){return Cx(this.currentPagerIndexedData,t)}getTableIndex(t){return Array.isArray(t)?this.currentPagerIndexedData.findIndex((e=>Pt(e,t))):this.currentPagerIndexedData.findIndex((e=>e===t))}getField(t,e,i,o,n){return this.getOriginalField(Cx(this.currentPagerIndexedData,t),e,i,o,n)}getRawField(t,e,i,o,n){return this.getRawFieldData(Cx(this.currentPagerIndexedData,t),e,i,o,n)}hasField(t,e){return this.hasOriginalField(Cx(this.currentPagerIndexedData,t),e)}getHierarchyState(t){var e;const i=this.getOriginalRecord(this.currentPagerIndexedData[t]);return null!==(e=null==i?void 0:i.hierarchyState)&&void 0!==e?e:null}toggleHierarchyState(t,e,i){const o=this.currentIndexedData.slice(0),n=this.getIndexKey(t),r=this.getHierarchyState(t),s=this.getOriginalRecord(n);if(this.clearSortedIndexMap(),r===by.collapse)s.hierarchyState=by.expand,this.pushChildrenNode(n,by.expand,s),this.hasHierarchyStateExpand=!0;else if(r===by.expand){let t=0;const e=(i,o,n)=>{if(!o||o===by.collapse||o===by.none)return;const r=n.filteredChildren?n.filteredChildren:n.children;if(r)for(let o=0;o<r.length;o++){t+=1;const n=Array.isArray(i)?i.concat([o]):[i,o];e(n,r[o].hierarchyState,r[o])}};e(n,r,s),this.currentIndexedData.splice(this.currentIndexedData.indexOf(n)+1,t),s.hierarchyState=by.collapse}this.updatePagerData();const l=[],a=[];if(r===by.collapse){const e=this.currentIndexedData.length-o.length;for(let i=0;i<e;i++)l.push(t+i+1)}else if(r===by.expand){const e=o.length-this.currentIndexedData.length;for(let i=0;i<e;i++)a.push(t+i+1)}return{add:l,remove:a}}pushChildrenNode(t,e,i){var o,n;if(!e||e===by.collapse||e===by.none)return 0;let r=0;const s=i.filteredChildren?i.filteredChildren:i.children;if(s){const e=Array.from({length:s.length},((t,e)=>e));null===(o=this.lastSortStates)||void 0===o||o.forEach((i=>{"normal"!==i.order&&sx((t=>K(e[t])?e[t]:e[t]=t),((t,i)=>{e[t]=i}),s.length,i.orderFn,i.order,(e=>this.getOriginalField(Array.isArray(t)?t.concat([e]):[t,e],i.field)))}));for(let i=0;i<e.length;i++){r+=1;const o=Array.isArray(t)?t.concat([e[i]]):[t,e[i]];this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+r,0,o);const l=this.getOriginalRecord(o);!l.hierarchyState&&(null!==(n=l.filteredChildren)&&void 0!==n?n:l.children)&&(l.hierarchyState=by.collapse),r+=this.pushChildrenNode(o,l.hierarchyState,s[e[i]])}}return r}changeFieldValue(t,e,i,o,n,r){var s;if(null!==i&&e>=0){const o=this.getIndexKey(e);if(!this.beforeChangedRecordsMap[o]){const t=this.getOriginalRecord(o);this.beforeChangedRecordsMap[o]=null!==(s=vt(t))&&void 0!==s?s:{}}if("string"==typeof i||"number"==typeof i){const e=this.beforeChangedRecordsMap[o][i],n=this.getOriginalRecord(o);let r=t;"number"==typeof e&&function(t){return/^-?\d+(\.\d+)?$/.test(t)}(t)&&(r=parseFloat(t)),gw(n)?n.then((t=>{t[i]=r})).catch((t=>{})):n?n[i]=r:(this.records[o]={},this.records[o][i]=r)}}}setRecord(t,e){var i,o;let n=!0;if((null===(o=null===(i=this.dataConfig)||void 0===i?void 0:i.filterRules)||void 0===o?void 0:o.length)>=1&&(this.filterRecord(t)?"tree"===this.rowHierarchyType&&t.children&&(t.filteredChildren=this.filteredChildren(t.children)):n=!1),n&&Array.isArray(this.records)){const i=this.getIndexKey(e);Array.isArray(i)||this.records.splice(i,1,t)}}addRecord(t,e){var i;if(Array.isArray(this.records)){this.records.splice(e,0,t),this.adjustBeforeChangedRecordsMap(e,1),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1;for(let e=0;e<this.fieldAggregators.length;e++)this.fieldAggregators[e].push(t);if("tree"===this.rowHierarchyType&&this.initTreeHierarchyState(),this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:t,currentPage:i}=this.pagination;e<t*(i||0)+t&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();(null===(i=this.dataSourceObj)||void 0===i?void 0:i.added)&&this.dataSourceObj.added(e,1)}}addRecords(t,e){var i;if(Array.isArray(this.records)){if(Array.isArray(t)){this.records.splice(e,0,...t),this.adjustBeforeChangedRecordsMap(e,t.length);for(let e=0;e<t.length;e++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length;for(let e=0;e<this.fieldAggregators.length;e++)for(let i=0;i<t.length;i++)this.fieldAggregators[e].push(t[i])}if(this.userPagination){this.pagination.totalCount=this._sourceLength;const{perPageCount:t,currentPage:i}=this.pagination;e<t*(i||0)+t&&this.updatePagerData()}else this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,this.updatePagerData();(null===(i=this.dataSourceObj)||void 0===i?void 0:i.added)&&this.dataSourceObj.added(e,t.length)}}addRecordForSorted(t){Array.isArray(this.records)&&(this.beforeChangedRecordsMap=[],this.records.push(t),this.currentIndexedData.push(this.currentIndexedData.length),this._sourceLength+=1,this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength))}addRecordsForSorted(t){if(Array.isArray(this.records)){if(this.beforeChangedRecordsMap=[],Array.isArray(t)){this.records.push(...t);for(let e=0;e<t.length;e++)this.currentIndexedData.push(this.currentIndexedData.length);this._sourceLength+=t.length,this.sortedIndexMap.clear()}this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}adjustBeforeChangedRecordsMap(t,e){for(let i=this.beforeChangedRecordsMap.length-1;i>=t;i--){const t=this.beforeChangedRecordsMap[i];delete this.beforeChangedRecordsMap[i],this.beforeChangedRecordsMap[i+e]=t}}deleteRecords(t){var e;if(Array.isArray(this.records)){const i=[],o=t.sort(((t,e)=>e-t));for(let t=0;t<o.length;t++){const e=o[t];if(e>=this._sourceLength||e<0)continue;delete this.beforeChangedRecordsMap[e],i.push(e);const n=this.records[e];for(let t=0;t<this.fieldAggregators.length;t++)this.fieldAggregators[t].deleteRecord(n);this.records.splice(e,1),this.currentIndexedData.pop(),this._sourceLength-=1}return this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength),this.updatePagerData(),(null===(e=this.dataSourceObj)||void 0===e?void 0:e.deleted)&&this.dataSourceObj.deleted(i),i}return[]}deleteRecordsForSorted(t){if(Array.isArray(this.records)){const e=t.sort(((t,e)=>e-t));for(let t=0;t<e.length;t++){const i=e[t];if(i>=this._sourceLength||i<0)continue;const o=this.currentIndexedData[i];delete this.beforeChangedRecordsMap[o],this.records.splice(o,1),this._sourceLength-=1}this.sortedIndexMap.clear(),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}}updateRecords(t,e){const i=[];for(let o=0;o<e.length;o++){const n=e[o];if(Array.isArray(n))delete this.beforeChangedRecordsMap[n.join(",")],i.push(n),n.slice(0,-1).reduce(((t,e)=>(void 0===t[e]&&(t[e]={}),t[e].children)),this.records)[n[n.length-1]]=t[o];else{if(n>=this._sourceLength||n<0)continue;delete this.beforeChangedRecordsMap[n],i.push(n);for(let e=0;e<this.fieldAggregators.length;e++)this.fieldAggregators[e].updateRecord(this.records[n],t[o]);this.records[n]=t[o]}}return this.userPagination&&this.updatePagerData(),i}updateRecordsForSorted(t,e){for(let i=0;i<e.length;i++){const o=e[i];if(o>=this._sourceLength||o<0)continue;const n=this.currentIndexedData[o];if("number"!=typeof n)return;delete this.beforeChangedRecordsMap[n],this.records[n]=t[i]}this.sortedIndexMap.clear()}sort(t){t=(Array.isArray(t)?t:[t]).filter((t=>{const e=this.columns.find((e=>e.field===t.field));return!1!==(null==e?void 0:e.sort)&&"normal"!==t.order})),this.lastSortStates=t;let e=t.map((t=>this.sortedIndexMap.get(null==t?void 0:t.field)||{asc:[],desc:[],normal:[]})),i=null;if(e.length>0&&(i=t.reduce(((t,i,o)=>{var n;const r=null===(n=e[o])||void 0===n?void 0:n[i.order];return r&&r.length>0?r:t}),null),i&&i.length>0))return this.currentIndexedData=i,this.updatePagerData(),void this.fireListeners(vx.CHANGE_ORDER,null);const o=Array.from({length:this._sourceLength},((t,e)=>e));if(o.sort(((e,i)=>t.reduce(((t,o)=>0!==t?t:(o.orderFn||("desc"!==o.order?(t,e)=>t===e?0:t>e?1:-1:(t,e)=>t===e?0:t<e?1:-1))(this.getOriginalField(e,o.field),this.getOriginalField(i,o.field),o.order)),0))),this.currentIndexedData=o,this.hierarchyExpandLevel){let t=o.length;for(let e=0;e<t;e++){const i=this.getOriginalRecord(o[e]),n=this.pushChildrenNode(o[e],i.hierarchyState,this.getOriginalRecord(o[e]));t+=n,e+=n}}if(!e.length){e=t.map((()=>({asc:[],desc:[],normal:[]})));for(let i=0;i<t.length;i++)this.sortedIndexMap.set(t[i].field,e[i])}t.forEach(((t,i)=>{e[i][t.order]=o.slice()})),this.updatePagerData(),this.fireListeners(vx.CHANGE_ORDER,null)}setSortedIndexMap(t,e){this.sortedIndexMap.set(t,e)}clearFilteredChildren(t){var e,i;t.filteredChildren=void 0;for(let o=0;null!==(i=o<(null===(e=t.children)||void 0===e?void 0:e.length))&&void 0!==i&&i;o++)this.clearFilteredChildren(t.children[o])}filterRecord(t){var e,i,o;let n=!0;for(let r=0;r<(null===(e=this.dataConfig.filterRules)||void 0===e?void 0:e.length);r++){const e=null===(i=this.dataConfig)||void 0===i?void 0:i.filterRules[r];if(e.filterKey){const i=t[e.filterKey];if(-1===e.filteredValues.indexOf(i)){n=!1;break}}else if(!(null===(o=e.filterFunc)||void 0===o?void 0:o.call(e,t))){n=!1;break}}return n}updateFilterRulesForSorted(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords(null!==(i=null===(e=this.dataSourceObj)||void 0===e?void 0:e.records)&&void 0!==i?i:this.dataSourceObj),this._sourceLength=(null===(o=this._source)||void 0===o?void 0:o.length)||0,this.sortedIndexMap.clear(),this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength)}updateFilterRules(t){var e,i,o;this.lastFilterRules=this.dataConfig.filterRules,this.dataConfig.filterRules=t,this._source=this.processRecords(null!==(i=null===(e=this.dataSourceObj)||void 0===e?void 0:e.records)&&void 0!==i?i:this.dataSourceObj),this._sourceLength=(null===(o=this._source)||void 0===o?void 0:o.length)||0,this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this._sourceLength,this.pagination.totalCount=this._sourceLength,"tree"===this.rowHierarchyType&&this.initTreeHierarchyState()),this.updatePagerData()}clearSortedIndexMap(){this.lastSortStates&&this.lastSortStates.length>0&&this.sortedIndexMap.forEach(((t,e)=>{this.lastSortStates.some((t=>t.field===e))?this.lastSortStates.forEach((e=>{"asc"===e.order?(t.desc=[],t.normal=[]):"desc"===e.order?(t.asc=[],t.normal=[]):(t.asc=[],t.desc=[])})):this.sortedIndexMap.delete(e)}))}get sourceLength(){return this._sourceLength}set sourceLength(t){this._sourceLength!==t&&(this._sourceLength=t,this.fireListeners(vx.SOURCE_LENGTH_UPDATE,this._sourceLength))}get length(){return this.currentPagerIndexedData.length}get dataSource(){return this}get currentPagerIndexedData(){return this._currentPagerIndexedData.length>0?this._currentPagerIndexedData:[]}release(){var t;null===(t=super.release)||void 0===t||t.call(this),this.lastFilterRules=null}clearSortedMap(){this.currentIndexedData&&(this.currentIndexedData.length=0),this.currentIndexedData=null,this.sortedIndexMap.forEach((t=>{t.asc&&(t.asc.length=0),t.desc&&(t.desc.length=0)})),this.sortedIndexMap.clear()}clearCurrentIndexedData(){this.currentIndexedData=null,this.currentPagerIndexedData.length=0}getOriginalRecord(t){let e;return e=this.dataSourceObj.records?Array.isArray(t)?wx(this.records,t):this.records[t]:this._get(t),mx(e,(e=>{this.recordPromiseCallBack(t,e)}))}getRawRecord(t){var e;if(null===(e=this.beforeChangedRecordsMap)||void 0===e?void 0:e[t])return this.beforeChangedRecordsMap[t];let i;return i=this.dataSourceObj.records?Array.isArray(t)?wx(this.records,t):this.records[t]:this._get(t),mx(i,(e=>{this.recordPromiseCallBack(t,e)}))}getOriginalField(t,e,i,o,n){if(null!==e)return bx(this.getOriginalRecord(t),e,i,o,n,(i=>{this.fieldPromiseCallBack(t,e,i)}))}getRawFieldData(t,e,i,o,n){if(null!==e)return bx(this.getRawRecord(t),e,i,o,n,(i=>{this.fieldPromiseCallBack(t,e,i)}))}hasOriginalField(t,e){if(null===e)return!1;if("function"==typeof e)return!0;const i=this.getOriginalRecord(t);return Boolean(i&&e in i)}fieldPromiseCallBack(t,e,i){}recordPromiseCallBack(t,e){}isCanExchangeOrder(t,e){if(this.hasHierarchyStateExpand){let i=this.currentPagerIndexedData[t],o=this.currentPagerIndexedData[e];if(i=Array.isArray(i)?[...i]:[i],o=Array.isArray(o)?[...o]:[o],e>t&&o.length>i.length){let t=this.currentPagerIndexedData[e+1];t=Array.isArray(t)?[...t]:[t],t.length<o.length&&o.splice(o.length-1,1)}if(i.length===o.length){for(let t=0;t<=i.length-2;t++)if(i[t]!==o[t])return!1;return!0}return!1}return!0}reorderRecord(t,e){var i,o;if(!(null===(i=this.lastSortStates)||void 0===i?void 0:i.some((t=>"asc"===t.order||"desc"===t.order)))&&this.isCanExchangeOrder(t,e))if(this.hasHierarchyStateExpand){let i,n,r=this.currentPagerIndexedData[t],s=this.currentPagerIndexedData[e];if(r=Array.isArray(r)?[...r]:[r],s=Array.isArray(s)?[...s]:[s],r.length>1||s.length>1){if(e>t&&s.length>r.length){let t=this.currentPagerIndexedData[e+1];t=Array.isArray(t)?[...t]:[t],t.length<s.length&&s.splice(s.length-1,1)}if(i=r.splice(r.length-1,1)[0],n=s.splice(s.length-1,1)[0],r.length>=1){const t=this.getOriginalRecord(r),e=t.filteredChildren?t.filteredChildren.splice(i,1):t.children.splice(i,1);e.unshift(n,0),Array.prototype.splice.apply(null!==(o=t.filteredChildren)&&void 0!==o?o:t.children,e)}else{const t=this.records.splice(i,1);t.unshift(n,0),Array.prototype.splice.apply(this.records,t)}}else{i=this.currentPagerIndexedData[t],n=this.currentPagerIndexedData[e];const o=this.records.splice(i,1);o.unshift(n,0),Array.prototype.splice.apply(this.records,o)}this.restoreTreeHierarchyState(),this.updatePagerData()}else{const i=this.records.splice(t,1);i.unshift(e,0),Array.prototype.splice.apply(this.records,i)}}restoreTreeHierarchyState(){var t,e;if(this.hierarchyExpandLevel){for(let e=0;e<this._sourceLength;e++){const i=this.getOriginalRecord(e);(null!==(t=i.filteredChildren)&&void 0!==t?t:i.children)&&!i.hierarchyState&&(i.hierarchyState=by.collapse)}this.currentIndexedData=Array.from({length:this._sourceLength},((t,e)=>e));let i=this._sourceLength;for(let t=0;t<i;t++){const o=this.currentIndexedData[t],n=this.getOriginalRecord(o),r=null!==(e=n.filteredChildren)&&void 0!==e?e:n.children;if((null==r?void 0:r.length)>0&&n.hierarchyState===by.expand){this.hasHierarchyStateExpand=!0;const e=this.restoreChildrenNodeHierarchy(o,n);t+=e,i+=e}else!0===n.children&&!n.hierarchyState&&(n.hierarchyState=by.collapse)}}}restoreChildrenNodeHierarchy(t,e){var i,o;let n=0;const r=null!==(i=e.filteredChildren)&&void 0!==i?i:e.children,s=null!==(o=null==r?void 0:r.length)&&void 0!==o?o:0;for(let i=0;i<s;i++){e.hierarchyState===by.expand&&(n+=1);const o=r[i],s=Array.isArray(t)?t.concat(i):[t,i];e.hierarchyState===by.expand&&this.currentIndexedData.splice(this.currentIndexedData.indexOf(t)+n,0,s),n+=this.restoreChildrenNodeHierarchy(s,o)}return n}}function wx(t,e){var i;let o=t;for(let t=0;t<e.length;t++){const n=e[t];if(!o[n])return;o=o[n];const r=null!==(i=o.filteredChildren)&&void 0!==i?i:null==o?void 0:o.children;r&&t+1<e.length&&(o=r)}return o}yx.EMPTY=new yx({get(){},length:0});class xx extends yx{static get EVENT_TYPE(){return yx.EVENT_TYPE}static ofArray(t,e,i,o,n,r){return new xx({get:e=>t[e],length:t.length,records:t},e,i,o,n,r)}constructor(t,e,i,o,n,r){et(null==e?void 0:e.groupByRules)&&(n="tree"),super(t,e,i,o,n,r),this._recordCache=[],this._fieldCache={}}getOriginalRecord(t){return this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getOriginalRecord(t)}getRawRecord(t){var e;return(null===(e=this.beforeChangedRecordsMap)||void 0===e?void 0:e[t])?this.beforeChangedRecordsMap[t]:this._recordCache&&this._recordCache[t]?this._recordCache[t]:super.getRawRecord(t)}getOriginalField(t,e,i,o,n){const r=this._fieldCache&&this._fieldCache[t];if(r){const t=r.get(e);if(t)return t}return super.getOriginalField(t,e,i,o,n)}clearCache(){this._recordCache&&(this._recordCache=[]),this._fieldCache&&(this._fieldCache={})}fieldPromiseCallBack(t,e,i){!function(t,e,i,o){(t[e]||(t[e]=new Map)).set(i,o)}(this._fieldCache,t,e,i)}recordPromiseCallBack(t,e){this._recordCache&&(this._recordCache[t]=e)}get records(){return Array.isArray(this._recordCache)&&this._recordCache.length>0?this._recordCache:super.records}release(){var t;null===(t=super.release)||void 0===t||t.call(this),this._recordCache=null,this._fieldCache=null}_generateFieldAggragations(){var t;if(super._generateFieldAggragations(),et(null===(t=this.dataConfig)||void 0===t?void 0:t.groupByRules)){const t=this.dataConfig.groupByRules;this.groupAggregator=new this.registedAggregators[Cy.CUSTOM]({dimension:"",aggregationFun:(e,i,o)=>{const n=new Map,r=[];for(let e=0;e<i.length;e++)_x(i[e],r,n,t,0),i[e].vtableOriginIndex=e;return r}}),this.fieldAggregators.push(this.groupAggregator)}}processRecords(t){var e;const i=super.processRecords(t);return(null===(e=this.groupAggregator)||void 0===e?void 0:e.value())||i}getGroupLength(){var t,e,i;return null!==(i=null===(e=null===(t=this.dataConfig)||void 0===t?void 0:t.groupByRules)||void 0===e?void 0:e.length)&&void 0!==i?i:0}updateGroup(){var t,e,i;this.clearCache();const o=this.source;this._source=this.processRecords(null!==(e=null===(t=this.dataSourceObj)||void 0===t?void 0:t.records)&&void 0!==e?e:this.dataSourceObj),o&&Sx(o,this.source),this.sourceLength=(null===(i=this.source)||void 0===i?void 0:i.length)||0,this.sortedIndexMap.clear(),this.currentIndexedData=Array.from({length:this.sourceLength},((t,e)=>e)),this.userPagination||(this.pagination.perPageCount=this.sourceLength,this.pagination.totalCount=this.sourceLength),this.initTreeHierarchyState(),this.updatePagerData()}addRecordsForGroup(t,e){et(t)&&0!==t.length&&((void 0===e||e>this.dataSourceObj.records)&&(e=this.dataSourceObj.records),this.dataSourceObj.records.splice(e,0,...t),this.updateGroup())}deleteRecordsForGroup(t){if(!et(t)||0===t.length)return;const e=t.sort(((t,e)=>e-t));for(let t=0;t<e.length;t++){const i=e[t];i>=this.sourceLength||i<0||(delete this.beforeChangedRecordsMap[i],this.dataSourceObj.records.splice(i,1),this.sourceLength-=1)}this.updateGroup()}updateRecordsForGroup(t,e){for(let i=0;i<e.length;i++){const o=e[i];o>=this.sourceLength||o<0||(delete this.beforeChangedRecordsMap[o],this.dataSourceObj.records[o]=t[i])}this.updateGroup()}}function _x(t,e,i,o,n){const r=o[n];if(!K(r))return void e.push(t);const s=t[r];if(void 0!==s){if(i.has(s)){const r=i.get(s);return _x(t,e[r].children,e[r].map,o,n+1)}return i.set(s,e.length),e.push({vtableMerge:!0,vtableMergeName:s,children:[],map:new Map}),_x(t,e[e.length-1].children,e[e.length-1].map,o,n+1)}}function Sx(t,e,i,o){if(!i){i=new Map;for(let e=0;e<t.length;e++){const o=t[e];o.vtableMerge&&i.set(o.vtableMergeName,e)}}if(!o){o=new Map;for(let t=0;t<e.length;t++){const i=e[t];i.vtableMerge&&o.set(i.vtableMergeName,t)}}for(let i=0;i<t.length;i++){const n=t[i],r=e[o.get(n.vtableMergeName)];K(r)&&(r.hierarchyState=t[i].hierarchyState),et(n.children)&&et(r.children)&&0!==n.map.size&&0!==r.map.size&&Sx(n.children,r.children,n.map,r.map)}}var Ax={exports:{}},Rx={},Bx=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),Mx=["style","variant","weight","size","lineHeight","family"],Tx=/([\.0-9]+)(.*)/,Px=function(t,e,i){var o=t.match(Tx);if(o){t=parseFloat(o[1]);var n=o[2].toLowerCase().trim(),r=Math.round(t);switch(r===t&&(t=r),n){case"em":if(null===e)return;return t*e;case"px":return t;case"pt":return t/(72/i);case"pc":return t/(6/i);case"mm":return t*(i/25.4);case"cm":return t*(i/2.54);case"in":return t*i;case"%":if(null===e)return;return e*(t/100)}}},Ex={size:Px,lineHeight:Px},kx={serif:1,"sans-serif":1,cursive:1,fantasy:1,monospace:1},Lx=Ax.exports=function(t,e,i){var o=t+"-"+(e||"null")+"@"+i;if(i=i||96,void 0!==Rx[o])return Rx[o];if(e&&(e=Lx(e,null,i)),"inherit"===t)return e;var n=Bx.exec(t);if(n){n.shift();for(var r={},s=0;s<n.length;s++){var l=Mx[s],a=n[s];if(Ex[l]&&a){var h=e&&e[l]||null,d=Ex[l](a,h,i);a=void 0===d&&"lineHeight"===l&&a?r.size*parseFloat(a):d}if(a&&"normal"!==a){if("inherit"===a){if(!e)return;a=e[l]}a.trim&&(a=a.trim()),r[l]=a}}Object.keys(r).length||(r=null),Rx[o]=r;var c=[];r.style&&c.push(r.style),r.variant&&c.push(r.variant),r.weight&&"400"!==r.weight&&"normal"!==r.weight&&c.push(r.weight),c.push(r.size+"px"),r.lineHeight&&(c[c.length-1]+="/"+r.lineHeight+"px");var u=r.family.split(",");return r.family=u.map((function(t){return t=t.trim(),kx[t.toLowerCase()]&&(t=t.toLowerCase()),t})),c.push(r.family),Object.defineProperty(r,"toString",{value:function(){return c.map((function(t){return Array.isArray(t)?t.map((function(t){return t.indexOf(" ")>-1?'"'+t.replace(/["']/g,"")+'"':t})).join(", "):t})).join(" ")}}),r}Rx[o]=null};Ax.exports.generics=kx;var Hx=G(Ax.exports);function Fx(t){var e,i,o,n;if(nt(t)||tt(t)||et(t)){let e=Qn(t);return"number"==typeof e||"string"==typeof e?e=[e,e,e,e]:Array.isArray(e)&&(e=e.slice(0)),e}return t&&(isFinite(t.bottom)||isFinite(t.left)||isFinite(t.right)||isFinite(t.top))?[null!==(e=t.top)&&void 0!==e?e:0,null!==(i=t.right)&&void 0!==i?i:0,null!==(o=t.bottom)&&void 0!==o?o:0,null!==(n=t.left)&&void 0!==n?n:0]:[0,0,0,0]}const zx=0,Ix=1,Ox=2,Dx=3,Wx=10,Nx=11,Gx=12,jx=9,Ux=13,Vx=10,$x=12,Yx=32,Xx=37,Kx=46,Zx=48,qx=57,Jx=65,Qx=90,t_=97,e_=122;function i_(t){return function(t){return t>=t_&&t<=e_}(t)||function(t){return t>=Jx&&t<=Qx}(t)}function o_(t){return t===jx||t===Vx||t===$x||t===Ux||t===Yx}function n_(t){return t>=Zx&&t<=qx}function r_(t){return t===Kx}function s_(t){return i_(t)||t===Xx}function l_(t){return new Error(`calc parse error: ${t}`)}const a_={"*":3,"/":3,"+":2,"-":2};function h_(t,e){function i(t){const i=t.pop(),o=t.pop(),n=t.pop();if(!(n&&n.nodeType&&o&&o.type===Ox&&i&&i.nodeType))throw l_(e);return{nodeType:Nx,left:n,op:o,right:i}}const o=[];for(;t.length;){const n=t.shift();if(n.type===zx&&"("===n.value){let i=0;const n=ow.findIndex(t,(t=>{if(t.type===zx&&"("===t.value)i++;else if(t.type===zx&&")"===t.value){if(!i)return!0;i--}return!1}));if(-1===n)throw l_(e);o.push(h_(t.splice(0,n),e)),t.shift()}else if(n.type===Ox){if(o.length>=3){const t=o[o.length-2].value;a_[n.value]<=a_[t]&&o.push(i(o))}o.push(n)}else if(n.type===Ix){const{value:t,unit:e}=n;o.push({nodeType:Wx,value:t,unit:e})}else n.type===Dx&&o.push({nodeType:Gx,value:n.value})}for(;o.length>1;)o.push(i(o));return o[0]}function d_(t){return h_(function(t){const e=t.replace(/calc\(/g,"(").trim(),i=[],o=e.length;for(let s=0;s<o;s++){const o=e[s],l=o.charCodeAt(0);if("("===o||")"===o)i.push({value:o,type:zx});else if("*"===o||"/"===o)i.push({value:o,type:Ox});else if("+"===o||"-"===o)s=n(o,s+1)-1;else if(n_(l)||r_(l))s=r(o,s+1)-1;else if(!o_(l))throw l_(t)}function n(t,n){if(n<o){const i=e[n],o=i.charCodeAt(0);if(n_(o)||r_(o))return r(t+i,n+1)}return i.push({value:t,type:Ox}),n}function r(n,r){let l=r;for(;l<o;l++){const i=e[l],o=i.charCodeAt(0);if(n_(o))n+=i;else{if("."!==i){if(s_(o))return s(n,i,l+1);break}if(n.indexOf(".")>=0)throw l_(t);n+=i}}if("."===n)throw l_(t);return i.push({value:parseFloat(n),type:Dx}),l}function s(t,n,r){let s=r;for(;s<o;s++){const t=e[s];if(!s_(t.charCodeAt(0)))break;n+=t}return i.push({value:parseFloat(t),unit:n,type:Ix}),s}return i}(t),t)}function c_(t,e){if(t.nodeType===Nx){const i=c_(t.left,e),o=c_(t.right,e);switch(t.op.value){case"+":return i+o;case"-":return i-o;case"*":return i*o;case"/":return i/o;default:throw new Error(`calc error. unknown operator: ${t.op.value}`)}}else if(t.nodeType===Wx)switch(t.unit){case"%":return t.value*e.full/100;case"px":return t.value;default:throw new Error(`calc error. unknown unit: ${t.unit}`)}else if(t.nodeType===Gx)return t.value;throw new Error("calc error.")}function u_(t,e){return c_(d_(t),e)}function g_(t){return!!tt(t)&&!!t.endsWith("%")&&function(t){return!(X(t)||!nt(t)&&+t!=+t)}(t.substring(0,t.length-1))}function p_(t,e){const{dataSourceEventIds:i}=t.internalProps;i&&i.forEach((e=>t.internalProps.handler.off(e))),e(t),t.internalProps.dataSourceEventIds=[t.internalProps.handler.on(t.internalProps.dataSource,yx.EVENT_TYPE.CHANGE_ORDER,(()=>{t.dataSource.hierarchyExpandLevel&&t.refreshRowColCount(),t.render()}))]}function f_(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];p_(t,(()=>{t.internalProps.records=e;const i=t.internalProps.dataSource=xx.ofArray(e,t.internalProps.dataConfig,t.pagination,t.internalProps.columns,t.internalProps.layoutMap.rowHierarchyType,function(t){var e;return t.options.hierarchyExpandLevel?t.options.hierarchyExpandLevel:t.options.groupBy?1/0:(null===(e=t._hasHierarchyTreeHeader)||void 0===e?void 0:e.call(t))?1:void 0}(t));t.addReleaseObj(i)}))}function v_(t,e){p_(t,(()=>{if(e)if(e instanceof yx)t.internalProps.dataSource=e;else{const i=t.internalProps.dataSource=new xx(e);t.addReleaseObj(i)}else t.internalProps.dataSource=yx.EMPTY;t.internalProps.records=null}))}function m_(t,e){return Math.round((i=e,o=t.internalProps.calcWidthContext,"string"==typeof i?u_(i.trim(),o):i-0));var i,o}function b_(t,e,i,o,n){let r=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];const s=Fx(n("padding",t,i,o,e)),l=n("bgColor",t,i,o,e),a=n("font",t,i,o,e);let h,d,c,u,g;if(a){const{family:t,size:e,weight:i,style:o,variant:n}=function(t){return Hx(t)}(a);h=t.join(" "),d=e,c=i,u=o,u=n}else h=n("fontFamily",t,i,o,e),d=n("fontSize",t,i,o,e),c=n("fontWeight",t,i,o,e),u=n("fontStyle",t,i,o,e),g=n("fontVariant",t,i,o,e);const p=n("textAlign",t,i,o,e),f=n("textBaseline",t,i,o,e),v=n("color",t,i,o,e),m=n("strokeColor",t,i,o,e),b=n("lineHeight",t,i,o,e),C=n("underline",t,i,o,e),y=n("underlineDash",t,i,o,e),w=n("underlineOffset",t,i,o,e),x=n("lineThrough",t,i,o,e),_=Math.max(1,Math.floor(d/10)),S=n("textOverflow",t,i,o,e),A=n("borderColor",t,i,o,e),R=n("borderLineWidth",t,i,o,e),B=n("borderLineDash",t,i,o,e),M=n("marked",t,i,o,e),T=n("cursor",t,i,o,e),P=!(s&&l&&a&&p&&f&&v&&S&&A&&R&&B&&"boolean"==typeof C&&"boolean"==typeof x&&"boolean"==typeof M);if(!r)return{hasFunctionPros:P};const E={text:{fontFamily:h,fontSize:d,fontWeight:c,fontStyle:u,fontVariant:g,fill:v,stroke:null!=m&&m,textAlign:p,textBaseline:f,lineHeight:null!=b?b:d,underline:C?_:void 0,underlineDash:y,underlineOffset:w,lineThrough:x?_:void 0,ellipsis:"clip"===S?"":"ellipsis"===S?"...":K(S)?S:void 0},group:{fill:l,lineDash:B,lineWidth:R,stroke:A,cursor:"auto"===T||"default"===T?void 0:T},_vtable:{padding:s,marked:M}};if(Array.isArray(R)&&(E.group.strokeArrayWidth=Fx(R)),Array.isArray(A)){const t=Fx(A);E.group.stroke=!t.every((t=>!t))&&t,E.group.strokeArrayColor=Fx(A)}return{theme:E,hasFunctionPros:P}}function C_(t,e,i){const o=i.theme.frameStyle.cornerRadius;if(Array.isArray(o)){if(0===t&&0===e)return[o[0],0,0,0];if(t===i.colCount-1&&0===e)return[0,o[1],0,0];if(0===t&&e===i.rowCount-1)return[0,0,0,o[3]];if(t===i.colCount-1&&e===i.rowCount-1)return[0,0,o[2],0]}else if(o){if(0===t&&0===e)return[o,0,0,0];if(t===i.colCount-1&&0===e)return[0,o,0,0];if(0===t&&e===i.rowCount-1)return[0,0,0,o];if(t===i.colCount-1&&e===i.rowCount-1)return[0,0,o,0]}return 0}function y_(t){for(let e=0;e<t.internalProps.columns.length;e++){const i=t.internalProps.columns[e];if(i.aggregation);else if(t.options.aggregation){let o;if(o="function"==typeof t.options.aggregation?t.options.aggregation({col:e,field:i.field}):t.options.aggregation,o)if(Array.isArray(o)){const t=[];o.forEach((e=>{t.push(Object.assign({showOnTop:!1},e))})),i.aggregation=t}else i.aggregation=Object.assign({showOnTop:!1},o)}}}class w_ extends sc{constructor(t){super(t),"mouseenter_cell"!==this.attribute.visibleTime&&"click_cell"!==this.attribute.visibleTime||(this.attribute.opacity=0),this.attribute.hoverImage&&(this.attribute.originImage=this.attribute.image),this.attribute.isGif&&this.attribute.gif&&this.loadGif()}loadGif(){this.playing=!1,mr.GetFile(this.attribute.gif,"arrayBuffer").then((t=>{const e=cy(t),i=ry(e,!0);this.renderGIF(i),this.resources.set(this.attribute.image,{state:"success",data:this.gifCanvas})})).catch((t=>{}))}get backgroundWidth(){var t,e;return null!==(e=null!==(t=this.attribute.backgroundWidth)&&void 0!==t?t:this.attribute.width)&&void 0!==e?e:0}get backgroundHeight(){var t,e;return null!==(e=null!==(t=this.attribute.backgroundHeight)&&void 0!==t?t:this.attribute.height)&&void 0!==e?e:0}renderGIF(t){this.loadedFrames=t,this.frameIndex=0,this.tempCanvas||(this.tempCanvas=document.createElement("canvas"),this.tempCtx=this.tempCanvas.getContext("2d")),this.gifCanvas||(this.gifCanvas=document.createElement("canvas"),this.gifCtx=this.gifCanvas.getContext("2d")),this.gifCanvas.width=t[0].dims.width,this.gifCanvas.height=t[0].dims.height,this.playing=!0,this.lastTime=(new Date).getTime(),this.animate().to({},1e3,"linear").loop(1/0)}renderFrame(t,e,i){const o=this.loadedFrames[this.frameIndex||0];2===o.disposalType&&this.gifCtx.clearRect(0,0,this.gifCanvas.width,this.gifCanvas.height),this.drawPatch(o),this.manipulate(t,e,i);const n=(new Date).getTime()-this.lastTime;o.delay<n&&(this.frameIndex++,this.lastTime=(new Date).getTime()),this.frameIndex>=this.loadedFrames.length&&(this.frameIndex=0)}drawPatch(t){const e=t.dims;this.frameImageData&&e.width===this.frameImageData.width&&e.height===this.frameImageData.height||(this.tempCanvas.width=e.width,this.tempCanvas.height=e.height,this.frameImageData=this.tempCtx.createImageData(e.width,e.height)),this.frameImageData.data.set(t.patch),this.tempCtx.putImageData(this.frameImageData,0,0),this.gifCtx.drawImage(this.tempCanvas,e.left,e.top)}manipulate(t,e,i){t.drawImage(this.gifCanvas,0,0,this.gifCanvas.width,this.gifCanvas.height,e,i,this.attribute.width,this.attribute.height)}setAttribute(t,e,i,o){super.setAttribute(t,e,i,o),"gif"===t&&this.loadGif()}setAttributes(t,e,i){super.setAttributes(t,e,i),t.gif&&this.loadGif()}}function x_(t){return{rootContainer:new cs({}),renderDefault:!0}}class __{constructor(t,e){this.removeAllContainer=t,this.table=e,this.customLayoutFuncCache=new Map,this.reactRemoveGraphicCache=new Map,this.headerCustomLayoutFuncCache=new Map,this.headerReactRemoveGraphicCache=new Map}hasReactCreateGraphic(t,e){return e?this.headerCustomLayoutFuncCache.has(t):this.customLayoutFuncCache.has(t)}setReactCreateGraphic(t,e,i){i?this.headerCustomLayoutFuncCache.set(t,e):this.customLayoutFuncCache.set(t,e)}setReactRemoveGraphic(t,e,i){i?this.headerReactRemoveGraphicCache.set(t,e):this.reactRemoveGraphicCache.set(t,e)}updateCustomCell(t,e){const i=this.table;if(i.isPivotTable()){const o=function(t,e,i){const o=e.internalProps.rowSeriesNumber?1:0,n=[],r=e.internalProps.layoutMap;if(i){const{headerObjects:e}=r,i=[];for(let o=0;o<e.length;o++){const n=e[o];n&&n.define.componentId===t&&i.push(n.id)}for(let t=0;t<i.length;t++){const e=i[t],o=r.getHeaderCellAdressById(e),s=r.getCellRange(o.col,o.row);n.push(s)}}else{let e;const{columnObjects:i,indicatorsAsCol:s}=r;for(let o=0;o<i.length;o++)if(i[o].define.componentId===t){e=o;break}if(s)for(let t=r.rowHeaderLevelCount+e;t<r.colCount;t+=i.length){const e={start:{col:t+o,row:r.columnHeaderLevelCount},end:{col:t+o,row:r.rowCount-1}};n.push(e)}else for(let t=r.columnHeaderLevelCount+e;t<r.rowCount;t+=i.length){const e={start:{col:r.rowHeaderLevelCount+o,row:t},end:{col:r.colCount-1,row:t}};n.push(e)}}return n}(t,i,e);for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start.col;t<=e.end.col;t++)for(let o=e.start.row;o<=e.end.row;o++)i.scenegraph.updateCellContent(t,o)}}else{const o=function(t,e,i){const o=e.internalProps.rowSeriesNumber?1:0;if(i){const i=e.internalProps.layoutMap,{headerObjects:o}=e.internalProps.layoutMap;let n;for(let e=0;e<o.length;e++){const i=o[e];if(i.define.componentId===t){n=i.id;break}}const r=i.getHeaderCellAdressById(n);return i.getCellRange(r.col,r.row)}const{columnObjects:n}=e.internalProps.layoutMap;for(let i=0;i<n.length;i++)if(n[i].define.componentId===t)return{start:{col:o+i,row:e.columnHeaderLevelCount},end:{col:o+i,row:e.rowCount-1}};return{start:{col:0,row:0},end:{col:e.colCount-1,row:e.rowCount-1}}}(t,i,e);for(let t=o.start.col;t<=o.end.col;t++)for(let e=o.start.row;e<=o.end.row;e++)i.scenegraph.updateCellContent(t,e)}"autoWidth"===i.widthMode&&i.scenegraph.recalculateColWidths(),"autoHeight"===i.heightMode&&i.scenegraph.recalculateRowHeights(),i.scenegraph.renderSceneGraph()}getCustomLayoutFunc(t,e){var i;if(this.table.isHeader(t,e)){const{componentId:o}=this.table.getHeaderDefine(t,e);return null!==(i=this.headerCustomLayoutFuncCache.get(o))&&void 0!==i?i:x_}const{componentId:o}=this.table.getBodyColumnDefine(t,e);return this.customLayoutFuncCache.get(o)||x_}removeCustomCell(t,e){let i;if(this.table.isHeader(t,e)){const o=this.table.getHeaderDefine(t,e),{componentId:n}=o;i=this.headerReactRemoveGraphicCache.get(n)}else{const o=this.table.getBodyColumnDefine(t,e),{componentId:n}=o;i=this.reactRemoveGraphicCache.get(n)}i&&i(t,e)}clearCache(){this.removeAllContainer()}}function S_(t){const e={abstractPos:{x:t.viewport.x,y:t.viewport.y}},i=A_(t.target);return i&&(e.eventArgs={col:i.col,row:i.row,event:t,targetCell:i,mergeInfo:R_(i),target:t.target}),e}function A_(t){for(;t&&t.parent;){if("cell"===t.role)return t;t=t.parent}return null}function R_(t){if(K(t.mergeStartCol)&&K(t.mergeStartRow)&&K(t.mergeEndCol)&&K(t.mergeEndRow))return{colStart:t.mergeStartCol,colEnd:t.mergeEndCol,rowStart:t.mergeStartRow,rowEnd:t.mergeEndRow}}const B_=/radio-\d+-\d+-(\d+)/,M_="_custom_",T_="custom-container",P_=M_+"_0";function E_(t,e,i,o,n,r,s,l,a,h,d){var c,u,g;let p,f,v,m,b=!0,C=!1;if("react-custom-layout"===t&&(t=(null===(c=d.reactCustomLayout)||void 0===c?void 0:c.getCustomLayoutFunc(i,o))||x_),"function"==typeof t){const e=t({col:null!==(u=null==h?void 0:h.start.col)&&void 0!==u?u:i,row:null!==(g=null==h?void 0:h.start.row)&&void 0!==g?g:o,dataValue:d.getCellOriginValue(i,o),value:d.getCellValue(i,o)||"",rect:{left:0,top:0,right:n,bottom:r,width:n,height:r},table:d,originCol:i,originRow:o});if(!e)return{renderDefault:!0};e.rootContainer&&(e.rootContainer=H_(e.rootContainer,d.animationManager.timeline)),e.rootContainer instanceof cs&&(m=e.rootContainer,m.name=T_,m.col=i,m.row=o),b=e.renderDefault,C=e.enableCellPadding}else if("function"==typeof e){const t=e({col:i,row:o,dataValue:d.getCellOriginValue(i,o),value:d.getCellValue(i,o)||"",rect:{left:0,top:0,right:n,bottom:r,width:n,height:r},table:d});t&&(v=t.elements,b=t.renderDefault,p=t.expectedWidth,f=t.expectedHeight)}else e&&(p=e.expectedWidth,f=e.expectedHeight,v=e.elements,b=e.renderDefault);return v&&(m=function(t,e,i,o){const n=new cs({x:0,y:0,width:e,height:i,fill:!1,stroke:!1,pickable:!1});return n.name=T_,function(t,e,i,o){const n=[],r=[0,0,0,0];for(let s=0;s<t.length;s++){const l=t[s],a=Object.assign({},l);for(const t in a)a.hasOwnProperty(t)&&Y(a[t])&&(a[t]=a[t](o));const h=a;K(h.x)&&(h.x=tt(h.x)?k_(h.x,e-r[1]):Number(h.x)),K(h.y)&&(h.y=tt(h.y)?k_(h.y,i-r[2]):Number(h.y)),"width"in a&&(a.width=tt(a.width)?k_(a.width,e-r[1]):Number(a.width)),"height"in a&&(a.height=tt(a.height)?k_(a.height,i-r[2]):Number(a.height)),"radius"in a&&(a.radius=tt(a.radius)?k_(a.radius,Math.min(e-r[1],i-r[2])):Number(a.radius)),"hover"in a&&(a.hover.x=tt(a.hover.x)?k_(a.hover.x,e-r[1]):Number(a.hover.x),a.hover.y=tt(a.hover.y)?k_(a.hover.y,i-r[2]):Number(a.hover.y),a.hover.width=tt(a.hover.width)?k_(a.hover.width,e-r[1]):Number(a.hover.width),a.hover.height=tt(a.hover.height)?k_(a.hover.height,i-r[2]):Number(a.hover.height),a.hover.x+=0,a.hover.y+=0),h.x=h.x+0,h.y=h.y+0,n.push(a)}return n}(t,e,i,o).forEach((t=>{var e,i,o,r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x,_,S,A,R,B,M,T;switch(t.clickable&&(t.pickable=t.clickable),t.type){case"arc":const P=Cc({x:t.x,y:t.y,dx:null!==(e=t.dx)&&void 0!==e?e:0,dy:null!==(i=t.dy)&&void 0!==i?i:0,fill:t.fill,stroke:t.stroke,outerRadius:t.radius,startAngle:t.startAngle,endAngle:t.endAngle,pickable:!!t.pickable,cursor:t.cursor});P.name=t.name,n.appendChild(P);break;case"text":if(t.background){const e=null!==(r=null===(o=t.background)||void 0===o?void 0:o.expandX)&&void 0!==r?r:0,i=null!==(l=null===(s=t.background)||void 0===s?void 0:s.expandY)&&void 0!==l?l:0,p=ic({x:t.x-e,y:t.y-i,dx:null!==(a=t.dx)&&void 0!==a?a:0,dy:null!==(h=t.dy)&&void 0!==h?h:0,width:t.width+2*e,height:t.height+2*i,cornerRadius:null!==(c=null===(d=t.background)||void 0===d?void 0:d.cornerRadius)&&void 0!==c?c:0,fill:null!==(g=null===(u=t.background)||void 0===u?void 0:u.fill)&&void 0!==g?g:"#888"});n.appendChild(p)}const E=new Ih(Object.assign({pickable:!!t.pickable,fill:null!==(p=t.color)&&void 0!==p?p:t.fill},t));E.name=t.name,n.appendChild(E);break;case"rect":const k=ic({x:t.x,y:t.y,dx:null!==(f=t.dx)&&void 0!==f?f:0,dy:null!==(v=t.dy)&&void 0!==v?v:0,width:t.width,height:t.height,cornerRadius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});k.name=t.name,n.appendChild(k);break;case"circle":const L=Hh({x:t.x,y:t.y,dx:null!==(m=t.dx)&&void 0!==m?m:0,dy:null!==(b=t.dy)&&void 0!==b?b:0,radius:t.radius,fill:t.fill,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});L.name=t.name,n.appendChild(L);break;case"icon":const H=new w_({x:t.x,y:t.y,dx:null!==(C=t.dx)&&void 0!==C?C:0,dy:null!==(y=t.dy)&&void 0!==y?y:0,width:t.width,height:t.height,image:t.svg,backgroundWidth:t.hover?null!==(w=t.hover.width)&&void 0!==w?w:t.width:void 0,backgroundHeight:t.hover?null!==(x=t.hover.width)&&void 0!==x?x:t.width:void 0,backgroundColor:t.hover?null!==(_=t.hover.bgColor)&&void 0!==_?_:"rgba(22,44,66,0.2)":void 0,pickable:!!t.pickable,cursor:t.cursor});H.name=t.name,H.role="icon-custom",n.appendChild(H);break;case"image":const F=new w_({x:t.x,y:t.y,dx:null!==(S=t.dx)&&void 0!==S?S:0,dy:null!==(A=t.dy)&&void 0!==A?A:0,width:t.width,height:t.height,image:t.src,backgroundWidth:t.hover?null!==(R=t.hover.width)&&void 0!==R?R:t.width:void 0,backgroundHeight:t.hover?null!==(B=t.hover.width)&&void 0!==B?B:t.width:void 0,backgroundColor:t.hover?null!==(M=t.hover.bgColor)&&void 0!==M?M:"rgba(22,44,66,0.2)":void 0,pickable:!!t.pickable,cursor:t.cursor,shape:t.shape});F.name=t.name,F.role="image-custom",n.appendChild(F);break;case"line":const z=Qd({points:t.points,lineWidth:null!==(T=t.lineWidth)&&void 0!==T?T:1,stroke:t.stroke,pickable:!!t.pickable,cursor:t.cursor});z.name=t.name,n.appendChild(z)}})),n}(v,s?p:n,l?f:r,d.getCellValue(i,o))),C&&m.setAttributes({x:a[3],y:a[0],width:n-a[1]-a[3],height:r-a[0]-a[2]}),L_(m,n,r),!h||h.start.col===h.end.col&&h.start.row===h.end.row||F_(m,i,o,0),{elementsGroup:m,renderDefault:b}}function k_(t,e){return t.endsWith("px")?parseInt(t,10):t.endsWith("%")&&e?parseInt(t,10)/100*e:parseInt(t,10)}function L_(t,e,i){t&&t.forEachChildren((t=>{var o,n;t&&(Z(t.attribute.width)&&t.attribute.width.percent&&t.setAttribute("width",Math.max(0,t.attribute.width.percent/100*e+(null!==(o=t.attribute.width.delta)&&void 0!==o?o:0))),t.attribute.width<0&&t.setAttribute("width",0),Z(t.attribute.height)&&t.attribute.height.percent&&t.setAttribute("height",Math.max(0,t.attribute.height.percent/100*i+(null!==(n=t.attribute.height.delta)&&void 0!==n?n:0))),t.attribute.height<0&&t.setAttribute("height",0),"group"===t.type&&L_(t,t.attribute.width,t.attribute.height))}))}function H_(t,e){if(!t||!K(t.$$typeof)&&!K(t.vtype))return t;const i=t.type,{attribute:o,children:n,stateProxy:r,animation:s}=t.props,l=i({attribute:o});if(function(t,e){let i=!1;switch(t.type){case"richtext":case"rich/image":break;default:i=!0}i&&Object.keys(e).forEach((i=>{const o=zg[i];o&&t.on(o,e[i])}))}(l,t.props),r&&(l.stateProxy=r),l.id=o.id,l.name=o.name,et(n)?n.forEach((t=>{const i=H_(t,e);i&&i.type&&l.add(i)})):n&&l.add(H_(n,e)),et(s)&&e){const t=l.animate();t.setTimeline(e),s.forEach((e=>{t[e[0]](...e.slice(1))}))}return l}function F_(t,e,i,o,n){t&&(t.name=`${M_}${null!=n?n:""}_${o}`,t.onBeforeAttributeUpdate=z_,"group"===t.type&&t.childrenCount&&t.forEachChildren(((t,r)=>{F_(t,e,i,r,(null!=n?n:"")+"_"+o)})))}function z_(t,e){const i=this;if(i.skipMergeUpdate)return;const o=A_(i);if(!o||!o.stage)return;const n=o.stage.table;i.skipAttributeUpdate=!0;const{mergeStartCol:r,mergeEndCol:s,mergeStartRow:l,mergeEndRow:a}=o;if(K(r)&&K(s)&&K(l)&&K(a)&&(r!==s||l!==a)){for(let e=r;e<=s;e++)for(let r=l;r<=a;r++){if(e===o.col&&r===o.row)continue;const s=n.scenegraph.highPerformanceGetCell(e,r);if("cell"===s.role){const e=s.getChildByName(i.name,!0);if(!e||e.skipAttributeUpdate)continue;for(const i in t)t[i]!==e.attribute[i]&&"dx"!==i&&"dy"!==i&&e.setAttribute(i,t[i])}}i.skipAttributeUpdate=void 0}}const I_={};class O_{static setIcon(t,e){this.cache.set(t,e)}static getIcon(t){return this.cache.has(t)?this.cache.get(t):null}static hasIcon(t){return this.cache.has(t)}static clear(t){return this.cache.delete(t)}static clearAll(){this.cache=new Map}}let D_,W_,N_,G_,j_,U_,V_,$_,Y_,X_,K_,Z_,q_,J_,Q_,tS,eS,iS,oS,nS,rS,sS,lS,aS;function hS(t){var e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x,_,S;D_=null!==(e=null==t?void 0:t.sort_color)&&void 0!==e?e:"#282F38",W_=null!==(i=null==t?void 0:t.sort_color_opacity)&&void 0!==i?i:"0.35",N_=null!==(o=null==t?void 0:t.sort_color_2)&&void 0!==o?o:"#416EFF",G_=null!==(n=null==t?void 0:t.sort_color_opacity_2)&&void 0!==n?n:"1",j_=null!==(r=null==t?void 0:t.sort_size)&&void 0!==r?r:16,U_=null!==(s=null==t?void 0:t.sort_size_2)&&void 0!==s?s:22,V_=null!==(l=null==t?void 0:t.frozen_color)&&void 0!==l?l:"#282F38",$_=null!==(a=null==t?void 0:t.frozen_color_opacity)&&void 0!==a?a:"0.35",Y_=null!==(h=null==t?void 0:t.frozen_color_opacity)&&void 0!==h?h:"0.2",X_=null!==(d=null==t?void 0:t.frozen_color_2)&&void 0!==d?d:"#416EFF",K_=null!==(c=null==t?void 0:t.frozen_color_opacity_2)&&void 0!==c?c:"1",Z_=null!==(u=null==t?void 0:t.frozen_size)&&void 0!==u?u:22,q_=null!==(g=null==t?void 0:t.frozen_size_2)&&void 0!==g?g:22,J_=null!==(p=null==t?void 0:t.collapse_color)&&void 0!==p?p:"#141414",Q_=null!==(f=null==t?void 0:t.collapse_color_opacity)&&void 0!==f?f:"0.65",tS=null!==(v=null==t?void 0:t.collapse_size)&&void 0!==v?v:16,eS=null!==(m=null==t?void 0:t.frozen_size_2)&&void 0!==m?m:22,iS=null!==(b=null==t?void 0:t.expand_color)&&void 0!==b?b:"#141414",oS=null!==(C=null==t?void 0:t.expand_color_opacity)&&void 0!==C?C:"0.65",nS=null!==(y=null==t?void 0:t.expand_size)&&void 0!==y?y:16,rS=null!==(w=null==t?void 0:t.expand_size_2)&&void 0!==w?w:22,sS=null!==(x=null==t?void 0:t.dragReorder_color)&&void 0!==x?x:"#666666",lS=null!==(_=null==t?void 0:t.dragReorder_color_opacity)&&void 0!==_?_:"1",aS=null!==(S=null==t?void 0:t.dragReorder_size)&&void 0!==S?S:20}O_.cache=new Map;const dS={get sort_downward(){return{type:"svg",svg:`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="${N_}" fill-opacity="${G_}"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="${D_}" fill-opacity="${W_}"/></svg> `,width:j_,height:j_,funcType:xy.sort,name:"sort_downward",positionType:wy.contentRight,marginLeft:3,hover:{width:U_,height:U_,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get sort_upward(){return{type:"svg",svg:`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="${D_}" fill-opacity="${W_}"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="${N_}" fill-opacity="${G_}"/> </svg>`,width:j_,height:j_,funcType:xy.sort,positionType:wy.contentRight,name:"sort_upward",marginLeft:3,hover:{width:U_,height:U_,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get sort_normal(){return{type:"svg",svg:`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.6665 9H11.3332L7.99984 13.1667L4.6665 9Z" fill="${D_}" fill-opacity="${W_}"/><path d="M11.3335 7L4.66683 7L8.00016 2.83333L11.3335 7Z" fill="${D_}" fill-opacity="${W_}"/></svg> `,width:j_,height:j_,funcType:xy.sort,positionType:wy.contentRight,name:"sort_normal",marginLeft:3,hover:{width:U_,height:U_,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get freeze(){return{type:"svg",svg:`<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0)"><path d="M17.1313 8.42047C17.1932 8.48238 17.2423 8.55587 17.2759 8.63676C17.3094 8.71764 17.3266 8.80434 17.3266 8.89189C17.3266 8.97944 17.3094 9.06613 17.2759 9.14702C17.2423 9.2279 17.1932 9.3014 17.1313 9.3633L13.3843 13.1103C13.7007 14.3048 13.5305 15.4443 12.8388 16.2395C12.8104 16.2781 12.7778 16.3136 12.7417 16.3451L12.712 16.3755C12.6501 16.4374 12.5766 16.4865 12.4957 16.52C12.4148 16.5535 12.3281 16.5707 12.2406 16.5707C12.153 16.5707 12.0663 16.5535 11.9854 16.52C11.9046 16.4865 11.8311 16.4374 11.7692 16.3755L9.17633 13.7826L6.05316 16.9058L5.11983 17.0925C5.09291 17.0979 5.06508 17.0965 5.03881 17.0886C5.01254 17.0806 4.98863 17.0663 4.96923 17.0469C4.94982 17.0275 4.9355 17.0036 4.92755 16.9773C4.9196 16.951 4.91827 16.9232 4.92366 16.8963L5.11033 15.963L8.23333 12.8396L5.64066 10.2471C5.57875 10.1852 5.52964 10.1117 5.49614 10.0309C5.46263 9.94997 5.44539 9.86327 5.44539 9.77572C5.44539 9.68817 5.46263 9.60148 5.49614 9.52059C5.52964 9.43971 5.57875 9.36621 5.64066 9.3043C5.65066 9.2943 5.66066 9.2843 5.67099 9.27464C5.70266 9.2383 5.73833 9.20547 5.77766 9.17664C6.57283 8.48564 7.71199 8.31564 8.90599 8.63197L12.6528 4.88497C12.7147 4.82306 12.7882 4.77395 12.8691 4.74045C12.95 4.70694 13.0367 4.6897 13.1242 4.6897C13.2118 4.6897 13.2985 4.70694 13.3794 4.74045C13.4603 4.77395 13.5338 4.82306 13.5957 4.88497L17.1312 8.42047H17.1313ZM15.7172 8.8918L13.1243 6.29914L9.56483 9.8588C9.47574 9.94788 9.36323 10.0099 9.24034 10.0376C9.11746 10.0654 8.98922 10.0578 8.87049 10.0156C8.22783 9.78764 7.63899 9.7553 7.17749 9.89814L12.1182 14.8388C12.261 14.3771 12.2287 13.7885 12.0007 13.146C11.9585 13.0272 11.9509 12.899 11.9787 12.7761C12.0064 12.6532 12.0684 12.5407 12.1575 12.4516L15.7172 8.89164V8.8918Z" fill="${V_}" fill-opacity="${Y_}"/></g><defs><clipPath id="clip0"><rect width="22" height="22" fill="white"/></clipPath></defs></svg>`,width:Z_,height:Z_,name:"freeze",funcType:xy.frozen,positionType:wy.right,marginRight:0,hover:{width:q_,height:q_,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get frozen(){return{type:"svg",svg:`<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.49975 3.66663C8.32294 3.66663 8.15337 3.73686 8.02835 3.86189C7.90332 3.98691 7.83309 4.15648 7.83309 4.33329V9.63246C6.76475 10.2533 6.07942 11.1795 6.00625 12.2308C5.99892 12.2786 5.99692 12.3268 6.00009 12.3741L5.99975 12.4166C5.99975 12.5934 6.06999 12.763 6.19501 12.888C6.32004 13.0131 6.48961 13.0833 6.66642 13.0833H10.3333L10.3331 17.5L10.8611 18.292C10.8763 18.3148 10.8969 18.3335 10.9211 18.3464C10.9453 18.3594 10.9723 18.3662 10.9998 18.3662C11.0272 18.3662 11.0542 18.3594 11.0784 18.3464C11.1026 18.3335 11.1232 18.3148 11.1384 18.292L11.6664 17.5L11.6666 13.0833H15.3331C15.5099 13.0833 15.6795 13.0131 15.8045 12.888C15.9295 12.763 15.9998 12.5934 15.9998 12.4166C15.9998 12.4025 15.9998 12.3883 15.9994 12.3741C16.0028 12.3263 16.0008 12.2776 15.9933 12.2295C15.9196 11.1786 15.2343 10.2528 14.1664 9.63229V4.33329C14.1664 4.15648 14.0962 3.98691 13.9712 3.86189C13.8461 3.73686 13.6766 3.66663 13.4998 3.66663H8.49975Z" fill="${V_}" fill-opacity="${$_}"/></svg>`,width:Z_,height:Z_,name:"frozen",funcType:xy.frozen,positionType:wy.right,marginRight:0,hover:{width:q_,height:q_,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get frozenCurrent(){return{type:"svg",svg:`<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.49975 3.66663C8.32294 3.66663 8.15337 3.73686 8.02835 3.86189C7.90332 3.98691 7.83309 4.15648 7.83309 4.33329V9.63246C6.76475 10.2533 6.07942 11.1795 6.00625 12.2308C5.99892 12.2786 5.99692 12.3268 6.00009 12.3741L5.99975 12.4166C5.99975 12.5934 6.06999 12.763 6.19501 12.888C6.32004 13.0131 6.48961 13.0833 6.66642 13.0833H10.3333L10.3331 17.5L10.8611 18.292C10.8763 18.3148 10.8969 18.3335 10.9211 18.3464C10.9453 18.3594 10.9723 18.3662 10.9998 18.3662C11.0272 18.3662 11.0542 18.3594 11.0784 18.3464C11.1026 18.3335 11.1232 18.3148 11.1384 18.292L11.6664 17.5L11.6666 13.0833H15.3331C15.5099 13.0833 15.6795 13.0131 15.8045 12.888C15.9295 12.763 15.9998 12.5934 15.9998 12.4166C15.9998 12.4025 15.9998 12.3883 15.9994 12.3741C16.0028 12.3263 16.0008 12.2776 15.9933 12.2295C15.9196 11.1786 15.2343 10.2528 14.1664 9.63229V4.33329C14.1664 4.15648 14.0962 3.98691 13.9712 3.86189C13.8461 3.73686 13.6766 3.66663 13.4998 3.66663H8.49975Z" fill="${X_}" fill-opacity="${K_}"/></svg>`,width:Z_,height:Z_,funcType:xy.frozen,positionType:wy.right,name:"frozenCurrent",marginRight:0,hover:{width:q_,height:q_,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get dropdownIcon(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="white"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#959DA5"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="#4F5965"/></svg>',width:24,height:24,funcType:xy.dropDown,positionType:wy.absoluteRight,name:"dropdownIcon",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)",image:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><rect x="2" y="1" width="20" height="20" rx="10" fill="#1E54C9"/><rect x="2.5" y="1.5" width="19" height="19" rx="9.5" stroke="#141414" stroke-opacity="0.2"/></g><path d="M14.9492 9.39531C15.0086 9.31911 15.0165 9.21887 14.9698 9.1356C14.923 9.05234 14.8294 9 14.7273 9L9.27273 9C9.17057 9 9.07697 9.05234 9.03023 9.1356C8.98348 9.21887 8.99142 9.31911 9.0508 9.39531L11.7781 12.8953C11.8293 12.961 11.9119 13 12 13C12.0881 13 12.1707 12.961 12.2219 12.8953L14.9492 9.39531Z" fill="white"/></svg>'},cursor:"pointer",visibleTime:"mouseenter_cell"}},get play(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01" /><path d="M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z" fill="none" stroke="#686a6e" stroke-width="4" stroke-linejoin="round" stroke-opacity="0.7" /><path d="M20 24V17.0718L26 20.5359L32 24L26 27.4641L20 30.9282V24Z" fill="none" stroke="#686a6e" stroke-width="4" stroke-linejoin="round" stroke-opacity="0.7" /></svg>',width:24,height:24,funcType:xy.play,positionType:wy.right,name:"play",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get damage_pic(){return{type:"svg",svg:'<svg width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 10V38C5 39.1046 5.89543 40 7 40H14H18L15 29L22 27L21 20L29 16L27 13L30 8H7C5.89543 8 5 8.89543 5 10Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M43 38V10C43 8.89543 42.1046 8 41 8H38L34 14L37 19L28 23L29 31L22 33L24 40H41C42.1046 40 43 39.1046 43 38Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path fill-rule="evenodd" clip-rule="evenodd" d="M14.5 18C15.3284 18 16 17.3284 16 16.5C16 15.6716 15.3284 15 14.5 15C13.6716 15 13 15.6716 13 16.5C13 17.3284 13.6716 18 14.5 18Z" fill="none" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>',width:24,height:24,funcType:xy.damagePic,positionType:wy.left,name:"damage_pic",marginRight:0,hover:{width:24,height:24,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get loading_pic(){return{type:"svg",svg:'<svg viewBox="0 0 400 300" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="a" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="50" y="65" width="301" height="170"><path d="M350.3 65H50v169.8h300.3V65Z" fill="#fff"/></mask><g mask="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M58.3 233.2h32.8v-36.8H58.3v36.8Z" fill="#C7DEFF"/><path d="M91.1 224.5v8.8H58.3M82.4 196.2H58.3" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M305.4 182.5s-2.7 12.6 0 17.4c2.7 4.8 8.3 6.7 12.4 4.4 4.2-2.4 5.3-8.1 2.6-12.9-2.7-4.8-15-8.9-15-8.9ZM336 204.7c4.3 2 9.7-.4 12-5.4 2.3-5-1.5-17.3-1.5-17.3s-11.8 5.1-14.1 10.1c-2.3 5-.7 10.6 3.6 12.6Z" fill="#00E4E5"/><path fill-rule="evenodd" clip-rule="evenodd" d="M326.7 174s-10 11.8-10 18.6c0 6.7 4.5 12.2 10 12.2s10-5.5 10-12.3c0-6.8-10-18.5-10-18.5Z" fill="#00E4E5"/><path d="M332.3 181.5c2.3 3.6 4.4 7.8 4.4 10.9M316.7 192.5c0-3.1 2.1-7.2 4.3-10.8" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M343.1 227.3v-9.7h-34v9.7c0 3.7 3 6.6 6.6 6.6h20.9c3.6 0 6.5-2.9 6.5-6.6Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M350.4 220.8V198H302v22.8c0 5.9 4.8 10.7 10.7 10.7h26.9c5.9 0 10.7-4.8 10.8-10.7Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M331.7 74.2H117.8L87.4 203h213.8l30.5-128.8Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M337 74.2h-6.2l-30.6 129.2h6.2L337 74.2Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M303.8 203.5h2.4l30.7-129.3h-1.8l-31.3 129.3Z" fill="#C7DEFF"/><path d="m337 74.2-30.6 129.2h-5.9" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M229.9 202.1h-47.6l2 9.6h47.3l-1.7-9.6Z" fill="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M94.7 172.6 87.4 203h213.1l7.8-30.4H94.7Z" fill="#006EFF"/><path d="M138.5 74.2h193.2l-23.4 98.6M94.5 172.7l11-46.3M104.8 155.4l-2.3 11.5h6.7M316 112.1l1.1-4.5" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M148.3 138.1h97V119h-97v19.1Z" fill="#00E4E5"/><path d="M303.1 80.6h20.3l-4.6 19.6M228.3 234.3c3.6 0 6.3-3.2 5.7-6.8l-4.1-24.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M226.2 229.5h-68.9v1.2c0 2 1.6 3.7 3.7 3.7h60.1c2.8 0 5-2.2 5.1-4.9Z" fill="#C7DEFF"/><path d="M180.699 226.8h-19.9c-2.8 0-4.6 3-3.3 5.5m0 0c.6 1.2 1.9 2 3.3 2h57.8M175.9 203.4l3.6 17.6M241.2 234.3h65.1M104.6 234.3h41.3" stroke="#071F4D"/><path d="M206.2 234.3h14.9c3.1 0 5.5-2.8 5-5.9l-4.3-24.9M160.7 226.8h46M62.2 226.1h-9.5c-1.2 0-2.2-1-2.2-2.2v-18.3c0-1.2 1-2.2 2.2-2.2h9.5" stroke="#071F4D"/><path d="M53.4 171.7H68c2.1 0 3.7 1.7 3.7 3.7v16.1M79.1 192v-21.8c0-2.5 2-4.6 4.6-4.6h2.2c2.5 0 4.5-2 4.5-4.5m0 0c0-2.5-2-4.5-4.5-4.5H56.1c-2.4 0-4.3-1.9-4.3-4.3V148M71.2 165.2h-18M64 181.7v10.1" stroke="#C7DEFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.7 120H124c4.3 0 7.7-3.5 7.7-7.7V65.5H94.2c-4.7 0-8.5 4.9-8.5 11V120Z" fill="#C7DEFF"/><path d="M85.7 110.7V73c0-4.1 3.4-7.5 7.5-7.5h38.5M146.2 73.8v-2.5c0-3.2-2-5.8-5.8-5.8-2.8 0-6 1.1-6 5.8v42.4c0 4.7-3.8 8.5-8.5 8.5h-15.6" stroke="#071F4D"/><path d="M119.7 122.3H87c-6.1 0-11.1-5-11.1-11.1m0 0h39M126.1 122.3c-6.1 0-11.1-5-11.1-11.1" stroke="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M85.4 122.1h37.2c-6.5-1.8-8-10.5-8-10.5H76.2c.6 8.8 9.2 10.5 9.2 10.5Z" fill="#071F4D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M95.8 102.9h4.8V83.6h-4.8v19.3ZM106.6 102.9h4.8V77.6h-4.8v25.3ZM117.3 102.9h4.8V89.1h-4.8v13.8Z" fill="#fff"/><path d="M273.2 195.9h16.9M261.2 195.9h5" stroke="#fff"/><path d="M62.4 201.9v2.9M62.4 224.5v2.9" stroke="#071F4D"/><path d="m153.6 138.1 9.7-19.1M168.8 138.1l9.7-19.1M184.1 138.1l9.7-19.1M199.4 138.1l9.7-19.1M214.6 138.1l9.8-19.1M229.9 138.1l9.7-19.1" stroke="#fff"/><path d="M148.3 138.1h121.6V119H148.3v19.1Z" stroke="#071F4D"/></g></svg>',width:400,height:300,name:"loading_pic",positionType:wy.left}},get expand(){return{type:"svg",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">\n <path d="M4.64988 6.81235C4.38797 6.48497 4.62106 6 5.04031 6L10.9597 6C11.3789 6 11.612 6.48497 11.3501 6.81235L8.39043 10.512C8.19027 10.7622 7.80973 10.7622 7.60957 10.512L4.64988 6.81235Z" fill="${iS}" fill-opacity="${oS}"/>\n </svg>`,width:nS,height:nS,funcType:xy.expand,name:"expand",positionType:wy.contentLeft,marginLeft:0,marginRight:4,hover:{width:rS,height:rS,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get collapse(){return{type:"svg",svg:`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">\n <path d="M5.81235 11.3501C5.48497 11.612 5 11.3789 5 10.9597L5 5.04031C5 4.62106 5.48497 4.38797 5.81235 4.64988L9.51196 7.60957C9.76216 7.80973 9.76216 8.19027 9.51196 8.39044L5.81235 11.3501Z" fill="${J_}" fill-opacity="${Q_}"/>\n </svg>`,width:tS,height:tS,funcType:xy.collapse,name:"collapse",positionType:wy.contentLeft,marginLeft:0,marginRight:4,hover:{width:eS,height:eS,bgColor:"rgba(101, 117, 168, 0.1)"},cursor:"pointer"}},get loading(){return{type:"image",src:"https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/media/loading-circle.gif",width:tS,height:tS,name:"loading",positionType:wy.contentLeft,marginLeft:0,marginRight:4,hover:{width:eS,height:eS,bgColor:"rgba(101, 117, 168, 0.1)"},isGif:!0}},get drillDown(){return{name:"drillDown",type:"svg",positionType:wy.absolute,funcType:xy.drillDown,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM549.333333 288a5.333333 5.333333 0 0 1 5.333334 5.333333V469.333333h176a5.333333 5.333333 0 0 1 5.333333 5.333334v74.666666a5.333333 5.333333 0 0 1-5.333333 5.333334H554.666667v176a5.333333 5.333333 0 0 1-5.333334 5.333333h-74.666666a5.333333 5.333333 0 0 1-5.333334-5.333333V554.666667H293.333333a5.333333 5.333333 0 0 1-5.333333-5.333334v-74.666666a5.333333 5.333333 0 0 1 5.333333-5.333334H469.333333V293.333333a5.333333 5.333333 0 0 1 5.333334-5.333333h74.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}},get drillUp(){return{name:"drillUp",type:"svg",positionType:wy.absolute,funcType:xy.drillUp,svg:'<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>',width:13,height:13,cursor:"pointer"}},get dragReorder(){return{type:"svg",svg:`<svg t="1710129136961" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5166" width="200" height="200"><path d="M362.666667 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${sS}" fill-opacity="${lS}" p-id="5167"></path><path d="M661.333333 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${sS}" fill-opacity="${lS}" p-id="5168"></path><path d="M362.666667 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${sS}" fill-opacity="${lS}" p-id="5169"></path><path d="M661.333333 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${sS}" fill-opacity="${lS}" p-id="5170"></path><path d="M362.666667 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${sS}" fill-opacity="${lS}" p-id="5171"></path><path d="M661.333333 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="${sS}" fill-opacity="${lS}" p-id="5172"></path></svg>`,width:aS,height:aS,funcType:xy.dragReorder,positionType:wy.left,name:"dragReorder",marginLeft:-10,marginRight:10,cursor:"grab"}}};function cS(){return hw(dS,I_)}class uS extends cs{clear(){this.removeAllChild()}getChildByName(t,e){let i=null;return this.forEachChildren((e=>e.name===t&&(i=e,!0))),e&&this.forEachChildren((e=>{if(e.getChildByName){const o=e.getChildByName(t,!0);if(o)return i=o,!0}return!1})),i}get width(){var t;let e=this.AABBBounds.width();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,null!==(t=this.attribute.width)&&void 0!==t?t:0)}get height(){var t;let e=this.AABBBounds.height();return e!==1/0&&e!==-1/0||(e=0),Math.max(e,null!==(t=this.attribute.height)&&void 0!==t?t:0)}setDeltaWidth(t){var e;0!==t&&(this.setAttribute("width",(null!==(e=this.attribute.width)&&void 0!==e?e:0)+t),this.border&&(this.border.setAttribute("width",this.border.attribute.width+t),"group"===this.border.type&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.width+t)))}setDeltaHeight(t){var e;0!==t&&(this.setAttribute("height",(null!==(e=this.attribute.height)&&void 0!==e?e:0)+t),this.border&&(this.border.setAttribute("height",this.border.attribute.height+t),"group"===this.border.type&&this.border.firstChild.setAttribute("width",this.border.firstChild.attribute.height+t)))}setDeltaX(t){0!==t&&this.setAttribute("x",this.attribute.x+t)}setDeltaY(t){0!==t&&this.setAttribute("y",this.attribute.y+t)}forEachChildrenSkipChild(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"border-rect";if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]){let i=this._lastChild,o=0;for(;i;){if(i.name!==e&&t(i,o++))return;i=i._prev}}else{let i=this._firstChild,o=0;for(;i;){if(i.name!==e&&t(i,o++))return;i=i._next}}}getColGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.col===t)return e;e=e._next}return null}getRowGroup(t){let e=this._firstChild;if(!e)return null;for(let i=0;i<this.childrenCount;i++){if(e.row===t)return e;e=e._next}return null}addCellGroup(t){if(0===this.childrenCount||this.lastChild.row===t.row-1)this.addChild(t);else{let e=this._firstChild;for(let i=0;i<this.childrenCount;i++){if(e.row===t.row-1)return void this.insertAfter(t,e);e=e._next}this.addChild(t)}}getChildAt(t){const e=super.getChildAt(t);return e&&"border-rect"===e.name?e._next:e}tryUpdateAABBBounds(){if("cell"===this.role){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),function(t,e){t.stage&&t.stage.dirtyBounds&&t.stage.renderCount&&(t.isContainer&&!e||t.stage.dirty(t.globalAABBBounds))}(this,t),e}return super.tryUpdateAABBBounds()}doUpdateAABBBounds(){if("cell"===this.role){const t=this.attribute,{x:e,y:i,width:o,height:n}=t;return this._AABBBounds.setValue(e,i,e+o,i+n),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this.shadowRoot&&this.shadowRoot.tryUpdateAABBBounds(),this._AABBBounds}return"body"===this.role||"row-header"===this.role||"col-header"===this.role||"right-frozen"===this.role||"bottom-frozen"===this.role||"corner-header"===this.role||"corner-right-top-header"===this.role||"corner-right-bottom-header"===this.role||"corner-left-bottom-header"===this.role?(this._AABBBounds.setValue(-1/0,-1/0,1/0,1/0),this.parent&&this.parent.addChildUpdateBoundTag(),this.clearUpdateBoundTag(),this.shadowRoot&&this.shadowRoot.tryUpdateAABBBounds(),this._AABBBounds):super.doUpdateAABBBounds()}updateColumnRowNumber(t){this.rowNumber?this.rowNumber=Math.max(this.rowNumber,t):this.rowNumber=t}updateColumnHeight(t){this.colHeight?this.colHeight+=t:this.colHeight=t}}function gS(t,e,i,o){const n=t/e;let r,s;return n>i/o?(r=i,s=r/n):(s=o,r=s*n),{width:r,height:s}}function pS(t,e,i,o,n,r){let s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"left",l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"middle",a=arguments.length>8&&void 0!==arguments[8]?arguments[8]:[0,0,0,0],h=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,d=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,c=arguments.length>11&&void 0!==arguments[11]?arguments[11]:0,u=arguments.length>12&&void 0!==arguments[12]?arguments[12]:0;const g=t+i,p=e+o;let f=t+a[3]+h;"right"===s||"end"===s?f=g-n-a[1]-d:"center"===s&&(f=t+(i-n+h-d)/2);let v=e+a[0]+c;return"bottom"===l||"alphabetic"===l||"ideographic"===l?v=p-r-a[2]-u:"middle"===l&&(v=e+(o-r+c-u)/2),{x:f,y:v}}function fS(t,e,i,o,n){const r=e&&K(e[t])?e[t]:void 0;return"function"==typeof r?r({col:i,row:o,table:n,value:n.getCellValue(i,o),dataValue:n.getCellOriginValue(i,o),cellHeaderPaths:n.getCellHeaderPaths(i,o)}):r}function vS(t,e,i,o,n){const r=e&&K(e[t])?e[t]:void 0;if("function"==typeof r)return r({col:i,row:o,table:n,value:n.getCellValue(i,o),dataValue:n.getCellOriginValue(i,o),cellHeaderPaths:n.getCellHeaderPaths(i,o)})}function mS(t,e,i,o){var n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w;let x=null!==(r=null===(n=null==i?void 0:i.group)||void 0===n?void 0:n.strokeArrayWidth)&&void 0!==r?r:void 0;return o.theme.cellInnerBorder||!function(t){return!!K(t)&&(!et(t)||t.some((t=>K(t))))}(o.theme.frameStyle.borderLineWidth)||function(t){return 0===t||et(t)&&t.every((t=>0===t))}(o.theme.frameStyle.borderLineWidth)||(0===t&&(x=null!=x?x:[null===(s=null==i?void 0:i.group)||void 0===s?void 0:s.lineWidth,null===(l=null==i?void 0:i.group)||void 0===l?void 0:l.lineWidth,null===(a=null==i?void 0:i.group)||void 0===a?void 0:a.lineWidth,null===(h=null==i?void 0:i.group)||void 0===h?void 0:h.lineWidth],x[3]=0),t===o.colCount-1&&(x=null!=x?x:[null===(d=null==i?void 0:i.group)||void 0===d?void 0:d.lineWidth,null===(c=null==i?void 0:i.group)||void 0===c?void 0:c.lineWidth,null===(u=null==i?void 0:i.group)||void 0===u?void 0:u.lineWidth,null===(g=null==i?void 0:i.group)||void 0===g?void 0:g.lineWidth],x[1]=0),0===e&&(x=null!=x?x:[null===(p=null==i?void 0:i.group)||void 0===p?void 0:p.lineWidth,null===(f=null==i?void 0:i.group)||void 0===f?void 0:f.lineWidth,null===(v=null==i?void 0:i.group)||void 0===v?void 0:v.lineWidth,null===(m=null==i?void 0:i.group)||void 0===m?void 0:m.lineWidth],x[0]=0),e===o.rowCount-1&&(x=null!=x?x:[null===(b=null==i?void 0:i.group)||void 0===b?void 0:b.lineWidth,null===(C=null==i?void 0:i.group)||void 0===C?void 0:C.lineWidth,null===(y=null==i?void 0:i.group)||void 0===y?void 0:y.lineWidth,null===(w=null==i?void 0:i.group)||void 0===w?void 0:w.lineWidth],x[2]=0)),x}class bS extends uS{constructor(t){super(t),this._autoWidth=!1,this._autoHeight=!1,this._leftGroup=new uS({pickable:!1,fill:!1,stroke:!1}),this._leftGroup.role="content-left",this._rightGroup=new uS({pickable:!1,fill:!1,stroke:!1}),this._rightGroup.role="content-right",this._centerGroup=new uS({pickable:!1,fill:!1,stroke:!1}),this._centerGroup.role="content-center",this.appendChild(this._leftGroup),this.appendChild(this._rightGroup),this.appendChild(this._centerGroup)}setCellContentOption(t){this._autoWidth=t.autoWidth,this._autoHeight=t.autoHeight,this._cellWidth=t.cellWidth,this._originCellWidth=t.cellWidth,this._cellHeight=t.cellHeight,this._align=t.align,this._baseline=t.baseline}addLeftOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._leftGroup.width+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)),this._leftGroup.appendChild(t),this._leftGroup.setDeltaWidth((null!==(i=t.attribute.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.attribute.marginRight)&&void 0!==o?o:0)+t.attribute.width)}addRightOccupyingIcon(t){var e,i,o;t.setAttribute("x",this._rightGroup.width+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)),this._rightGroup.appendChild(t),this._rightGroup.setDeltaWidth((null!==(i=t.attribute.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.attribute.marginRight)&&void 0!==o?o:0)+t.attribute.width)}addContent(t){const e=this._centerGroup.lastChild;e&&t.setAttributes({x:e.attribute.x+e.AABBBounds.width()}),this._centerGroup.appendChild(t),t instanceof Ih&&(this._centerGroup.setAttribute("pickable",!1),t.setAttribute("textAlign","left"))}layout(){let t=this._leftGroup.width;t===1/0&&(t=0);let e=this._rightGroup.width;if(e===-1/0&&(e=0),this._autoWidth){const i=this._centerGroup.width;this._cellWidth=t+e+i,this.setAttribute("width",this._cellWidth)}else{const i=this._cellWidth-t-e;this.updateCenterLayout(i);const o=this._centerGroup.width;this._cellWidth=t+e+o,this.setAttribute("width",this._cellWidth)}this.updateHorizontalPos();const i=this._leftGroup.height,o=this._rightGroup.height,n=this._centerGroup.height;this._cellHeight=Math.max(i,o,n),this.setAttribute("height",this._cellHeight),this.updateVerticalPos()}updateCenterLayout(t){let e=t;this._centerGroup.forEachChildren((t=>{t instanceof w_&&(e-=t.AABBBounds.width())}));const i=this._centerGroup.getChildByName("text");i instanceof uc?i.setAttribute("width",e):i instanceof Ih&&i.setAttribute("maxLineWidth",e);let o=0;this._centerGroup.forEachChildren((t=>{t.setAttribute("x",o),o+=t.AABBBounds.width()}))}updateHorizontalPos(){this._leftGroup.setAttribute("x",0),this._rightGroup.setAttribute("x",this._cellWidth-this._rightGroup.width),this._centerGroup.setAttribute("x",this._leftGroup.width),"left"===this._align||"start"===this._align?this.setAttribute("dx",0):"center"===this._align?this.setAttribute("dx",-this.attribute.width/2):"right"!==this._align&&"end"!==this._align||this.setAttribute("dx",-this.attribute.width)}updateVerticalPos(){"top"===this._baseline?(this._leftGroup.setAttribute("y",0),this._rightGroup.setAttribute("y",0),this._centerGroup.setAttribute("y",0)):"middle"===this._baseline?(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",(this._leftGroup.height-t.AABBBounds.height())/2)})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",(this._rightGroup.height-t.AABBBounds.height())/2)})),this._leftGroup.setAttribute("y",this._cellHeight/2-this._leftGroup.height/2),this._rightGroup.setAttribute("y",this._cellHeight/2-this._rightGroup.height/2),this._centerGroup.setAttribute("y",this._cellHeight/2-this._centerGroup.height/2)):"bottom"===this._baseline&&(this._leftGroup.forEachChildren((t=>{t.setAttribute("y",this._leftGroup.height-t.AABBBounds.height())})),this._rightGroup.forEachChildren((t=>{t.setAttribute("y",this._rightGroup.height-t.AABBBounds.height())})),this._leftGroup.setAttribute("y",this._cellHeight-this._leftGroup.height),this._rightGroup.setAttribute("y",this._cellHeight-this._rightGroup.height),this._centerGroup.setAttribute("y",this._cellHeight-this._centerGroup.height))}updateWidth(t){this._cellWidth=t,this._originCellWidth=t,this.layout()}updateHeight(t){this._cellHeight=t,this._cellWidth=this._originCellWidth,this.layout()}}function CS(t,e,i){var o,n,r,s,l;let a=0;const h=i.internalProps.layoutMap;if(h.isHeader(t,e)){const r=h.getHeader(t,e);K(null==r?void 0:r.hierarchyLevel)&&(a=(null!==(o=r.hierarchyLevel)&&void 0!==o?o:0)*(null!==(n=h.rowHierarchyIndent)&&void 0!==n?n:0),h.rowHierarchyTextStartAlignment&&!i.internalProps.headerHelper.getHierarchyIcon(t,e)&&(a+=i.internalProps.headerHelper.getHierarchyIconWidth()))}else if(i.options.groupBy||(null===(r=i.getBodyColumnDefine(t,e))||void 0===r?void 0:r.tree)){const o=i.dataSource.getIndexKey(i.getRecordShowIndexByCell(t,e)),n=null!==(s=i.dataSource.getGroupLength())&&void 0!==s?s:0;let r=et(o)?o.length-1:0;n>0&&r===n&&(r=0),a=Array.isArray(o)&&i.getHierarchyState(t,e)!==by.none?r*(null!==(l=h.hierarchyIndent)&&void 0!==l?l:0):0,h.hierarchyTextStartAlignment&&!i.internalProps.bodyHelper.getHierarchyIcon(t,e)&&(a+=i.internalProps.bodyHelper.getHierarchyIconWidth())}return a}function yS(t,e){var i,o;let n,r=!1;for(tt(t)&&t.length>(e.options.maxCharactersNumber||200)&&(t=t.slice(0,e.options.maxCharactersNumber||200),t+="…",r=!0),n=e.internalProps.enableLineBreak||(null===(i=e.options.customConfig)||void 0===i?void 0:i.multilinesForXTable)?Vy(t).replace(/\r?\n/g,"\n").replace(/\r/g,"\n").split("\n")||[]:[Vy(t)];n.length&&n.length>1&&!n[n.length-1];)n.pop();if((null===(o=e.options.customConfig)||void 0===o?void 0:o.multilinesForXTable)&&!e.internalProps.autoWrapText)for(;n.length&&n.length>1&&!n[0];)n.shift();return{text:n,moreThanMaxCharacters:r}}function wS(t,e,i,o,n,r,s){var l,a,h,d,c,u;const g={};"image"===t.type?t.isGif?(g.gif=t.src,g.image=t.src):g.image=t.src:("svg"===t.type||"svg"in t)&&(g.image=t.svg),g.width=t.width,g.height=t.height,g.visibleTime=null!==(l=t.visibleTime)&&void 0!==l?l:"always",g.funcType=t.funcType,g.interactive=t.interactive,g.isGif=t.isGif;let p=0;if(s&&0!==(null==s?void 0:s.addedHierarchyOffset)||!nt(i)||!nt(o)||!r||t.funcType!==xy.collapse&&t.funcType!==xy.expand&&t.positionType!==wy.contentLeft&&t.positionType!==wy.contentRight||(p=n?CS(n.start.col,n.start.row,r):CS(i,o,r),s&&(s.addedHierarchyOffset=1)),g.marginLeft=(null!==(a=t.marginLeft)&&void 0!==a?a:0)+p,g.marginRight=null!==(h=t.marginRight)&&void 0!==h?h:0,!1===t.interactive&&(g.pickable=!1),t.hover&&(g.backgroundWidth=null!==(d=t.hover.width)&&void 0!==d?d:t.width,g.backgroundHeight=null!==(c=t.hover.width)&&void 0!==c?c:t.width,g.backgroundColor=null!==(u=t.hover.bgColor)&&void 0!==u?u:"rgba(22,44,66,0.2)",g.hoverImage=t.hover.image),t.cursor&&(g.cursor=t.cursor),"shape"in t&&"circle"===t.shape&&(g.shape=t.shape),e)return e.setAttributes(g),e.loadImage(g.image),e.tooltip=t.tooltip,e.name=t.name,e;const f=new w_(g);return f.tooltip=t.tooltip,f.name=t.name,f}function xS(t){var e,i,o,n,r,s;const l={};return"image"===t.type?l.image=t.src:("svg"===t.type||"svg"in t)&&(l.image=t.svg),l.visibleTime=null!==(e=t.visibleTime)&&void 0!==e?e:"always",l.funcType=t.funcType,l.id=t.name,l.width=t.width,l.height=t.height,(t.marginRight||t.marginLeft)&&(l.margin=[0,null!==(i=t.marginRight)&&void 0!==i?i:0,0,null!==(o=t.marginLeft)&&void 0!==o?o:0]),t.hover&&(l.backgroundWidth=null!==(n=t.hover.width)&&void 0!==n?n:t.width,l.backgroundHeight=null!==(r=t.hover.height)&&void 0!==r?r:t.height,l.backgroundShowMode="hover",l.hoverImage=t.hover.image,l.backgroundStroke=!1,l.backgroundFill=null!==(s=t.hover.bgColor)&&void 0!==s?s:"rgba(22,44,66,0.2)"),t.cursor&&(l.cursor=t.cursor),l.tooltip=t.tooltip,l}function _S(t,e,i,o,n,r,s,l,a){var h,d,c,u;rt(t.contentWidth)&&(o=e-(null!==(h=t.contentWidth)&&void 0!==h?h:t.attribute.width));let g,p=0,f=0,v=0,m=0;t.forEachChildren((t=>{var e,i,o,n;"icon-left"===t.role?(p+=t.AABBBounds.width()+(null!==(e=t.attribute.marginLeft)&&void 0!==e?e:0)+(null!==(i=t.attribute.marginRight)&&void 0!==i?i:0),f=Math.max(f,t.AABBBounds.height())):"icon-right"===t.role&&(v+=t.AABBBounds.width()+(null!==(o=t.attribute.marginLeft)&&void 0!==o?o:0)+(null!==(n=t.attribute.marginRight)&&void 0!==n?n:0),m=Math.max(m,t.AABBBounds.height()))}));const b=t.getChildByName("text"),C=t.getChildByName("content");let y;b instanceof Ih?(g=b.AABBBounds.height(),b.setAttribute("maxLineWidth",e-p-v-(r[1]+r[3])-(null!==(d=b.attribute.dx)&&void 0!==d?d:0)-(null!==(c=a.table.theme._contentOffset)&&void 0!==c?c:0)),y=b.AABBBounds.height()):b instanceof uc?(g=b.AABBBounds.height(),b.setAttribute("width",e-p-v-(r[1]+r[3])),y=b.AABBBounds.height()):C&&(g=C.AABBBounds.height(),C.updateWidth(e-p-v-(r[1]+r[3])),y=C.AABBBounds.height());const w=Math.round(Math.max(f,m,g)+r[0]+r[2]);if(t.forEachChildren((i=>{var n;if("icon-left"===i.role);else if("icon-right"===i.role)i.setAttribute("x",i.attribute.x+o);else if("icon-absolute-right"===i.role)i.setAttribute("x",i.attribute.x+o);else if("content"===i.name||"text"===i.name&&"richtext"!==i.type){const t=null!==(n=i.attribute.textAlign)&&void 0!==n?n:s;"center"===t?i.setAttribute("x",r[3]+p+(e-(r[1]+r[3])-p-v)/2):"right"===t&&i.setAttribute("x",r[3]+e-(r[1]+r[3])-v)}else"mark"===i.name&&i.setAttribute("x",t.attribute.width)})),n){let e=Math.max(f,y,m);if(function(t,e,i,o){const n=t.table,r=nx(n,e.col,e.row);if(r&&r.end.row-r.start.row){o/=r.end.row-r.start.row+1,i/=r.end.row-r.start.row+1;for(let t=r.start.row;t<=r.end.row;t++){const e=n.getRowHeight(t);if(e===o&&i!==e)return!0;if(i>e)return!0}}else{const t=n.getRowHeight(e.row);if(t===o&&i!==t)return!0;if(i>t)return!0}return!1}(a,t,Math.round(e+r[0]+r[2]),w))return!0;e=(null!==(u=t.contentHeight)&&void 0!==u?u:i)-(r[0]+r[2]),t.forEachChildren((t=>{"rect"!==t.type&&"chart"!==t.type&&t.name!==T_&&("mark"===t.name?t.setAttribute("y",0):"middle"===l?t.setAttribute("y",r[0]+(e-t.AABBBounds.height())/2):"bottom"===l?t.setAttribute("y",r[0]+e-t.AABBBounds.height()):t.setAttribute("y",r[0]))}))}else"middle"!==l&&"bottom"!==l||t.forEachChildren((t=>{"rect"!==t.type&&"chart"!==t.type&&t.name!==T_&&("mark"===t.name?t.setAttribute("y",0):"middle"===l?t.setAttribute("y",(i-r[2]+r[0]-t.AABBBounds.height())/2):"bottom"===l?t.setAttribute("y",i-t.AABBBounds.height()-r[2]):t.setAttribute("y",r[0]))}));return!1}function SS(t,e,i,o,n,r,s,l){var a;const h=e-Math.floor(n[0]+n[2]),d=t.getChildByName("text");d instanceof Ih&&!o?d.setAttributes({heightLimit:!1===(null===(a=l.options.customConfig)||void 0===a?void 0:a.limitContentHeight)?-1:h}):d instanceof uc&&!o?d.setAttributes({height:h}):t.getChildByName("content")&&t.getChildByName("content").updateHeight(h),t.forEachChildren((t=>{t.setAttribute("dy",0),"rect"===t.type||"chart"===t.type||t.name===T_||("mark"===t.name?t.setAttribute("y",0):"middle"===s?t.setAttribute("y",n[0]+(h-t.AABBBounds.height())/2):"bottom"===s?t.setAttribute("y",n[0]+h-t.AABBBounds.height()):t.setAttribute("y",n[0]))}))}function AS(t,e,i,o){const n=[],r=[],s=[],l=[],a=[],h=[],d=[],c=[];let u=0,g=0,p=0,f=0,v=0,m=0;return t.forEach((t=>{switch(t.positionType){case wy.left:n.push(t);break;case wy.right:r.push(t);break;case wy.contentLeft:s.push(t);break;case wy.contentRight:l.push(t);break;case wy.absoluteRight:c.push(t);break;case wy.inlineFront:a.push(t);break;case wy.inlineEnd:h.push(t)}})),n.forEach((t=>{var n,r,s;const l=wS(t,void 0,e.col,e.row,i,o);l.role="icon-left",l.name=t.name,l.setAttribute("x",u+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),u+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),g=Math.max(g,l.AABBBounds.height()),e.appendChild(l)})),r.forEach((t=>{var n,r,s;const l=wS(t,void 0,e.col,e.row,i,o);l.role="icon-right",l.name=t.name,l.setAttribute("x",p+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),p+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),f=Math.max(f,l.AABBBounds.height()),e.appendChild(l)})),d.forEach((t=>{var n,r,s;const l=wS(t,void 0,e.col,e.row,i,o);l.role="icon-absolute-left",l.name=t.name,l.setAttribute("x",v+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),v+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),e.appendChild(l)})),c.forEach((t=>{var n,r,s;const l=wS(t,void 0,e.col,e.row,i,o);l.role="icon-absolute-right",l.name=t.name,l.setAttribute("x",m+(null!==(n=l.attribute.marginLeft)&&void 0!==n?n:0)),m+=l.AABBBounds.width()+(null!==(r=l.attribute.marginLeft)&&void 0!==r?r:0)+(null!==(s=l.attribute.marginRight)&&void 0!==s?s:0),e.appendChild(l)})),{leftIcons:n,rightIcons:r,contentLeftIcons:s,contentRightIcons:l,inlineFrontIcons:a,inlineEndIcons:h,absoluteLeftIcons:d,absoluteRightIcons:c,leftIconWidth:u,leftIconHeight:g,rightIconWidth:p,rightIconHeight:f,absoluteLeftIconWidth:v,absoluteRightIconWidth:m}}function RS(t,e){if(t.hasOwnProperty("hoverIconId")){const e=this;if(e.skipMergeUpdate)return;const i=A_(e);if(!i||!i.stage)return;const o=i.stage.table;e.skipAttributeUpdate=!0;const{mergeStartCol:n,mergeEndCol:r,mergeStartRow:s,mergeEndRow:l}=i;if(K(n)&&K(r)&&K(s)&&K(l)&&(n!==r||s!==l)){for(let a=n;a<=r;a++)for(let n=s;n<=l;n++){if(a===i.col&&n===i.row){if(t.hoverIconId!==e.attribute.hoverIconId){const i=e._frameCache.icons.get(t.hoverIconId);e.updateHoverIconState(i)}continue}const r=o.scenegraph.highPerformanceGetCell(a,n);if("cell"===r.role){const i=r.getChildByName(e.name,!0);if(!i||i.skipAttributeUpdate)continue;t.hoverIconId!==i.attribute.hoverIconId&&(i.setAttribute("hoverIconId",t.hoverIconId),r.addUpdateBoundTag())}}e.skipAttributeUpdate=void 0}}}function BS(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v){var m,b,C,y,w,x,_,S,A,R,B,M,T,P,E,k,L,H,F,z,I,O,D,W,N,G,j,U,V,$;const Y=vS("padding",g._getCellStyle(o,n),o,n,g);(null===(m=g.options.customConfig)||void 0===m?void 0:m.imageMargin)?h=Fx(null===(b=g.options.customConfig)||void 0===b?void 0:b.imageMargin):K(Y)&&(h=Y),(null===(C=null==p?void 0:p.text)||void 0===C?void 0:C.textAlign)&&(d=null===(y=null==p?void 0:p.text)||void 0===y?void 0:y.textAlign),(null===(w=null==p?void 0:p.text)||void 0===w?void 0:w.textBaseline)&&(c=null===(x=null==p?void 0:p.text)||void 0===x?void 0:x.textBaseline);const X=mS(o,n,p,g);let Z,q;if(v&&(Z=g.scenegraph.highPerformanceGetCell(o,n,!0),Z&&"cell"===Z.role&&Z.setAttributes({x:e,y:i,width:r,height:s,lineWidth:null!==(S=null===(_=null==p?void 0:p.group)||void 0===_?void 0:_.lineWidth)&&void 0!==S?S:void 0,fill:null!==(R=null===(A=null==p?void 0:p.group)||void 0===A?void 0:A.fill)&&void 0!==R?R:void 0,stroke:null!==(M=null===(B=null==p?void 0:p.group)||void 0===B?void 0:B.stroke)&&void 0!==M?M:void 0,strokeArrayWidth:null!=X?X:void 0,strokeArrayColor:null!==(P=null===(T=null==p?void 0:p.group)||void 0===T?void 0:T.strokeArrayColor)&&void 0!==P?P:void 0,cursor:null!==(k=null===(E=null==p?void 0:p.group)||void 0===E?void 0:E.cursor)&&void 0!==k?k:void 0,lineDash:null!==(H=null===(L=null==p?void 0:p.group)||void 0===L?void 0:L.lineDash)&&void 0!==H?H:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})),Z&&"cell"===Z.role||(Z=new uS({x:e,y:i,width:r,height:s,lineWidth:null!==(z=null===(F=null==p?void 0:p.group)||void 0===F?void 0:F.lineWidth)&&void 0!==z?z:void 0,fill:null!==(O=null===(I=null==p?void 0:p.group)||void 0===I?void 0:I.fill)&&void 0!==O?O:void 0,stroke:null!==(W=null===(D=null==p?void 0:p.group)||void 0===D?void 0:D.stroke)&&void 0!==W?W:void 0,strokeArrayWidth:null!=X?X:void 0,strokeArrayColor:null!==(G=null===(N=null==p?void 0:p.group)||void 0===N?void 0:N.strokeArrayColor)&&void 0!==G?G:void 0,cursor:null!==(U=null===(j=null==p?void 0:p.group)||void 0===j?void 0:j.cursor)&&void 0!==U?U:void 0,lineDash:null!==($=null===(V=null==p?void 0:p.group)||void 0===V?void 0:V.lineDash)&&void 0!==$?$:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),Z.role="cell",Z.col=o,Z.row=n,null==t||t.addCellGroup(Z)),u){let t=o,e=n;f&&(t=f.start.col,e=f.start.row),q=g.getCellIcons(t,e)}let J=0,Q=0,tt=0;if(Array.isArray(q)&&0!==q.length){const{leftIconWidth:t,rightIconWidth:e,absoluteLeftIconWidth:i,absoluteRightIconWidth:o}=AS(q,Z,f,g);J=t+e,Q=t,tt=e,Z.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+r-e-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+r-o-h[1])})),Z.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(s-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",s-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])})),Z._cellLeftIconWidth=Q,Z._cellRightIconWidth=tt}const et=g.getCellValue(o,n),it=lc({x:h[3],y:h[0],width:r-h[1]-h[3]-J,height:s-h[0]-h[2],image:et,cursor:"pointer"});return it.name="image",it.keepAspectRatio=l,it.textAlign=d,it.textBaseline=c,l||a?it.resources&&it.resources.has(it.attribute.image)&&"success"===it.resources.get(it.attribute.image).state?setTimeout((()=>{kS(a,l,h,d,c,it,Z,g)}),0):it.successCallback=()=>{kS(a,l,h,d,c,it,Z,g),g.scenegraph.updateNextFrame()}:it.resources&&it.resources.has(it.attribute.image)&&"success"===it.resources.get(it.attribute.image).state?TS(Z,o,n,0,0,g):it.successCallback=()=>{TS(Z,o,n,0,0,g)},it.failCallback=()=>{const t=cS();it.image=t.damage_pic.svg},Z.appendChild(it),Z}function MS(t,e,i,o,n,r,s){let l=!1,a=null,h=null;const{width:d,height:c,isMerge:u}=PS(s,n.table);if(d<i+r[1]+r[3]&&(a=i+r[1]+r[3],l=!0),c<o+r[2]+r[0]&&(h=o+r[2]+r[0],l=!0),l){if("number"==typeof a)if(u)for(let t=s.mergeStartCol;t<=s.mergeEndCol;t++)n.setColWidth(t,a/(s.mergeEndCol-s.mergeStartCol+1));else n.setColWidth(t,a);if("number"==typeof h)if(u)for(let t=s.mergeStartRow;t<=s.mergeEndRow;t++)n.setRowHeight(t,h/(s.mergeEndRow-s.mergeStartRow+1));else n.setRowHeight(e,h);return n.component.updateScrollBar(),!0}return!1}function TS(t,e,i,o,n,r){var s,l,a,h,d,c,u,g,p,f,v,m;const b=t.getChildByName("image");if(!b)return;const C="string"!=typeof b.attribute.image&&b.attribute.image||(null===(s=b.resources)||void 0===s?void 0:s.get(b.attribute.image).data);if(!C)return;const y=r._getCellStyle(e,i),w=null!==(l=fS("textAlign",y,e,i,r))&&void 0!==l?l:"left",x=null!==(a=fS("textBaseline",y,e,i,r))&&void 0!==a?a:"middle";let _;_=(null===(h=r.options.customConfig)||void 0===h?void 0:h.imageMargin)?Fx(null===(d=r.options.customConfig)||void 0===d?void 0:d.imageMargin):null!==(c=Fx(fS("padding",y,e,i,r)))&&void 0!==c?c:[0,0,0,0];const{width:S,height:A,isMerge:R}=PS(t,r),B=null!==(u=t.mergeStartCol)&&void 0!==u?u:t.col,M=null!==(g=t.mergeStartRow)&&void 0!==g?g:t.row,T=null!==(p=t.mergeEndCol)&&void 0!==p?p:t.col,P=null!==(f=t.mergeEndCol)&&void 0!==f?f:t.row,E=null!==(v=t._cellLeftIconWidth)&&void 0!==v?v:0,k=null!==(m=t._cellRightIconWidth)&&void 0!==m?m:0;if(b.keepAspectRatio){const{width:t,height:e}=gS(C.width||C.videoWidth,C.height||C.videoHeight,S-(_[1]+_[3]),A-(_[0]+_[2])),i=pS(0,0,S,A,t,e,w,x,_);for(let o=B;o<=T;o++)for(let n=M;n<=P;n++){const s=r.scenegraph.getCell(o,n).getChildByName("image");null==s||s.setAttributes({x:i.x,y:i.y,width:t,height:e})}}else for(let t=B;t<=T;t++)for(let e=M;e<=P;e++){const i=r.scenegraph.getCell(t,e).getChildByName("image");null==i||i.setAttributes({x:E+_[3],y:_[0],width:S-_[1]-_[3]-k-E,height:A-_[0]-_[2]})}if(t.getChildByName("play-icon")){const e=0,i=0,{width:o,height:n}=PS(t,r),s=Math.floor(Math.min(o-_[1]-_[3],n-_[2]-_[0])/2),l=e+(o>b.attribute.width?b.attribute.x-e+b.attribute.width/2:o/2),a=i+(n>b.attribute.height?b.attribute.y-i+b.attribute.height/2:n/2);for(let t=B;t<=T;t++)for(let e=M;e<=P;e++)r.scenegraph.getCell(t,e).getChildByName("play-icon").setAttributes({x:l-s/2,y:a-s/2,width:s,height:s})}t.forEachChildren((t=>{"icon-left"===t.role||("icon-right"===t.role||"icon-absolute-right"===t.role)&&t.setAttribute("x",t.attribute.x+o)})),t.forEachChildren((t=>{("rect"===t.type||t.role&&t.role.startsWith("icon"))&&("middle"===x?t.setAttribute("y",_[0]+(A-_[0]-_[2]-t.AABBBounds.height())/2):"bottom"===x?t.setAttribute("y",_[0]+A-_[0]-_[2]-t.AABBBounds.height()):t.setAttribute("y",_[0]))})),R&&ES(t.mergeStartCol,t.mergeEndCol,t.mergeStartRow,t.mergeEndRow,r)}function PS(t,e){return"cell"===t.role&&K(t.mergeStartCol)&&K(t.mergeEndCol)&&K(t.mergeStartRow)&&K(t.mergeEndRow)?{width:e.getColsWidth(t.mergeStartCol,t.mergeEndCol),height:e.getRowsHeight(t.mergeStartRow,t.mergeEndRow),isMerge:!0}:{width:t.attribute.width,height:t.attribute.height,isMerge:!1}}function ES(t,e,i,o,n){for(let r=t;r<=e;r++)for(let t=i;t<=o;t++){const e=n.scenegraph.getCell(r,t);if(e){const i=e.getChildByName("image");i&&i.setAttributes({dx:-n.getColsWidth(e.mergeStartCol,r-1),dy:-n.getRowsHeight(e.mergeStartRow,t-1)});const o=e.getChildByName("play-icon");o&&o.setAttributes({dx:-n.getColsWidth(e.mergeStartCol,r-1),dy:-n.getRowsHeight(e.mergeStartRow,t-1)})}}}function kS(t,e,i,o,n,r,s,l){const a=r.resources.get(r.attribute.image).data,{col:h,row:d}=s;if(t&&!LS(r)&&MS(h,d,a.width,a.height,l.scenegraph,i,s),e||LS(r)){const{width:t,height:e,isMerge:h}=PS(s,l),{width:d,height:c}=gS(a.width,a.height,t-i[1]-i[3],e-i[0]-i[2]),u=pS(0,0,t,e,d,c,o,n,i);r.setAttributes({x:u.x,y:u.y,width:d,height:c}),h&&ES(s.mergeStartCol,s.mergeEndCol,s.mergeStartRow,s.mergeEndRow,l)}}function LS(t){const e=cS();return t.attribute.image===e.damage_pic.svg}function HS(t,e,i){t.then((()=>{i(),e.scenegraph.updateNextFrame()})).catch((t=>{}))}function FS(t,e){var i,o;const n=this;if(n.shadowRoot&&n.shadowRoot.childrenCount&&(K(t.width)||K(t.height))){const e=n.shadowRoot.findChildrenByName("shadow-rect")[0];e&&e.setAttributes({width:null!==(i=t.width)&&void 0!==i?i:e.attribute.width,height:null!==(o=t.height)&&void 0!==o?o:e.attribute.height})}}function zS(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m){var b,C;let y,w=!1;if(gw(e)){if("cell"!==o.scenegraph.highPerformanceGetCell(n,r).role)return y;e=o.getCellValue(n,r),w=!0}if("text"===t||"link"===t||m){if("link"===t){const s=e,l=o._getCellStyle(n,r);"link"===t&&("templateLink"in i&&i.templateLink||!("linkDetect"in i)||!i.linkDetect||Gw.test(s))&&(f?(f.text.fill=fS("linkColor",l,n,r,o),f.group.cursor="pointer"):f={text:{fill:fS("linkColor",l,n,r,o)},group:{cursor:"pointer"}})}let C,x=!0;if(m)C=m.elementsGroup,x=m.renderDefault;else{let t,e;if("body"!==o.getCellLocation(n,r)?(t=null==i?void 0:i.headerCustomRender,e=null==i?void 0:i.headerCustomLayout):(t=(null==i?void 0:i.customRender)||o.customRender,e=null==i?void 0:i.customLayout),e||t){const i=E_(e,t,n,r,l,a,!1,o.isAutoRowHeight(r),c,v,o);C=i.elementsGroup,x=i.renderDefault}}y=rx.getFunction("createTextCellGroup")(o,e,h,0,d,n,r,s,l,a,c,u,g,p,C,x,f,v,w);const _=o.internalProps.layoutMap.getAxisConfigInPivotChart(n,r);if(_){const t=new(rx.getComponent("axis"))(_,y.attribute.width,y.attribute.height,null!==(b=_.__vtablePadding)&&void 0!==b?b:c,o);y.clear(),y.appendChild(t.component),t.overlap()}else o.internalProps.layoutMap.isEmpty(n,r)?(y.setAttributes({fill:!1,stroke:!1}),y.clear()):o.internalProps.layoutMap.isAxisCell(n,r)&&y.clear()}else if("image"===t)y=rx.getFunction("createImageCellGroup")(h,0,d,n,r,l,a,i.keepAspectRatio,i.imageAutoSizing,c,u,g,p,o,f,v,w);else if("video"===t)y=rx.getFunction("createVideoCellGroup")(h,0,d,n,r,l,a,i.keepAspectRatio,i.imageAutoSizing,c,u,g,p,o,f,v,w);else if("chart"===t){const t=o.internalProps.layoutMap.getChartInstance(n,r);y=rx.getFunction("createChartCellGroup")(null,h,0,d,n,r,l,a,c,e,i.chartModule,o.internalProps.layoutMap.getChartSpec(n,r),t,null!==(C=o.internalProps.layoutMap.getChartDataId(n,r))&&void 0!==C?C:"data",o,f,o.internalProps.layoutMap.isShareChartSpec(n,r),w,o.internalProps.layoutMap.isNoChartDataRenderNothing(n,r))}else if("progressbar"===t){const t=o._getCellStyle(n,r),p=o.getCellOriginValue(n,r);y=rx.getFunction("createTextCellGroup")(o,e,h,0,d,n,r,s,l,a,c,u,g,!1,null,!0,f,v,w);const m=rx.getFunction("createProgressBarCell")(i,t,s,e,p,n,r,c,o,v);y.firstChild?y.insertBefore(m,y.firstChild):y.appendChild(m)}else"sparkline"===t?y=rx.getFunction("createSparkLineCellGroup")(null,h,0,d,n,r,l,a,c,o,f,w):"checkbox"===t?y=rx.getFunction("createCheckboxCellGroup")(null,h,0,d,n,r,s,l,a,c,u,g,p,o,f,i,v,w):"radio"===t&&(y=rx.getFunction("createRadioCellGroup")(null,h,0,d,n,r,s,l,a,c,u,g,o,f,i));return y.onBeforeAttributeUpdate=FS,y}function IS(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x;const _=i.scenegraph.highPerformanceGetCell(t,e,!0),S=i.getCellLocation(t,e);let A,R,B,M,T=i.getCellValue(t,e),P=!1;if(i.internalProps.customMergeCell){const o=i.getCustomMerge(t,e);if(o){const{range:t,text:n,style:r,customLayout:s,customRender:l}=o;R=t,A=R.start.col!==R.end.col||R.start.row!==R.end.row,T=n,B=r,(s||l)&&(M=E_(s,l,t.start.col,t.start.row,i.getColsWidth(t.start.col,t.end.col),i.getRowsHeight(t.start.row,t.end.row),!1,i.isAutoRowHeight(e),[0,0,0,0],R,i)),P=!0}}let E=t,k=e;R&&(E=R.start.col,k=R.start.row);const L="body"!==S?i.getHeaderDefine(E,k):i.getBodyColumnDefine(E,k);let H="body"!==S||(null==L?void 0:L.dragOrder)||!!(null==L?void 0:L.icon)||!!(null==L?void 0:L.tree);R||!i.internalProps.enableTreeNodeMerge&&"body"===S&&!(null==L?void 0:L.mergeCell)||(R=i.getCellRange(t,e),A=R.start.col!==R.end.col||R.start.row!==R.end.row);let F=!1;if(i.internalProps.enableTreeNodeMerge&&A){const t=i.getCellRawRecord(R.start.col,R.start.row),{vtableMergeName:o,vtableMerge:n}=null!=t?t:{};F=n,n&&(H=!0,i.options.groupTitleCustomLayout&&(M=E_(i.options.groupTitleCustomLayout,void 0,R.start.col,R.start.row,i.getColsWidth(R.start.col,R.end.col),i.getRowsHeight(R.start.row,R.end.row),!1,i.isAutoRowHeight(e),[0,0,0,0],R,i))),o&&(T=o)}const z=B||i._getCellStyle(R?R.start.col:t,R?R.start.row:e),I=null!==(r=z.autoWrapText)&&void 0!==r?r:i.internalProps.autoWrapText,O=b_(z,i,A?R.start.col:t,A?R.start.row:e,fS).theme;if(O.group.cornerRadius=C_(t,e,i),!o&&!A&&!((null==L?void 0:L.customLayout)||(null==L?void 0:L.customRender)||(null==L?void 0:L.headerCustomLayout)||(null==L?void 0:L.headerCustomRender))&&function(t,e,i,o,n,r){var s;const l=r.getBodyColumnType(t,e),a=r.isAutoRowHeight(e),h=r.getCellValue(t,e);return!(r.isHeader(t,e)||"cell"!==i.role||"text"!==l||o||a||n||"text"!==(null===(s=i.firstChild)||void 0===s?void 0:s.type)||gw(h))}(t,e,_,I,H,i)){const o=i.getColWidth(t),n=i.getRowHeight(e);_.setAttributes({width:o,height:n,lineWidth:null!==(l=null===(s=null==O?void 0:O.group)||void 0===s?void 0:s.lineWidth)&&void 0!==l?l:void 0,fill:null!==(h=null===(a=null==O?void 0:O.group)||void 0===a?void 0:a.fill)&&void 0!==h?h:void 0,stroke:null!==(c=null===(d=null==O?void 0:O.group)||void 0===d?void 0:d.stroke)&&void 0!==c?c:void 0,strokeArrayWidth:null!==(g=null===(u=null==O?void 0:O.group)||void 0===u?void 0:u.strokeArrayWidth)&&void 0!==g?g:void 0,strokeArrayColor:null!==(f=null===(p=null==O?void 0:O.group)||void 0===p?void 0:p.strokeArrayColor)&&void 0!==f?f:void 0,cursor:null!==(m=null===(v=null==O?void 0:O.group)||void 0===v?void 0:v.cursor)&&void 0!==m?m:void 0,cornerRadius:null!==(C=null===(b=null==O?void 0:O.group)||void 0===b?void 0:b.cornerRadius)&&void 0!==C?C:0,y:i.scenegraph.getCellGroupY(e)}),_.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})}));const r=_.getChildByName("text");if(r){const s=i.getCellValue(t,e),{text:l,moreThanMaxCharacters:a}=yS(s,i),h=CS(t,e,i),d=z.lineClamp,c=null!==(y=Fx(fS("padding",z,t,e,i)))&&void 0!==y?y:[0,0,0,0],u=O.text.textAlign;let g=0;g="center"===u?c[3]+(o-(c[1]+c[3]))/2:"right"===u?c[3]+o-(c[1]+c[3]):c[3];const p={text:1!==l.length||I?l:l[0],moreThanMaxCharacters:a,maxLineWidth:o-(c[1]+c[3]+h),textBaseline:"top",autoWrapText:I,lineClamp:d,wordBreak:"break-word",heightLimit:n-Math.floor(c[0]+c[2]),pickable:!1,dx:"left"===u?h:0,x:g};if(r.setAttributes(O.text?Object.assign({},O.text,p):p),r.attribute.text){const t=O.text.textBaseline,e=n-(c[0]+c[2]);let i=0;i="middle"===t?c[0]+(e-r.AABBBounds.height())/2:"bottom"===t?c[0]+e-r.AABBBounds.height():c[0],r.setAttributes({y:i})}}return _}if(!o&&"empty"===_.role)return;const D=F||P?"text":i.isHeader(t,e)?null!==(w=i._getHeaderLayoutMap(t,e).headerType)&&void 0!==w?w:"text":null!==(x=i.getBodyColumnType(t,e))&&void 0!==x?x:"text",W=O._vtable.padding,N=O.text.textAlign,G=O.text.textBaseline;let j,U,V;if(R?(U=i.getColsWidth(R.start.col,R.end.col),V=i.getRowsHeight(R.start.row,R.end.row)):(U=i.getColWidth(t),V=i.getRowHeight(e)),gw(T)?(_.removeAllChild(),HS(T,i,DS.bind(null,{type:D,value:T,define:L,table:i,col:t,row:e,cellWidth:U,cellHeight:V,oldCellGroup:_,padding:W,textAlign:N,textBaseline:G,mayHaveIcon:H,addNew:o,range:R,customResult:M,customStyle:B}))):j=OS(D,T,L,i,t,e,U,V,_,W,N,G,H,o,O,R,M),A){const{width:t}=j.attribute,{height:e}=j.attribute;j.contentWidth=t,j.contentHeight=e,n?function(t,e,i,o,n,r,s,l){const{col:a,row:h}=l;t.start.row!==t.end.row&&l.contentHeight!==i&&SS(l,i,0,s.isAutoRowHeight(h),o,0,r,s),t.start.col!==t.end.col&&l.contentWidth!==e&&_S(l,e,i,0,s.isAutoRowHeight(h),o,n,r,s.scenegraph),l.contentWidth=e,l.contentHeight=i;const d=s.getRowHeight(h);NS(l,s.getColWidth(a),d,t,s)}(R,U,V,W,N,G,i,j):WS(R,U,V,W,N,G,i)}return j}function OS(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v){var m,b;if(gw(e)&&(e=o.getCellValue(n,r)),!g&&(a.row!==r||a.col!==n))return null;if(!g&&a.parent&&o.reactCustomLayout){const t=a.getChildByName("custom-container");if(t){const{col:e,row:i}=t;o.reactCustomLayout.removeCustomCell(e,i)}}const C=zS(t,e,i,o,n,r,o.getColWidth(n),s,l,g?o.scenegraph.getColGroup(n):a.parent,g?0:o.scenegraph.getCellGroupY(r),h,d,c,u,p,f,v);return!g&&a.parent&&(a.parent.insertAfter(C,a),a.parent.removeChild(a),(null===(m=o.scenegraph)||void 0===m?void 0:m.proxy.cellCache.get(n))&&(null===(b=o.scenegraph)||void 0===b||b.proxy.cellCache.set(n,C))),C}function DS(t){const{type:e,value:i,define:o,table:n,col:r,row:s,cellWidth:l,cellHeight:a,oldCellGroup:h,padding:d,textAlign:c,textBaseline:u,mayHaveIcon:g,addNew:p,range:f,customResult:v,customStyle:m}=t,b=b_(m||n._getCellStyle(f?f.start.col:r,f?f.start.row:s),n,f?f.start.col:r,f?f.start.row:s,fS).theme;b.group.cornerRadius=C_(r,s,n),OS(e,i,o,n,r,s,l,a,h,d,c,u,g,p,b,f,v)}function WS(t,e,i,o,n,r,s){for(let l=t.start.col;l<=t.end.col;l++)for(let a=t.start.row;a<=t.end.row;a++){const h=s.scenegraph.highPerformanceGetCell(l,a,!0);if("cell"!==h.role)continue;t.start.row!==t.end.row&&h.contentHeight!==i&&SS(h,i,0,s.isAutoRowHeight(a),o,0,r,s),t.start.col!==t.end.col&&h.contentWidth!==e&&_S(h,e,i,0,s.isAutoRowHeight(a),o,n,r,s.scenegraph),h.contentWidth=e,h.contentHeight=i;const d=s.getRowHeight(a);NS(h,s.getColWidth(l),d,t,s)}}function NS(t,e,i,o,n){var r;const{col:s,row:l}=t,a=-n.getColsWidth(o.start.col,s-1),h=-n.getRowsHeight(o.start.row,l-1);t.forEachChildren((t=>{var e,i,o,n,r,s;"number"==typeof t._dx?(t.skipMergeUpdate=!0,t.setAttributes({dx:(null!==(e=t._dx)&&void 0!==e?e:0)+a}),t.skipMergeUpdate=!1):(t.skipMergeUpdate=!0,t._dx=null!==(i=t.attribute.dx)&&void 0!==i?i:0,t.setAttributes({dx:(null!==(o=t.attribute.dx)&&void 0!==o?o:0)+a}),t.skipMergeUpdate=!1),"number"==typeof t._dy?(t.skipMergeUpdate=!0,t.setAttributes({dy:(null!==(n=t._dy)&&void 0!==n?n:0)+h}),t.skipMergeUpdate=!1):(t._dy=null!==(r=t.attribute.dy)&&void 0!==r?r:0,t.skipMergeUpdate=!0,t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+h}),t.skipMergeUpdate=!1)}));const d=null!==(r=t.attribute.strokeArrayWidth)&&void 0!==r?r:t.attribute.lineWidth,c=et(d),u=[0,0,0,0];s===o.start.col&&(u[3]=c?d[3]:d),l===o.start.row&&(u[0]=c?d[0]:d),s===o.end.col&&(u[1]=c?d[1]:d),l===o.end.row&&(u[2]=c?d[2]:d);const g=e!==t.attribute.width,p=i!==t.attribute.height;return t.skipMergeUpdate=!0,t.setAttributes({width:e,height:i,strokeArrayWidth:u}),t.skipMergeUpdate=!1,t.mergeStartCol=o.start.col,t.mergeStartRow=o.start.row,t.mergeEndCol=o.end.col,t.mergeEndRow=o.end.row,{widthChange:g,heightChange:p}}function GS(t,e,i,o){if(o.internalProps.customMergeCell){const n=o.getCustomMerge(t,e);if(n){const{range:r,text:s,style:l,customLayout:a,customRender:h}=n;if(a||h){const n=E_(a,h,r.start.col,r.start.row,o.getColsWidth(r.start.col,r.end.col),o.getRowsHeight(r.start.row,r.end.row),!1,o.isAutoRowHeight(e),[0,0,0,0],r,o).elementsGroup;i.childrenCount>0&&n?i.insertBefore(n,i.firstChild):n&&i.appendChild(n);const s=o.getRowHeight(e),l=o.getColWidth(t),{width:d}=i.attribute,{height:c}=i.attribute;return i.contentWidth=d,i.contentHeight=c,NS(i,l,s,r,o),r}}}}function jS(t){return!!("cell"===t.role&&nt(t.mergeStartCol)&&nt(t.mergeStartRow)&&nt(t.mergeEndCol)&&nt(t.mergeEndRow))}const US=new XC({}),VS=new KC({});function $S(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){const f=Ky(Z(t)?t.text:t).split("\n")||[],v=p.getColsWidth(e,o),m=fS("size",n,e,i,p);let b=fS("outerRadius",n,e,i,p);const C=nt(b)?2*b:m;let y=0;if(r){const t=fS("spaceBetweenTextAndIcon",n,e,i,p),o=v-(g[1]+g[3])-s-C-t;nt(b)||(b=Math.round(m/2)),VS.setAttributes({text:{maxLineWidth:o,text:f,fontSize:l,fontStyle:a,fontWeight:h,fontFamily:d,lineHeight:c,wordBreak:"break-word",lineClamp:u},circle:{outerRadius:b},spaceBetweenTextAndIcon:t}),VS.render(),y=VS.AABBBounds.height()}else y=Math.max(m,f.length*c);return y}let YS="quick";const XS=new i(((t,e,i,o)=>{i(qo)?o(qo).to(qS).inSingletonScope():t(qo).to(qS).inSingletonScope()}));new i(((t,e,i,o)=>{i(qo)?o(qo).to(Jo).inSingletonScope():t(qo).to(Jo).inSingletonScope()}));const KS=new Map;function ZS(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"normal";const n=`${t}-${e}-${i}-${o}`,r=KS.get(n);if(r)return r;const s=(l={fontSize:t,fontFamily:i,fontWeight:e,fontStyle:o},new Pe(Object.assign({defaultFontParams:{fontFamily:bo.fontFamily,fontSize:bo.fontSize},getTextBounds:Ma,specialCharSet:`{}()//&-/: .,@%'"~…=——${Pe.ALPHABET_CHAR_SET}${Pe.ALPHABET_CHAR_SET.toUpperCase()}0123456789`},{}),l));var l;return KS.set(n,s),s}class qS extends Jo{measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return ZS(i,n,o,r).measure(t,YS).width}measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return ZS(i,n,o,r).measure(t,YS)}}const JS=new class{measureText(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return ZS(i,n,o,r).measure(t,YS)}measureTextWidth(t,e){const{fontSize:i,fontFamily:o="Arial,sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e;return ZS(i,n,o,r).measure(t,YS).width}clipText(t,e,i){if(0===t.length)return{str:"",width:0};let o=this.measureTextWidth(t,e);return o<=i?{str:t,width:o}:(o=this.measureTextWidth(t[0],e),o>i?{str:"",width:0}:this._clipText(t,e,i,0,t.length-1))}_clipText(t,e,i,o,n){const r=Math.floor((o+n)/2),s=t.substring(0,r+1),l=this.measureTextWidth(s,e);let a;if(l>i){if(s.length<=1)return{str:"",width:0};const n=t.substring(0,r);return a=this.measureTextWidth(n,e),a<=i?{str:n,width:a}:this._clipText(t,e,i,o,r)}if(l<i){if(r>=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const o=t.substring(0,r+2);return a=this.measureTextWidth(o,e),a>=i?{str:s,width:l}:this._clipText(t,e,i,r,n)}return{str:s,width:l}}clipTextWithSuffix(t,e,i,o){if(""===o)return this.clipText(t,e,i);if(0===t.length)return{str:"",width:0};const n=this.measureTextWidth(t,e);if(n<=i)return{str:t,width:n};const r=this.measureTextWidth(o,e);if(r>i)return{str:"",width:0};i-=r;const s=this._clipText(t,e,i,0,t.length-1);return s.str+=o,s.width+=r,s}},QS=new Ih({ignoreBuf:!0});function tA(t){return QS.initAttributes(Object.assign(Object.assign({},t),{ignoreBuf:!0})),QS.AABBBounds}const eA=new uc({width:0,height:0,textConfig:[]});function iA(t,e,i){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],n=arguments.length>4?arguments[4]:void 0;var r,s,l,a,h,d,c,u,g,p,f;"undefined"!=typeof window&&window.performance.now();const v=[],m=[];if(n)for(let o=e;o<=i;o++)v[o]=t.getRowHeight(o);const b=t.internalProps.layoutMap;t.isPivotTable()&&(b.enableUseGetBodyCache(),b.enableUseHeaderPathCache()),t.defaultHeaderRowHeight,t.defaultHeaderColWidth;const C="auto"===t.defaultHeaderRowHeight||et(t.defaultHeaderRowHeight)&&t.defaultHeaderRowHeight.some((t=>"auto"===t)),y="autoHeight"===t.heightMode||"adaptive"===t.heightMode&&!1!==t.options.autoHeightInAdaptiveMode;if(y||C){e=null!=e?e:0,i=null!=i?i:t.rowCount-1,(0===e&&i===t.rowCount-1||o)&&t._clearRowRangeHeightsMap();for(let i=e;i<t.columnHeaderLevelCount;i++){let e=0,o=t.colCount-1;if((t.isPivotTable()&&!t.isPivotChart()||t.isPivotChart()&&!t.internalProps.layoutMap.indicatorsAsCol)&&rA(t,i)&&!nx(t,t.rowHeaderLevelCount,i)&&(e=0,o=t.rowHeaderLevelCount),y||"auto"===t.getDefaultRowHeight(i)){const r=oA(i,e,o,t);m[i]=Math.round(r),"only-body"!==t.heightAdaptiveMode&&n||t._setRowHeight(i,r)}}for(let e=t.rowCount-t.bottomFrozenRowCount;e<=i;e++)if(y||"auto"===t.getDefaultRowHeight(e)){const i=oA(e,0,t.colCount-1,t);n?m[e]=Math.round(i):t._setRowHeight(e,i)}if(i<t.columnHeaderLevelCount||!y);else if(t.internalProps.transpose||t.isPivotTable()&&!t.internalProps.layoutMap.indicatorsAsCol||!function(t){var e,i,o;const{layoutMap:n}=t.internalProps,r=t.columnHeaderLevelCount;if((t.internalProps.autoWrapText||t.internalProps.enableLineBreak||t.isPivotChart())&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;for(let s=0;s<t.colCount;s++){const l=n.getBody(s,r);if("radio"===l.cellType)return!1;if("function"==typeof l.style||"function"==typeof l.icon||(null===(e=l.define)||void 0===e?void 0:e.customRender)||(null===(i=l.define)||void 0===i?void 0:i.customLayout)||"function"==typeof(null===(o=l.define)||void 0===o?void 0:o.icon))return!1;const a=t._getCellStyle(s,r);if("function"==typeof a.padding||"function"==typeof a.fontSize||"function"==typeof a.lineHeight||!0===a.autoWrapText)return!1}return!0}(t))if(t.internalProps.transpose||t.isPivotTable()&&!t.internalProps.layoutMap.indicatorsAsCol)for(let o=Math.max(e,t.columnHeaderLevelCount);o<=i;o++){let e;e=nA(t,o)?oA(o,0,t.rowHeaderLevelCount,t):oA(o,0,t.colCount-1,t),n?m[o]=Math.round(e):t._setRowHeight(o,e)}else for(let o=Math.max(e,t.columnHeaderLevelCount);o<=i;o++){const e=oA(o,0,t.colCount-1,t);n?m[o]=Math.round(e):t._setRowHeight(o,e)}else{!function(t,e,i,o,n){if(!o.internalProps.useOneRowHeightFillAll){for(let r=e;r<=i;r++)n?n[r]=t:o._setRowHeight(r,t);o.internalProps.useOneRowHeightFillAll=!0}}(oA(t.columnHeaderLevelCount,0,t.colCount-1,t),t.columnHeaderLevelCount,t.rowCount-1-t.bottomFrozenRowCount,t,n?m:void 0);for(let e=t.rowCount-t.bottomFrozenRowCount;e<=i;e++){const i=oA(e,0,t.colCount-1,t);n?m[e]=Math.round(i):t._setRowHeight(e,i)}}}else if(("adaptive"===t.heightMode||t.autoFillHeight)&&t.clearRowHeightCache(),n)for(let o=e;o<=i;o++)m[o]=t.getRowHeight(o);if((0===e&&i===t.rowCount-1||o)&&t._clearRowRangeHeightsMap(),"adaptive"===t.heightMode){t._clearRowRangeHeightsMap();let e=t.tableNoFrameHeight,i=0,o=t.rowCount;if("only-body"===t.heightAdaptiveMode){const n=t.getRowsHeight(0,t.columnHeaderLevelCount-1),r=t.isPivotChart()?t.getBottomFrozenRowsHeight():0;e=t.tableNoFrameHeight-n-r,i=t.columnHeaderLevelCount,o=t.isPivotChart()?t.rowCount-t.bottomFrozenRowCount:t.rowCount}let l=0;for(let e=i;e<o;e++)l+=n&&null!==(r=m[e])&&void 0!==r?r:t.getRowHeight(e);const a=e/l;for(let r=i;r<o;r++){let l;l=r===o-1?e-(n?m.reduce(((t,e,n)=>n>=i&&n<=o-2?t+e:t),0):t.getRowsHeight(i,o-2)):Math.round((n&&null!==(s=m[r])&&void 0!==s?s:t.getRowHeight(r))*a),n?m[r]=l:t._setRowHeight(r,l,!1)}}else if(t.autoFillHeight){t._clearRowRangeHeightsMap();const e=t.tableNoFrameHeight;let i=0,o=0;for(let e=0;e<t.rowCount;e++){const r=n&&null!==(l=m[e])&&void 0!==l?l:t.getRowHeight(e);(e<t.columnHeaderLevelCount||t.isPivotChart()&&e>=t.rowCount-t.bottomFrozenRowCount)&&(o+=r),i+=r}if(t.scenegraph._dealAutoFillHeightOriginRowsHeight=i,i<e&&i-o>0){const r=t.columnHeaderLevelCount,s=t.isPivotChart()?t.rowCount-t.bottomFrozenRowCount:t.rowCount,l=(e-o)/(i-o);for(let i=r;i<s;i++){let h;h=i===s-1?e-o-(n?m.reduce(((t,e,i)=>i>=r&&i<=s-2?t+e:t),0):t.getRowsHeight(r,s-2)):Math.round((n&&null!==(a=m[i])&&void 0!==a?a:t.getRowHeight(i))*l),n?m[i]=h:t._setRowHeight(i,h,!1)}}}if(n){for(let o=e;o<=i;o++){const e=null!==(h=m[o])&&void 0!==h?h:t.getRowHeight(o);K(e)&&t._setRowHeight(o,e)}if("adaptive"===t.heightMode||t.autoFillHeight&&t.getAllRowsHeight()<=t.tableNoFrameHeight){for(let e=0;e<=t.columnHeaderLevelCount-1;e++){const i=t.getRowHeight(e);i!==(null!==(d=v[e])&&void 0!==d?d:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(c=v[e])&&void 0!==c?c:t.getRowHeight(e)),!0)}for(let e=t.rowCount-t.bottomFrozenRowCount;e<=t.rowCount-1;e++){const i=t.getRowHeight(e);i!==(null!==(u=v[e])&&void 0!==u?u:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(g=v[e])&&void 0!==g?g:t.getRowHeight(e)),!0)}}for(let e=t.scenegraph.proxy.rowStart;e<=t.scenegraph.proxy.rowEnd;e++){const i=t.getRowHeight(e);i!==(null!==(p=v[e])&&void 0!==p?p:t.getRowHeight(e))&&t.scenegraph.updateRowHeight(e,i-(null!==(f=v[e])&&void 0!==f?f:t.getRowHeight(e)),!0)}}t.isPivotTable()&&(b.disableUseGetBodyCache(),b.disableUseHeaderPathCache())}function oA(t,e,i,o){var n;let r;if(o.isPivotChart()&&t>=o.columnHeaderLevelCount&&t<o.rowCount-o.bottomFrozenRowCount)if(o.internalProps.layoutMap.indicatorsAsCol){const e=o.internalProps.layoutMap.getOptimunHeightForChart(t);if(e>0)return e}else{const e=o.getDefaultRowHeight(t);if(nt(e))return e}for(let s=e;s<=i;s++){const e=sA(s,t,o);if(e&&(r=K(r)?Math.max(e.height,r):e.height,!e.renderDefault))continue;if(o.isPivotChart()){const e=o.internalProps.layoutMap.getAxisConfigInPivotChart(s,t);if(e){const t=rx.getFunction("computeAxisComponentHeight")(e,o);if("number"==typeof t){r=K(r)?Math.max(t,r):t;continue}}}if(o.isPivotChart()&&(o.isLeftFrozenColumn(s)&&o.isBottomFrozenRow(t)||o.isRightFrozenColumn(s)&&o.isBottomFrozenRow(t)))continue;const i=lA(s,t,o.isHeader(s,t)?null===(n=o._getHeaderLayoutMap(s,t))||void 0===n?void 0:n.headerType:o.getBodyColumnType(s,t),o);r=K(r)?Math.max(i,r):i}if(K(r))return r;const s=o.getDefaultRowHeight(t);return nt(s)?s:o.defaultRowHeight}function nA(t,e){var i,o,n;const{layoutMap:r}=t.internalProps;if((t.internalProps.autoWrapText||t.internalProps.enableLineBreak)&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;const s=r.getBody(t.rowHeaderLevelCount,e);if("function"==typeof s.style||"function"==typeof s.icon||(null===(i=s.define)||void 0===i?void 0:i.customRender)||(null===(o=s.define)||void 0===o?void 0:o.customLayout)||"function"==typeof(null===(n=s.define)||void 0===n?void 0:n.icon))return!1;const l=t._getCellStyle(t.rowHeaderLevelCount,e);return"function"!=typeof l.padding&&"function"!=typeof l.fontSize&&"function"!=typeof l.lineHeight&&!0!==l.autoWrapText}function rA(t,e){var i,o,n;const{layoutMap:r}=t.internalProps;if(t.internalProps.autoWrapText&&("autoHeight"===t.options.heightMode||"adaptive"===t.options.heightMode))return!1;const s=r.getHeader(t.rowHeaderLevelCount,e);if("function"==typeof s.style||"function"==typeof s.icons||(null===(i=s.define)||void 0===i?void 0:i.headerCustomRender)||(null===(o=s.define)||void 0===o?void 0:o.headerCustomLayout)||"function"==typeof(null===(n=s.define)||void 0===n?void 0:n.icon))return!1;const l=t._getCellStyle(t.rowHeaderLevelCount,e);return"function"!=typeof l.padding&&"function"!=typeof l.fontSize&&"function"!=typeof l.lineHeight&&!0!==l.autoWrapText}function sA(t,e,i){var o,n,r,s,l,a,h;const d=i.getCustomRender(t,e);let c=i.getCustomLayout(t,e);if(d||c){let u,g=1,p=0,f=!1,v=!1;(i.isHeader(t,e)||(null===(o=i.getBodyColumnDefine(t,e))||void 0===o?void 0:o.mergeCell)||i.hasCustomMerge())&&(u=i.getCellRange(t,e),g=u.end.row-u.start.row+1);const m={col:null!==(n=null==u?void 0:u.start.col)&&void 0!==n?n:t,row:null!==(r=null==u?void 0:u.start.row)&&void 0!==r?r:e,dataValue:i.getCellOriginValue(t,e),value:i.getCellValue(t,e)||"",rect:aA(t,e,i),table:i,originCol:t,originRow:e};if("react-custom-layout"===c&&(c=(null===(s=i.reactCustomLayout)||void 0===s?void 0:s.getCustomLayoutFunc(t,e))||x_),Y(c)){const e=c(m);e.rootContainer?(e.rootContainer=H_(e.rootContainer),L_(e.rootContainer,i.getColWidth(t),0),e.rootContainer.setStage(i.scenegraph.stage),p=null!==(l=e.rootContainer.AABBBounds.height())&&void 0!==l?l:0,f=e.renderDefault,v=e.enableCellPadding):(p=0,f=e.renderDefault,v=e.enableCellPadding)}else if("function"==typeof d){const t=d(m);p=null!==(a=null==t?void 0:t.expectedHeight)&&void 0!==a?a:0,f=null==t?void 0:t.renderDefault}else p=null!==(h=null==d?void 0:d.expectedHeight)&&void 0!==h?h:0,f=null==d?void 0:d.renderDefault;if(v){const o=Fx(fS("padding",i._getCellStyle(t,e),t,e,i));p+=o[0]+o[2]}return{height:p/g,renderDefault:f}}}function lA(t,e,i,o){var n,r,s;let l=0;const a=o.getCellValue(t,e),h=o._getCellStyle(t,e);let d=0,c=0;const u=[];let g=0;const p=[];let f=0,v=!1;if("body"!==o.getCellLocation(t,e))v=!0;else{const i=o.getBodyColumnDefine(t,e);v=!!(null==i?void 0:i.icon)||!!(null==i?void 0:i.tree)||(null==i?void 0:i.dragOrder)}if(v){const i=o.getCellIcons(t,e);null==i||i.forEach((t=>{var e,i,o,n,r,s,l,a,h,v;t.positionType!==wy.absoluteRight&&t.positionType!==wy.inlineFront&&t.positionType!==wy.inlineEnd?(c+=(null!==(e=t.width)&&void 0!==e?e:0)+(null!==(i=t.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.marginRight)&&void 0!==o?o:0),d=Math.max(d,null!==(n=t.height)&&void 0!==n?n:0)):t.positionType===wy.inlineFront?(u.push(t),g=Math.max(g,(null!==(r=t.height)&&void 0!==r?r:0)+(null!==(s=t.marginLeft)&&void 0!==s?s:0)+(null!==(l=t.marginRight)&&void 0!==l?l:0))):t.positionType===wy.inlineEnd&&(p.push(t),f=Math.max(f,(null!==(a=t.height)&&void 0!==a?a:0)+(null!==(h=t.marginLeft)&&void 0!==h?h:0)+(null!==(v=t.marginRight)&&void 0!==v?v:0)))}))}let m=1,b=t;if(o.isHeader(t,e)||(null===(n=o.getBodyColumnDefine(t,e))||void 0===n?void 0:n.mergeCell)||o.hasCustomMerge()){const i=o.getCellRange(t,e);m=i.end.row-i.start.row+1,t=i.start.col,b=i.end.col}const C=Fx(fS("padding",h,t,e,o)),y=fS("fontSize",h,t,e,o),w=fS("fontStyle",h,t,e,o),x=fS("fontWeight",h,t,e,o),_=null!==(r=fS("lineHeight",h,t,e,o))&&void 0!==r?r:y,S=fS("fontFamily",h,t,e,o),A=fS("autoWrapText",h,t,e,o),R=fS("lineClamp",h,t,e,o);let B;if("text"!==i&&"link"!==i&&"progressbar"!==i&&"checkbox"!==i&&"radio"!==i)l=_;else if("checkbox"===i)l=function(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){const f=Ky(Z(t)?t.text:t).split("\n")||[],v=p.getColsWidth(e,o),m=fS("size",n,e,i,p);let b=0;if(r){const t=fS("spaceBetweenTextAndIcon",n,e,i,p),o=v-(g[1]+g[3])-s-m-t;US.setAttributes({text:{maxLineWidth:o,text:f,fontSize:l,fontStyle:a,fontWeight:h,fontFamily:d,lineHeight:c,wordBreak:"break-word",lineClamp:u},icon:{width:Math.floor(m/1.4),height:Math.floor(m/1.4)},box:{width:m,height:m},spaceBetweenTextAndIcon:t}),US.render(),b=US.AABBBounds.height()}else b=Math.max(m,f.length*c);return b}(a,t,e,b,h,A,c,y,w,x,S,_,R,C,o);else if("radio"===i)l=function(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f;if(et(t)){let v=0;const m=p.getBodyColumnDefine(e,i),b=fS("spaceBetweenRadio",n,e,i,p),C=null!==(f=null==m?void 0:m.radioDirectionInCell)&&void 0!==f?f:"vertical";return"vertical"===C?t.forEach(((f,m)=>{const C=$S(f,e,i,o,n,r,s,l,a,h,d,c,u,g,p);v+=C,m!==t.length-1&&(v+=b)})):"horizontal"===C&&t.forEach((t=>{const f=$S(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p);v=Math.max(f,v)})),v}return $S(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p)}(a,t,e,b,h,A,c,y,w,x,S,_,R,C,o);else{B=a;const i=yS(B,o).text,n=o.getColsWidth(t,b);if(u.length||p.length)if(A){const t=Object.assign({text:null==a?void 0:a.toString(),fontFamily:S,fontSize:y,fontStyle:w,fontWeight:x,lineHeight:_});t.textBaseline="middle";const e=[...u.map((t=>xS(t))),t,...p.map((t=>xS(t)))];eA.setAttributes({width:n-(C[1]+C[3])-c,height:0,textConfig:e}),l=eA.AABBBounds.height()}else l=0,i.forEach(((t,e)=>{var n;(null===(n=o.options.customConfig)||void 0===n?void 0:n.multilinesForXTable)&&0!==e||(0===e&&u.length?l+=Math.max(_,g):e===i.length-1&&p.length?l+=Math.max(_,f):l+=_)}));else if(A){const r=CS(t,e,o),s=tA({maxLineWidth:n-(C[1]+C[3])-c-r,text:i,fontSize:y,fontStyle:w,fontWeight:x,fontFamily:S,lineHeight:_,wordBreak:"break-word",whiteSpace:1!==i.length||A?"normal":"no-wrap",lineClamp:R});l=s.height()||("number"==typeof _?_:y)}else l=(null===(s=o.options.customConfig)||void 0===s?void 0:s.multilinesForXTable)?_:i.length*_}return(Math.max(l,d)+C[0]+C[2])/m}function aA(t,e,i){return{left:0,top:0,right:i.getColWidth(t),bottom:i.getRowHeight(e),width:i.getColWidth(t),height:0}}function hA(t,e){if(!e||!e.proxy)return{colStart:0,colEnd:0,rowStart:0,rowEnd:0};const{mergeStartCol:i,mergeEndCol:o,mergeStartRow:n,mergeEndRow:r,col:s,row:l}=t,{colStart:a,colEnd:h,rowStart:d,rowEnd:c,bodyLeftCol:u,bodyRightCol:g,bodyTopRow:p,bodyBottomRow:f}=e.proxy;let v=i,m=o,b=n,C=r;return s>=u&&s<=g&&(v=Math.max(t.mergeStartCol,a),m=Math.min(t.mergeEndCol,h)),l>=p&&l<=f&&(b=Math.max(t.mergeStartRow,d),C=Math.min(t.mergeEndRow,c)),{colStart:v,colEnd:m,rowStart:b,rowEnd:C}}function dA(t,e,i,o){o||t.table._setRowHeight(e,t.table.getRowHeight(e)+i,!0);for(let o=0;o<t.table.colCount;o++){const n=t.getCell(o,e);if("empty"===n.role)continue;const r=nx(t.table,o,e);r&&r.start.col!==o||(cA(t,n,o,e,n.attribute.height+i,i,t.table.isHeader(o,e)),t.updateCellContentWhileResize(o,e))}let n=0,r=0;e<t.table.frozenRowCount?(n=e+1,r=t.table.frozenRowCount-1):e>=t.table.rowCount-t.table.bottomFrozenRowCount?(n=e+1,r=t.table.rowCount-1):(n=e+1,r=Math.min(t.proxy.rowEnd,t.table.rowCount-t.table.bottomFrozenRowCount-1));for(let e=0;e<t.table.colCount;e++)for(let o=n;o<=r;o++){const n=t.highPerformanceGetCell(e,o);"cell"===n.role&&n.setAttribute("y",n.attribute.y+i)}}function cA(t,e,i,o,n,r,s){e&&function(t,e,i,o,n,r,s){var l,a,h,d,c;if(e.attribute.height===n&&!e.needUpdateHeight)return;e.needUpdateHeight=!1,e.setAttribute("height",n);const u=null===(l=t.table.getCellRawRecord(i,o))||void 0===l?void 0:l.vtableMerge,g=!!t.table.getCustomMerge(i,o),p=u||g?"text":t.table.isHeader(i,o)?null!==(a=t.table._getHeaderLayoutMap(i,o).headerType)&&void 0!==a?a:"text":null!==(h=t.table.getBodyColumnType(i,o))&&void 0!==h?h:"text";if("progressbar"===p){const s=t.table.getBodyColumnDefine(i,o),l=t.table._getCellStyle(i,o),a=t.table.getCellValue(i,o),h=t.table.getCellOriginValue(i,o),d=Fx(fS("padding",l,i,o,t.table));let c;(null==s?void 0:s.mergeCell)&&(c=t.table.getCellRange(i,o));const u=rx.getFunction("createProgressBarCell")(s,l,e.attribute.width,a,h,i,o,d,t.table,c),g=e.getChildByName("progress-bar");e.insertBefore(u,g),e.removeChild(g),g.removeAllChild(),g.release(),uA(e,n,r,t.table.isAutoRowHeight(o),!0,t.table)}else if("sparkline"===p){e.removeAllChild();const n=t.table._getCellStyle(i,o),r=Fx(fS("padding",n,i,o,t.table));rx.getFunction("createSparkLineCellGroup")(e,e.parent,e.attribute.x,e.attribute.y,i,o,e.attribute.width,e.attribute.height,r,t.table,b_(n,t.table,i,o,fS).theme,!1)}else if("image"===p||"video"===p)TS(e,i,o,0,0,t.table);else if("axis"===(null===(d=e.firstChild)||void 0===d?void 0:d.name))null===(c=e.firstChild)||void 0===c||c.originAxis.resize(e.attribute.width,e.attribute.height);else{let s=!0;const l=e.getChildByName(T_)||e.getChildByName(P_);if(l){let n;e.removeChild(l);const r=GS(i,o,e,t.table);if(r)for(let e=r.start.row;e<=r.end.row;e++){if(e===o)continue;const n=t.getCell(i,e),r=n.getChildByName(T_)||n.getChildByName(P_);r.removeAllChild(),n.removeChild(r),GS(i,e,n,t.table)}else{let r,l;const a=t.table.getCellLocation(i,o),{vtableMerge:h}=t.table.getCellRawRecord(i,o)||{};if(h&&t.table.options.groupTitleCustomLayout)l=t.table.options.groupTitleCustomLayout;else if("body"!==a){const e=t.table.getHeaderDefine(i,o);r=null==e?void 0:e.headerCustomRender,l=null==e?void 0:e.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(i,o);r=(null==e?void 0:e.customRender)||t.table.customRender,l=null==e?void 0:e.customLayout}if((r||l)&&jS(e))for(let i=e.mergeStartCol;i<=e.mergeEndCol;i++)for(let n=e.mergeStartRow;n<=e.mergeEndRow;n++)n!==o&&t.updateCellContent(i,n);if(l||r){const a=Fx(fS("padding",t.table._getCellStyle(i,o),i,o,t.table));let h=e.attribute.width,d=e.attribute.height;jS(e)&&(h=t.table.getColsWidth(e.mergeStartCol,e.mergeEndCol),d=t.table.getRowsHeight(e.mergeStartRow,e.mergeEndRow));const c=E_(l,r,i,o,h,d,!1,t.table.isAutoRowHeight(o),a,jS(e)?{start:{col:e.mergeStartCol,row:e.mergeStartRow},end:{col:e.mergeEndCol,row:e.mergeEndRow}}:void 0,t.table);n=c.elementsGroup,s=c.renderDefault}e.childrenCount>0&&n?e.insertBefore(n,e.firstChild):n&&e.appendChild(n)}}uA(e,n,r,t.table.isAutoRowHeight(o),s,t.table)}}(t,e,i,o,n,r)}function uA(t,e,i,o,n,r){if(jS(t)){e=0;for(let i=t.mergeStartRow;i<=t.mergeEndRow;i++)e+=r.getRowHeight(i);const{colStart:i,colEnd:s,rowStart:l,rowEnd:a}=hA(t,r.scenegraph);for(let h=i;h<=s;h++)for(let s=l;s<=a;s++){const a=r.scenegraph.getCell(h,s);if(a.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})})),n){const t=r._getCellStyle(i,l);SS(a,e,0,o,Fx(t.padding),t.textAlign,t.textBaseline,r)}const d=r.getRowHeight(s),c=r.getColWidth(h);a.contentHeight=e;const{widthChange:u}=NS(a,c,d,{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}},r);u&&(a.needUpdateWidth=!0)}}else{const i=r._getCellStyle(t.col,t.row);SS(t,e,0,o,Fx(i.padding),i.textAlign,i.textBaseline,r)}}function gA(t,e,i,o){var n,r,s,l,a,h,d;let c=!1;const u=null!==(n=null==t?void 0:t.attribute.width)&&void 0!==n?n:0;if(null==t||t.setAttribute("width",u+e),null==t||t.forEachChildren(((t,n)=>{if(function(t,e,i,o,n,r,s,l,a){var h,d,c,u,g,p,f;if(e.attribute.width===r&&!e.needUpdateWidth)return!1;e.needUpdateWidth=!1,e.setAttribute("width",r);const v=e;if(!v)return!1;const m=t.table.isAutoRowHeight(o),b=null===(h=t.table.getCellRawRecord(i,o))||void 0===h?void 0:h.vtableMerge,C=!!t.table.getCustomMerge(i,o),y=b||C?"text":t.table.isHeader(i,o)?null!==(d=t.table._getHeaderLayoutMap(i,o).headerType)&&void 0!==d?d:"text":null!==(c=t.table.getBodyColumnType(i,o))&&void 0!==c?c:"text";let w=!1;if("progressbar"===y){const e=t.table.getBodyColumnDefine(i,o),n=t.table._getCellStyle(i,o),l=t.table.getCellValue(i,o),a=t.table.getCellOriginValue(i,o),h=Fx(fS("padding",n,i,o,t.table));let d;(null==e?void 0:e.mergeCell)&&(d=t.table.getCellRange(i,o));const c=rx.getFunction("createProgressBarCell")(e,n,v.attribute.width,l,a,i,o,h,t.table,d),u=v.getChildByName("progress-bar");v.insertBefore(c,u),v.removeChild(u),u.removeAllChild(),u.release();const g=pA(v,r,s,m,!0,t.table);w=w||g}else if("sparkline"===y){v.removeAllChild();const e=t.table._getCellStyle(i,o),n=Fx(fS("padding",e,i,o,t.table));rx.getFunction("createSparkLineCellGroup")(v,v.parent,v.attribute.x,v.attribute.y,i,o,v.attribute.width,v.attribute.height,n,t.table,b_(e,t.table,i,o,fS).theme,!1)}else if("image"===y||"video"===y)TS(v,i,o,s,0,t.table);else if("axis"===(null===(u=v.firstChild)||void 0===u?void 0:u.name)){const e=t.table.internalProps.layoutMap.getAxisConfigInPivotChart(i,o),n=Fx(fS("padding",t.table._getCellStyle(i,o),i,o,t.table));if(e){const i=new(rx.getComponent("axis"))(e,v.attribute.width,v.attribute.height,null!==(g=e.__vtablePadding)&&void 0!==g?g:n,t.table);v.clear(),v.appendChild(i.component),i.overlap()}}else if("axis"===(null===(p=e.firstChild)||void 0===p?void 0:p.name))null===(f=e.firstChild)||void 0===f||f.originAxis.resize(e.attribute.width,e.attribute.height);else{let n=!0;const l=e.getChildByName(T_)||e.getChildByName(P_);if(l){let r;e.removeChild(l);const s=GS(i,o,e,t.table);if(s)for(let e=s.start.col;e<=s.end.col;e++){if(e===i)continue;const n=t.getCell(e,o),r=n.getChildByName(T_)||n.getChildByName(P_);r.removeAllChild(),n.removeChild(r),GS(e,o,n,t.table)}else{let s,l;const a=t.table.getCellLocation(i,o),{vtableMerge:h}=t.table.getCellRawRecord(i,o)||{};if(h&&t.table.options.groupTitleCustomLayout)l=t.table.options.groupTitleCustomLayout;else if("body"!==a){const e=t.table.getHeaderDefine(i,o);s=null==e?void 0:e.headerCustomRender,l=null==e?void 0:e.headerCustomLayout}else{const e=t.table.getBodyColumnDefine(i,o);s=(null==e?void 0:e.customRender)||t.table.customRender,l=null==e?void 0:e.customLayout}if((s||l)&&jS(v))for(let e=v.mergeStartCol;e<=v.mergeEndCol;e++)if(e!==i)for(let i=v.mergeStartRow;i<=v.mergeEndRow;i++)t.updateCellContent(e,i);if(l||s){const e=Fx(fS("padding",t.table._getCellStyle(i,o),i,o,t.table));let a=v.attribute.width,h=v.attribute.height;jS(v)&&(a=t.table.getColsWidth(v.mergeStartCol,v.mergeEndCol),h=t.table.getRowsHeight(v.mergeStartRow,v.mergeEndRow));const d=E_(l,s,i,o,a,h,!1,t.table.isAutoRowHeight(o),e,jS(v)?{start:{col:v.mergeStartCol,row:v.mergeStartRow},end:{col:v.mergeEndCol,row:v.mergeEndRow}}:void 0,t.table);r=d.elementsGroup,n=d.renderDefault,w=!0}e.childrenCount>0&&r?e.insertBefore(r,e.firstChild):r&&e.appendChild(r)}}const a=pA(v,r,s,m,n,t.table);w=w||a}a||(a=t.table._getCellStyle(i,o).autoWrapText);return!(!m||!a)&&w}(o,t,t.col,t.row,0,u+e,e,"row-body"!==i||(t.col,o.table.rowHeaderLevelCount),o.table.internalProps.autoWrapText)){const e=nx(o.table,t.col,t.row);if(e&&e.end.row-e.start.row)for(let t=e.start.row;t<=e.end.row;t++)fA(o,t);else fA(o,t.row);c=!0}})),c){let t,e,n,c=0;for(let u=0;u<o.table.colCount;u++){if("col-corner"===i?(n=0,t=o.getColGroup(u,!0),e=null!==(r=o.colHeaderGroup.attribute.height)&&void 0!==r?r:0):"row-body"===i?(n=o.table.frozenRowCount,t=o.getColGroup(u,!1),e=null!==(s=o.bodyGroup.attribute.height)&&void 0!==s?s:0):"bottom"===i?(n=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInBottom(u),e=null!==(l=o.bottomFrozenGroup.attribute.height)&&void 0!==l?l:0):"left-bottom"===i?(n=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInLeftBottomCorner(u),e=null!==(a=o.leftBottomCornerGroup.attribute.height)&&void 0!==a?a:0):"right-top"===i?(n=0,t=o.getColGroupInRightTopCorner(u),e=null!==(h=o.rightTopCornerGroup.attribute.height)&&void 0!==h?h:0):"right-bottom"===i&&(n=o.table.rowCount-o.table.bottomFrozenRowCount,t=o.getColGroupInRightBottomCorner(u),e=null!==(d=o.rightBottomCornerGroup.attribute.height)&&void 0!==d?d:0),!t)continue;let g=0;t.forEachChildren((t=>{var e;t.setAttribute("y",g),g+=null!==(e=o.table.getRowHeight(t.row))&&void 0!==e?e:0})),c=g}o.updateContainerHeight(n,c-e);for(let t=0;t<o.table.frozenColCount;t++){const e=o.getColGroupInLeftBottomCorner(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}for(let t=o.table.colCount-o.table.rightFrozenColCount;t<o.table.colCount;t++){const e=o.getColGroupInRightBottomCorner(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}for(let t=o.table.frozenColCount;t<o.table.colCount-o.table.rightFrozenColCount;t++){const e=o.getColGroupInBottom(t);let i=0;null==e||e.forEachChildren((t=>{t.setAttribute("y",i),i+=o.table.getRowHeight(t.row)}))}}}function pA(t,e,i,o,n,r){if(jS(t)){e=0;let s=!1;for(let i=t.mergeStartCol;i<=t.mergeEndCol;i++)e+=r.getColWidth(i);let l=0;for(let e=t.mergeStartRow;e<=t.mergeEndRow;e++)l+=r.getRowHeight(e);const{colStart:a,colEnd:h,rowStart:d,rowEnd:c}=hA(t,r.scenegraph);for(let u=a;u<=h;u++)for(let h=d;h<=c;h++){if(u===t.col&&h!==t.row)continue;const c=r.scenegraph.getCell(u,h);c.forEachChildren((t=>{t.setAttributes({dx:0,dy:0})}));let g=!1;if(n){const t=r._getCellStyle(a,d);g=_S(c,e,l,i,o,Fx(t.padding),t.textAlign,t.textBaseline,r.scenegraph);const n=CS(c.col,c.row,r);if(n){const t=c.getChildByName("text"),e=c.getChildByName("expand")||c.getChildByName("collapse");"icon-left"!==(null==e?void 0:e.role)&&t&&t.setAttribute("dx",n)}}const p=r.getRowHeight(h),f=r.getColWidth(u);c.contentWidth=e;const{heightChange:v}=NS(c,f,p,{start:{col:t.mergeStartCol,row:t.mergeStartRow},end:{col:t.mergeEndCol,row:t.mergeEndRow}},r);v&&(c.needUpdateHeight=!0),s=s||g}return s}const s=r._getCellStyle(t.col,t.row),l=Fx(s.padding),a=s.textAlign,h=s.textBaseline;return _S(t,e,r.getRowHeight(t.row),i,o,l,a,h,r.scenegraph)}function fA(t,e){const i=Math.round(oA(e,0,t.table.colCount-1,t.table));t.table._setRowHeight(e,i,!0);for(let o=0;o<t.table.colCount;o++){const n=i,r=t.highPerformanceGetCell(o,e);if("empty"===r.role)return;cA(t,r,o,e,n,n-r.attribute.height,t.table.isHeader(o,e))}}var vA;!function(t){t.dropDown="dropDown",t.contextmenu="contextmenu",t.custom="custom"}(vA||(vA={}));const mA=12,bA="Arial,sans-serif",CA="#000",yA="#2E68CF",wA="#EEE",xA=30,_A="#FFF",SA=4,AA=.5,RA="#CCC",BA=6,MA=9,TA=200;const PA=cS();class EA{constructor(){const t=PA.drillDown;this.icon=new w_({x:-1e3,y:-1e3,image:t.svg,width:t.width,height:t.height,dx:-t.width/2,dy:-t.height/2,visible:!1,funcType:t.funcType,cursor:t.cursor}),this.icon.role="icon-drill"}appand(t){t.appendChild(this.icon)}update(t,e,i,o,n,r){if(!t||o&&n)return this.icon.setAttributes({x:-1e3,y:-1e3,visible:!1}),void r.updateNextFrame();const s=PA.drillDown,l=PA.drillUp;this.icon.setAttributes({x:e,y:i,image:o?s.svg:l.svg,visible:!0}),this.icon.loadImage(this.icon.attribute.image),r.updateNextFrame()}}class kA{constructor(t){const e=t.theme.dragHeaderSplitLine.lineWidth,i=t.theme.dragHeaderSplitLine.lineColor,o=t.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel=Zd({visible:!1,pickable:!1,x:0,y:0,symbolType:"triangle",fill:i}),this.columnMoverLine=Qd({visible:!1,pickable:!1,stroke:i,lineWidth:e,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnMoverBack=ic({visible:!1,pickable:!1,fill:o,x:0,y:0,width:0,height:0}),this.table=t}appand(t){t.appendChild(this.columnMoverLabel),t.appendChild(this.columnMoverLine),t.appendChild(this.columnMoverBack)}show(t,e,i){const o=this.table.getCellLocation(t,e),n=nx(this.table,t,e);n&&(t=n.start.col,e=n.start.row);let r=0,s=0,l=0,a=0,h=0,d=0,c=0,u=0,g=Math.PI;const p=[];return"columnHeader"===o?(r=this.table.getColsWidth(0,t-1)-this.table.stateManager.scroll.horizontalBarPos,s=this.table.getRowsHeight(0,this.table.frozenRowCount-1),a=this.table.tableNoFrameHeight,l=n?this.table.getColsWidth(n.start.col,n.end.col):this.table.getColWidth(t),h=r-i,c=r+l,u=2,p.push({x:0,y:0}),p.push({x:0,y:this.table.tableNoFrameHeight})):("rowHeader"===o||this.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(s=this.table.getRowsHeight(0,e-1)-this.table.stateManager.scroll.verticalBarPos,r=this.table.getColsWidth(0,this.table.frozenColCount-1),l=this.table.tableNoFrameWidth,a=n?this.table.getRowsHeight(n.start.row,n.end.row):this.table.getRowHeight(e),d=s-i,c=2,u=s+a,g=Math.PI/2,p.push({x:0,y:0}),p.push({x:this.table.tableNoFrameWidth,y:0})),this.columnMoverBack.setAttributes({visible:!0,x:r-h,y:s-d,width:l,height:a,dx:h,dy:d}),this.columnMoverLine.setAttributes({x:c,y:u,visible:!0,points:p}),this.columnMoverLabel.setAttributes({visible:!0,x:c,y:u,angle:g}),{backX:r-h,lineX:c,backY:s-d,lineY:u}}hide(){this.columnMoverLabel.setAttribute("visible",!1),this.columnMoverLine.setAttribute("visible",!1),this.columnMoverBack.setAttribute("visible",!1)}update(t,e,i,o){"number"==typeof t&&"number"==typeof e?(this.columnMoverLabel.setAttribute("x",e),this.columnMoverLine.setAttribute("x",e),this.columnMoverBack.setAttribute("x",t)):"number"==typeof i&&"number"==typeof o&&(this.columnMoverLabel.setAttribute("y",o),this.columnMoverLine.setAttribute("y",o),this.columnMoverBack.setAttribute("y",i))}updateStyle(){const t=this.table.theme.dragHeaderSplitLine.lineWidth,e=this.table.theme.dragHeaderSplitLine.lineColor,i=this.table.theme.dragHeaderSplitLine.shadowBlockColor;this.columnMoverLabel.setAttributes({fill:e}),this.columnMoverLine.setAttributes({stroke:e,lineWidth:t}),this.columnMoverBack.setAttributes({fill:i})}}function LA(t,e,i){if(i)return Math.min(e.tableNoFrameWidth,e.getAllColsWidth())-e.getColsWidth(t,e.colCount-1);let o=e.getColsWidth(0,t);return t>=e.frozenColCount&&(o-=e.scrollLeft),o}function HA(t,e,i){if(i)return Math.min(e.tableNoFrameWidth,e.getAllRowsHeight())-e.getRowsHeight(t,e.rowCount-1);let o=e.getRowsHeight(0,t);return t>=e.frozenRowCount&&(o-=e.scrollTop),o}class FA{constructor(t){var e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;this.table=t;const b=this.table.theme;this.createScrollBar();const C=null===(e=b.columnResize)||void 0===e?void 0:e.lineColor,y=null===(i=b.columnResize)||void 0===i?void 0:i.lineWidth,w=null===(o=b.columnResize)||void 0===o?void 0:o.bgColor,x=null===(n=b.columnResize)||void 0===n?void 0:n.width,_=null===(s=null===(r=b.columnResize)||void 0===r?void 0:r.labelVisible)||void 0===s||s,S=null===(l=b.columnResize)||void 0===l?void 0:l.labelColor,A=null===(a=b.columnResize)||void 0===a?void 0:a.labelFontSize,R=null===(h=b.columnResize)||void 0===h?void 0:h.labelFontFamily,B=null===(d=b.columnResize)||void 0===d?void 0:d.labelBackgroundFill,M=null===(c=b.columnResize)||void 0===c?void 0:c.labelBackgroundCornerRadius;this.labelVisible=_,this.columnResizeLine=Qd({visible:!1,pickable:!1,stroke:C,lineWidth:y,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.columnResizeBgLine=Qd({visible:!1,pickable:!1,stroke:w,lineWidth:x,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const T=Oh({visible:!1,pickable:!1,x:0,y:0,fontSize:A,fill:S,fontFamily:R,text:"",textBaseline:"top",dx:16,dy:-A/2}),P=ic({visible:!1,pickable:!1,fill:B,x:0,y:0,width:5*A*.8,height:A+8,cornerRadius:M,dx:12,dy:-A/2-4});this.columnResizeLabel=us({visible:!1,pickable:!1,x:0,y:0}),this.columnResizeLabel.appendChild(P),this.columnResizeLabel.appendChild(T),this.rowResizeLine=Qd({visible:!1,pickable:!1,stroke:C,lineWidth:y,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]}),this.rowResizeBgLine=Qd({visible:!1,pickable:!1,stroke:w,lineWidth:x,x:0,y:0,points:[{x:0,y:0},{x:0,y:0}]});const E=Oh({visible:!1,pickable:!1,x:0,y:0,fontSize:A,fill:S,fontFamily:R,text:"",textBaseline:"top",dx:16,dy:-A/2}),k=ic({visible:!1,pickable:!1,fill:B,x:0,y:0,width:5*A*.8,height:A+8,cornerRadius:M,dx:12,dy:-A/2-4});this.rowResizeLabel=us({visible:!1,pickable:!1,x:0,y:0}),this.rowResizeLabel.appendChild(k),this.rowResizeLabel.appendChild(E),this.cellMover=new kA(this.table);const L=null===(g=null===(u=b.frozenColumnLine)||void 0===u?void 0:u.shadow)||void 0===g?void 0:g.width,H=null===(f=null===(p=b.frozenColumnLine)||void 0===p?void 0:p.shadow)||void 0===f?void 0:f.startColor,F=null===(m=null===(v=b.frozenColumnLine)||void 0===v?void 0:v.shadow)||void 0===m?void 0:m.endColor;this.frozenShadowLine=ic({visible:!0,pickable:!1,x:0,y:0,width:L,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:H,offset:0},{color:F,offset:1}]}}),this.rightFrozenShadowLine=ic({visible:!0,pickable:!1,x:0,y:0,width:L,height:0,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:F,offset:0},{color:H,offset:1}]}}),this.menu=new class{constructor(t){this._table=t,this._menuInstance=new uS({x:0,y:0,fill:_A,stroke:RA,cornerRadius:SA,lineWidth:AA}),this._menuInfo={x:-1,y:-1,col:-1,row:-1,type:vA.dropDown,menuInfo:[],highlightIndex:-1}}bindTableComponent(t){t.appendChild(this._menuInstance),this.bindEvent()}release(){}attach(t,e,i,o,n,r){if(n===vA.dropDown&&this.checkDropDownMenuChange(i,o)){const t=this.getMenuInfo(i,o,n);if(!t)return;const{menuInfo:e,highlightIndex:r}=t;this.updateMenuInfo(i,o,n,e,r),this.updateMenuInstance(e,r)}else if(n===vA.contextmenu&&this.checkContextMenuChange(t,e)){const t=this.getMenuInfo(i,o,n);if(!t)return;const{menuInfo:e,highlightIndex:r}=t;this.updateMenuInfo(i,o,n,e,r),this.updateMenuInstance(e,r)}this.updatePosition(t-this._table.scenegraph.x,e-this._table.scenegraph.y),this.addToScene()}updateMenuInfo(t,e,i,o,n){this._menuInfo.col=t,this._menuInfo.row=e,this._menuInfo.type=i,this._menuInfo.menuInfo=o,this._menuInfo.highlightIndex=n}checkDropDownMenuChange(t,e){const{type:i,col:o,row:n}=this._menuInfo;return i!==vA.dropDown||t!==o||e!==n}checkContextMenuChange(t,e){var i;const{type:o,menuInfo:n}=this._menuInfo;return o!==vA.contextmenu||n!==(null===(i=this._table.internalProps.menu)||void 0===i?void 0:i.contextMenuItems)}updateMenuInstance(t,e){this._menuInstance.removeAllChild();let i=BA;const o=BA;let n=0;t.forEach(((t,r)=>{var s,l;const a=e===r;let h,d;"string"==typeof t?d=t:"object"==typeof t&&(d=t.text,h=a?t.selectedIcon:t.icon);const c=new uS({y:i,x:o,height:xA,fill:_A});c.role="menu-item",this._menuInstance.appendChild(c),c.stateProxy=t=>"hover"===t?{fill:wA}:{fill:_A},c.addEventListener("pointerenter",(t=>{c.addState("hover",!0,!1),this._table.scenegraph.updateNextFrame()})),c.addEventListener("pointerleave",(t=>{c.removeState("hover",!1),this._table.scenegraph.updateNextFrame()}));const u=new Ih({x:MA,y:MA,fill:a?yA:CA,text:d,textBaseline:"top",fontSize:mA,fontFamily:bA,pickable:!1,maxLineWidth:TA,ellipsis:"…"});if(c.addChild(u),h){u.AABBBounds.height();const t=null!==(s=h.width)&&void 0!==s?s:16,e=null!==(l=h.height)&&void 0!==l?l:16,i=new w_({x:MA,y:(xA-e)/2,width:t,height:e,image:h.svg,pickable:!1});i.role="menu-icon",c.insertBefore(i,u),u.setAttribute("x",t+MA)}n=Math.max(c.AABBBounds.width(),n),i+=xA})),this._menuInstance.setAttributes({width:n+2*MA+2*BA,height:i+BA}),this._menuInstance.forEachChildren((t=>{t.setAttribute("width",n+2*MA)}))}updatePosition(t,e){this._menuInstance.setAttributes({x:this._menuInfo.type===vA.dropDown?t-this._menuInstance.attribute.width:t,y:e}),this._menuInfo.x=vA.dropDown?t-this._menuInstance.attribute.width:t,this._menuInfo.y=e}addToScene(){this._table.scenegraph.updateNextFrame()}detach(){this._menuInstance.setAttributes({x:-1e3,y:-1e3}),this._table.scenegraph.updateNextFrame()}getMenuInfo(t,e,i){var o;if(i===vA.dropDown){const{dropDownMenu:i=this._table.globalDropDownMenu,pivotInfo:o}=this._table._getHeaderLayoutMap(t,e);let n=-1;if(Array.isArray(i))for(let o=0;o<i.length;o++)if(this._table._dropDownMenuIsHighlight(t,e,o)){n=o;break}return{menuInfo:i,highlightIndex:n}}if(i===vA.contextmenu){const i=null===(o=this._table.internalProps.menu)||void 0===o?void 0:o.contextMenuItems;let n;if(Array.isArray(i))n=i;else if("function"==typeof i){const{field:o}=this._table.isHeader(t,e)?this._table.getHeaderDefine(t,e):this._table.getBodyColumnDefine(t,e);n=i(o,e,t)}return{menuInfo:n,highlightIndex:-1}}}bindEvent(){this._menuInstance.addEventListener("click",(t=>{const{target:e}=t;if(e&&"menu-item"===e.role){const i=this.getEventInfo(e),o=this._table.getMenuInfo(this._menuInfo.col,this._menuInfo.row,this._menuInfo.type),n=Object.assign(i,o);n.event=t.nativeEvent,this._table.fireListeners(Aw.DROPDOWN_MENU_CLICK,n)}}))}getEventInfo(t){const e=t.parent;let i=0;e.forEachChildren(((e,o)=>e===t&&(i=o-1,!0)));const o="string"==typeof this._menuInfo.menuInfo[i]?this._menuInfo.menuInfo[i]:this._menuInfo.menuInfo[i].text,n="string"==typeof this._menuInfo.menuInfo[i]?o:this._menuInfo.menuInfo[i].menuKey||o;return{col:this._menuInfo.col,row:this._menuInfo.row,dropDownIndex:i,highlight:i===this._menuInfo.highlightIndex,text:o,menuKey:n}}get bounds(){return this._menuInstance.globalAABBBounds}}(this.table),this.drillIcon=new EA}addToGroup(t){t.addChild(this.frozenShadowLine),t.addChild(this.rightFrozenShadowLine),t.addChild(this.columnResizeBgLine),t.addChild(this.columnResizeLine),t.addChild(this.columnResizeLabel),t.addChild(this.rowResizeBgLine),t.addChild(this.rowResizeLine),t.addChild(this.rowResizeLabel),this.table.theme.scrollStyle.hoverOn&&!this.table.theme.scrollStyle.barToSide?(t.addChild(this.hScrollBar),t.addChild(this.vScrollBar)):(t.stage.defaultLayer.addChild(this.hScrollBar),t.stage.defaultLayer.addChild(this.vScrollBar)),this.menu.bindTableComponent(t),this.drillIcon.appand(t),this.cellMover.appand(t)}createScrollBar(){var t,e,i,o,n,r;const s=this.table.theme,l=null===(t=s.scrollStyle)||void 0===t?void 0:t.scrollRailColor,a=null===(e=s.scrollStyle)||void 0===e?void 0:e.scrollSliderColor,h=null===(i=s.scrollStyle)||void 0===i?void 0:i.scrollSliderCornerRadius,d=null===(o=s.scrollStyle)||void 0===o?void 0:o.width,c=null===(n=s.scrollStyle)||void 0===n?void 0:n.horizontalPadding,u=null===(r=s.scrollStyle)||void 0===r?void 0:r.verticalPadding;let g;g=K(h)?{cornerRadius:h,fill:a}:{fill:a},this.hScrollBar=new Cm({direction:"horizontal",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:this.table.tableNoFrameWidth,height:d,padding:c,railStyle:{fill:l},sliderStyle:g,range:[0,.1],visible:!1}),this.hScrollBar.render(),this.hScrollBar.hideAll(),this.vScrollBar=new Cm({direction:"vertical",x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:d,height:this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight(),padding:u,railStyle:{fill:l},sliderStyle:g,range:[0,.1],visible:!1}),this.vScrollBar.render(),this.vScrollBar.hideAll()}updateScrollBar(){var t,e,i,o,n,r,s;const l=this.table.stateManager.scroll.horizontalBarPos,a=this.table.stateManager.scroll.verticalBarPos,h=this.table.theme,d=null===(t=h.scrollStyle)||void 0===t?void 0:t.width,c=null===(e=h.scrollStyle)||void 0===e?void 0:e.visible,u=null!==(o=null===(i=h.scrollStyle)||void 0===i?void 0:i.horizontalVisible)&&void 0!==o?o:c,g=null!==(r=null===(n=h.scrollStyle)||void 0===n?void 0:n.verticalVisible)&&void 0!==r?r:c,p=Math.ceil(this.table.scenegraph.tableGroup.attribute.width),f=Math.ceil(this.table.scenegraph.tableGroup.attribute.height),v=this.table.getAllRowsHeight(),m=this.table.getAllColsWidth(),b=this.table.getFrozenRowsHeight(),C=this.table.getFrozenColsWidth(),y=this.table.getBottomFrozenRowsHeight(),w=this.table.getRightFrozenColsWidth(),x=(null===(s=this.table.options.customConfig)||void 0===s?void 0:s._disableColumnAndRowSizeRound)?1:0;if(m>p+x){const t=Math.min(f,v),e=Math.max(.05,(p-C)/(m-C)),i=this.table.theme.scrollStyle.hoverOn;let o=0;o=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameHeight-(i?d:-this.table.scenegraph.tableGroup.attribute.y)+this.table.tableY:t-(i?d:-this.table.scenegraph.tableGroup.attribute.y),this.hScrollBar.setAttributes({x:C+(i?0:this.table.scenegraph.tableGroup.attribute.x),y:o,width:p-C-w,range:[0,e],visible:"always"===u});const n=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:n.x1,y:n.y1},"always"===u&&this.hScrollBar.showAll()}else this.hScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,width:0,visible:!1});if(v>f+x){const t=Math.min(p,m),e=Math.max(.05,(f-b)/(v-b));let i=0;const o=this.table.theme.scrollStyle.hoverOn;i=this.table.theme.scrollStyle.barToSide?this.table.tableNoFrameWidth-(o?d:-this.table.scenegraph.tableGroup.attribute.x)+this.table.tableX:t-(o?d:-this.table.scenegraph.tableGroup.attribute.x),this.vScrollBar.setAttributes({x:i,y:b+(o?0:this.table.scenegraph.tableGroup.attribute.y),height:f-b-y,range:[0,e],visible:"always"===g});const n=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:n.x1,y:n.y1},"always"===g&&this.vScrollBar.showAll()}else this.vScrollBar.setAttributes({x:2*-this.table.tableNoFrameWidth,y:2*-this.table.tableNoFrameHeight,height:0,visible:!1});this.table.stateManager.setScrollLeft(l),this.table.stateManager.setScrollTop(a)}hideResizeCol(){this.columnResizeLine.setAttribute("visible",!1),this.columnResizeBgLine.setAttribute("visible",!1),this.columnResizeLabel.setAttribute("visible",!1),this.columnResizeLabel.hideAll()}showResizeCol(t,e,i){const o=LA(t,this.table,i);this.columnResizeLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({visible:!0,x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.labelVisible&&(this.columnResizeLabel.showAll(),this.columnResizeLabel.setAttributes({visible:!0,x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${this.table.getColWidth(t)}px`))}updateResizeCol(t,e,i){const o=LA(t,this.table,i);this.columnResizeLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.columnResizeBgLine.setAttributes({x:o,points:[{x:0,y:0},{x:0,y:this.table.getRowsHeight(0,this.table.rowCount-1)}]}),this.labelVisible&&(this.columnResizeLabel.setAttributes({x:o,y:e}),this.columnResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getColWidth(t))}px`))}hideResizeRow(){this.rowResizeLine.setAttribute("visible",!1),this.rowResizeBgLine.setAttribute("visible",!1),this.rowResizeLabel.setAttribute("visible",!1),this.rowResizeLabel.hideAll()}showResizeRow(t,e,i){const o=HA(t,this.table,i);this.rowResizeLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({visible:!0,y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.labelVisible&&(this.rowResizeLabel.showAll(),this.rowResizeLabel.setAttributes({visible:!0,y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${this.table.getRowHeight(t)}px`))}updateResizeRow(t,e,i){const o=HA(t,this.table,i);this.rowResizeLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.rowResizeBgLine.setAttributes({y:o,points:[{y:0,x:0},{y:0,x:this.table.getColsWidth(0,this.table.colCount-1)}]}),this.labelVisible&&(this.rowResizeLabel.setAttributes({y:o,x:e}),this.rowResizeLabel.lastChild.setAttribute("text",`${Math.floor(this.table.getRowHeight(t))}px`))}hideMoveCol(){this.cellMover.hide()}showMoveCol(t,e,i){return this.cellMover.show(t,e,i)}updateMoveCol(t,e,i,o){this.cellMover.update(t,e,i,o)}setFrozenColumnShadow(t,e){if(t<0)this.frozenShadowLine.setAttributes({visible:!1});else{const i=LA(t,this.table,e);this.frozenShadowLine.setAttributes({visible:!0,x:i,height:this.table.getDrawRange().height})}}setRightFrozenColumnShadow(t){if(t>=this.table.colCount)this.rightFrozenShadowLine.setAttributes({visible:!1});else{const e=LA(t,this.table,!0);this.rightFrozenShadowLine.setAttributes({visible:!0,x:e-this.rightFrozenShadowLine.attribute.width,height:this.table.getDrawRange().height})}}hideVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.verticalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.vScrollBar.setAttribute("visible",!1),this.vScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showVerticalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.verticalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.vScrollBar.setAttribute("visible",!0),this.vScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}hideHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.horizontalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.hScrollBar.setAttribute("visible",!1),this.hScrollBar.hideAll(),this.table.scenegraph.updateNextFrame())}showHorizontalScrollBar(){var t;const e=this.table.theme.scrollStyle.visible,i=null!==(t=this.table.theme.scrollStyle.horizontalVisible)&&void 0!==t?t:e;"focus"!==i&&"scrolling"!==i||(this.hScrollBar.setAttribute("visible",!0),this.hScrollBar.showAll(),this.table.scenegraph.updateNextFrame())}updateVerticalScrollBarPos(t){const e=this.vScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.vScrollBar.setAttribute("range",[o,o+i]);const n=this.vScrollBar.AABBBounds&&this.vScrollBar.globalAABBBounds;this.vScrollBar._viewPosition={x:n.x1,y:n.y1}}updateHorizontalScrollBarPos(t){const e=this.hScrollBar.attribute.range,i=e[1]-e[0],o=t*(1-i);this.hScrollBar.setAttribute("range",[o,o+i]);const n=this.hScrollBar.AABBBounds&&this.hScrollBar.globalAABBBounds;this.hScrollBar._viewPosition={x:n.x1,y:n.y1}}updateStyle(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x;const _=this.table.theme,S=null===(t=_.scrollStyle)||void 0===t?void 0:t.scrollRailColor,A=null===(e=_.scrollStyle)||void 0===e?void 0:e.scrollSliderColor,R=null===(i=_.scrollStyle)||void 0===i?void 0:i.scrollSliderCornerRadius,B=null===(o=_.scrollStyle)||void 0===o?void 0:o.width,M=null===(n=_.scrollStyle)||void 0===n?void 0:n.horizontalPadding,T=null===(r=_.scrollStyle)||void 0===r?void 0:r.verticalPadding;let P;P=K(R)?{cornerRadius:R,fill:A}:{fill:A},this.hScrollBar.setAttributes({height:B,padding:M,railStyle:{fill:S},sliderStyle:P}),this.vScrollBar.setAttributes({width:B,padding:T,railStyle:{fill:S},sliderStyle:P});const E=null===(s=_.columnResize)||void 0===s?void 0:s.lineColor,k=null===(l=_.columnResize)||void 0===l?void 0:l.lineWidth,L=null===(a=_.columnResize)||void 0===a?void 0:a.bgColor,H=null===(h=_.columnResize)||void 0===h?void 0:h.width;this.columnResizeLine.setAttributes({stroke:E,lineWidth:k}),this.columnResizeBgLine=Qd({stroke:L,lineWidth:H});const F=null===(d=_.columnResize)||void 0===d?void 0:d.labelColor,z=null===(c=_.columnResize)||void 0===c?void 0:c.labelFontSize,I=null===(u=_.columnResize)||void 0===u?void 0:u.labelFontFamily,O=null===(g=_.columnResize)||void 0===g?void 0:g.labelBackgroundFill,D=null===(p=_.columnResize)||void 0===p?void 0:p.labelBackgroundCornerRadius,W=null===(v=null===(f=_.columnResize)||void 0===f?void 0:f.labelVisible)||void 0===v||v;this.labelVisible=W,this.columnResizeLabel.lastChild.setAttributes({fontSize:z,fill:F,fontFamily:I,dy:-z/2}),this.columnResizeLabel.firstChild.setAttributes({fill:O,width:5*z*.8,height:z+8,cornerRadius:D,dy:-z/2-4}),this.rowResizeLabel.lastChild.setAttributes({fontSize:z,fill:F,fontFamily:I,dy:-z/2}),this.rowResizeLabel.firstChild.setAttributes({fill:O,width:5*z*.8,height:z+8,cornerRadius:D,dy:-z/2-4});const N=null===(b=null===(m=_.frozenColumnLine)||void 0===m?void 0:m.shadow)||void 0===b?void 0:b.width,G=null===(y=null===(C=_.frozenColumnLine)||void 0===C?void 0:C.shadow)||void 0===y?void 0:y.startColor,j=null===(x=null===(w=_.frozenColumnLine)||void 0===w?void 0:w.shadow)||void 0===x?void 0:x.endColor;this.frozenShadowLine.setAttributes({width:N,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:G,offset:0},{color:j,offset:1}]}}),this.rightFrozenShadowLine.setAttributes({width:N,fill:{gradient:"linear",x0:0,y0:0,x1:1,y1:0,stops:[{color:j,offset:0},{color:G,offset:1}]}}),this.cellMover.updateStyle()}}function zA(t,e,i,o,n){var r,s,l,a,h,d;if(!e)return;const c="table"===i,{shadowBlur:u,shadowOffsetX:g,shadowOffsetY:p,shadowColor:f,cornerRadius:v,borderColor:m,borderLineWidth:b,borderLineDash:C}=e;let y=!1;const w={},x={pickable:!1};u&&c&&(x.shadowBlur=u,x.shadowOffsetX=g,x.shadowOffsetY=p,x.shadowColor=f,x.stroke=!0,x.stroke=f,x.lineWidth=1,y=!0),b&&(x.stroke=!0,x.fill=!1,x.stroke=OA(null!=m?m:"#E1E4E8",o,b),x.lineWidth=b,C&&(x.lineDash=C),x.lineCap="butt"),Array.isArray(m)&&(x.strokeArrayColor=Fx(m)),Array.isArray(b)&&(x.strokeArrayWidth=Fx(b),x.lineWidth=1),v&&(x.cornerRadius=v,w.cornerRadius=v);const _=x.strokeArrayWidth?x.strokeArrayWidth[0]:null!==(r=x.lineWidth)&&void 0!==r?r:0,S=x.strokeArrayWidth?x.strokeArrayWidth[1]:null!==(s=x.lineWidth)&&void 0!==s?s:0,A=x.strokeArrayWidth?x.strokeArrayWidth[2]:null!==(l=x.lineWidth)&&void 0!==l?l:0,R=x.strokeArrayWidth?x.strokeArrayWidth[3]:null!==(a=x.lineWidth)&&void 0!==a?a:0;if(t.setAttributes(w),!n)if(x.stroke)if(x.x=R/2,x.y=_/2,x.pickable=!1,c){if(v)if(Array.isArray(v)){const t=Fx(v);x.cornerRadius=t,w.cornerRadius=t,t[0]&&(t[0]=t[0]+Math.min(R,_)/2),t[1]&&(t[1]=t[1]+Math.min(_,S)/2),t[2]&&(t[2]=t[2]+Math.min(S,A)/2),t[3]&&(t[3]=t[3]+Math.min(A,R)/2)}else if(et(b)){const t=[];x.cornerRadius=t,w.cornerRadius=t,t[0]=v+Math.min(R,_)/2,t[1]=v+Math.min(_,S)/2,t[2]=v+Math.min(S,A)/2,t[3]=v+Math.min(A,R)/2}else x.cornerRadius=v+(null!==(h=x.lineWidth)&&void 0!==h?h:0)/2,w.cornerRadius=v+(null!==(d=x.lineWidth)&&void 0!==d?d:0)/2;let i,o;if(e.innerBorder?(x.x=t.attribute.x+R/2,x.y=t.attribute.y+_/2,x.width=t.attribute.width-R/2-S/2,x.height=t.attribute.height-_/2-A/2):(x.x=t.attribute.x-R/2,x.y=t.attribute.y-_/2,x.width=t.attribute.width+R/2+S/2,x.height=t.attribute.height+_/2+A/2),y){x.fill="white",x.notAdjustPos=!0,o=us(x),o.name="table-border-rect",i=ic({x:R/2,y:_/2,width:t.attribute.width,height:t.attribute.height,fill:"red",cornerRadius:t.attribute.cornerRadius,globalCompositeOperation:"destination-out"}),o.addChild(i);const e=ic({x:R/2,y:_/2,width:t.attribute.width,height:t.attribute.height,fill:"transparent",pickable:!1,globalCompositeOperation:"source-over"});o.addChild(e)}else o=ic(x),o.name="table-border-rect";e.innerBorder&&!y?t.parent.insertAfter(o,t):t.parent.insertBefore(o,t),t.border=o}else{x.width=t.attribute.width-R/2-S/2,x.height=t.attribute.height-_/2-A/2;const e=ic(x);e.name="border-rect",t.addChild(e),t.border=e}else{const e=ic({fill:!1,stroke:!1,pickable:!1,lineWidth:0});e.name="border-rect",t.addChild(e),t.border=e}}function IA(t,e,i){var o;if(!e)return;const{borderColor:n}=e;null===(o=t.border)||void 0===o||o.setAttribute("stroke",OA(n,i))}function OA(t,e,i){let o=!0;return!e&&!et(i)||et(t)?e?o=e:e||et(t)?et(t)&&(o=!0):o=t:o=(null!=e?e:i).map((e=>!!e&&t)),o}function DA(t){var e,i,o,n;if(!t.border)return;const r=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[0]:null!==(e=t.border.attribute.lineWidth)&&void 0!==e?e:0,s=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[1]:null!==(i=t.border.attribute.lineWidth)&&void 0!==i?i:0,l=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[2]:null!==(o=t.border.attribute.lineWidth)&&void 0!==o?o:0,a=t.border.attribute.strokeArrayWidth?t.border.attribute.strokeArrayWidth[3]:null!==(n=t.border.attribute.lineWidth)&&void 0!==n?n:0;t.border.setAttributes({width:t.attribute.width-a/2-s/2,height:t.attribute.height-r/2-l/2}),"group"===t.border.type&&t.border.firstChild.setAttributes({width:t.attribute.width,height:t.attribute.height})}function WA(t,e){t.setAttribute("cornerRadius",e),t.border&&t.border.setAttribute("cornerRadius",e)}const NA=Nr();class GA extends cs{constructor(t,e){if(super(e),this.type="chart",this.numberType=NA,this.isShareChartSpec=t,e.chartInstance)this.chartInstance=e.chartInstance;else{const t=this.chartInstance=new e.ClassType(e.spec,yt({},this.attribute.tableChartOption,{renderCanvas:e.canvas,mode:"node"===this.attribute.mode?"node":"desktop-browser",modeParams:this.attribute.modeParams,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:e.dpr,interactive:!1,animation:!1,autoFit:!1}));t.renderSync(),t.getStage().enableDirtyBounds(),e.chartInstance=this.chartInstance=t}}activate(t){var e,i,o,n;this.active=!0;const{col:r,row:s}=this.parent,{x1:l,y1:a,x2:h,y2:d}=this.getViewBox(),c=function(t,e,i){var o,n,r,s,l,a,h,d;const{layoutMap:c}=i.internalProps,u=new ke,g=i.scenegraph.tableGroup.globalAABBBounds;return u.x1=g.x1,u.x2=g.x2,u.y1=g.y1,u.y2=g.y2,c.isLeftBottomCorner(t,e)||c.isRightTopCorner(t,e)||c.isLeftTopCorner(t,e)||c.isRightBottomCorner(t,e)||(c.isFrozenColumn(t,e)?(u.y1=g.y1+i.getFrozenRowsHeight(),u.y2=g.y2-i.getBottomFrozenRowsHeight()):c.isFrozenRow(t,e)?(u.x1=g.x1+i.getFrozenColsWidth(),u.x2=g.x2-i.getRightFrozenColsWidth()):c.isRightFrozenColumn(t,e)?(u.y1=g.y1+i.getFrozenRowsHeight(),u.y2=g.y2-i.getBottomFrozenRowsHeight()):c.isBottomFrozenRow(t,e)?(u.x1=g.x1+i.getFrozenColsWidth(),u.x2=g.x2-i.getRightFrozenColsWidth()):c.isFrozenColumn(t,e)||c.isRightFrozenColumn(t,e)||(u.x1=g.x1+i.getFrozenColsWidth(),u.x2=g.x2-i.getRightFrozenColsWidth(),u.y1=g.y1+i.getFrozenRowsHeight(),u.y2=g.y2-i.getBottomFrozenRowsHeight())),u.x1=u.x1+(null!==(n=null===(o=i.options.viewBox)||void 0===o?void 0:o.x1)&&void 0!==n?n:0),u.x2=u.x2+(null!==(s=null===(r=i.options.viewBox)||void 0===r?void 0:r.x1)&&void 0!==s?s:0),u.y1=u.y1+(null!==(a=null===(l=i.options.viewBox)||void 0===l?void 0:l.y1)&&void 0!==a?a:0),u.y2=u.y2+(null!==(d=null===(h=i.options.viewBox)||void 0===h?void 0:h.y1)&&void 0!==d?d:0),u}(r,s,t).intersect({x1:l-t.scrollLeft,x2:h-t.scrollLeft,y1:a-t.scrollTop,y2:d-t.scrollTop});this.activeChartInstance=new this.attribute.ClassType(this.attribute.spec,yt({},this.attribute.tableChartOption,{renderCanvas:this.attribute.canvas,mode:"desktop-browser",canvasControled:!1,viewBox:{x1:0,x2:h-l,y1:0,y2:d-a},dpr:t.internalProps.pixelRatio,animation:!1,interactive:!0,autoFit:!1,beforeRender:e=>{const i=this.stage,o=e.window.getContext(),n=i.window.getViewBoxTransform(),r=i.window.getViewBox();o.inuse=!0,o.clearMatrix(),o.setTransform(n.a,n.b,n.c,n.d,n.e,n.f,!0),o.translate(r.x1,r.y1),o.setTransformForCurrent(!0),o.beginPath(),o.rect(c.x1,c.y1,c.x2-c.x1,c.y2-c.y1),o.clip(),o.clearMatrix(),t.options.canvas&&!e.needRender&&(e.pauseRender(),t.scenegraph.stage.dirtyBounds.union(this.globalAABBBounds),t.scenegraph.updateNextFrame())},afterRender(t){t.window.getContext().inuse=!1,t.needRender=!1,u.resumeRender()}}));const u=this.activeChartInstance.getStage(),g=this.globalTransMatrix.clone(),p=this.stage.window.getViewBoxTransform();g.multiply(p.a,p.b,p.c,p.d,p.e,p.f),u.window.setViewBoxTransform&&u.window.setViewBoxTransform(g.a,g.b,g.c,g.d,g.e,g.f),this.activeChartInstance.renderSync(),null===(i=null===(e=t.internalProps.layoutMap)||void 0===e?void 0:e.updateDataStateToActiveChartInstance)||void 0===i||i.call(e,this.activeChartInstance),this.activeChartInstance.on("click",(e=>{var i;!1===(null===(i=this.attribute.spec.select)||void 0===i?void 0:i.enable)?t.scenegraph.updateChartState(null):GA.temp&&t.scenegraph.updateChartState(null==e?void 0:e.datum)})),this.activeChartInstance.on("brushEnd",(e=>{var i;t.scenegraph.updateChartState(null===(i=null==e?void 0:e.value)||void 0===i?void 0:i.inBrushData),GA.temp=0,setTimeout((()=>{GA.temp=1}),0)})),null===(n=(o=t)._bindChartEvent)||void 0===n||n.call(o,this.activeChartInstance)}deactivate(){var t,e;this.active=!1,null===(t=this.activeChartInstance)||void 0===t||t.updateViewBox({x1:-1e3,x2:-800,y1:-1e3,y2:-800},!1,!1),null===(e=this.activeChartInstance)||void 0===e||e.release(),this.activeChartInstance=null}updateData(t){this.attribute.data=t}getViewBox(){var t,e,i,o,n,r,s,l;const a=this.parent,h=this.attribute.cellPadding,d=this.stage.table,{x1:c,y1:u,x2:g,y2:p}=a.globalAABBBounds;return{x1:Math.ceil(c+h[3]+d.scrollLeft+(null!==(e=null===(t=d.options.viewBox)||void 0===t?void 0:t.x1)&&void 0!==e?e:0)),x2:Math.ceil(c+a.attribute.width-h[1]+d.scrollLeft+(null!==(o=null===(i=d.options.viewBox)||void 0===i?void 0:i.x1)&&void 0!==o?o:0)),y1:Math.ceil(u+h[0]+d.scrollTop+(null!==(r=null===(n=d.options.viewBox)||void 0===n?void 0:n.y1)&&void 0!==r?r:0)),y2:Math.ceil(u+a.attribute.height-h[2]+d.scrollTop+(null!==(l=null===(s=d.options.viewBox)||void 0===s?void 0:s.y1)&&void 0!==l?l:0))}}}GA.temp=1;const jA=[],UA=[];let VA=5,$A=!1;function YA(t){K(t)&&(VA=t)}function XA(t){var e,i,o,n,r,s;const{axes:l,dataId:a,data:h,spec:d,ClassType:c,canvas:u,mode:g,modeParams:p,dpr:f}=t.attribute;let{chartInstance:v}=t;v||(v=new c(d,{renderCanvas:u,mode:"node"===g?"node":"desktop-browser",modeParams:p,canvasControled:!1,viewBox:{x1:0,x2:0,y1:0,y2:0},dpr:f,interactive:!1,animation:!1,autoFit:!1}),v.renderSync(),t.chartInstance=v);const m=t.getViewBox();m.x2<=m.x1&&(m.x2=m.x1+1),m.y2<=m.y1&&(m.y2=m.y1+1),v.updateViewBox({x1:0,x2:m.x2-m.x1,y1:0,y2:m.y2-m.y1},!1,!1);const b=v.getStage(),C=t.globalTransMatrix.clone(),y=t.stage.window.getViewBoxTransform();C.multiply(y.a,y.b,y.c,y.d,y.e,y.f),b.window.setViewBoxTransform&&b.window.setViewBoxTransform(C.a,C.b,C.c,C.d,C.e,C.f);const{table:w}=t.getRootNode();let x=!1;if(w.options.specFormat){const e=w.options.specFormat(t.attribute.spec);if(e.needFormatSpec&&e.spec){const t=e.spec;v.updateSpecSync(t),x=!0}}if(!x)if(null==l||l.forEach(((t,e)=>{var i,o,n,r;"band"===t.type?v.updateModelSpec({type:"axes",index:e},{domain:t.domain.slice(0)},!0):v.updateModelSpecSync({type:"axes",index:e},{min:null!==(o=null===(i=t.range)||void 0===i?void 0:i.min)&&void 0!==o?o:0,max:null!==(r=null===(n=t.range)||void 0===n?void 0:n.max)&&void 0!==r?r:0},!0)})),null===(i=null===(e=w.internalProps.layoutMap)||void 0===e?void 0:e.updateDataStateToActiveChartInstance)||void 0===i||i.call(e,v),"string"==typeof a)v.updateDataSync(a,null!=h?h:[]);else{const t=[];for(const e in a){const i=a[e],s=d.series.find((t=>{var i;return(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.id)===e}));t.push({id:e,values:i?null!==(o=null==h?void 0:h.filter((t=>t.hasOwnProperty(i))))&&void 0!==o?o:[]:null!=h?h:[],fields:null===(n=null==s?void 0:s.data)||void 0===n?void 0:n.fields}),v.updateFullDataSync||v.updateDataSync(e,i?null!==(r=null==h?void 0:h.filter((t=>t.hasOwnProperty(i))))&&void 0!==r?r:[]:null!=h?h:[])}null===(s=v.updateFullDataSync)||void 0===s||s.call(v,t)}!function(t,e){var i;const{viewWidth:o,viewHeight:n}=t;if(o<ZA&&n<ZA)return e.cacheCanvas=qA(t),void(e.isShareChartSpec||(null===(i=e.chartInstance)||void 0===i||i.release(),e.chartInstance=null,e.setAttribute("chartInstance",null)));const r=Math.ceil(n/ZA),s=Math.ceil(o/ZA),l=[];for(let e=0;e<r;e++)for(let i=0;i<s;i++){const r=i*ZA,s=e*ZA,a=r+ZA>o?o:r+ZA,h=s+ZA>n?n:s+ZA,d=a-r,c=h-s,u=new ke;u.setValue(r,s,a,h);const g=qA(t,!1,u);l.push({canvas:g,x:r,y:s,width:d,height:c})}e.cacheCanvas=l}(v.getStage(),t)}function KA(t){$A=!0,UA.length>0?requestAnimationFrame((()=>{const e=UA.splice(0,VA);jA.splice(0,VA),e.forEach((t=>{XA(t),t.addUpdateBoundTag()})),t.render(),KA(t)})):$A=!1}const ZA=2e3;function qA(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;if("released"===t.releaseStatus)return null;const o=t.window.getViewBoxTransform(),n=function(t){let e=arguments.length>2?arguments[2]:void 0;const i=t.window.getViewBoxTransform(),o=Qo.get(ln),n=e?-e.x1:0,r=e?-e.y1:0,s=e?e.x2:t.viewWidth,l=e?e.y2:t.viewHeight,a=e?e.width():t.viewWidth,h=e?e.height():t.viewHeight;return o.create({viewBox:{x1:n,y1:r,x2:s,y2:l},width:a*i.a,height:h*i.d,dpr:t.window.dpr,canvasControled:!0,offscreen:!0,title:""}),t.renderTo(o),o}(t,e,i);n.setViewBoxTransform(o.a,o.b,o.c,o.d,0,0),t.renderTo(n);const r=n.getNativeHandler();return r.nativeCanvas?r.nativeCanvas:null}var JA=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const QA=Symbol.for("ChartRender");let tR=class extends dl{constructor(){super(...arguments),this.numberType=NA}drawShape(t,e,i,o,n,r,s,l){var a,h,d,c;const u=_n(t,null==r?void 0:r.theme).group,{dataId:g,data:p,spec:f}=t.attribute,{width:v=u.width,height:m=u.height}=(t.getViewBox(),t.attribute),{table:b}=t.getRootNode(),{active:C,cacheCanvas:y,activeChartInstance:w}=t;if(!C&&y)et(y)?y.forEach((t=>{const{x:i,y:o,width:n,height:r,canvas:s}=t;e.drawImage(s,i,o,n,r)})):e.drawImage(y,i,o,v,m);else if(w){if(b.options.specFormat){const e=b.options.specFormat(t.attribute.spec);if(e.needFormatSpec&&e.spec){const t=e.spec;return void w.updateSpecSync(t)}}const e=t.getViewBox();w.updateViewBox({x1:0,x2:e.x2-e.x1,y1:0,y2:e.y2-e.y1},!1,!1);const i=w.getStage();i.needRender=!0;const o=t.globalTransMatrix.clone(),n=t.stage.window.getViewBoxTransform().clone();if(n.multiply(o.a,o.b,o.c,o.d,o.e,o.f),i.window.setViewBoxTransform(n.a,n.b,n.c,n.d,n.e,n.f),"string"==typeof g)w.updateDataSync(g,null!=p?p:[]);else{const t=[];for(const e in g){const i=g[e],o=f.series.find((t=>{var i;return(null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.id)===e}));t.push({id:e,values:i?null!==(a=null==p?void 0:p.filter((t=>t.hasOwnProperty(i))))&&void 0!==a?a:[]:null!=p?p:[],fields:null===(h=null==o?void 0:o.data)||void 0===h?void 0:h.fields}),w.updateFullDataSync||w.updateDataSync(e,i?null!==(d=null==p?void 0:p.filter((t=>t.hasOwnProperty(i))))&&void 0!==d?d:[]:null!=p?p:[])}null===(c=w.updateFullDataSync)||void 0===c||c.call(w,t)}}else b.internalProps.renderChartAsync?(-1===jA.indexOf(`${t.parent.col}+${t.parent.row}`)&&(jA.push(`${t.parent.col}+${t.parent.row}`),UA.push(t)),$A||KA(b)):XA(t)}draw(t,e,i,o){this._draw(t,{},!1,i,o)}};tR=JA([f()],tR);var eR=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let iR=class{constructor(){this.time=Ai.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{shape:g}=t.attribute;if("circle"===g){const{width:n=a.width,height:r=a.height}=t.attribute;e.beginPath(),e.arc(i+n/2,o+r/2,Math.min(n,r)/2,0,2*Math.PI),e.closePath(),e.save(),e.clip()}}};iR=eR([f()],iR);let oR=class{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{shape:g}=t.attribute;"circle"===g&&e.restore()}};oR=eR([f()],oR);let nR=class{constructor(){this.time=Ai.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{isGif:g}=t.attribute;g&&t.playing&&(t.attribute.opacity=0)}};nR=eR([f()],nR);let rR=class{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{isGif:g}=t.attribute;g&&t.playing&&(t.attribute.opacity=1,e.globalAlpha=t.attribute.opacity,t.renderFrame(e,i,o))}};function sR(t,e,i,o){var n;const{highlightScope:r,disableHeader:s,cellPos:l}=t.hover,a=t.table,h=a.isHeader(e,i);if(h&&s)return;let d;if(r===vy.single&&l.col===e&&l.row===i?d="cellBgColor":r===vy.column&&l.col===e?d=l.col===e&&l.row===i?"cellBgColor":"inlineColumnBgColor":r===vy.row&&l.row===i?d=l.col===e&&l.row===i?"cellBgColor":"inlineRowBgColor":r===vy.cross&&(l.col===e&&l.row===i?d="cellBgColor":l.col===e?d="inlineColumnBgColor":l.row===i&&(d="inlineRowBgColor")),d){let t;if(h){const r=a.getHeaderDefine(e,i);t=null==r?void 0:r.disableHeaderHover,o.firstChild&&"axis"===o.firstChild.name&&(null===(n=a.options.hover)||void 0===n?void 0:n.disableAxisHover)&&(t=!0)}else{const o=a.getBodyColumnDefine(e,i);t=null==o?void 0:o.disableHover}t&&(d=void 0)}return d}function lR(t,e,i,o){const{highlightInRange:n,disableHeader:r,ranges:s}=t.select;let l;const a=1===s.length&&function(t){return t.start.col!==t.end.col||t.start.row!==t.end.row}(null==s?void 0:s[0])&&n;if(a?1===(null==s?void 0:s.length)&&s[0].start&&s[0].end:1===(null==s?void 0:s.length)&&s[0].end.col===s[0].start.col&&s[0].end.row===s[0].start.row){const o=t.table,n=o.isHeader(e,i);if(n&&r)return;if(l=a?function(t,e,i){let o;const{highlightScope:n,cellPos:r,ranges:s}=t.select,l=s[0],a=Math.min(l.start.col,l.end.col),h=Math.max(l.start.col,l.end.col),d=Math.min(l.start.row,l.end.row),c=Math.max(l.start.row,l.end.row);return n===vy.single&&r.col===e&&r.row===i?o="cellBgColor":n===vy.column&&e>=a&&e<=h?o=vw(s[0],e,i)?"cellBgColor":"inlineColumnBgColor":n===vy.row&&i>=d&&i<=c?o=vw(s[0],e,i)?"cellBgColor":"inlineRowBgColor":n===vy.cross&&(vw(s[0],e,i)?o="cellBgColor":e>=a&&e<=h?o="inlineColumnBgColor":i>=d&&i<=c&&(o="inlineRowBgColor")),o}(t,e,i):function(t,e,i){let o;const{highlightScope:n,cellPos:r}=t.select;return n===vy.single&&r.col===e&&r.row===i?o="cellBgColor":n===vy.column&&r.col===e?o=r.col===e&&r.row===i?"cellBgColor":"inlineColumnBgColor":n===vy.row&&r.row===i?o=r.col===e&&r.row===i?"cellBgColor":"inlineRowBgColor":n===vy.cross&&(r.col===e&&r.row===i?o="cellBgColor":r.col===e?o="inlineColumnBgColor":r.row===i&&(o="inlineRowBgColor")),o}(t,e,i),l){let t;if(n){const n=o.getHeaderDefine(e,i);t=null==n?void 0:n.disableHeaderSelect}else{const n=o.getBodyColumnDefine(e,i);t=null==n?void 0:n.disableSelect}t&&(l=void 0)}}else if("replace"===t.table.theme.selectionStyle.selectionFillMode)for(let t=0;t<s.length;t++){const o=s[t],n=Math.min(o.start.col,o.end.col),r=Math.max(o.start.col,o.end.col),a=Math.min(o.start.row,o.end.row),h=Math.max(o.start.row,o.end.row);if(n<=e&&a<=i&&r>=e&&h>=i){l="cellBgColor";break}}return l}function aR(t,e,i){const o=t.getBodyColumnDefine(e,i),n=t.isHeader(e,i);return!(!(null==o?void 0:o.disableSelect)||n)||!(!n||!(null==o?void 0:o.disableHeaderSelect))}rR=eR([f()],rR);var hR=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let dR=class{constructor(){this.time=Ai.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{stroke:g=a.stroke,strokeArrayWidth:p=a.strokeArrayWidth,strokeArrayColor:f=a.strokeArrayColor}=t.attribute;g&&(Array.isArray(p)||Array.isArray(f))&&(u.doStroke=!1)}};dR=hR([f()],dR);let cR=class{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u,g;const{stroke:p=a.stroke,strokeArrayColor:f=a.strokeArrayColor,strokeArrayWidth:v=a.strokeArrayWidth,lineWidth:m=a.lineWidth,strokeColor:b=a.stroke,cornerRadius:C=a.cornerRadius}=t.attribute;let y,w,{width:x=a.width,height:_=a.height}=t.attribute;if(p&&(Array.isArray(v)||0!==m)&&(Array.isArray(f)||Array.isArray(v))){if("number"==typeof m&&1&m||Array.isArray(v)&&v.some((t=>1&t))){const e=t.stage.table;if(!e)return;const n="bottom-right"===(null===(u=null==e?void 0:e.theme)||void 0===u?void 0:u.cellBorderClipDirection);if(n){if(i=Math.floor(i)-.5,o=Math.floor(o)-.5,"cell"===t.role){const e=t.col,n=t.row;0===e&&(i+=1),0===n&&(o+=1)}}else i=Math.floor(i)+.5,o=Math.floor(o)+.5;(null===(g=e.options.customConfig)||void 0===g?void 0:g._disableColumnAndRowSizeRound)&&(x=Math.round(x),_=Math.round(_));const{width:r,height:s}=_R(t,Math.ceil(x),Math.ceil(_),n);y=r,w=s}else y=Math.ceil(x),w=Math.ceil(_);0===C||et(C)&&C.every((t=>0===t))?gR(t,e,i,o,a,p,v||m,f||b,y,w):(e.beginPath(),El(e,i,o,y,w,C,new Array(4).fill(0).map(((n,r)=>(n,s,l,h)=>{BR(r,n,s,l,h,t,e,i,o,a,p,v||m,f||b,y,w)}))),e.stroke())}}};function uR(t){if(!Array.isArray(t))return{isSplitDraw:!1,width:t};let e;for(let i=0;i<t.length;i++){const o=t[i];if(o)if(e){if(o!==e)return{isSplitDraw:!0}}else e=o}return{isSplitDraw:!1,width:e}}function gR(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f;const v=uR(s),m=!Array.isArray(s),b=!Array.isArray(r),C=Array.isArray(c),y=Array.isArray(l)||v.isSplitDraw;e.setStrokeStyle(t,t.attribute,i,o,n);const{lineDash:w=n.lineDash}=t.attribute;let x=!1;w.length&&w.some((t=>Array.isArray(t)))&&(x=!0),e.beginPath(),e.moveTo(i,o);const _=(b||r[0])&&(m||s[0]),S=(b||r[1])&&(m||s[1]),A=(b||r[2])&&(m||s[2]),R=(b||r[3])&&(m||s[3]);if(_){const t=(m?v.width:s[0])/2,n=(m?v.width:s[0])/2;C&&Array.isArray(c[0])?(e.moveTo(i-t+(a+t+n)*c[0][0],o),e.lineTo(i-t+(a+t+n)*(c[0][1]-c[0][0]),o),e.moveTo(i+a+n,o)):(e.moveTo(i-t,o),e.lineTo(i+a+n,o)),(y||x)&&(l&&l[0]?e.strokeStyle=l[0]:e.strokeStyle="transparent",m||(e.lineWidth=s[0]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,x&&e.setLineDash(null!==(u=w[0])&&void 0!==u?u:[]),e.stroke(),e.beginPath(),e.moveTo(i+a,o))}else e.moveTo(i+a,o);if(S){const t=(m?v.width:s[1])/2,n=(m?v.width:s[1])/2;C&&Array.isArray(c[1])?(e.moveTo(i+a,o-t+h*c[1][0]),e.lineTo(i+a,o-t+(h+t+n)*(c[1][1]-c[1][0])),e.moveTo(i+a,o+h+n)):(e.moveTo(i+a,o-t),e.lineTo(i+a,o+h+n)),(y||x)&&(l&&l[1]?e.strokeStyle=l[1]:e.strokeStyle="transparent",m||(e.lineWidth=s[1]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,x&&e.setLineDash(null!==(g=w[1])&&void 0!==g?g:[]),e.stroke(),e.beginPath(),e.moveTo(i+a,o+h))}else e.moveTo(i+a,o+h);if(A){const t=(m?v.width:s[2])/2,n=(m?v.width:s[2])/2;C&&Array.isArray(c[2])?(e.moveTo(i-t+(a+t+n)*c[2][0],o+h),e.lineTo(i-t+(a+t+n)*(c[2][1]-c[2][0]),o+h),e.moveTo(i-t,o+h)):(e.moveTo(i-t,o+h),e.lineTo(i+a+n,o+h)),(y||x)&&(l&&l[2]?e.strokeStyle=l[2]:e.strokeStyle="transparent",m||(e.lineWidth=s[2]),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,x&&e.setLineDash(null!==(p=w[2])&&void 0!==p?p:[]),e.stroke(),e.beginPath(),e.moveTo(i,o+h))}else e.moveTo(i,o+h);if(R){const t=(m?v.width:s[3])/2,n=(m?v.width:s[3])/2;C&&Array.isArray(c[3])?(e.moveTo(i,o-t+(h+t+n)*c[3][0]),e.lineTo(i,o-t+(h+t+n)*(c[3][1]-c[3][0])),e.moveTo(i,o-t)):(e.moveTo(i,o-t),e.lineTo(i,o+h+n)),(y||x)&&(l&&l[3]?e.strokeStyle=l[3]:e.strokeStyle="transparent",m||(e.lineWidth=s[3]),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,x&&e.setLineDash(null!==(f=w[3])&&void 0!==f?f:[]),e.stroke(),e.beginPath(),e.moveTo(i,o))}else e.moveTo(i,o);y||x||(!m&&v.width&&(e.lineWidth=v.width),e.stroke()),e.lineDashOffset=0,e.setLineDash([])}cR=hR([f()],cR);let pR=class{constructor(){this.time=Ai.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g;const{lineDash:p=a.lineDash,stroke:f=a.stroke,strokeArrayColor:v=a.strokeArrayColor,strokeArrayWidth:m=a.strokeArrayWidth}=t.attribute;f&&Array.isArray(p)&&p.length&&(null===(g=p[0])||void 0===g?void 0:g.length)&&!Array.isArray(v)&&!Array.isArray(m)&&(u.doStroke=!1)}};pR=hR([f()],pR);let fR=class{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f,v,m;const{lineDash:b=a.lineDash,stroke:C=a.stroke,strokeArrayColor:y=a.strokeArrayColor,strokeArrayWidth:w=a.strokeArrayWidth,lineWidth:x=a.lineWidth}=t.attribute;if(!C||!(Array.isArray(b)&&b.length&&(null===(u=b[0])||void 0===u?void 0:u.length))||Array.isArray(y)||Array.isArray(w))return;const _=t.stage.table;if(!_)return;const S=et(b[0])?function(t){return 1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:t}(b):[b,b,b,b];let A,R,{width:B=a.width,height:M=a.height}=t.attribute;if((null===(g=_.options.customConfig)||void 0===g?void 0:g._disableColumnAndRowSizeRound)?(B=Math.round(B),M=Math.round(M)):(B=Math.ceil(B),M=Math.ceil(M)),1&x){const e="bottom-right"===_.theme.cellBorderClipDirection,n=0,r=0;e?(i=Math.floor(i)-.5,o=Math.floor(o)-.5,"cell"===t.role&&(0===t.col&&(i+=1),0===t.row&&(o+=1))):(i=Math.floor(i)+.5,o=Math.floor(o)+.5);const{width:s,height:l}=_R(t,Math.ceil(B+n),Math.ceil(M+r),e);A=s,R=l}else A=Math.ceil(B),R=Math.ceil(M);e.setStrokeStyle(t,t.attribute,i,o,a),e.beginPath(),e.moveTo(i,o),e.lineTo(i+A,o),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.setLineDash(null!==(p=S[0])&&void 0!==p?p:[]),e.stroke(),e.beginPath(),e.moveTo(i+A,o),e.lineTo(i+A,o+R),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.setLineDash(null!==(f=S[1])&&void 0!==f?f:[]),e.stroke(),e.beginPath(),e.moveTo(i,o+R),e.lineTo(i+A,o+R),e.lineDashOffset=e.currentMatrix.e/e.currentMatrix.a,e.setLineDash(null!==(v=S[2])&&void 0!==v?v:[]),e.stroke(),e.beginPath(),e.moveTo(i,o),e.lineTo(i,o+R),e.lineDashOffset=e.currentMatrix.f/e.currentMatrix.d,e.setLineDash(null!==(m=S[3])&&void 0!==m?m:[]),e.stroke(),e.lineDashOffset=0,e.setLineDash([])}};fR=hR([f()],fR);let vR=class{constructor(){this.time=Ai.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{lineWidth:g=a.lineWidth,stroke:p=a.stroke,lineDash:f=a.lineDash,strokeArrayWidth:v=a.strokeArrayWidth,strokeArrayColor:m=a.strokeArrayColor,notAdjustPos:b}=t.attribute;!0!==b&&p&&Array.isArray(f)&&!f.length&&!Array.isArray(m)&&!Array.isArray(v)&&1&g&&(u.doStroke=!1)}};vR=hR([f()],vR);let mR=class{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){var u,g;const{lineWidth:p=a.lineWidth,stroke:f=a.stroke,lineDash:v=a.lineDash,strokeArrayWidth:m=a.strokeArrayWidth,strokeArrayColor:b=a.strokeArrayColor,notAdjustPos:C,cornerRadius:y=a.cornerRadius}=t.attribute;let{width:w=a.width,height:x=a.height}=t.attribute;if(!0!==C&&f&&Array.isArray(v)&&!v.length&&!Array.isArray(b)&&!Array.isArray(m)&&1&p){const n=t.stage.table;if(!n)return;(null===(u=n.options.customConfig)||void 0===u?void 0:u._disableColumnAndRowSizeRound)&&(w=Math.round(w),x=Math.round(x)),e.beginPath();const r="bottom-right"===(null===(g=null==n?void 0:n.theme)||void 0===g?void 0:g.cellBorderClipDirection),s=0,l=0;r?(i=Math.floor(i)-.5,o=Math.floor(o)-.5,"cell"===t.role&&(0===t.col&&(i+=1),0===t.row&&(o+=1))):(i=Math.floor(i)+.5,o=Math.floor(o)+.5);const{width:h,height:d}=_R(t,Math.ceil(w),Math.ceil(x),r);y?El(e,i,o,h+s,d+l,y):e.rect(i,o,h,d),e.setStrokeStyle(t,t.attribute,i,o,a),e.stroke()}}};mR=hR([f()],mR);let bR=class{constructor(){this.time=Ai.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){if("cell"===t.role){const e=t.stage.table;if(e){const i=function(t,e){var i,o,n,r,s,l,a,h,d,c,u;let g,p;if("cell"===t.role&&K(t.mergeStartCol)&&K(t.mergeStartRow)&&K(t.mergeEndCol)&&K(t.mergeEndRow)){const{colStart:i,colEnd:o,rowStart:n,rowEnd:r}=hA(t,e.scenegraph);for(let t=i;t<=o;t++)for(let i=n;i<=r;i++){const o=lR(e.stateManager,t,i);!o||g&&"cellBgColor"!==o||(g=o)}}else"cell"===t.role&&(g=lR(e.stateManager,t.col,t.row));if(!g)return;const f=e.internalProps.layoutMap;return f.isCornerHeader(t.col,t.row)?p=(null===(i=e.theme.cornerHeaderStyle)||void 0===i?void 0:i.select)||(null===(o=e.theme.headerStyle)||void 0===o?void 0:o.select):f.isColumnHeader(t.col,t.row)?p=null===(n=e.theme.headerStyle)||void 0===n?void 0:n.select:f.isRowHeader(t.col,t.row)?p=null===(r=e.theme.rowHeaderStyle)||void 0===r?void 0:r.select:f.isBottomFrozenRow(t.col,t.row)?p=(null===(s=e.theme.bottomFrozenStyle)||void 0===s?void 0:s.select)||(e.isListTable()?null===(l=e.theme.bodyStyle)||void 0===l?void 0:l.select:null===(a=e.theme.headerStyle)||void 0===a?void 0:a.select):f.isRightFrozenColumn(t.col,t.row)?p=(null===(h=e.theme.rightFrozenStyle)||void 0===h?void 0:h.select)||(e.isListTable()?null===(d=e.theme.bodyStyle)||void 0===d?void 0:d.select:null===(c=e.theme.rowHeaderStyle)||void 0===c?void 0:c.select):e.isHeader(t.col,t.row)||(p=null===(u=e.theme.bodyStyle)||void 0===u?void 0:u.select),fS(g,p,t.col,t.row,e)}(t,e);if(i)t.attribute._vtableHightLightFill=i;else if(e.stateManager.interactionState!==fy.scrolling){const i=function(t,e){var i,o,n,r,s,l,a,h,d,c,u;let g,p;if("cell"===t.role&&K(t.mergeStartCol)&&K(t.mergeStartRow)&&K(t.mergeEndCol)&&K(t.mergeEndRow)){const{colStart:i,colEnd:o,rowStart:n,rowEnd:r}=hA(t,e.scenegraph);for(let s=i;s<=o;s++)for(let i=n;i<=r;i++){const o=sR(e.stateManager,s,i,t);!o||g&&"cellBgColor"!==o||(g=o)}}else"cell"===t.role&&(g=sR(e.stateManager,t.col,t.row,t));if(!g)return;const f=e.internalProps.layoutMap;return f.isCornerHeader(t.col,t.row)?p=(null===(i=e.theme.cornerHeaderStyle)||void 0===i?void 0:i.hover)||(null===(o=e.theme.headerStyle)||void 0===o?void 0:o.hover):f.isColumnHeader(t.col,t.row)?p=null===(n=e.theme.headerStyle)||void 0===n?void 0:n.hover:f.isRowHeader(t.col,t.row)?p=null===(r=e.theme.rowHeaderStyle)||void 0===r?void 0:r.hover:f.isBottomFrozenRow(t.col,t.row)?p=(null===(s=e.theme.bottomFrozenStyle)||void 0===s?void 0:s.hover)||(e.isListTable()?null===(l=e.theme.bodyStyle)||void 0===l?void 0:l.hover:null===(a=e.theme.headerStyle)||void 0===a?void 0:a.hover):f.isRightFrozenColumn(t.col,t.row)?p=(null===(h=e.theme.rightFrozenStyle)||void 0===h?void 0:h.hover)||(e.isListTable()?null===(d=e.theme.bodyStyle)||void 0===d?void 0:d.hover:null===(c=e.theme.rowHeaderStyle)||void 0===c?void 0:c.hover):e.isHeader(t.col,t.row)||(p=null===(u=e.theme.bodyStyle)||void 0===u?void 0:u.hover),fS(g,p,t.col,t.row,e)}(t,e);i&&(t.attribute._vtableHightLightFill=i)}}}}};bR=hR([f()],bR);let CR=class{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){if(t.attribute._vtableHightLightFill)if(d);else if(s){const n=t.attribute.fill;t.attribute.fill=t.attribute._vtableHightLightFill,e.setCommonStyle(t,t.attribute,i,o,a),e.fill(),t.attribute.fill=n,t.attribute._vtableHightLightFill=void 0}}};CR=hR([f()],CR);let yR=class{constructor(){this.time=Ai.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g,p,f,v,m,b;const C=t.stage.table;C&&("body"===t.role?xR(e,-(null!==(g=t.attribute.x)&&void 0!==g?g:0)+C.getFrozenColsWidth(),-(null!==(p=t.attribute.y)&&void 0!==p?p:0)+C.getFrozenRowsHeight(),t.parent.attribute.width-C.getFrozenColsWidth()-C.getRightFrozenColsWidth(),t.parent.attribute.height-C.getFrozenRowsHeight()-C.getBottomFrozenRowsHeight()):"row-header"===t.role?xR(e,0,-(null!==(f=t.attribute.y)&&void 0!==f?f:0)+C.getFrozenRowsHeight(),C.getFrozenColsWidth(),t.parent.attribute.height-C.getFrozenRowsHeight()-C.getBottomFrozenRowsHeight()):"col-header"===t.role?xR(e,-(null!==(v=t.attribute.x)&&void 0!==v?v:0)+C.getFrozenColsWidth(),0,t.parent.attribute.width-C.getFrozenColsWidth()-C.getRightFrozenColsWidth(),C.getFrozenRowsHeight()):"right-frozen"===t.role?xR(e,0,-(null!==(m=t.attribute.y)&&void 0!==m?m:0)+C.getFrozenRowsHeight(),C.getRightFrozenColsWidth(),t.parent.attribute.height-C.getFrozenRowsHeight()-C.getBottomFrozenRowsHeight()):"bottom-frozen"===t.role?xR(e,-(null!==(b=t.attribute.x)&&void 0!==b?b:0)+C.getFrozenColsWidth(),0,t.parent.attribute.width-C.getFrozenColsWidth()-C.getRightFrozenColsWidth(),C.getBottomFrozenRowsHeight()):"corner-header"===t.role?xR(e,0,0,C.getFrozenColsWidth(),C.getFrozenRowsHeight()):"corner-right-top-header"===t.role?xR(e,0,0,C.getRightFrozenColsWidth(),C.getFrozenRowsHeight()):"corner-right-bottom-header"===t.role?xR(e,0,0,C.getRightFrozenColsWidth(),C.getBottomFrozenRowsHeight()):"corner-left-bottom-header"===t.role&&xR(e,0,0,C.getFrozenColsWidth(),C.getBottomFrozenRowsHeight()))}};yR=hR([f()],yR);const wR=Math.pow(2,24);function xR(t,e,i,o,n){t.beginPath();const r=t.applyedMatrix;Math.abs(r.f)>wR||Math.abs(r.g)>wR?t.rect(e-wR,i-wR,o+2*wR,n+2*wR):t.rect(e,i,o,n)}function _R(t,e,i,o){const n=t.stage.table;if(!n)return{width:e,height:i};if("cell"===t.role){let r=t.col,s=t.row;const l=nx(n,r,s);l&&(r=l.end.col,s=l.end.row),r!==n.colCount-1||o?(r===n.frozenColCount-1&&n.scrollLeft&&!o||0===r&&o)&&(e-=1):e-=1,s!==n.rowCount-1||o?(s===n.frozenRowCount-1&&n.scrollTop&&!o||0===s&&o)&&(i-=1):i-=1}else"corner-frozen"===t.role&&(n.scrollLeft&&!o&&(e-=1),n.scrollTop&&!o&&(i-=1));return{width:e,height:i}}var SR=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let AR=class{constructor(){this.time=Ai.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){const{stroke:g=a.stroke,strokeArrayWidth:p=a.strokeArrayWidth,strokeArrayColor:f=a.strokeArrayColor}=t.attribute;g&&(Array.isArray(g)||Array.isArray(p)||Array.isArray(f))&&(u.doStroke=!1)}};AR=SR([f()],AR);let RR=class{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c){const{width:u=a.width,height:g=a.height,stroke:p=a.stroke,strokeArrayColor:f=a.strokeArrayColor,strokeArrayWidth:v=a.strokeArrayWidth,lineWidth:m=a.lineWidth,strokeColor:b=a.stroke,cornerRadius:C=a.cornerRadius}=t.attribute;if(p&&(Array.isArray(v)||0!==m)&&(Array.isArray(p)||Array.isArray(f)||Array.isArray(v))){const n=0,r=0;"border-rect"!==t.name&&"table-border-rect"!==t.name&&("number"==typeof m&&1&m||Array.isArray(v)&&v.some((t=>1&t)))&&(i=Math.floor(i)+.5,o=Math.floor(o)+.5),0===C||et(C)&&C.every((t=>0===t))?gR(t,e,i,o,a,p,v||m,f||b,Math.ceil(u+n),Math.ceil(g+r)):(e.beginPath(),El(e,i,o,u,g,C,new Array(4).fill(0).map(((s,l)=>(s,h,d,c)=>{BR(l,s,h,d,c,t,e,i,o,a,p,v||m,f||b,Math.ceil(u+n),Math.ceil(g+r))}))),e.stroke())}}};function BR(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f,v,m,b;const C=r,y=h,w=uR(c),x=!Array.isArray(c),_=!Array.isArray(d),S=Array.isArray(u)||w.isSplitDraw;s.setStrokeStyle(r,r.attribute,l,a,h);const{lineDash:A=y.lineDash}=C.attribute;let R=!1;A.length&&A.some((t=>Array.isArray(t)))&&(R=!0),s.moveTo(l,a);const B=(_||d[0])&&(x||c[0]),M=(_||d[1])&&(x||c[1]),T=(_||d[2])&&(x||c[2]),P=(_||d[3])&&(x||c[3]);B&&0===t?(x?w.width:c[0],x?w.width:c[0],s.moveTo(e,i),s.lineTo(o,n),(S||R)&&(u&&u[0]?s.strokeStyle=u[0]:s.strokeStyle="transparent",x||(s.lineWidth=c[0]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,R&&s.setLineDash(null!==(f=A[0])&&void 0!==f?f:[]),s.stroke(),s.beginPath())):0===t&&s.moveTo(l+g,a),M&&1===t?(x?w.width:c[1],x?w.width:c[1],s.moveTo(e,i),s.lineTo(o,n),(S||R)&&(u&&u[1]?s.strokeStyle=u[1]:s.strokeStyle="transparent",x||(s.lineWidth=c[1]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,R&&s.setLineDash(null!==(v=A[1])&&void 0!==v?v:[]),s.stroke(),s.beginPath(),s.moveTo(l+g,a+p))):1===t&&s.moveTo(l+g,a+p),T&&2===t?(x?w.width:c[2],x?w.width:c[2],s.moveTo(e,i),s.lineTo(o,n),(S||R)&&(u&&u[2]?s.strokeStyle=u[2]:s.strokeStyle="transparent",x||(s.lineWidth=c[2]),s.lineDashOffset=s.currentMatrix.e/s.currentMatrix.a,R&&s.setLineDash(null!==(m=A[2])&&void 0!==m?m:[]),s.stroke(),s.beginPath(),s.moveTo(l,a+p))):2===t&&s.moveTo(l,a+p),P&&3===t?(x?w.width:c[3],x?w.width:c[3],s.moveTo(e,i),s.lineTo(o,n),(S||R)&&(u&&u[3]?s.strokeStyle=u[3]:s.strokeStyle="transparent",x||(s.lineWidth=c[3]),s.lineDashOffset=s.currentMatrix.f/s.currentMatrix.d,R&&s.setLineDash(null!==(b=A[3])&&void 0!==b?b:[]),s.stroke(),s.beginPath(),s.moveTo(l,a))):3===t&&s.moveTo(l,a),S||R||(!x&&w.width&&(s.lineWidth=w.width),s.stroke()),s.lineDashOffset=0,s.setLineDash([]),s.closePath()}RR=SR([f()],RR);var MR=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let TR,PR=class{constructor(){this.order=1,this.interceptors=[new ER]}afterDrawItem(t,e,i,o,n){for(let r=0;r<this.interceptors.length;r++)if(this.interceptors[r].afterDrawItem&&this.interceptors[r].afterDrawItem(t,e,i,o,n))return!0;return!1}beforeDrawItem(t,e,i,o,n){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,o,n))return!0;return!1}};PR=MR([f()],PR);class ER{constructor(){this.order=1}afterDrawItem(t,e,i,o,n){return"image"===t.type&&this.drawItem(t,e,i,o,n),!1}drawItem(t,e,i,o,n){const{image:r,gif:s}=t.attribute;if(s&&t.playing)return!1;if(!r||!t.resources)return!1;const l=t.resources.get(r);if(!l||"loading"!==l.state)return!1;if(!TR){const t=cS(),e=t.loading_pic.svg,i=t.loading_pic.width,o=t.loading_pic.height;TR=lc({width:i,height:o,image:e})}const{image:a}=TR.attribute;if(!r||!TR.resources)return!1;const h=TR.resources.get(a);if("success"!==h.state)return!1;const{context:d}=i;d.highPerformanceSave(),t.parent&&d.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&d.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const c=t.AABBBounds,{width:u,height:g}=gS(h.data.width,h.data.height,c.width(),c.height());return d.drawImage(h.data,c.x1+(c.width()-u)/2,c.y1+(c.height()-g)/2,u,g),d.highPerformanceRestore(),!0}}var kR=function(t,e,i,o){var n,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};let LR=class{constructor(){this.time=Ai.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,o,n,r,s,l,a,h,d,c,u){var g,p;const{text:f,underline:v=a.underline,lineThrough:m=a.lineThrough,direction:b=a.direction,whiteSpace:C=a.whiteSpace,fontSize:y=a.fontSize,verticalMode:w=a.verticalMode,ellipsis:x=a.ellipsis,textAlign:_=a.textAlign,textBaseline:S=a.textBaseline,x:A=a.x,y:R=a.y}=t.attribute;let B=!1;if(Array.isArray(t)){const e=null===(g=t.cache)||void 0===g?void 0:g.layoutData;x&&e&&e.lines.every((t=>""===t.str))&&(B=!0)}else{const{cache:e}=t;x&&e&&""===e.clipedText&&0===e.clipedWidth&&(B=!0)}if(!B)return;const M=tt(x)?x:"...",T=null!==(p=ar(t.attribute.lineHeight,y))&&void 0!==p?p:y;let P=0;T!==y&&("top"===S?P=(T-y)/2:"middle"===S||"bottom"===S&&(P=-(T-y)/2)),r&&(c?c(e,t.attribute,a):l&&(e.setStrokeStyle(t,t.attribute,A-i,R-o,a),e.strokeText(M,A,R+P))),n&&(d?d(e,t.attribute,a):s&&(e.setCommonStyle(t,t.attribute,A-i,R-o,a),e.fillText(M,A,R+P),this.drawUnderLine(v,m,t,A,R+P,0,a,e,M)))}drawUnderLine(t,e,i,o,n,r,s,l,a){if(e+t<=0)return;const{textAlign:h=s.textAlign,textBaseline:d=s.textBaseline,fontSize:c=s.fontSize,fontFamily:u=s.fontFamily,fontWeight:g=s.fontWeight,fontStyle:p=s.fontStyle,fill:f=s.fill,opacity:v=s.opacity,underlineOffset:m=s.underlineOffset,underlineDash:b=s.underlineDash,fillOpacity:C=s.fillOpacity}=i.attribute;if(!t&&!e)return;const y=JS.measureTextWidth(a,{fontSize:c,fontFamily:u,fontWeight:g,fontStyle:p}),w=Xs(h,y),x=Ks(d,c,c),_={lineWidth:0,stroke:f,opacity:v,strokeOpacity:C};if(t){_.lineWidth=t,l.setStrokeStyle(i,_,o,n,s),l.setLineDash(b),l.beginPath();const e=n+x+c+m;l.moveTo(o+w,e,r),l.lineTo(o+w+y,e,r),l.stroke()}if(e){_.lineWidth=e,l.setStrokeStyle(i,_,o,n,s),l.beginPath();const t=n+x+c/2;l.moveTo(o+w,t,r),l.lineTo(o+w+y,t,r),l.stroke()}}};LR=kR([f()],LR);var HR=new i(((t,e,i,o)=>{i(Hl)?o(Hl).to(AR).inSingletonScope():(t(AR).toSelf().inSingletonScope(),t(Us).toService(AR)),i(Fl)?o(Fl).to(RR).inSingletonScope():(t(RR).toSelf().inSingletonScope(),t(Us).toService(RR)),t(tR).toSelf().inSingletonScope(),t(QA).to(tR),t(eh).to(tR),t(iR).toSelf().inSingletonScope(),t(Ns).toService(iR),t(oR).toSelf().inSingletonScope(),t(Ns).toService(oR),t(nR).toSelf().inSingletonScope(),t(Ns).toService(nR),t(rR).toSelf().inSingletonScope(),t(Ns).toService(rR),t(bR).toSelf().inSingletonScope(),t(Ws).toService(bR),t(CR).toSelf().inSingletonScope(),t(Ws).toService(CR),t(cR).toSelf().inSingletonScope(),t(Ws).toService(cR),t(dR).toSelf().inSingletonScope(),t(Ws).toService(dR),t(pR).toSelf().inSingletonScope(),t(Ws).toService(pR),t(fR).toSelf().inSingletonScope(),t(Ws).toService(fR),t(vR).toSelf().inSingletonScope(),t(Ws).toService(vR),t(mR).toSelf().inSingletonScope(),t(Ws).toService(mR),t(yR).toSelf().inSingletonScope(),t(Ws).toService(yR),t(PR).toSelf().inSingletonScope(),t(fh).toService(PR),t(LR).toSelf().inSingletonScope(),t($s).toService(LR)}));function FR(t,e,i,o){var n,r,s,l,a,h,d,c;t.internalProps.columnWidthConfig&&t._parseColumnWidthConfig(t.internalProps.columnWidthConfig),e=null!=e?e:0,i=null!=i?i:t.colCount-1,0===e&&i===t.colCount-1&&t._clearColRangeWidthsMap();const u=t.internalProps.layoutMap;t.isPivotTable()&&(u.enableUseGetBodyCache(),u.enableUseHeaderPathCache());const g=[],p=[];if(o)for(let e=0;e<t.colCount;e++)g[e]=t.getColWidth(e);for(let a=e;a<=i;a++){let e;if(t.internalProps.transpose||"only-header"!==(null===(r=null===(n=t.internalProps.layoutMap.columnObjects)||void 0===n?void 0:n[a])||void 0===r?void 0:r.columnWidthComputeMode)&&"only-header"!==t.columnWidthComputeMode||!("showHeader"in t.internalProps.layoutMap))e=t.internalProps.transpose||"only-body"!==(null===(l=null===(s=t.internalProps.layoutMap.columnObjects)||void 0===s?void 0:s[a])||void 0===l?void 0:l.columnWidthComputeMode)&&"only-body"!==t.columnWidthComputeMode?zR(a,0,t.rowCount-1,t):zR(a,t.internalProps.layoutMap.getBodyRange().start.row,t.internalProps.layoutMap.getBodyRange().end.row,t);else{const i=t.internalProps.layoutMap.showHeader;t.internalProps.layoutMap.showHeader=!0,e=zR(a,0,t.internalProps.layoutMap.headerLevelCount-1,t),t.internalProps.layoutMap.showHeader=i}t._setColContentWidth(a,e),t.getColWidth(a)!==e&&t._clearColRangeWidthsMap(a),o?p[a]=Math.round(t._adjustColWidth(a,e)):t._setColWidth(a,t._adjustColWidth(a,e),!1,!0)}if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,n=0,r=t.colCount;if("only-body"===t.widthAdaptiveMode){for(let e=0;e<t.colCount;e++){const n=o&&null!==(a=p[e])&&void 0!==a?a:t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=n)}n=t.rowHeaderLevelCount,r=t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount}NR(e-i,n,r,o,p,t)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,n=0;for(let e=0;e<t.colCount;e++){const r=o&&null!==(h=p[e])&&void 0!==h?h:t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=r),n+=r}n<e&&n>i&&NR(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,o,p,t)}if(o){for(let e=0;e<t.colCount;e++){const i=null!==(c=null!==(d=p[e])&&void 0!==d?d:t.getColWidth(e))&&void 0!==c?c:t.getColWidth(e);i!==g[e]&&t._setColWidth(e,i,!1,!0)}t.stateManager.checkFrozen();for(let e=0;e<t.colCount;e++){const i=t.getColWidth(e);i!==g[e]&&t.scenegraph.updateColWidth(e,i-g[e],!0,!0)}t.scenegraph.updateContainer(!0)}t.isPivotTable()&&(u.disableUseGetBodyCache(),u.disableUseHeaderPathCache())}function zR(t,e,i,o){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=function(t,e){const i=e.getColWidthDefined(t);return e.internalProps._widthResizedColMap.has(t)?e.getColWidth(t):i}(t,o);return o.internalProps.transpose&&"auto"===r&&("only-header"===o.columnWidthComputeMode&&t>=o.rowHeaderLevelCount||"only-body"===o.columnWidthComputeMode&&t<o.rowHeaderLevelCount)&&(r=o.getDefaultColumnWidth(t)),n&&!o.internalProps.transpose?IR(r,t,e,i,n,o):"number"==typeof r?r:"auto"!==r&&"string"==typeof r?o._adjustColWidth(t,o._colWidthDefineToPxWidth(r)):IR(r,t,e,i,n,o)}function IR(t,e,i,o,n,r){var s,l,a,h,d;let c=0,u=1,g=1;if(o-i>5e3&&(g=Math.ceil((o-i)/5e3)),r.isPivotChart()&&e>=r.rowHeaderLevelCount&&e<r.colCount-r.rightFrozenColCount){if(r.internalProps.layoutMap.indicatorsAsCol)return r.defaultColWidth;{const t=r.internalProps.layoutMap.getOptimunWidthForChart(e);if(t>0)return t}}for(let p=i;p<=o;p+=u){if(r.isPivotChart()){const t=r.internalProps.layoutMap,i=t.getAxisConfigInPivotChart(e,p);if(i){const t=rx.getFunction("computeAxisComponentWidth")(i,r);if("number"==typeof t){c=Math.max(t,c);continue}}else if(t.isLeftBottomCorner(e,p)||t.isRightTopCorner(e,p)||t.isRightBottomCorner(e,p))continue}const i=OR(e,p,r);if(i&&(c=Math.max(i.width,c),!i.renderDefault))continue;const o=t;if("number"==typeof o&&"standard"===r.widthMode&&!n){c=Math.max(o,c);continue}const f=r.isHeader(e,p)?null===(s=r._getHeaderLayoutMap(e,p))||void 0===s?void 0:s.headerType:r.getBodyColumnType(e,p);if(K(f)&&"text"!==f&&"link"!==f&&"progressbar"!==f&&"checkbox"!==f&&"radio"!==f){c=Math.max(c,r.getColWidthDefinedNumber(e)||0);continue}let v=0;const m=r.internalProps.layoutMap;if(m.isHeader(e,p)){const t=m.getHeader(e,p);if("only-body"===(null===(l=null==t?void 0:t.define)||void 0===l?void 0:l.columnWidthComputeMode))continue;K(null==t?void 0:t.hierarchyLevel)&&(v=(null!==(a=t.hierarchyLevel)&&void 0!==a?a:0)*(null!==(h=m.rowHierarchyIndent)&&void 0!==h?h:0),m.rowHierarchyTextStartAlignment&&!r.internalProps.headerHelper.getHierarchyIcon(e,p)&&(v+=r.internalProps.headerHelper.getHierarchyIconWidth()))}else if(r.isListTable()){u=g;const t=r.getBodyColumnDefine(e,p);if(null==t?void 0:t.tree){const t=r.dataSource.getIndexKey(r.getRecordShowIndexByCell(e,p));v=Array.isArray(t)&&r.getHierarchyState(e,p)!==by.none?(t.length-1)*(null!==(d=m.hierarchyIndent)&&void 0!==d?d:0):0,m.hierarchyTextStartAlignment&&!r.internalProps.bodyHelper.getHierarchyIcon(e,p)&&(v+=r.internalProps.headerHelper.getHierarchyIconWidth())}}const b=DR(e,p,f,r);c=Math.max(b+v,c),u>1&&r.bottomFrozenRowCount>0&&p<r.rowCount-r.bottomFrozenRowCount&&p+u>=r.rowCount-r.bottomFrozenRowCount&&(p=r.rowCount-r.bottomFrozenRowCount-u,u=1,g=1)}const p=r.getMinColWidth(e),f=r.getMaxColWidth(e);return c<p?p:c>f?f:(c<=0&&(c=r.defaultColWidth),c)}function OR(t,e,i){var o,n,r,s,l,a,h;const d=i.getCustomRender(t,e);let c=i.getCustomLayout(t,e);if(d||c){let u,g=1,p=0,f=!1,v=!1;(i.isHeader(t,e)||(null===(o=i.getBodyColumnDefine(t,e))||void 0===o?void 0:o.mergeCell)||i.hasCustomMerge())&&(u=i.getCellRange(t,e),g=u.end.col-u.start.col+1);const m={col:null!==(n=null==u?void 0:u.start.col)&&void 0!==n?n:t,row:null!==(r=null==u?void 0:u.start.row)&&void 0!==r?r:e,dataValue:i.getCellOriginValue(t,e),value:i.getCellValue(t,e)||"",rect:WR(t,e,i),table:i,originCol:t,originRow:e};if("react-custom-layout"===c&&(c=(null===(s=i.reactCustomLayout)||void 0===s?void 0:s.getCustomLayoutFunc(t,e))||x_),Y(c)){const t=c(m);if(t.rootContainer){t.rootContainer=H_(t.rootContainer),L_(t.rootContainer,0,i.getRowHeight(e));const o=t.rootContainer.attribute.width;t.rootContainer.setStage(i.scenegraph.stage),p=o>0?o:null!==(l=t.rootContainer.AABBBounds.width())&&void 0!==l?l:0,f=t.renderDefault,v=t.enableCellPadding}else p=0,f=t.renderDefault,v=t.enableCellPadding}else if("function"==typeof d){const t=d(m);p=null!==(a=null==t?void 0:t.expectedWidth)&&void 0!==a?a:0,f=null==t?void 0:t.renderDefault}else p=null!==(h=null==d?void 0:d.expectedWidth)&&void 0!==h?h:0,f=null==d?void 0:d.renderDefault;if(p=Math.ceil(p),v){const o=Fx(fS("padding",i._getCellStyle(t,e),t,e,i));p+=o[1]+o[3]}return{width:p/g,renderDefault:f}}}function DR(t,e,i,o){var n,r,s;let l=0;const a=o.getCellValue(t,e),h=o._getCellStyle(t,e);let d=0,c=!1;if("body"!==o.getCellLocation(t,e))c=!0;else{const i=o.getBodyColumnDefine(t,e);c=!!(null==i?void 0:i.icon)||!!(null==i?void 0:i.tree)||(null==i?void 0:i.dragOrder)}if(c){const i=o.getCellIcons(t,e);null==i||i.forEach((t=>{var e,i,o;t.positionType!==wy.absoluteRight&&(d+=(null!==(e=t.width)&&void 0!==e?e:0)+(null!==(i=t.marginLeft)&&void 0!==i?i:0)+(null!==(o=t.marginRight)&&void 0!==o?o:0))}))}let u=1;if(o.isHeader(t,e)||(null===(n=o.getBodyColumnDefine(t,e))||void 0===n?void 0:n.mergeCell)||o.hasCustomMerge()){const i=o.getCellRange(t,e);u=i.end.col-i.start.col+1}const g=Fx(fS("padding",h,t,e,o)),p=g[1]+g[3],f=fS("fontSize",h,t,e,o),v=fS("fontFamily",h,t,e,o),m=fS("fontWeight",h,t,e,o);let b;if("checkbox"===i)b=Z(a)?a.text:a;else if("radio"===i)if(et(a)){b="";const i=o.getBodyColumnDefine(t,e),n=null!==(r=null==i?void 0:i.radioDirectionInCell)&&void 0!==r?r:"vertical";"vertical"===n?a.forEach((t=>{b+=(Z(t)?t.text:t).toString()+"\n"})):"horizontal"===n&&a.forEach((t=>{b+=(Z(t)?t.text:t).toString()}))}else b=Z(a)?a.text:a;else b=a;const C=yS(b,o).text;if(C.length>=1&&(1!==C.length||""!==C[0])?C.forEach((t=>{const e=o.measureText(t,{fontSize:f,fontFamily:v,fontWeight:m}).width;l=Math.max((e+p+4+d)/u,l)})):l=Math.max((p+4+d)/u,l),!1!==o.internalProps.limitMaxAutoWidth&&(l=Math.min("number"==typeof o.internalProps.limitMaxAutoWidth?o.internalProps.limitMaxAutoWidth:450,l)),"checkbox"===i){const i=fS("size",h,t,e,o);if(l+=i,b){const i=fS("spaceBetweenTextAndIcon",h,t,e,o);l+=i}}else if("radio"===i){const i=fS("size",h,t,e,o),n=fS("outerRadius",h,t,e,o),r=nt(n)?2*n:i,d=fS("spaceBetweenTextAndIcon",h,t,e,o);if(et(a)){const i=o.getBodyColumnDefine(t,e),n=fS("spaceBetweenRadio",h,t,e,o),c=null!==(s=null==i?void 0:i.radioDirectionInCell)&&void 0!==s?s:"vertical";"vertical"===c?(l+=r,l+=d):"horizontal"===c&&(l+=(r+d)*a.length,l+=n*(a.length-1))}else l+=r,b&&(l+=d)}return l}function WR(t,e,i){return{left:0,top:0,right:i.getColWidth(t),bottom:i.getRowHeight(e),width:null,height:null}}function NR(t,e,i,o,n,r,s){var l,a,h,d;let c=0;const u=[],g=[];let p=0;for(let s=e;s<i;s++){const e=o&&null!==(l=n[s])&&void 0!==l?l:r.getColWidth(s),i=r.getMaxColWidth(s),h=r.getMinColWidth(s);e!==i&&e!==h?(c+=e,u.push(s)):t-=e,(null===(a=r.options.customConfig)||void 0===a?void 0:a.shrinkSparklineFirst)&&"sparkline"===r.getBodyColumnType(s,0)&&(g.push({col:s,width:e}),p+=e-r.defaultColWidth)}const f=t/c;if((null===(h=r.options.customConfig)||void 0===h?void 0:h.shrinkSparklineFirst)&&f<1&&c-t<p)for(let e=0;e<g.length;e++){const{col:i,width:l}=g[e],a=(c-t)/g.length,h=Math.floor(l-a);o?n[i]=r._adjustColWidth(i,h):s?r.scenegraph.setColWidth(i,r._adjustColWidth(i,h)):r._setColWidth(i,r._adjustColWidth(i,h),!1,!0)}else for(let e=0;e<u.length;e++){const i=u[e];let l;l=e===u.length-1?t-u.reduce(((t,e,s)=>{var l;return e!==i?t+(o?null!==(l=n[e])&&void 0!==l?l:r.getColWidth(i):r.getColWidth(e)):t}),0):Math.round((o&&null!==(d=n[i])&&void 0!==d?d:r.getColWidth(i))*f),o?n[i]=r._adjustColWidth(i,l):s?r.scenegraph.setColWidth(i,r._adjustColWidth(i,l)):r._setColWidth(i,r._adjustColWidth(i,l),!1,!0)}}const GR=new uS({});function jR(t,e,i,o,n,r,s,l,a){var h,d;let c,u,g,p=0;t.lastChild&&t.lastChild.row===o-1?p=t.lastChild.attribute.y+t.lastChild.attribute.height:t.colHeight&&(p=t.colHeight);for(let f=o;f<=n;f++){const n=f;let v,m,b,C,y=l.getCellLocation(e,n),w=l.getCellValue(e,n),x=i,_=l.getRowHeight(n),S=!1;if(l.internalProps.customMergeCell){const t=l.getCustomMerge(e,n);if(t){const{range:e,text:i,style:s,customLayout:a,customRender:h}=t;if(v=e,m=v.start.col!==v.end.col||v.start.row!==v.end.row,m){const t=VR(v,r,l,o>v.start.row);x=t.cellWidth,_=t.cellHeight}w=i,b=s,(a||h)&&(C=E_(a,h,e.start.col,e.start.row,l.getColsWidth(e.start.col,e.end.col),l.getRowsHeight(e.start.row,e.end.row),!1,l.isAutoRowHeight(n),[0,0,0,0],v,l)),S=!0}}let A,R=e,B=n;v&&(R=v.start.col,B=v.start.row),!l.isPivotTable()&&("columnHeader"===y||"cornerHeader"===y)&&n>=l.columnHeaderLevelCount&&(y="body"),A=!l.isPivotTable()&&l.isSeriesNumberInBody(e,n)?l.getBodyColumnDefine(R,B):"body"!==y?l.getHeaderDefine(R,B):l.getBodyColumnDefine(R,B);let M="body"!==y||(null==A?void 0:A.dragOrder)||!!(null==A?void 0:A.icon)||!!(null==A?void 0:A.tree);if(!v&&(l.internalProps.enableTreeNodeMerge||"body"!==y||(null==A?void 0:A.mergeCell))&&(v=l.getCellRange(e,n),m=v.start.col!==v.end.col||v.start.row!==v.end.row,m)){const t=VR(v,r,l,o>v.start.row);x=t.cellWidth,_=t.cellHeight}let T=!1;if(l.internalProps.enableTreeNodeMerge&&m){const t=l.getCellRawRecord(v.start.col,v.start.row),{vtableMergeName:e,vtableMerge:i}=null!=t?t:{};T=i,i&&(M=!0,l.options.groupTitleCustomLayout&&(C=E_(l.options.groupTitleCustomLayout,void 0,v.start.col,v.start.row,l.getColsWidth(v.start.col,v.end.col),l.getRowsHeight(v.start.row,v.end.row),!1,l.isAutoRowHeight(n),[0,0,0,0],v,l))),e&&(w=e)}const P=T||S?"text":null!==(d=l.isHeader(e,n)?null!==(h=l._getHeaderLayoutMap(e,n).headerType)&&void 0!==h?h:"text":l.getBodyColumnType(e,n))&&void 0!==d?d:"text";if(gw(w)){$R(e,n,0,p,x,_,t),HS(w,l,UR.bind(null,{type:P,value:w,define:A,table:l,col:e,row:n,colWidth:i,cellWidth:x,cellHeight:_,columnGroup:t,y:p,customStyle:b,mayHaveIcon:M,cellLocation:y,range:v,customResult:C,defaultRowHeight:s})),t.updateColumnRowNumber(n);const o=l.getRowHeight(n);t.updateColumnHeight(o),p+=o}else{const o=b_(b||l._getCellStyle(v?v.start.col:e,v?v.start.row:n),l,v?v.start.col:e,v?v.start.row:n,fS).theme;o.group.cornerRadius=C_(e,n,l),o.group.width=i,o.group.height=Array.isArray(s)?s[n]:s,o._vtable.padding&&(c=o._vtable.padding),o.text.textAlign&&(u=o.text.textAlign),o.text.textBaseline&&(g=o.text.textBaseline),"body"===y||o.group.fill||(o.group.fill="#fff");const r=zS(P,w,A,l,e,n,i,x,_,t,p,c,u,g,M,o,v,C);if(t.updateColumnRowNumber(n),m){const i=l.getRowHeight(n),{width:o}=(l.getColWidth(e),r.attribute),{height:s}=r.attribute;r.contentWidth=o,r.contentHeight=s,WS(v,o,s,c,u,g,l),t.updateColumnHeight(i),p+=i}else t.updateColumnHeight(_),p+=_}if(a&&n>a)break}return t.setAttribute("width",i),{width:i,height:p}}function UR(t){let e,i,o;const{type:n,value:r,define:s,table:l,col:a,row:h,colWidth:d,cellWidth:c,cellHeight:u,columnGroup:g,y:p,cellLocation:f,mayHaveIcon:v,customStyle:m,range:b,customResult:C,defaultRowHeight:y}=t,w=b_(m||l._getCellStyle(b?b.start.col:a,b?b.start.row:h),l,b?b.start.col:a,b?b.start.row:h,fS).theme;w.group.cornerRadius=C_(a,h,l),w.group.width=d,w.group.height=Array.isArray(y)?y[h]:y,w._vtable.padding&&(e=w._vtable.padding),w.text.textAlign&&(i=w.text.textAlign),w.text.textBaseline&&(o=w.text.textBaseline),"body"===f||w.group.fill||(w.group.fill="#fff"),zS(n,r,s,l,a,h,d,c,u,g,p,e,i,o,v,w,b,C)}function VR(t,e,i,o){let n=0,r=0;const s=e.get(`${t.start.col},${t.start.row};${t.end.col},${t.end.row}`);if(!s||o){for(let e=t.start.col;e<=t.end.col;e++)n+=i.getColWidth(e);for(let e=t.start.row;e<=t.end.row;e++)r+=i.getRowHeight(e);e.set(`${t.start.col},${t.start.row};${t.end.col},${t.end.row}`,{cellWidth:n,cellHeight:r})}else n=s.cellWidth,r=s.cellHeight;return{cellWidth:n,cellHeight:r}}function $R(t,e,i,o,n,r,s){const l=new uS({x:i,y:o,width:n,height:r});l.role="cell",l.col=t,l.row=e,s.addChild(l)}function YR(t,e,i,o,n,r,s,l,a,h){if(o>n||r>s)return;const{layoutMap:d,defaultRowHeight:c,defaultHeaderRowHeight:u,defaultColWidth:g}=a.internalProps;let p=0,f=0;for(let d=o;d<=n;d++){const o=d,n=a.getColWidth(o),g=new uS({x:e+p,y:i,width:n,height:0,clip:!1,pickable:!1});g.role="column",g.col=d,t.addChild(g);const{width:v,height:m}=jR(g,o,n,r,s,a.scenegraph.mergeMap,"columnHeader"===l&&nt(u)?u:c,a,h);p+=v,f=Math.max(f,m)}t.setAttribute("width",p),t.setAttribute("height",f)}function XR(t){let e=t.firstChild;for(;"group"!==e.type;)e=e._next;return e}function KR(t){let e=t.lastChild;for(;"group"!==e.type;)e=e._prev;return e}function ZR(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left";for(let n=t;n<=e;n++){const t=i.scenegraph.getColGroup(n);t&&qR(t,i,o);const e=i.scenegraph.getColGroup(n,!0);e&&qR(e,i,o);const r=i.scenegraph.getColGroupInBottom(n);r&&qR(r,i,o)}const n=Math.min(i.scenegraph.proxy.colLimit,i.scenegraph.proxy.bodyRightCol-i.scenegraph.proxy.bodyLeftCol+1),r=i.getColsWidth(i.frozenColCount,i.frozenColCount+n),s=i.getColsWidth(i.frozenColCount,i.colCount-1);i.scenegraph.proxy.xLimitLeft=r/2,i.scenegraph.proxy.xLimitRight=s-r/2}function qR(t,e){if("left"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left")){let i;const o=function(t){let e=t._prev;for(;e&&"group"!==e.type;)e=e._prev;return e}(t);i=o?o.attribute.x+e.getColWidth(t._prev.col):e.getColsWidth(e.frozenColCount,t.col-1),t.setAttribute("x",i)}else{let i;const o=function(t){let e=t._next;for(;e&&"group"!==e.type;)e=e._next;return e}(t);i=o?o.attribute.x-e.getColWidth(t.col):e.getColsWidth(e.frozenColCount,t.col-1),t.setAttribute("x",i)}}GR.role="empty";var JR=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function QR(t,e,i,o){return JR(this,void 0,void 0,(function*(){if(!e)return;const n=e.col,r=e.left;let s;if(s=i?o.bodyRightCol-o.colEnd:o.screenLeftCol-o.referenceCol,function(t,e,i,o,n){t>0?(tB(t,"left",n.screenLeftCol,i,o,n),n.updateDeltaX(o,i,e),n.table.scenegraph.setBodyAndColHeaderX(-o+n.deltaX)):t<0?(tB(-t,"right",n.screenLeftCol,i,o,n),n.updateDeltaX(o,i,e),n.table.scenegraph.setBodyAndColHeaderX(-o+n.deltaX)):(n.updateDeltaX(o,i,e),n.table.scenegraph.setBodyAndColHeaderX(-o+n.deltaX))}(s,n,r,t,o),i){const e=o.table.scenegraph.getColGroup(o.colEnd);if(e){const i=e.attribute.x+e.attribute.width-(o.table.tableNoFrameWidth-o.table.getFrozenColsWidth()-o.table.getRightFrozenColsWidth())-t;o.deltaX=-i,o.table.scenegraph.setBodyAndColHeaderX(-t+o.deltaX)}}o.table.scenegraph.updateNextFrame()}))}function tB(t,e,i,o,n,r){return JR(this,void 0,void 0,(function*(){if("left"===e&&r.colEnd+t>r.bodyRightCol?t=r.bodyRightCol-r.colEnd:"right"===e&&r.colStart-t<r.bodyLeftCol&&(t=r.colStart-r.bodyLeftCol),0!==t)if(t<0&&(e="left"===e?"right":"left",t=-t),t<r.colEnd-r.colStart){const n="left"===e?r.colStart:r.colEnd-t+1,s="left"===e?r.colStart+t-1:r.colEnd,l="left"===e?r.colEnd+1:r.colStart-t,a="left"===e?r.colEnd+t:r.colStart-1;FR(r.table,l,a),function(t,e,i,o){for(let n=t;n<=e;n++)o.table.scenegraph.bodyGroup.childrenCount>0&&"group"===o.table.scenegraph.bodyGroup.firstChild.type&&nB(o.table.scenegraph.bodyGroup,i,o),o.table.scenegraph.colHeaderGroup.childrenCount>0&&"group"===o.table.scenegraph.colHeaderGroup.firstChild.type&&nB(o.table.scenegraph.colHeaderGroup,i,o),o.table.scenegraph.bottomFrozenGroup.childrenCount>0&&"group"===o.table.scenegraph.bottomFrozenGroup.firstChild.type&&nB(o.table.scenegraph.bottomFrozenGroup,i,o)}(n,s,e,r);const h=l,d=a;r.colStart="left"===e?r.colStart+t:r.colStart-t,r.colEnd="left"===e?r.colEnd+t:r.colEnd-t,rB(h,d,r),ZR(h,d,r.table,e);const c=r.table.scenegraph.getColGroup(i)||r.table.scenegraph.getColGroup(i,!0),u=o-(c.attribute.x+r.table.getFrozenColsWidth()+r.table.scenegraph.proxy.deltaX);r.table.scenegraph.proxy.deltaX+=u,r.currentCol="left"===e?r.currentCol+t:r.currentCol-t,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,"left"===e?r.totalCol+t:r.totalCol-t)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=l,r.colUpdateDirection=e,r.table.scenegraph.updateNextFrame()}else{const i="left"===e?r.colStart+t:r.colStart-t,o="left"===e?r.colEnd+t:r.colEnd-t;FR(r.table,i,o),function(t,e,i,o){o.table.scenegraph.colHeaderGroup.forEachChildren(((n,r)=>{"group"===n.type&&eB(n,"left"===i?n.col+e:n.col-e,0===r?t:n._prev.attribute.x+o.table.getColWidth(n._prev.col))})),o.table.scenegraph.bottomFrozenGroup.forEachChildren(((n,r)=>{"group"===n.type&&eB(n,"left"===i?n.col+e:n.col-e,0===r?t:n._prev.attribute.x+o.table.getColWidth(n._prev.col))})),o.table.scenegraph.bodyGroup.forEachChildren(((n,r)=>{"group"===n.type&&eB(n,"left"===i?n.col+e:n.col-e,0===r?t:n._prev.attribute.x+o.table.getColWidth(n._prev.col))}))}(r.table.getColsWidth(r.bodyLeftCol,i-1),t,e,r);const n=i,s=o;r.colStart=i,r.colEnd=o,rB(n,s,r),ZR(n,s,r.table,o>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left"),r.currentCol="left"===e?r.currentCol+t:r.currentCol-t,r.totalCol=Math.max(0,Math.min(r.table.colCount-1,"left"===e?r.totalCol+t:r.totalCol-t)),r.referenceCol=r.colStart+Math.floor((r.colEnd-r.colStart)/2),r.colUpdatePos=r.colStart,r.colUpdateDirection=o>r.bodyRightCol-(r.colEnd-r.colStart+1)?"right":"left",r.table.scenegraph.updateNextFrame()}}))}function eB(t,e,i){t.col=e,t.forEachChildren((t=>{t.col=e,t.needUpdate=!0})),t.setAttribute("x",i),t.needUpdate=!0}function iB(t,e){if(!t)return;let i=t.firstChild;for(;i;)i=e.updateCellGroupContent(i)._next;t.needUpdate=!1,t.setAttribute("width",e.table.getColWidth(t.col))}function oB(t,e){if(!t)return;const i=e.screenTopRow,o=Math.max(e.bodyTopRow,i-1*e.screenRowCount),n=Math.min(e.bodyBottomRow,i+2*e.screenRowCount,e.table.rowCount-1);for(let i=o;i<=n;i++){const o=e.highPerformanceGetCell(t.col,i,!0);e.updateCellGroupContent(o)}e.rowUpdatePos=e.rowStart,t.needUpdate=!1,t.setAttribute("width",e.table.getColWidth(t.col))}function nB(t,e,i){if("left"===e){const e=XR(t),o=KR(t);eB(e,o.col+1,o.attribute.x+i.table.getColWidth(o.col)),t.appendChild(e),t.border&&t.appendChild(t.border)}else{const e=KR(t),o=XR(t);eB(e,o.col-1,o.attribute.x-i.table.getColWidth(o.col-1)),t.insertBefore(e,t.firstChild)}}function rB(t,e,i){for(let o=t;o<=e;o++){const t=i.table.scenegraph.getColGroup(o,!0);t&&iB(t,i);const e=i.table.scenegraph.getColGroupInBottom(o);e&&iB(e,i);const n=i.table.scenegraph.getColGroupInRightTopCorner(o);n&&iB(n,i);const r=i.table.scenegraph.getColGroupInRightBottomCorner(o);r&&iB(r,i);const s=i.table.scenegraph.getColGroup(o);s&&oB(s,i)}i.progress()}function sB(t,e,i,o,n){let r=arguments.length>6?arguments[6]:void 0;var s,l;if("up"===(arguments.length>5&&void 0!==arguments[5]?arguments[5]:"up"))for(let l=t;l<=e;l++)for(let t=i;t<=o;t++){const e=n.scenegraph.highPerformanceGetCell(l,t,!0);if("cell"!==e.role||!e.row)continue;let i;if(e._prev)i=(null===(s=e._prev)||void 0===s?void 0:s.attribute.y)+n.getRowHeight(e._prev.row);else if(r){if(i=n.scenegraph.highPerformanceGetCell(l,o+1,!0).attribute.y,K(i))for(let e=t;e<=o;e++)i-=n.getRowHeight(e)}else i=lB(e.row,n);K(i)&&e.setAttribute("y",i)}else for(let s=t;s<=e;s++)for(let t=o;t>=i;t--){const e=n.scenegraph.highPerformanceGetCell(s,t,!0);if("cell"!==e.role||!e.row)continue;let o;if(e._next)o=(null===(l=e._next)||void 0===l?void 0:l.attribute.y)-n.getRowHeight(e.row);else if(r){o=n.scenegraph.highPerformanceGetCell(s,i-1,!0).attribute.y;for(let e=i-1;e<t;e++)o+=n.getRowHeight(e)}else o=lB(e.row,n);K(o)&&e.setAttribute("y",o)}const a=Math.min(n.scenegraph.proxy.rowLimit,n.scenegraph.proxy.bodyBottomRow-n.scenegraph.proxy.bodyTopRow+1),h=n.getRowsHeight(n.frozenRowCount,n.frozenRowCount+a),d=n.getRowsHeight(n.frozenRowCount,n.rowCount-1);n.scenegraph.proxy.yLimitTop=h/2,n.scenegraph.proxy.yLimitBottom=d-h/2}function lB(t,e){let i;return i=t<e.frozenRowCount?e.getRowsHeight(0,t-1):t>=e.rowCount-e.bottomFrozenRowCount?e.getRowsHeight(e.rowCount-e.bottomFrozenRowCount,t-1):e.getRowsHeight(e.frozenRowCount,t-1),i}var aB=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function hB(t,e,i,o){return aB(this,void 0,void 0,(function*(){if(!e)return;const n=e.row,r=e.top;let s;if(s=i?o.bodyBottomRow-o.rowEnd:n-o.referenceRow,function(t,e,i,o,n){t>0?(dB(t,"up",e,i,o,n),n.updateDeltaY(o,i,e),n.updateBody(o-n.deltaY)):t<0?(dB(-t,"down",e,i,o,n),n.updateDeltaY(o,i,e),n.updateBody(o-n.deltaY)):(n.updateDeltaY(o,i,e),n.updateBody(o-n.deltaY))}(s,n,r,t,o),i){const e=o.table.scenegraph.highPerformanceGetCell(o.colStart,o.rowEnd,!0);if("cell"===e.role){const i=e.attribute.y+e.attribute.height-(o.table.tableNoFrameHeight-o.table.getFrozenRowsHeight()-o.table.getBottomFrozenRowsHeight())-t;o.deltaY=-i,o.updateBody(t-o.deltaY)}}}))}function dB(t,e,i,o,n,r){return aB(this,void 0,void 0,(function*(){if("up"===e&&r.rowEnd+t>r.bodyBottomRow?t=r.bodyBottomRow-r.rowEnd:"down"===e&&r.rowStart-t<r.bodyTopRow&&(t=r.rowStart-r.bodyTopRow),0!==t)if(t<0&&(e="up"===e?"down":"up",t=-t),t<r.rowEnd-r.rowStart){const o="up"===e?r.rowStart:r.rowEnd-t+1,n="up"===e?r.rowStart+t-1:r.rowEnd,s="up"===e?r.rowEnd+1:r.rowStart-t,l="up"===e?r.rowEnd+t:r.rowStart-1;let a,h;"autoHeight"===r.table.heightMode?(a=s,h=l):(a=Math.max(r.bodyTopRow,i-1*r.screenRowCount),h=Math.min(r.bodyBottomRow,i+2*r.screenRowCount,r.table.rowCount-1)),iA(r.table,a,h,!1),function(t,e,i,o){for(let n=0;n<o.table.frozenColCount;n++){const r=o.table.scenegraph.getColGroup(n);if(r)for(let n=t;n<=e;n++)cB(r,i,o)}for(let n=o.table.colCount-o.table.rightFrozenColCount;n<o.table.colCount;n++){const r=o.table.scenegraph.getColGroup(n);if(r)for(let n=t;n<=e;n++)cB(r,i,o)}for(let n=o.bodyLeftCol;n<=o.bodyRightCol;n++){const r=o.table.scenegraph.getColGroup(n);if(r)for(let n=t;n<=e;n++)cB(r,i,o)}}(o,n,e,r),r.rowStart="up"===e?r.rowStart+t:r.rowStart-t,r.rowEnd="up"===e?r.rowEnd+t:r.rowEnd-t;const d=uB(a,h,r,!0);"autoHeight"===r.table.heightMode&&(sB(r.bodyLeftCol,r.bodyRightCol,a,h,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),sB(0,r.table.frozenColCount-1,a,h,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0),sB(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,a,h,r.table,l>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",!0)),r.currentRow="up"===e?r.currentRow+t:r.currentRow-t,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,"up"===e?r.totalRow+t:r.totalRow-t,r.table.rowCount-1)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),"autoHeight"===r.table.heightMode&&d?r.rowUpdatePos=Math.min(r.rowUpdatePos,r.rowEnd+1):r.rowUpdatePos=Math.min(r.rowUpdatePos,s),r.rowUpdateDirection=e,r.table.scenegraph.updateNextFrame(),yield r.progress()}else{const o="up"===e?r.rowStart+t:r.rowStart-t,n=Math.min(r.table.rowCount-1,"up"===e?r.rowEnd+t:r.rowEnd-t),s=r.table.getRowsHeight(r.bodyTopRow,o-1);let l,a;"autoHeight"===r.table.heightMode?(l=o,a=n):(l=Math.max(r.bodyTopRow,i-1*r.screenRowCount),a=Math.min(r.bodyBottomRow,i+2*r.screenRowCount,r.table.rowCount-1)),iA(r.table,l,a,!1),function(t,e,i,o){for(let n=0;n<o.table.frozenColCount;n++){const r=o.table.scenegraph.getColGroup(n);null==r||r.forEachChildren(((n,r)=>{o.updateCellGroupPosition(n,"up"===i?n.row+e:n.row-e,0===r?t:n._prev.attribute.y+o.table.getRowHeight(n._prev.row))}))}for(let n=o.table.colCount-o.table.rightFrozenColCount;n<o.table.colCount;n++){const r=o.table.scenegraph.getColGroup(n);null==r||r.forEachChildren(((n,r)=>{o.updateCellGroupPosition(n,"up"===i?n.row+e:n.row-e,0===r?t:n._prev.attribute.y+o.table.getRowHeight(n._prev.row))}))}for(let n=o.bodyLeftCol;n<=o.bodyRightCol;n++){const r=o.table.scenegraph.getColGroup(n);null==r||r.forEachChildren(((n,r)=>{o.updateCellGroupPosition(n,"up"===i?n.row+e:n.row-e,0===r?t:n._prev.attribute.y+o.table.getRowHeight(n._prev.row))}))}}(s,t,e,r),r.rowStart=o,r.rowEnd=n;const h=uB(l,a,r,!0);"autoHeight"===r.table.heightMode&&(sB(r.bodyLeftCol,r.bodyRightCol,l,a,r.table,n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),sB(0,r.table.frozenColCount-1,l,a,r.table,n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up"),sB(r.table.colCount-r.table.rightFrozenColCount,r.table.colCount-1,l,a,r.table,n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up")),r.currentRow="up"===e?r.currentRow+t:r.currentRow-t,r.totalRow=Math.max(0,Math.min(r.bodyBottomRow,"up"===e?r.totalRow+t:r.totalRow-t,r.table.rowCount-1)),r.referenceRow=r.rowStart+Math.floor((r.rowEnd-r.rowStart)/2),"autoHeight"===r.table.heightMode&&h?r.rowUpdatePos=r.rowEnd+1:r.rowUpdatePos=r.rowStart,r.rowUpdateDirection=n>r.bodyBottomRow-(r.rowEnd-r.rowStart+1)?"down":"up",r.table.scenegraph.updateNextFrame(),yield r.progress()}}))}function cB(t,e,i){if(t.childrenCount>=1)if("up"===e){const e=t.firstChild;i.updateCellGroupPosition(e,t.lastChild.row+1,t.lastChild.attribute.y+i.table.getRowHeight(t.lastChild.row)),t.appendChild(e)}else{const e=t.lastChild;i.updateCellGroupPosition(e,t.firstChild.row-1,t.firstChild.attribute.y-i.table.getRowHeight(e.row)),t.insertBefore(e,t.firstChild)}}function uB(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(let o=0;o<i.table.frozenColCount;o++)for(let n=t;n<=e;n++){const t=i.highPerformanceGetCell(o,n,!0);i.updateCellGroupContent(t)}for(let o=i.table.colCount-i.table.rightFrozenColCount;o<i.table.colCount;o++)for(let n=t;n<=e;n++){const t=i.highPerformanceGetCell(o,n);i.updateCellGroupContent(t)}let n=i.bodyLeftCol,r=i.bodyRightCol,s=!0;if(o){const t=i.screenLeftCol;n=Math.max(i.bodyLeftCol,t-1*i.screenColCount),r=Math.min(i.bodyRightCol,t+2*i.screenColCount),n===i.bodyLeftCol&&r===i.bodyRightCol||(s=!1)}for(let o=n;o<=r;o++)for(let n=t;n<=e;n++){const t=i.highPerformanceGetCell(o,n);i.updateCellGroupContent(t)}return i.table.scenegraph.updateNextFrame(),s}var gB=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};var pB=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};function fB(t){const{changedCells:e}=t.internalProps.stick;e.forEach((e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((t=>{t.setAttributes({dx:e.dx,dy:e.dy})}))})),e.clear();const{scrollTop:i,scrollLeft:o,frozenRowCount:n,frozenColCount:r}=t,s=t.getFrozenRowsHeight(),l=t.getFrozenColsWidth(),{row:a}=t.getRowAt(i+s+1),{col:h}=t.getColAt(o+l+1),d=Math.max(a,t.frozenRowCount),c=Math.max(h,t.frozenColCount),u=t.getAllRowsHeight()>t.tableNoFrameHeight?t.getRowAt(i+t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()-1).row:t.rowCount-t.bottomFrozenRowCount-1,g=t.getAllColsWidth()>t.tableNoFrameWidth?t.getColAt(o+t.tableNoFrameWidth-t.getRightFrozenColsWidth()-1).col:t.colCount-t.rightFrozenColCount-1;if(!(g<0||u<0)){for(let i=0;i<n&&!(g<c);i++)[c,g].forEach((o=>{const n=t._getCellStyle(o,i);(null==n?void 0:n.textStick)&&"vertical"!==(null==n?void 0:n.textStick)&&bB(t.scenegraph.getCell(o,i),l+t.tableX,t.tableNoFrameWidth-t.getRightFrozenColsWidth()+t.tableX,e,null==n?void 0:n.textStickBaseOnAlign,t)}));for(let i=0;i<r&&!(u<d);i++)[d,u].forEach((o=>{const n=t._getCellStyle(i,o);(null==n?void 0:n.textStick)&&"tree"!==t.internalProps.layoutMap.rowHierarchyType&&"horizontal"!==(null==n?void 0:n.textStick)&&vB(t.scenegraph.getCell(i,o),s+t.tableY,t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()+t.tableY,e,null==n?void 0:n.textStickBaseOnAlign,t)}));for(let i=c;i<=g&&!(u<d);i++)[d,u].forEach((o=>{const n=t._getCellStyle(i,o);(null==n?void 0:n.textStick)&&"horizontal"!==(null==n?void 0:n.textStick)&&vB(t.scenegraph.getCell(i,o),s+t.tableY,t.tableNoFrameHeight-t.getBottomFrozenRowsHeight()+t.tableY,e,null==n?void 0:n.textStickBaseOnAlign,t)}));for(let i=d;i<=u&&!(g<c);i++)[c,g].forEach((o=>{const n=t._getCellStyle(o,i);(null==n?void 0:n.textStick)&&"vertical"!==(null==n?void 0:n.textStick)&&bB(t.scenegraph.getCell(o,i),l+t.tableX,t.tableNoFrameWidth-t.getRightFrozenColsWidth()+t.tableX,e,null==n?void 0:n.textStickBaseOnAlign,t)}))}}function vB(t,e,i,o,n,r){if(nt(t.mergeStartCol)&&nt(t.mergeStartRow)&&nt(t.mergeEndCol)&&nt(t.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=hA(t,r.scenegraph);for(let t=s;t<=l;t++)for(let s=a;s<=h;s++)mB(r.scenegraph.getCell(t,s),e,i,o,n)}else mB(t,e,i,o,n)}function mB(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w;const x=t.getChildByName("text",!0)||t.getChildByName("image",!0);if(!x)return;if("image"===x.type){const{image:t}=x.attribute;if(!t||!x.resources)return;if("success"!==x.resources.get(t).state)return}const _=null!==(r=x.textBaseline)&&void 0!==r?r:"top";x.AABBBounds.width();const S=x.globalAABBBounds.y1,A=x.globalAABBBounds.y2;if("middle"===_&&n){const n=t.globalAABBBounds.y1+(null!==(l=null===(s=t.firstChild)||void 0===s?void 0:s.attribute.dy)&&void 0!==l?l:0),r=n+(null!==(h=null!==(a=t.contentHeight)&&void 0!==a?a:t.attribute.height)&&void 0!==h?h:0);if(n<e||r>i){const s=Math.max(n,e),l=Math.min(r,i),a=x.globalTransMatrix.f-(l+s)/2+x.AABBBounds.height()/2;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(c=null===(d=t.firstChild)||void 0===d?void 0:d.attribute.dx)&&void 0!==c?c:0,dy:null!==(g=null===(u=t.firstChild)||void 0===u?void 0:u.attribute.dy)&&void 0!==g?g:0}),t.forEachChildren((t=>{var e;t.setAttribute("dy",(null!==(e=t.attribute.dy)&&void 0!==e?e:0)-a+2)}))}}else if(S<e){const i=S-e;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(f=null===(p=t.firstChild)||void 0===p?void 0:p.attribute.dx)&&void 0!==f?f:0,dy:null!==(m=null===(v=t.firstChild)||void 0===v?void 0:v.attribute.dy)&&void 0!==m?m:0}),t.forEachChildren((t=>{var e;t.setAttribute("dy",(null!==(e=t.attribute.dy)&&void 0!==e?e:0)-i+2)}))}else if(A>i){const e=A-i;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(C=null===(b=t.firstChild)||void 0===b?void 0:b.attribute.dx)&&void 0!==C?C:0,dy:null!==(w=null===(y=t.firstChild)||void 0===y?void 0:y.attribute.dy)&&void 0!==w?w:0}),t.forEachChildren((t=>{var i;t.setAttribute("dy",(null!==(i=t.attribute.dy)&&void 0!==i?i:0)-e)}))}}function bB(t,e,i,o,n,r){if(nt(t.mergeStartCol)&&nt(t.mergeStartRow)&&nt(t.mergeEndCol)&&nt(t.mergeEndRow)){const{colStart:s,colEnd:l,rowStart:a,rowEnd:h}=hA(t,r.scenegraph);for(let t=s;t<=l;t++)for(let s=a;s<=h;s++)CB(r.scenegraph.getCell(t,s),e,i,o,n)}else CB(t,e,i,o,n)}function CB(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x;const _=t.getChildByName("text",!0)||t.getChildByName("image",!0);if(!_)return;if("image"===_.type){const{image:t}=_.attribute;if(!t||!_.resources)return;if("success"!==_.resources.get(t).state)return}const S=null!==(s=null!==(r=_.attribute.textAlign)&&void 0!==r?r:_.textAlign)&&void 0!==s?s:"left";_.AABBBounds.width();const A=_.globalAABBBounds.x1,R=_.globalAABBBounds.x2;if("center"===S&&n){const n=t.globalAABBBounds.x1+(null!==(a=null===(l=t.firstChild)||void 0===l?void 0:l.attribute.dx)&&void 0!==a?a:0),r=n+(null!==(d=null!==(h=t.contentWidth)&&void 0!==h?h:t.attribute.width)&&void 0!==d?d:0);if(n<e||r>i){const s=Math.max(n,e),l=Math.min(r,i),a=_.globalTransMatrix.e-(l+s)/2;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(u=null===(c=t.firstChild)||void 0===c?void 0:c.attribute.dx)&&void 0!==u?u:0,dy:null!==(p=null===(g=t.firstChild)||void 0===g?void 0:g.attribute.dy)&&void 0!==p?p:0}),t.forEachChildren((t=>{var e;t.setAttribute("dx",(null!==(e=t.attribute.dx)&&void 0!==e?e:0)-a+2)}))}}else if(A<e){const i=A-e;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(v=null===(f=t.firstChild)||void 0===f?void 0:f.attribute.dx)&&void 0!==v?v:0,dy:null!==(b=null===(m=t.firstChild)||void 0===m?void 0:m.attribute.dy)&&void 0!==b?b:0}),t.forEachChildren((t=>{var e;t.setAttribute("dx",(null!==(e=t.attribute.dx)&&void 0!==e?e:0)-i+2)}))}else if(R>i){const e=R-i;!o.has(`${t.col}-${t.row}`)&&o.set(`${t.col}-${t.row}`,{col:t.col,row:t.row,dx:null!==(y=null===(C=t.firstChild)||void 0===C?void 0:C.attribute.dx)&&void 0!==y?y:0,dy:null!==(x=null===(w=t.firstChild)||void 0===w?void 0:w.attribute.dy)&&void 0!==x?x:0}),t.forEachChildren((t=>{var i;t.setAttribute("dx",(null!==(i=t.attribute.dx)&&void 0!==i?i:0)-e)}))}}function yB(t){var e,i;const o=t.internalProps.layoutMap.headerObjects,n=t.internalProps.layoutMap.columnObjects;for(let t=0;t<o.length;t++){const i=o[t];if(i&&(null===(e=i.style)||void 0===e?void 0:e.textStick))return!0}for(let t=0;t<n.length;t++){const e=n[t];if(e&&(null===(i=e.style)||void 0===i?void 0:i.textStick))return!0}return!!(t.theme.headerStyle.textStick||t.theme.rowHeaderStyle.textStick||t.theme.bodyStyle.textStick)}var wB=function(t,e,i,o){return new(i||(i=Promise))((function(n,r){function s(t){try{a(o.next(t))}catch(t){r(t)}}function l(t){try{a(o.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,l)}a((o=o.apply(t,e||[])).next())}))};class xB{constructor(t){this.isRelease=!1,this.mode="column",this.rowLimit=200,this.currentRow=0,this.rowStart=0,this.rowEnd=0,this.referenceRow=0,this.screenTopRow=0,this.deltaY=0,this.deltaHeight=0,this.colLimit=100,this.screenLeftCol=0,this.deltaX=0,this.deltaWidth=0,this.cellCache=new Map,this.table=t,this.table.isPivotChart()?(this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))):"autoHeight"===this.table.heightMode?this.rowLimit=Math.max(100,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight)):("autoWidth"===this.table.widthMode||(this.rowLimit=Math.max(200,Math.ceil(2*t.tableNoFrameHeight/t.defaultRowHeight))),this.colLimit=Math.max(100,Math.ceil(2*t.tableNoFrameWidth/t.defaultColWidth))),this.table.internalProps.transpose?this.mode="row":this.table.isPivotTable()&&(this.mode="pivot"),this.table.options.maintainedDataCount&&(this.rowLimit=this.table.options.maintainedDataCount)}get bodyLeftCol(){return this.table.frozenColCount}setParamsForColumn(){this.bodyRightCol=this.table.colCount-1-this.table.rightFrozenColCount;const t=Math.min(this.colLimit,this.bodyRightCol-this.bodyLeftCol+1);this.totalActualBodyColCount=t,this.totalCol=this.bodyLeftCol+t-1,this.colStart=this.bodyLeftCol,this.colEnd=this.totalCol;const e=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/e);const i=e*t,o=e*(this.bodyRightCol-this.bodyLeftCol+1);this.xLimitLeft=i/2,this.xLimitRight=o-i/2;const n=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/e),this.firstScreenColLimit=Math.max(15,this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(n/e))),this.colUpdatePos=this.bodyRightCol}setParamsForRow(){this.bodyTopRow=this.table.frozenRowCount,this.bodyBottomRow=this.table.rowCount-1-this.table.bottomFrozenRowCount;const t=Math.min(this.rowLimit,this.bodyBottomRow-this.bodyTopRow+1);this.totalActualBodyRowCount=t,this.totalRow=this.bodyTopRow+t-1,this.rowStart=this.bodyTopRow,this.rowEnd=this.totalRow;const e=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/e);const i=e*t,o=e*(this.bodyBottomRow-this.bodyTopRow+1);this.yLimitTop=i/2,this.yLimitBottom=o-i/2;const n=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/e),this.firstScreenRowLimit=Math.max(30,this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(n/e))),this.rowUpdatePos=this.bodyBottomRow}refreshRowCount(){this.bodyTopRow=this.table.frozenRowCount,this.bodyBottomRow=this.table.rowCount-1-this.table.bottomFrozenRowCount;const t=Math.min(this.rowLimit,this.bodyBottomRow-this.bodyTopRow+1);this.totalActualBodyRowCount=t,this.totalRow=this.rowStart+t-1,this.rowStart=this.bodyTopRow,this.rowEnd=this.totalRow}refreshColCount(){this.bodyRightCol=this.table.colCount-1-this.table.rightFrozenColCount;const t=Math.min(this.colLimit,this.bodyRightCol-this.bodyLeftCol+1);this.totalActualBodyColCount=t,this.totalCol=this.bodyLeftCol+t-1,this.colStart=this.bodyLeftCol,this.colEnd=this.totalCol}resize(){const t=this.table.defaultColWidth;this.taskColCount=1*Math.ceil(this.table.tableNoFrameWidth/t);const e=5*this.table.tableNoFrameWidth;this.screenColCount=Math.ceil(this.table.tableNoFrameWidth/t),this.firstScreenColLimit=this.bodyLeftCol+Math.min(this.colLimit,Math.ceil(e/t));const i=this.table.defaultRowHeight;this.taskRowCount=1*Math.ceil(this.table.tableNoFrameHeight/i);const o=5*this.table.tableNoFrameHeight;this.screenRowCount=Math.ceil(this.table.tableNoFrameHeight/i),this.firstScreenRowLimit=this.bodyTopRow+Math.min(this.rowLimit,Math.ceil(o/i))}createGroupForFirstScreen(t,e,i,o,n,r,s,l){!function(t,e,i,o,n,r,s,l,a){var h,d,c,u,g,p,f,v,m,b,C,y;const{table:w}=a,{leftBottomCornerGroup:x,rightTopCornerGroup:_,rightBottomCornerGroup:S}=w.scenegraph;let A,R,B,M;a.setParamsForRow(),a.setParamsForColumn(),"adaptive"===w.widthMode||w.options.autoWrapText&&("adaptive"===w.heightMode||"autoHeight"===w.heightMode)?(B=w.colCount-1,A=Math.min(a.firstScreenColLimit,w.colCount-1)):A=Math.min(a.firstScreenColLimit,w.colCount-1),"adaptive"===w.heightMode?(M=w.rowCount-1,R=Math.min(a.firstScreenRowLimit,w.rowCount-1)):R=Math.min(a.firstScreenRowLimit,w.rowCount-1),0===w.internalProps._widthResizedColMap.size&&FR(w,0,null!=B?B:A),0===w.internalProps._heightResizedRowMap.size&&iA(w,0,null!=M?M:R),A<w.colCount-w.rightFrozenColCount&&FR(w,w.colCount-w.rightFrozenColCount,w.colCount-1),R<w.rowCount-w.bottomFrozenRowCount&&iA(w,w.rowCount-w.bottomFrozenRowCount,w.rowCount-1),w.scenegraph.colHeaderGroup.setAttribute("x",w.getFrozenColsWidth()),w.scenegraph.rowHeaderGroup.setAttribute("y",w.getFrozenRowsHeight()),w.scenegraph.bottomFrozenGroup.setAttribute("x",w.getFrozenColsWidth()),w.scenegraph.rightFrozenGroup.setAttribute("y",w.getFrozenRowsHeight()),w.scenegraph.bodyGroup.setAttributes({x:w.getFrozenColsWidth(),y:w.getFrozenRowsHeight()}),YR(t,s,l,0,w.frozenColCount-1,0,w.frozenRowCount-1,w.isListTable()?"columnHeader":"cornerHeader",w),A-w.rightFrozenColCount>=w.frozenColCount&&YR(e,s,l,w.frozenColCount,A-w.rightFrozenColCount,0,w.frozenRowCount-1,"columnHeader",w),w.frozenColCount>0&&(w.leftRowSeriesNumberCount>0&&YR(i,s,l,0,w.leftRowSeriesNumberCount-1,w.frozenRowCount,R-w.bottomFrozenRowCount,"rowHeader",w),w.rowHeaderLevelCount>0&&YR(i,s,l,w.leftRowSeriesNumberCount,w.leftRowSeriesNumberCount+w.rowHeaderLevelCount-1,w.frozenRowCount,R-w.bottomFrozenRowCount,"rowHeader",w),w.frozenColCount>w.rowHeaderLevelCount+w.leftRowSeriesNumberCount&&YR(i,s,l,w.rowHeaderLevelCount+w.leftRowSeriesNumberCount,w.frozenColCount-1,w.frozenRowCount,R-w.bottomFrozenRowCount,"body",w)),w.bottomFrozenRowCount>0&&(w.frozenColCount>0&&(w.leftRowSeriesNumberCount>0&&YR(x,s,l,0,w.leftRowSeriesNumberCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"rowHeader",w),w.rowHeaderLevelCount>0&&YR(x,s,l,w.leftRowSeriesNumberCount,w.leftRowSeriesNumberCount+w.rowHeaderLevelCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"rowHeader",w),w.frozenColCount>w.rowHeaderLevelCount+w.leftRowSeriesNumberCount&&YR(x,s,l,w.rowHeaderLevelCount+w.leftRowSeriesNumberCount,w.frozenColCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"body",w)),A-w.rightFrozenColCount>=w.frozenColCount&&YR(n,s,l,w.frozenColCount,A-w.rightFrozenColCount,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,w.isPivotChart()?"rowHeader":"body",w)),w.rightFrozenColCount>0&&(YR(_,s,l,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,0,w.frozenRowCount-1,"columnHeader",w),YR(o,s,l,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,w.frozenRowCount,R-w.bottomFrozenRowCount,w.isPivotChart()?"rowHeader":"body",w)),w.bottomFrozenRowCount>0&&w.rightFrozenColCount>0&&YR(S,s,l,w.colCount-1-w.rightFrozenColCount+1,w.colCount-1,w.rowCount-1-w.bottomFrozenRowCount+1,w.rowCount-1,"body",w),A-w.rightFrozenColCount>=w.frozenColCount&&YR(r,s,l,w.frozenColCount,A-w.rightFrozenColCount,w.frozenRowCount,R-w.bottomFrozenRowCount,"body",w),r.firstChild||e.firstChild||t.firstChild||i.firstChild?(a.currentRow=null!==(u=null!==(d=null===(h=r.firstChild)||void 0===h?void 0:h.rowNumber)&&void 0!==d?d:null===(c=i.firstChild)||void 0===c?void 0:c.rowNumber)&&void 0!==u?u:a.totalRow,a.rowEnd=a.currentRow,a.rowUpdatePos=a.rowEnd+1,a.referenceRow=a.rowStart+Math.floor((a.rowEnd-a.rowStart)/2),a.currentCol=null!==(y=null!==(b=null!==(v=null!==(p=null===(g=r.lastChild)||void 0===g?void 0:g.col)&&void 0!==p?p:null===(f=e.lastChild)||void 0===f?void 0:f.col)&&void 0!==v?v:null===(m=i.lastChild)||void 0===m?void 0:m.col)&&void 0!==b?b:null===(C=t.lastChild)||void 0===C?void 0:C.col)&&void 0!==y?y:a.totalCol,a.colEnd=a.currentCol,a.colUpdatePos=a.colEnd+1,a.referenceCol=a.colStart+Math.floor((a.colEnd-a.colStart)/2),a.progress()):(a.currentRow=a.totalRow,a.rowEnd=a.currentRow,a.rowUpdatePos=a.rowEnd+1,a.referenceRow=a.rowStart+Math.floor((a.rowEnd-a.rowStart)/2),a.currentCol=a.totalCol,a.colEnd=a.currentCol,a.colUpdatePos=a.colEnd+1,a.referenceCol=a.colStart+Math.floor((a.colEnd-a.colStart)/2))}(t,e,i,o,n,r,s,l,this)}progress(){return wB(this,void 0,void 0,(function*(){if(!this.isProgressing)return this.isProgressing=!0,new Promise(((t,e)=>{setTimeout((()=>wB(this,void 0,void 0,(function*(){this.isProgressing=!1,this.isRelease||(this.colUpdatePos<=this.colEnd?(yield this.updateColCellGroupsAsync(),yield this.progress()):this.rowUpdatePos<=this.rowEnd?(yield this.updateRowCellGroupsAsync(),yield this.progress()):this.currentCol<this.totalCol?(yield this.createCol(),yield this.progress()):this.currentRow<this.totalRow&&(yield this.createRow(),yield this.progress()),fB(this.table),this.table.scenegraph.updateNextFrame(),t())}))),16)}))}))}createRow(){return wB(this,void 0,void 0,(function*(){this.taskRowCount&&this.createRowCellGroup(this.taskRowCount)}))}createCol(){return wB(this,void 0,void 0,(function*(){this.taskColCount&&this.createColGroup(this.taskRowCount)}))}createRowCellGroup(t){const e=Math.min(this.totalRow,this.currentRow+t);if(iA(this.table,this.currentRow+1,e,!1),this.rowEnd=e,this.table.frozenColCount){let t=0;for(let i=0;i<this.table.frozenColCount;i++){const o=this.table.scenegraph.getColGroup(i),{height:n}=(this.table.isListTable(),jR(o,i,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table));t=Math.max(t,n),this.table.scenegraph.rowHeaderGroup.setAttribute("height",t)}}if(this.table.rightFrozenColCount){let t=0;for(let i=this.table.colCount-this.table.rightFrozenColCount;i<this.table.colCount;i++){const o=this.table.scenegraph.getColGroup(i),{height:n}=(this.table.isPivotChart(),jR(o,i,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table));t=Math.max(t,n),this.table.scenegraph.rightFrozenGroup.setAttribute("height",t)}}let i=0;for(let t=this.bodyLeftCol;t<=this.bodyRightCol;t++){const o=this.table.scenegraph.getColGroup(t);if(!o)continue;this.table.rowHeaderLevelCount;const{height:n}=jR(o,t,o.attribute.width,this.currentRow+1,e,this.table.scenegraph.mergeMap,this.table.internalProps.defaultRowHeight,this.table);i=Math.max(i,n)}this.table.scenegraph.bodyGroup.setAttribute("height",i),this.currentRow=e,this.rowUpdatePos=this.rowEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}createColGroup(t){const e=Math.min(this.totalCol,this.currentCol+t);FR(this.table,this.currentCol+1,e),this.colEnd=e;for(let t=0;t<this.table.rowCount;t++){const e=this.highPerformanceGetCell(this.currentCol,t);"cell"===e.role&&nt(e.mergeStartCol)&&e.mergeStartCol>this.currentCol&&this.table.scenegraph.updateCellContent(e.col,e.row)}if(this.table.frozenRowCount){const t=this.table.scenegraph.colHeaderGroup.lastChild instanceof uS?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev,i=t.attribute.x+t.attribute.width,o=t.attribute.y;YR(this.table.scenegraph.colHeaderGroup,i,o,this.currentCol+1,e,0,this.table.frozenRowCount-1,"columnHeader",this.table)}if(this.table.bottomFrozenRowCount){const t=this.table.scenegraph.bottomFrozenGroup.lastChild instanceof uS?this.table.scenegraph.bottomFrozenGroup.lastChild:this.table.scenegraph.bottomFrozenGroup.lastChild._prev,i=t.attribute.x+t.attribute.width,o=t.attribute.y;YR(this.table.scenegraph.bottomFrozenGroup,i,o,this.currentCol+1,e,this.table.rowCount-this.table.bottomFrozenRowCount,this.table.rowCount-1,"columnHeader",this.table)}let i=this.table.scenegraph.bodyGroup.lastChild&&(this.table.scenegraph.bodyGroup.lastChild instanceof uS?this.table.scenegraph.bodyGroup.lastChild:this.table.scenegraph.bodyGroup.lastChild._prev);i||(i=this.table.scenegraph.colHeaderGroup.lastChild&&(this.table.scenegraph.colHeaderGroup.lastChild instanceof uS?this.table.scenegraph.colHeaderGroup.lastChild:this.table.scenegraph.colHeaderGroup.lastChild._prev));const o=i.attribute.x+i.attribute.width,n=i.attribute.y;YR(this.table.scenegraph.bodyGroup,o,n,this.currentCol+1,e,this.rowStart,this.rowEnd,"body",this.table),this.currentCol=e,this.colUpdatePos=this.colEnd,this.table.scenegraph.updateContainer(),this.table.scenegraph.updateBorderSizeAndPosition()}setY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return wB(this,void 0,void 0,(function*(){const i=this.table.getRowsHeight(this.bodyTopRow,this.bodyTopRow+(this.rowEnd-this.rowStart+1))/2,o=this.table.getAllRowsHeight()-i,n=this.table.getTargetRowAt(t+this.table.scenegraph.colHeaderGroup.attribute.height);n&&(this.screenTopRow=n.row),t<i&&this.rowStart===this.bodyTopRow||t>o&&this.rowEnd===this.bodyBottomRow?(this.updateDeltaY(t),this.updateBody(t-this.deltaY)):this.table.scenegraph.bodyGroup.firstChild&&0!==this.table.scenegraph.bodyGroup.firstChild.childrenCount||this.table.scenegraph.rowHeaderGroup.firstChild&&0!==this.table.scenegraph.rowHeaderGroup.firstChild.childrenCount?this.dynamicSetY(t,n,e):(this.updateDeltaY(t),this.updateBody(t-this.deltaY))}))}setX(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return wB(this,void 0,void 0,(function*(){const i=this.table.getColsWidth(this.bodyLeftCol,this.bodyLeftCol+(this.colEnd-this.colStart+1))/2,o=this.table.getAllColsWidth()-i,n=this.table.getTargetColAt(t+this.table.scenegraph.rowHeaderGroup.attribute.width);n&&(this.screenLeftCol=n.col),t<i&&this.colStart===this.bodyLeftCol||t>o&&this.colEnd===this.bodyRightCol||this.table.scenegraph.bodyGroup.firstChild&&0===this.table.scenegraph.bodyGroup.firstChild.childrenCount?(this.updateDeltaX(t),this.table.scenegraph.setBodyAndColHeaderX(-t+this.deltaX)):this.dynamicSetX(t,n,e)}))}dynamicSetY(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return wB(this,void 0,void 0,(function*(){hB(t,e,i,this)}))}dynamicSetX(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return wB(this,void 0,void 0,(function*(){QR(t,e,i,this)}))}updateBody(t){this.table.scenegraph.setBodyAndRowHeaderY(-t)}updateRowCellGroupsAsync(){return wB(this,void 0,void 0,(function*(){this.updateCellGroups(this.taskRowCount)}))}updateCellGroups(t){const e=Math.min(this.bodyBottomRow,this.rowUpdatePos+t);"autoHeight"===this.table.heightMode&&iA(this.table,this.rowUpdatePos,e,!1),uB(this.rowUpdatePos,e,this),"autoHeight"===this.table.heightMode&&(sB(this.bodyLeftCol,this.bodyRightCol,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),sB(0,this.table.frozenColCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0),sB(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,this.rowUpdatePos,e,this.table,this.rowUpdateDirection,!0)),this.rowUpdatePos=e+1}updateBottomFrozenCellGroups(){const t=this.table.rowCount-this.table.bottomFrozenRowCount,e=this.table.rowCount-1;"autoHeight"===this.table.heightMode&&iA(this.table,t,e,!1),uB(t,e,this),"autoHeight"===this.table.heightMode&&(sB(this.bodyLeftCol,this.bodyRightCol,t,e,this.table,this.rowUpdateDirection),sB(0,this.table.frozenColCount-1,t,e,this.table,this.rowUpdateDirection),sB(this.table.colCount-this.table.rightFrozenColCount,this.table.colCount-1,t,e,this.table,this.rowUpdateDirection))}updateRightFrozenCellGroups(){const t=this.table.colCount-this.table.rightFrozenColCount,e=this.table.colCount-1;"autoWidth"===this.table.widthMode&&FR(this.table,t,e,!1),rB(t,e,this),"autoHeight"===this.table.heightMode&&ZR(t,e,this.table,this.colUpdateDirection)}updateColCellGroupsAsync(){return wB(this,void 0,void 0,(function*(){this.updateColGroups(this.taskRowCount)}))}updateColGroups(t){const e=Math.min(this.bodyRightCol,this.colUpdatePos+t);FR(this.table,this.colUpdatePos,e),rB(this.colUpdatePos,e,this),this.colUpdatePos=e+1}updateCellGroupPosition(t,e,i){t.row=e,t.mergeStartCol=void 0,t.mergeStartRow=void 0,t.mergeEndCol=void 0,t.mergeEndRow=void 0,t.setAttribute("y",i),t.needUpdate=!0,t.needUpdateForAutoRowHeight=!0}updateCellGroupContent(t){if(!t.needUpdate||"cell"!==t.role)return t;const e=this.table.scenegraph.updateCellContent(t.col,t.row);return t.needUpdate=!1,e||t}sortCellVertical(){return wB(this,void 0,void 0,(function*(){yield function(t){var e;return gB(this,void 0,void 0,(function*(){let i,o;t.table.scenegraph.bodyGroup.forEachChildren(((t,e)=>{"group"===t.type&&(t.needUpdate=!0,null==t||t.forEachChildren((t=>{t.needUpdate=!0})))})),"autoHeight"===t.table.heightMode?(i=t.rowStart,o=t.rowEnd):(i=Math.max(t.bodyTopRow,t.screenTopRow-1*t.screenRowCount),o=Math.min(t.bodyBottomRow,t.screenTopRow+2*t.screenRowCount,t.table.rowCount-1));const n=t.table.getAllRowsHeight();iA(t.table,i,o);const r=t.table.getAllRowsHeight();n!==r&&t.table.scenegraph.updateContainerHeight(t.table.frozenRowCount,r-n);for(let i=0;null!==(e=i<t.table.frozenColCount)&&void 0!==e&&e;i++){const e=t.table.scenegraph.getColGroup(i);null==e||e.setAttribute("chartInstance",void 0);for(let e=t.rowStart;e<=t.rowEnd;e++)t.table.scenegraph.updateCellContent(i,e);for(let e=t.table.rowCount-t.table.bottomFrozenRowCount;e<t.table.rowCount;e++)t.table.scenegraph.updateCellContent(i,e)}for(let e=t.colStart;e<=t.colEnd;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}for(let e=t.table.colCount-t.table.rightFrozenColCount;e<t.table.colCount;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.rowStart;i<=t.rowEnd;i++)t.table.scenegraph.updateCellContent(e,i);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}uB(i,o,t),"autoHeight"===t.table.heightMode&&sB(t.bodyLeftCol,t.bodyRightCol,i,o,t.table,t.rowEnd>t.bodyBottomRow-(t.rowEnd-t.rowStart+1)?"down":"up"),t.rowUpdatePos=t.rowStart,t.rowUpdateDirection=t.rowEnd>t.bodyBottomRow-(t.rowEnd-t.rowStart+1)?"down":"up",t.table.scenegraph.updateNextFrame(),"autoHeight"!==t.table.heightMode&&(yield t.progress())}))}(this)}))}sortCellHorizontal(){return wB(this,void 0,void 0,(function*(){yield function(t){return pB(this,void 0,void 0,(function*(){t.table.scenegraph.bodyGroup.forEachChildren(((t,e)=>{"group"===t.type&&(t.needUpdate=!0,null==t||t.forEachChildren((t=>{t.needUpdate=!0})))}));const e=Math.max(t.bodyLeftCol,t.screenLeftCol-1*t.screenColCount),i=Math.min(t.bodyRightCol,t.screenLeftCol+2*t.screenColCount);FR(t.table,e,i);for(let e=t.colStart;e<=t.colEnd;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}for(let e=t.table.colCount-t.table.rightFrozenColCount;e<t.table.colCount;e++){const i=t.table.scenegraph.getColGroup(e);null==i||i.setAttribute("chartInstance",void 0);for(let i=t.rowStart;i<=t.rowEnd;i++)t.table.scenegraph.updateCellContent(e,i);for(let i=t.table.rowCount-t.table.bottomFrozenRowCount;i<t.table.rowCount;i++)t.table.scenegraph.updateCellContent(e,i)}rB(e,i,t),t.colUpdatePos=t.colStart,t.colUpdateDirection=t.colEnd>t.bodyRightCol-(t.colEnd-t.colStart+1)?"right":"left",t.table.scenegraph.updateNextFrame(),yield t.progress()}))}(this)}))}highPerformanceGetCell(t,e,i){if(e>=this.table.frozenRowCount&&e<this.table.rowCount-this.table.bottomFrozenRowCount&&(e<this.rowStart||e>this.rowEnd))return GR;if(t>=this.table.frozenColCount&&t<this.table.colCount-this.table.rightFrozenColCount&&(t<this.colStart||t>this.colEnd))return GR;if(this.cellCache.get(t)){const o=this.cellCache.get(t);if((o._next||o._prev)&&Math.abs(o.row-e)<e){let n=_B(o,e);return n&&(i||"shadow-cell"!==n.role)||(n=this.table.scenegraph.getCell(t,e,i)),n.row&&this.cellCache.set(t,n),n}const n=this.table.scenegraph.getCell(t,e,i);return n.col===t&&n.row&&this.cellCache.set(t,n),n}const o=this.table.scenegraph.getCell(t,e,i);return o.col===t&&o.row&&this.cellCache.set(t,o),o}updateDeltaY(t,e,i){if(this.rowStart===this.bodyTopRow){const t=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowStart,!0);if("cell"===t.role){const e=t.attribute.y;this.deltaY=-e}}else if(this.rowEnd===this.bodyBottomRow){const t=this.table.scenegraph.highPerformanceGetCell(this.colStart,this.rowEnd,!0);if("cell"===t.role){const e=t.attribute.y+t.attribute.height-(this.table.getAllRowsHeight()-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight());this.deltaY=-e}}else if(K(e)&&K(i)){let o=this.table.scenegraph.highPerformanceGetCell(this.colStart,i,!0);"cell"!==o.role&&(o=this.table.scenegraph.highPerformanceGetCell(0,i,!0));const n=t-this.deltaY,r=e-n,s=o.attribute.y-n+this.table.getFrozenRowsHeight();this.deltaY=r-s}}updateDeltaX(t,e,i){if(this.colStart===this.bodyLeftCol){const t=this.table.scenegraph.getColGroup(this.colStart);if(t){const e=t.attribute.x;this.deltaX=-e}}else if(this.colEnd===this.bodyRightCol){const t=this.table.scenegraph.getColGroup(this.colEnd);if(t){const e=t.attribute.x+t.attribute.width-(this.table.getAllColsWidth()-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth());this.deltaX=-e}}else if(K(e)&&K(i)){const o=this.table.scenegraph.getColGroup(i)||this.table.scenegraph.getColGroup(i,!0),n=t-this.deltaX,r=e-n,s=o.attribute.x-n+this.table.getFrozenColsWidth();this.deltaX=r-s}}release(){this.isRelease=!0}}function _B(t,e){if(!t)return null;if(t.row===e)return t;const i=t._prev,o=t._next;return t.row>e&&i&&i.row===t.row-1?_B(i,e):t.row<e&&o&&o.row===t.row+1?_B(o,e):null}function SB(t,e,i){var o,n,r,s,l,a,h,d,c;const u=i.table,[g,p,f,v]=e.split("-"),m=parseInt(g,10),b=parseInt(p,10),C=parseInt(f,10),y=parseInt(v,10);let w,x=m,_=b,S=C,A=y;switch(t.role){case"rowHeader":w=u.getBodyVisibleRowRange(),w&&(_=Math.max(b,w.rowStart-1),A=Math.min(y,w.rowEnd+1));break;case"columnHeader":case"bottomFrozen":w=u.getBodyVisibleCellRange(),w&&(x=Math.max(m,w.colStart-1),S=Math.min(C,w.colEnd+1));break;case"cornerHeader":case"rightTopCorner":case"leftBottomCorner":case"rightBottomCorner":break;case"rightFrozen":w=u.getBodyVisibleCellRange(),w&&(_=Math.max(b,w.rowStart-1),A=Math.min(y,w.rowEnd+1));break;default:w=u.getBodyVisibleCellRange(),w&&(_=Math.max(b,w.rowStart-1),A=Math.min(y,w.rowEnd+1),x=Math.max(m,w.colStart-1),S=Math.min(C,w.colEnd+1))}const R=u.getColsWidth(x,S),B=u.getRowsHeight(_,A),M=i.highPerformanceGetCell(x,_).globalAABBBounds,T=i.highPerformanceGetCell(S,A).globalAABBBounds;t.rect.setAttributes({x:M.x1-i.tableGroup.attribute.x,y:M.y1-i.tableGroup.attribute.y,width:R,height:B,visible:!0}),t.fillhandle&&(null===(o=t.fillhandle)||void 0===o||o.setAttributes({x:T.x2-i.tableGroup.attribute.x-3,y:T.y2-i.tableGroup.attribute.y-3,width:6,height:6,visible:!0}));let P=!!u.frozenColCount&&m===u.frozenColCount;!P&&u.frozenColCount&&u.scrollLeft>0&&m>=u.frozenColCount&&u.getColsWidth(0,m-1)-u.scrollLeft<u.getFrozenColsWidth()&&(P=!0);let E=!!u.rightFrozenColCount&&u.rightFrozenColCount>0&&C===u.colCount-u.rightFrozenColCount-1;!E&&u.rightFrozenColCount&&C<u.colCount-u.rightFrozenColCount&&u.getColsWidth(0,C)-u.scrollLeft>u.tableNoFrameWidth-u.getRightFrozenColsWidth()&&(E=!0);let k=!u.frozenRowCount||b===u.frozenRowCount;!k&&u.frozenRowCount&&u.scrollTop>0&&b>=u.frozenRowCount&&u.getRowsHeight(0,b-1)-u.scrollTop<u.getFrozenRowsHeight()&&(k=!0);let L=!!u.bottomFrozenRowCount&&y===u.rowCount-u.bottomFrozenRowCount-1;if(!L&&u.bottomFrozenRowCount&&y<u.rowCount-u.bottomFrozenRowCount&&u.getRowsHeight(0,y)-u.scrollTop>u.tableNoFrameHeight-u.getBottomFrozenRowsHeight()&&(L=!0),P&&t.rect.attribute.stroke[3]||E&&t.rect.attribute.stroke[1]||k&&t.rect.attribute.stroke[0]||L&&t.rect.attribute.stroke[2]){if(P&&t.rect.attribute.stroke[3]&&i.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?i.cornerHeaderGroup:"bottomFrozen"===t.role?i.leftBottomCornerGroup:i.rowHeaderGroup),L&&t.rect.attribute.stroke[2]&&i.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?i.leftBottomCornerGroup:"rightFrozen"===t.role?i.rightBottomCornerGroup:i.bottomFrozenGroup),k&&t.rect.attribute.stroke[0]&&i.tableGroup.insertAfter(t.rect,"rowHeader"===t.role?i.cornerHeaderGroup:"rightFrozen"===t.role?i.rightTopCornerGroup:i.colHeaderGroup),E&&t.rect.attribute.stroke[1]&&i.tableGroup.insertAfter(t.rect,"columnHeader"===t.role?i.rightTopCornerGroup:"bottomFrozen"===t.role?i.rightBottomCornerGroup:i.rightFrozenGroup),t.rect.attribute.x<u.getFrozenColsWidth()&&u.scrollLeft>0&&("body"===t.role||"columnHeader"===t.role||"bottomFrozen"===t.role)){const e=t.rect.attribute.width-(u.getFrozenColsWidth()-t.rect.attribute.x);t.rect.setAttributes({x:t.rect.attribute.x+(u.getFrozenColsWidth()-t.rect.attribute.x),width:e>0?e:0}),null===(n=t.fillhandle)||void 0===n||n.setAttributes({visible:e>0})}if(u.getRightFrozenColsWidth()>0&&i.rightFrozenGroup.attribute.height>0&&t.rect.attribute.x+t.rect.attribute.width>i.rightFrozenGroup.attribute.x&&("body"===t.role||"columnHeader"===t.role||"bottomFrozen"===t.role)){const e=i.rightFrozenGroup.attribute.x-t.rect.attribute.x;t.rect.setAttributes({x:t.rect.attribute.x,width:e>0?e:0}),null===(r=t.fillhandle)||void 0===r||r.setAttributes({visible:e-R>0})}if(t.rect.attribute.y<i.colHeaderGroup.attribute.height&&u.scrollTop>0&&("body"===t.role||"rowHeader"===t.role||"rightFrozen"===t.role)){const e=t.rect.attribute.height-(i.colHeaderGroup.attribute.height-t.rect.attribute.y);t.rect.setAttributes({y:t.rect.attribute.y+(i.colHeaderGroup.attribute.height-t.rect.attribute.y),height:e>0?e:0}),null===(s=t.fillhandle)||void 0===s||s.setAttributes({visible:e>0})}if(i.bottomFrozenGroup.attribute.width>0&&i.bottomFrozenGroup.attribute.height>0&&t.rect.attribute.y+t.rect.attribute.height>i.bottomFrozenGroup.attribute.y&&("body"===t.role||"rowHeader"===t.role||"rightFrozen"===t.role)){const e=i.bottomFrozenGroup.attribute.y-t.rect.attribute.y;t.rect.setAttributes({y:t.rect.attribute.y,height:e>0?e:0}),null===(l=t.fillhandle)||void 0===l||l.setAttributes({visible:e-B>0})}}else i.tableGroup.insertAfter(t.rect,"body"===t.role?i.bodyGroup:"columnHeader"===t.role?i.colHeaderGroup:"rowHeader"===t.role?i.rowHeaderGroup:"cornerHeader"===t.role?i.cornerHeaderGroup:"rightTopCorner"===t.role?i.rightTopCornerGroup:"rightFrozen"===t.role?i.rightFrozenGroup:"leftBottomCorner"===t.role?i.leftBottomCornerGroup:"bottomFrozen"===t.role?i.bottomFrozenGroup:i.rightBottomCornerGroup);let H=0;"number"==typeof t.rect.attribute.lineWidth&&(H=Math.ceil(t.rect.attribute.lineWidth/2)),C===u.colCount-1&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(a=t.rect.attribute.lineWidth[1])&&void 0!==a?a:0)/2)),t.rect.setAttributes({width:t.rect.attribute.width-H})),0===m&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(h=t.rect.attribute.lineWidth[3])&&void 0!==h?h:0)/2)),t.rect.setAttributes({x:t.rect.attribute.x+H,width:t.rect.attribute.width-H})),y===u.rowCount-1&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(d=t.rect.attribute.lineWidth[2])&&void 0!==d?d:0)/2)),t.rect.setAttributes({height:t.rect.attribute.height-H})),0===b&&(Array.isArray(t.rect.attribute.lineWidth)&&(H=Math.ceil((null!==(c=t.rect.attribute.lineWidth[0])&&void 0!==c?c:0)/2)),t.rect.setAttributes({y:t.rect.attribute.y+H,height:t.rect.attribute.height-H}))}function AB(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=t.table,n=e.start.col,r=e.start.row,s=e.end.col,l=e.end.row,a=e.skipBodyMerge;let h=Math.max(Math.min(s,n),0),d=Math.max(Math.min(l,r),0),c=Math.min(Math.max(s,n),o.colCount-1),u=Math.min(Math.max(l,r),o.rowCount-1);const g=()=>{let t=!1;for(let e=h;e<=c;e++){if(e===h)for(let i=d;i<=u;i++){if(!o.isHeader(e,i)&&a)continue;const n=nx(o,e,i);if(n&&n.start.col<h){h=n.start.col,t=!0;break}}if(!t&&e===c)for(let i=d;i<=u;i++){if(!o.isHeader(e,i)&&a)continue;const n=nx(o,e,i);if(n&&Math.min(n.end.col,o.colCount-1)>c){c=n.end.col,t=!0;break}}if(t)break}if(!t)for(let e=d;e<=u;e++){if(e===d)for(let i=h;i<=c;i++){if(!o.isHeader(i,e)&&a)continue;const n=nx(o,i,e);if(n&&n.start.row<d){d=n.start.row,t=!0;break}}if(!t&&e===u)for(let i=h;i<=c;i++){if(!o.isHeader(i,e)&&a)continue;const n=nx(o,i,e);if(n&&Math.min(n.end.row,o.rowCount-1)>u){u=n.end.row,t=!0;break}}if(t)break}t&&g()};i&&g(),t.selectingRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectingRangeComponents=new Map;let p=!1,f=!1,v=!1,m=!1,b=!1,C=!1,y=!1,w=!1,x=!1;if(h<=o.frozenColCount-1&&d<=o.frozenRowCount-1&&(C=!0),c>=o.colCount-o.rightFrozenColCount&&d<=o.frozenRowCount-1&&(y=!0),h<=o.frozenColCount-1&&u>=o.rowCount-o.bottomFrozenRowCount&&(x=!0),c>=o.colCount-o.rightFrozenColCount&&u>=o.rowCount-o.bottomFrozenRowCount&&(w=!0),h<=o.frozenColCount-1&&u>=o.frozenRowCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&(p=!0),c>=o.colCount-o.rightFrozenColCount&&u>=o.frozenRowCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&(f=!0),d<=o.frozenRowCount-1&&c>=o.frozenColCount&&h<=o.colCount-o.rightFrozenColCount-1&&(v=!0),u>=o.rowCount-o.bottomFrozenRowCount&&c>=o.frozenColCount&&h<=o.colCount-o.rightFrozenColCount-1&&(m=!0),h<=o.colCount-o.rightFrozenColCount-1&&c>=o.frozenColCount&&d<=o.rowCount-o.bottomFrozenRowCount-1&&u>=o.frozenRowCount&&(b=!0),C){const e=Math.min(c,o.frozenColCount-1),i=Math.min(u,o.frozenRowCount-1),n=[!0,!v,!p,!0];t.createCellSelectBorder(h,d,e,i,"cornerHeader",`${h}${d}${c}${u}`,n)}if(y){const e=Math.max(h,o.colCount-o.rightFrozenColCount),i=Math.min(u,o.frozenRowCount-1),n=[!0,!0,!f,!v];t.createCellSelectBorder(e,d,c,i,"rightTopCorner",`${h}${d}${c}${u}`,n)}if(x){const e=Math.min(c,o.frozenColCount-1),i=Math.max(d,o.rowCount-o.bottomFrozenRowCount),n=[!p,!m,!0,!0];t.createCellSelectBorder(h,i,e,u,"leftBottomCorner",`${h}${d}${c}${u}`,n)}if(w){const e=Math.max(h,o.colCount-o.rightFrozenColCount),i=Math.max(d,o.rowCount-o.bottomFrozenRowCount),n=[!f,!0,!0,!m];t.createCellSelectBorder(e,i,c,u,"rightBottomCorner",`${h}${d}${c}${u}`,n)}if(v){const e=Math.max(h,o.frozenColCount),i=Math.min(c,o.colCount-o.rightFrozenColCount-1),n=Math.min(u,o.frozenRowCount-1),r=[!0,!y,!b,!C];t.createCellSelectBorder(e,d,i,n,"columnHeader",`${h}${d}${c}${u}`,r)}if(m){const e=Math.max(h,o.frozenColCount),i=Math.min(c,o.colCount-o.rightFrozenColCount-1),n=Math.max(d,o.rowCount-o.bottomFrozenRowCount),r=[!b,!w,!0,!x];t.createCellSelectBorder(e,n,i,u,"bottomFrozen",`${h}${d}${c}${u}`,r)}if(p){const e=Math.max(d,o.frozenRowCount),i=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),n=Math.min(c,o.frozenColCount-1),r=[!C,!b,!x,!0];t.createCellSelectBorder(h,e,n,i,"rowHeader",`${h}${d}${c}${u}`,r)}if(f){const e=Math.max(d,o.frozenRowCount),i=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),n=Math.max(h,o.colCount-o.rightFrozenColCount),r=[!y,!0,!w,!b];t.createCellSelectBorder(n,e,c,i,"rightFrozen",`${h}${d}${c}${u}`,r)}if(b){const e=Math.max(h,o.frozenColCount),i=Math.max(d,o.frozenRowCount),n=Math.min(c,o.colCount-o.rightFrozenColCount-1),r=Math.min(u,o.rowCount-o.bottomFrozenRowCount-1),s=[!v,!f,!m,!p];t.createCellSelectBorder(e,i,n,r,"body",`${h}${d}${c}${u}`,s)}}function RB(t){t.selectingRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",0)})),t.selectedRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",0)}))}function BB(t){t.selectingRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",1)})),t.selectedRangeComponents.forEach(((t,e)=>{t.rect.setAttribute("opacity",1)}))}function MB(t){t.selectingRangeComponents.forEach(((e,i)=>{var o;t.selectedRangeComponents.get(i)&&(t.selectingRangeComponents.get(i).rect.delete(),null===(o=t.selectingRangeComponents.get(i).fillhandle)||void 0===o||o.delete()),t.selectedRangeComponents.set(i,e)})),t.selectingRangeComponents=new Map,t.updateNextFrame()}function TB(t){t.selectedRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectedRangeComponents=new Map}function PB(t){t.selectingRangeComponents.forEach(((t,e)=>{var i;t.rect.delete(),null===(i=t.fillhandle)||void 0===i||i.delete()})),t.selectingRangeComponents=new Map}function EB(t,e,i,o){const n=o.scenegraph,r=Jy(t.map((t=>t.row))).sort(((t,e)=>e-t)),s=Jy(e.map((t=>t.row))).sort(((t,e)=>t-e)),l=Jy(i.map((t=>t.row))).sort(((t,e)=>t-e));let a;if(l.length&&(a=FB(l[0]-1,l[l.length-1]+1,n)),s.length){const t=FB(s[0]-1,s[s.length-1]+1,n);a=K(a)?K(t)?Math.min(a,t):a:t}if(r.length){const t=FB(r[0]-1,r[r.length-1]+1,n);a=K(a)?K(t)?Math.min(a,t):a:t}r.forEach((t=>{!function(t,e){const i=e.proxy;t>=i.rowStart&&t<=i.rowEnd&&(LB(t,e),i.rowEnd--,i.currentRow--),i.bodyBottomRow--;const o=Math.min(i.rowLimit,i.bodyBottomRow-i.bodyTopRow+1);i.totalActualBodyRowCount=o,i.totalRow=Math.min(i.table.rowCount-1,i.rowStart+o-1)}(t,n)}));const h=o.rowHeightsMap;if(r.forEach((t=>{h.delete(t)})),r.length){!function(t){function e(e,i){e.row=i;const o=nx(t.table,e.col,e.row);o?(e.mergeStartCol=o.start.col,e.mergeEndCol=o.end.col,e.mergeStartRow=o.start.row,e.mergeEndRow=o.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}t.bodyGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rowHeaderGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rightFrozenGroup.forEachChildren((i=>{let o=t.bodyRowStart;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.bottomFrozenGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.leftBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))})),t.rightBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount;null==i||i.forEachChildren((t=>{e(t,o),o++}))}))}(n);const t=HB(r[r.length-1]-1,r[0]-r.length+1,n);a=K(a)?K(t)?Math.min(a,t):a:t}let d;if(n.table._clearRowRangeHeightsMap(),s.forEach((t=>{const e=function(t,e){const i=e.proxy;i.bodyBottomRow++;const o=Math.min(i.rowLimit,i.bodyBottomRow-i.bodyTopRow+1);if(i.totalActualBodyRowCount=o,i.totalRow=i.rowStart+o-1,!(t<i.rowStart))return t>i.rowEnd?i.rowEnd-i.rowStart+1<i.rowLimit?(i.rowEnd++,i.currentRow++,kB(t,e),t):void 0:i.rowEnd-i.rowStart+1<i.rowLimit?(i.rowEnd++,i.currentRow++,kB(t,e),t):t}(t,n);d=null!=d?d:e,h.insert(t)})),function(t){function e(e,i,o){e.row=i,e.setAttribute("y",o);const n=nx(t.table,e.col,e.row);n?(e.mergeStartCol=n.start.col,e.mergeEndCol=n.end.col,e.mergeStartRow=n.start.row,e.mergeEndRow=n.end.row):(e.mergeStartCol=void 0,e.mergeEndCol=void 0,e.mergeStartRow=void 0,e.mergeEndRow=void 0)}t.bodyGroup.forEachChildren((i=>{let o=t.bodyRowStart,n=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.rowHeaderGroup.forEachChildren((i=>{let o=t.bodyRowStart,n=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.rightFrozenGroup.forEachChildren((i=>{let o=t.bodyRowStart,n=t.getCellGroupY(o);null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.bottomFrozenGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,n=0;null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.leftBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,n=0;null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))})),t.rightBottomCornerGroup.forEachChildren((i=>{let o=t.table.rowCount-t.table.bottomFrozenRowCount,n=0;null==i||i.forEachChildren((t=>{e(t,o,n),o++,n+=t.attribute.height}))}))}(n),s.length){const t=HB(s[0]-1,s[s.length-1]+1,n);a=K(a)?K(t)?Math.min(a,t):a:t}for(let t=0;t<o.colCount;t++)l.forEach((e=>{if(e<o.frozenRowCount){const i=nx(n.table,t,e);if(i)for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)IS(t,e,n.table,!1);else IS(t,e,n.table,!1)}else if(e>o.rowCount-1||e<n.table.rowCount-n.table.bottomFrozenRowCount&&(e<n.proxy.rowStart||e>n.proxy.rowEnd))LB(e,n);else{const i=nx(n.table,t,e);if(i)for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)IS(t,e,n.table,!1);else IS(t,e,n.table,!1)}}));if(l.length){const t=HB(l[0]-1,l[l.length-1]+1,n);a=K(a)?K(t)?Math.min(a,t):a:t}if(nt(d)){for(let t=0;t<o.colCount;t++)for(let e=d;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}a=K(a)?K(d)?Math.min(a,d):a:d}if(nt(a)&&(n.proxy.rowUpdatePos=Math.min(n.proxy.rowUpdatePos,a)),s.length){if(!nt(d)){const t=Math.min(...s);n.proxy.rowUpdatePos=Math.min(t,n.proxy.rowUpdatePos)}n.proxy.rowUpdateDirection="up",n.proxy.updateCellGroups(2*n.proxy.screenRowCount),u()}else r.length&&(function(t,e){if(e.table.isHasSeriesNumber())for(let i=t;i<=e.table.rowCount-1;i++)IS(0,i,e.table,!1)}(r[r.length-1],n),n.proxy.updateCellGroups(2*n.proxy.screenRowCount),u());n.proxy.progress();const c=o.getRowsHeight(o.frozenRowCount,o.rowCount-1-o.bottomFrozenRowCount);function u(){if((null==s?void 0:s[(null==s?void 0:s.length)-1])>=o.rowCount-o.bottomFrozenRowCount||(null==l?void 0:l[(null==l?void 0:l.length)-1])>=o.rowCount-o.bottomFrozenRowCount||(null==r?void 0:r[0])>=o.rowCount-o.bottomFrozenRowCount){for(let t=0;t<o.colCount;t++)for(let e=o.rowCount-o.bottomFrozenRowCount;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}n.proxy.updateBottomFrozenCellGroups()}}n.updateContainerHeight(n.table.frozenRowCount,c-n.bodyGroup.attribute.height)}function kB(t,e){for(let i=0;i<e.table.colCount;i++){const o=new uS({x:0,y:0,width:e.table.getColWidth(i),height:e.table.getRowHeight(t)});if(o.role="cell",o.col=i,o.row=t,o.needUpdate=!0,!o)continue;const n=e.getColGroup(i);if(n)if(n.firstChild&&t<n.firstChild.row)n.insertBefore(o,n.firstChild),n.firstChild.row=n.firstChild.row+1;else if(n.lastChild&&t>n.lastChild.row)n.appendChild(o);else{const r=e.highPerformanceGetCell(i,t,!0);r!==o&&(n.insertBefore(o,r),r&&(r.row=r.row+1),r!==n.lastChild&&n.lastChild&&(n.lastChild.row=n.lastChild.row+1))}}}function LB(t,e){for(let i=0;i<e.table.colCount;i++){const o=e.getColGroup(i,!1);if(!o)continue;let n;o.forEachChildren((e=>e.row===t&&(n=e,!0))),n&&(o.updateColumnHeight(-n.attribute.height),o.removeChild(n))}}function HB(t,e,i){let o;for(let n=0;n<i.table.colCount;n++){const r=i.table.getCellRange(n,t);let s;r.start.row<=t+1&&r.end.row>=t+1&&(zB(r,i),s=r.start.row);const l=i.table.getCellRange(n,e);l.start.row<=e+1&&l.end.row>=e+1&&(zB(l,i),s=l.start.row),K(s)&&(o=K(o)?Math.min(o,s):s)}return o}function FB(t,e,i){let o;for(let n=0;n<i.table.colCount;n++){let r;const s=i.highPerformanceGetCell(n,t);s.mergeStartRow&&s.mergeEndRow&&s.mergeEndRow>t&&(zB({start:{row:s.mergeStartRow,col:"autoHeight"===i.table.heightMode?0:s.mergeStartCol},end:{row:s.mergeEndRow,col:"autoHeight"===i.table.heightMode?i.table.colCount-1:s.mergeEndCol}},i),r=s.mergeStartRow);const l=i.highPerformanceGetCell(n,e);l.mergeStartRow&&l.mergeEndRow&&l.mergeStartRow<e&&(zB({start:{row:l.mergeStartRow,col:"autoHeight"===i.table.heightMode?0:l.mergeStartCol},end:{row:l.mergeEndRow,col:"autoHeight"===i.table.heightMode?i.table.colCount-1:l.mergeEndCol}},i),r=l.mergeStartRow),K(r)&&(o=K(o)?Math.min(o,r):r)}return o}function zB(t,e){const{start:i,end:o}=t;for(let t=i.col;t<=o.col;t++)for(let n=i.row;n<=o.row;n++){const i=e.highPerformanceGetCell(t,n,!0);i&&(i.needUpdate=!0)}}function IB(t){var e,i,o,n;if(t.frozenColCount>t.table.frozenColCount){t.bodyGroup.setAttribute("height",t.rowHeaderGroup.attribute.height),t.bodyGroup.setAttribute("y",t.rowHeaderGroup.attribute.y),t.colHeaderGroup.setAttribute("height",t.cornerHeaderGroup.attribute.height);for(let e=0;e<t.frozenColCount-t.table.frozenColCount;e++)WB(t),NB(t),jB(t)}else if(t.frozenColCount<t.table.frozenColCount){t.rowHeaderGroup.setAttribute("height",t.bodyGroup.attribute.height),t.rowHeaderGroup.setAttribute("y",t.bodyGroup.attribute.y),t.cornerHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height);for(let e=0;e<t.table.frozenColCount-t.frozenColCount;e++)OB(t),DB(t),GB(t)}(function(t){if(!t.table.reactCustomLayout)return;const{table:e,stage:i}=t,o=i.pluginService.findPluginsByName("ReactAttributePlugin")[0],{htmlMap:n}=o;for(const r in n){const s=n[r],{graphic:l,wrapContainer:a}=s;let h;if(t.frozenColCount>e.frozenColCount){const{col:i,row:o}=A_(l);o>=e.rowCount-e.bottomFrozenRowCount&&i<t.frozenColCount&&i>=e.frozenColCount&&l.attribute.react.container===e.frozenBottomDomContainer?h=e.bottomDomContainer:o>=e.frozenRowCount&&i<t.frozenColCount&&i>=e.frozenColCount&&l.attribute.react.container===e.frozenBodyDomContainer?h=e.bodyDomContainer:o<e.frozenRowCount&&i<t.frozenColCount&&i>=e.frozenColCount&&l.attribute.react.container===e.frozenHeaderDomContainer&&(h=e.headerDomContainer)}else if(t.frozenColCount<e.frozenColCount){const{col:i,row:o}=A_(l);o>=e.rowCount-e.bottomFrozenRowCount&&i<e.frozenColCount&&i>=t.frozenColCount&&l.attribute.react.container===e.bottomDomContainer?h=e.frozenBottomDomContainer:o>=e.frozenRowCount&&i<e.frozenColCount&&i>=t.frozenColCount&&l.attribute.react.container===e.bodyDomContainer?h=e.frozenBodyDomContainer:o<e.frozenRowCount&&i<e.frozenColCount&&i>=t.frozenColCount&&l.attribute.react.container===e.headerDomContainer&&(h=e.frozenHeaderDomContainer)}h&&(h.appendChild(a),s.nativeContainer=h,s.container=h,l.attribute.react.container=h,o.updateStyleOfWrapContainer(l,i,a,h,l.attribute.react))}})(t),t.recreateAllSelectRangeComponents(),t.frozenColCount=t.table.frozenColCount,t.frozenRowCount=null!==(i=null===(e=t.colHeaderGroup.firstChild)||void 0===e?void 0:e.childrenCount)&&void 0!==i?i:0,t.proxy.colStart=null!==(n=null===(o=t.bodyGroup.firstChild)||void 0===o?void 0:o.col)&&void 0!==n?n:t.table.frozenColCount,t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.table.transpose?t.table.options.frozenColCount?t.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.rightFrozenColCount&&t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):(t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)),t.hasFrozen=!0}function OB(t){const e=t.bodyGroup.firstChild instanceof uS?t.bodyGroup.firstChild:null;e&&(t.rowHeaderGroup.appendChild(e),t.rowHeaderGroup.setAttribute("width",t.rowHeaderGroup.attribute.width+e.attribute.width),t.bodyGroup.setAttribute("width",t.bodyGroup.attribute.width-e.attribute.width))}function DB(t){const e=t.colHeaderGroup.firstChild instanceof uS?t.colHeaderGroup.firstChild:null;e&&(t.cornerHeaderGroup.appendChild(e),t.cornerHeaderGroup.setAttribute("width",t.cornerHeaderGroup.attribute.width+e.attribute.width),t.colHeaderGroup.setAttribute("width",t.colHeaderGroup.attribute.width-e.attribute.width))}function WB(t){var e;const i=t.rowHeaderGroup.lastChild instanceof uS?t.rowHeaderGroup.lastChild:null===(e=t.rowHeaderGroup.lastChild)||void 0===e?void 0:e._prev;i&&(UB(t.bodyGroup,i,t.bodyGroup.firstChild),t.bodyGroup.setAttribute("width",t.bodyGroup.attribute.width+i.attribute.width),t.rowHeaderGroup.setAttribute("width",t.rowHeaderGroup.attribute.width-i.attribute.width))}function NB(t){var e;const i=t.cornerHeaderGroup.lastChild instanceof uS?t.cornerHeaderGroup.lastChild:null===(e=t.cornerHeaderGroup.lastChild)||void 0===e?void 0:e._prev;i&&(UB(t.colHeaderGroup,i,t.colHeaderGroup.firstChild),t.colHeaderGroup.setAttribute("width",t.colHeaderGroup.attribute.width+i.attribute.width),t.cornerHeaderGroup.setAttribute("width",t.cornerHeaderGroup.attribute.width-i.attribute.width))}function GB(t){const e=t.bottomFrozenGroup.firstChild instanceof uS?t.bottomFrozenGroup.firstChild:null;e&&(t.leftBottomCornerGroup.appendChild(e),t.leftBottomCornerGroup.setAttribute("width",t.leftBottomCornerGroup.attribute.width+e.attribute.width),t.bottomFrozenGroup.setAttribute("width",t.bottomFrozenGroup.attribute.width-e.attribute.width),t.table.isPivotChart()&&e.forEachChildren((t=>{t.setAttributes({stroke:!1,fill:!1})})))}function jB(t){var e;const i=t.leftBottomCornerGroup.lastChild instanceof uS?t.leftBottomCornerGroup.lastChild:null===(e=t.leftBottomCornerGroup.lastChild)||void 0===e?void 0:e._prev;i&&(UB(t.bottomFrozenGroup,i,t.bottomFrozenGroup.firstChild),t.bottomFrozenGroup.setAttribute("width",t.bottomFrozenGroup.attribute.width+i.attribute.width),t.leftBottomCornerGroup.setAttribute("width",t.leftBottomCornerGroup.attribute.width-i.attribute.width),t.table.isPivotChart()&&i.forEachChildren((e=>{var i,o,n,r;const s=t.table._getCellStyle(e.col,e.row),l=t.table.getCellRange(e.col,e.row),a=b_(s,t.table,l?l.start.col:e.col,l?l.start.row:e.row,fS).theme;e.setAttributes({fill:null!==(o=null===(i=null==a?void 0:a.group)||void 0===i?void 0:i.fill)&&void 0!==o?o:void 0,stroke:null!==(r=null===(n=null==a?void 0:a.group)||void 0===n?void 0:n.stroke)&&void 0!==r?r:void 0})})))}function UB(t,e,i){e&&t&&(i?t.insertBefore(e,i):t.appendChild(e))}function VB(t){var e;for(let i=t.proxy.colStart;i<=t.proxy.colEnd;i++){const o=t.getColGroup(i);null===(e=null==o?void 0:o.getChildren())||void 0===e||e.forEach((t=>{t.children.forEach((t=>{"chart"===t.type&&(t.cacheCanvas=null,t.addUpdateBoundTag())}))}))}}function $B(t,e,i){t.forEachChildren((t=>{"chart"===t.type&&(t.cacheCanvas=null,t.setAttributes({width:Math.ceil(e-t.attribute.cellPadding[3]-t.attribute.cellPadding[1]),height:Math.ceil(i-t.attribute.cellPadding[0]-t.attribute.cellPadding[2])}))}))}function YB(t,e,i){return new uS({x:0,y:0,width:t,height:e,clip:null!=i&&i,pickable:!1})}function XB(t,e){return t.forEachChildrenSkipChild(((t,i)=>{t.setAttribute("x",e),e+=t.attribute.width})),e}function KB(t,e,i,o,n){const r=t.name;JB(i,o,(t=>t.name===r),(t=>{wS(e,t),t.name=e.name}),n),n.updateNextFrame()}function ZB(t){const{col:e,row:i,iconMark:o,order:n,oldSortCol:r,oldSortRow:s,oldIconMark:l,scene:a}=t,h=a.table.internalProps.headerHelper.getSortIcon(n,a.table,e,i);if(o&&KB(o,h,e,i,a),!function(t,e,i,o,n){const r=n.getCellRange(t,e),s=n.getCellRange(i,o);return r.start.col===s.start.col&&r.start.row===s.start.row&&r.end.col===s.end.col&&r.end.row===s.end.row}(e,i,r,s,a.table)){const t=a.table.internalProps.headerHelper.getSortIcon("normal",a.table,r,s);l?KB(l,t,r,s,a):function(t,e,i,o){const n=o.getCell(t,e);if(K(n.mergeStartCol)&&K(n.mergeStartRow)&&K(n.mergeEndCol)&&K(n.mergeEndRow))for(let t=n.mergeStartCol;t<=n.mergeEndCol;t++)for(let e=n.mergeStartRow;e<=n.mergeEndRow;e++){let n;o.getCell(t,e).forEachChildren((t=>"sort"===t.attribute.funcType&&(n=t,!0))),n&&(wS(i,n),n.name=i.name)}else{let t;Qy(n,"children",(e=>"sort"===e.attribute.funcType&&(t=e,!0))),t&&(wS(i,t),t.name=i.name)}}(r,s,t,a)}}function qB(t,e,i){t.forEachChildren((t=>{"group"===t.type?qB(t,e,i):e(t)&&i(t)}))}function JB(t,e,i,o,n){const r=n.getCell(t,e);if("cell"===r.role&&K(r.mergeStartCol)&&K(r.mergeStartRow)&&K(r.mergeEndCol)&&K(r.mergeEndRow)){const{colStart:t,colEnd:e,rowStart:s,rowEnd:l}=hA(r,n);for(let r=t;r<=e;r++)for(let t=s;t<=l;t++)qB(n.highPerformanceGetCell(r,t),i,o)}else qB(r,i,o)}function QB(t,e){const{bgColor:i,borderColor:o,borderLineWidth:n,borderLineDash:r}=e,s={x:0,y:0,width:0,height:0,visible:!1,pickable:!0,fill:i};return s.stroke=OA(o,void 0),s.lineWidth=n,r&&(s.lineDash=r),s.lineCap="butt",Array.isArray(o)&&(s.strokeArrayColor=Fx(o)),Array.isArray(n)&&(s.strokeArrayWidth=Fx(n),s.lineWidth=1),t.setAttributes(s),t.role="corner-frozen",t}function tM(t,e,i,o){const n=o.scenegraph,r=eM(t.map((t=>t.col))).sort(((t,e)=>e-t)),s=eM(e.map((t=>t.col))).sort(((t,e)=>t-e)),l=eM(i.map((t=>t.col))).sort(((t,e)=>t-e));r.forEach((t=>{!function(t,e){const i=e.proxy;if(t>=e.table.rowHeaderLevelCount)if(t>=e.table.colCount-e.table.rightFrozenColCount);else{const i=e.getColGroup(t,!1);i&&i.parent===e.bodyGroup&&e.bodyGroup.removeChild(i);const o=e.getColGroupInBottom(t);o&&o.parent===e.bottomFrozenGroup&&e.bottomFrozenGroup.removeChild(o)}t>=i.colStart&&t<=i.colEnd&&(i.colEnd--,i.currentCol--),i.bodyRightCol--;const o=Math.min(i.colLimit,i.bodyRightCol-i.bodyLeftCol+1);i.totalActualBodyColCount=o,i.totalCol=i.colStart+o-1}(t,n)}));const a=o.colWidthsMap;let h;if(r.forEach((t=>{a.delAndReorder(t)})),r.length&&iM(n),n.table._clearColRangeWidthsMap(),s.forEach((t=>{const e=function(t,e){const i=e.proxy;i.bodyRightCol++;const o=Math.min(i.colLimit,i.bodyRightCol-i.bodyLeftCol+1);if(i.totalActualBodyColCount=o,i.totalCol=i.colStart+o-1,!(t<i.colStart))return t>i.colEnd?i.colEnd-i.colStart+1<i.colLimit?(i.colEnd++,i.currentCol++,oM(t,e),t):void 0:i.colEnd-i.colStart+1<i.colLimit?(i.colEnd++,i.currentCol++,oM(t,e),t):t}(t,n);iM(n),h=null!=h?h:e,a.addAndReorder(t)})),function(t){let e=t.bodyColStart,i=t.getCellGroupX(e);function o(i){i.col=e;const o=nx(t.table,i.col,i.row);o&&(i.mergeStartCol=o.start.col,i.mergeStartCol=o.start.col,i.mergeEndCol=o.end.col,i.mergeEndCol=o.end.col),i.role}t.bodyGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.bodyColStart,i=t.getCellGroupX(e),t.colHeaderGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.bodyColStart,i=t.getCellGroupX(e),t.bottomFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightTopCornerGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++})),e=t.table.colCount-t.table.rightFrozenColCount,i=0,t.rightBottomCornerGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{o(t)})),t.setAttribute("x",i),i+=t.attribute.width,e++}))}(n),l.forEach((t=>{for(let e=0;e<o.rowCount;e++){const i=nx(n.table,t,e);if(i)for(let t=i.start.col;t<=i.end.col;t++)for(let t=i.start.col;t<=i.end.col;t++)IS(t,e,n.table,!1);else IS(t,e,n.table,!1)}})),nt(h)){for(let t=h;t<o.colCount;t++)for(let e=0;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}n.proxy.colUpdatePos=h}if(s.length){if(!nt(h)){const t=Math.min(...s);n.proxy.colUpdatePos=t}n.proxy.colUpdateDirection="left",n.proxy.updateColGroups(2*n.proxy.screenColCount),c(),n.proxy.progress()}else r.length&&(n.proxy.updateColGroups(2*n.proxy.screenColCount),c(),n.proxy.progress());const d=o.getColsWidth(o.frozenColCount,o.colCount-1);function c(){if((null==s?void 0:s[(null==s?void 0:s.length)-1])>=o.colCount-o.rightFrozenColCount||(null==l?void 0:l[(null==l?void 0:l.length)-1])>=o.colCount-o.rightFrozenColCount||(null==r?void 0:r[0])>=o.colCount-o.rightFrozenColCount){for(let t=o.colCount-o.rightFrozenColCount;t<o.colCount;t++)for(let e=0;e<o.rowCount;e++){const i=n.highPerformanceGetCell(t,e,!0);i&&(i.needUpdate=!0)}n.proxy.updateRightFrozenCellGroups()}}n.updateContainerWidth(n.table.frozenColCount,d-n.bodyGroup.attribute.width)}function eM(t){const e=[];for(let i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}function iM(t){let e=t.bodyColStart;function i(i){i.col=e;const o=nx(t.table,i.col,i.row);o&&(i.mergeStartCol=o.start.col,i.mergeStartCol=o.start.col,i.mergeEndCol=o.end.col,i.mergeEndCol=o.end.col),i.role}t.bodyGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++})),e=t.bodyColStart,t.colHeaderGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++})),e=t.bodyColStart,t.bottomFrozenGroup.forEachChildren((t=>{t.col=e,null==t||t.forEachChildren((t=>{i(t)})),e++}))}function oM(t,e){if(e.colHeaderGroup&&e.table.columnHeaderLevelCount>0){const o=new uS({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const n=e.getColGroup(t,!0);n?e.colHeaderGroup.insertBefore(o,n):e.colHeaderGroup.appendChild(o),i(o,t,0,e.table.columnHeaderLevelCount-1)}if(e.bodyGroup){const o=new uS({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const n=e.getColGroup(t,!1);n?e.bodyGroup.insertBefore(o,n):e.bodyGroup.appendChild(o),i(o,t,e.bodyRowStart,e.bodyRowEnd)}if(e.bottomFrozenGroup&&e.table.bottomFrozenRowCount>0){const o=new uS({x:0,y:0,width:e.table.getColWidth(t),height:0,clip:!1,pickable:!1});o.role="column",o.col=t;const n=e.getColGroupInBottom(t);n?e.bottomFrozenGroup.insertBefore(o,n):e.bottomFrozenGroup.appendChild(o),i(o,t,e.table.rowCount-e.table.bottomFrozenRowCount,e.table.rowCount-1)}function i(t,i,o,n){for(let r=o;r<=n;r++){const o=new uS({x:0,y:0,width:e.table.getColWidth(i),height:e.table.getRowHeight(r)});o.role="cell",o.col=i,o.row=r,o.needUpdate=!0,t.appendChild(o)}}}py(),Qo.load(HR),Qo.load(XS);class nM{constructor(t){let e,i;var o,n;this._needUpdateContainer=!1,this.table=t,this.hasFrozen=!1,this.clear=!0,this.mergeMap=new Map,n=this.table.theme.textPopTipStyle,yt(Lm.poptip,km,n),t.options.canvas&&t.options.viewBox?(uu.setEnv("browser"),e=t.options.viewBox.x2-t.options.viewBox.x1,i=t.options.viewBox.y2-t.options.viewBox.y1):"node"===Oy.mode?(uu.setEnv("node",t.options.modeParams),e=t.canvasWidth,i=t.canvasHeight):(uu.setEnv("browser"),e=t.canvas.width,i=t.canvas.height),this.stage=(o=Object.assign({canvas:t.canvas,width:e,height:i,disableDirtyBounds:!1,background:t.theme.underlayBackgroundColor,dpr:t.internalProps.pixelRatio,enableLayout:!0,beforeRender:t=>{this.table.options.beforeRender&&this.table.options.beforeRender(t),this.table.animationManager.ticker.start()},afterRender:t=>{this.table.options.afterRender&&this.table.options.afterRender(t),this.table.fireListeners("after_render",null)},canvasControled:!t.options.canvas,viewBox:t.options.viewBox},t.options.renderOption),new Mu(o)),this.stage.defaultLayer.setTheme({group:{boundsPadding:0,strokeBoundsBuffer:0,lineJoin:"round"},text:{ignoreBuf:!0}}),this.initSceneGraph(),this.stage.defaultLayer.add(this.tableGroup),this.stage.table=this.table,this.createComponent()}get width(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.width)&&void 0!==e?e:0}get height(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.height)&&void 0!==e?e:0}get x(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.x)&&void 0!==e?e:0}get y(){var t,e;return null!==(e=null===(t=this.tableGroup.attribute)||void 0===t?void 0:t.y)&&void 0!==e?e:0}get bodyRowStart(){var t;return null!==(t=this.proxy.rowStart)&&void 0!==t?t:0}get bodyRowEnd(){var t;return null!==(t=this.proxy.rowEnd)&&void 0!==t?t:this.table.rowCount-1}get bodyColStart(){var t;return null!==(t=this.proxy.colStart)&&void 0!==t?t:0}get bodyColEnd(){var t;return null!==(t=this.proxy.colEnd)&&void 0!==t?t:this.table.colCount-1}initSceneGraph(){this.isPivot=this.table.isPivotTable(),function(t){const e=t.table.tableNoFrameWidth,i=t.table.tableNoFrameHeight;t.tableGroup=new uS({x:0,y:0,width:e,height:i,clip:!0,pickable:!1}),t.tableGroup.role="table";const o=YB(0,0,!t.table.options.enableTreeStickCell);o.role="col-header",t.colHeaderGroup=o;const n=YB(0,0,!t.table.options.enableTreeStickCell);n.role="corner-header",t.cornerHeaderGroup=n;const r=YB(0,0,!0);r.role="row-header",t.rowHeaderGroup=r;const s=YB(e,0,!0);s.role="body",t.bodyGroup=s;const l=YB(0,0,!0);l.role="right-frozen",t.rightFrozenGroup=l;const a=YB(0,0,!0);a.role="bottom-frozen",t.bottomFrozenGroup=a;const h=YB(0,0);h.role="component",t.componentGroup=h;const d=YB(0,0,!0);d.role="corner-right-top-header",t.rightTopCornerGroup=d;const c=YB(0,0,!0);c.role="corner-right-bottom-header",t.rightBottomCornerGroup=c;const u=YB(0,0,!0);u.role="corner-left-bottom-header",t.leftBottomCornerGroup=u,t.tableGroup.addChild(s),t.tableGroup.addChild(r),t.tableGroup.addChild(a),t.tableGroup.addChild(o),t.tableGroup.addChild(l),t.tableGroup.addChild(c),t.tableGroup.addChild(d),t.tableGroup.addChild(u),t.tableGroup.addChild(n),t.tableGroup.addChild(h)}(this)}clearCells(){var t,e;this.table.animationManager.clear(),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.findPluginsByName("poptipForText").forEach((t=>{t.deactivate(this.stage.pluginService)})),this.clear=!0,this.hasFrozen=!1,this.mergeMap.clear(),this.colHeaderGroup.clear(),this.rowHeaderGroup.clear(),this.cornerHeaderGroup.clear(),this.bodyGroup.clear(),this.bottomFrozenGroup.clear(),this.rightFrozenGroup.clear(),this.rightTopCornerGroup.clear(),this.rightBottomCornerGroup.clear(),this.leftBottomCornerGroup.clear(),this.colHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rowHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.cornerHeaderGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bodyGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.bottomFrozenGroup.setAttributes({x:0,y:0,width:0,height:0}),this.rightTopCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.leftBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.rightBottomCornerGroup.setAttributes({x:0,y:0,width:0,height:0,visible:!1}),this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:0,height:0}),this.tableGroup.border&&(this.tableGroup.parent.removeChild(this.tableGroup.border),delete this.tableGroup.border),null===(t=this.proxy)||void 0===t||t.release(),null===(e=this.table.reactCustomLayout)||void 0===e||e.clearCache()}updateStageBackground(){this.stage.background=this.table.theme.underlayBackgroundColor,this.stage.renderNextFrame()}createComponent(){this.component=new FA(this.table),this.component.addToGroup(this.componentGroup),this.selectedRangeComponents=new Map,this.selectingRangeComponents=new Map}updateComponent(){this.component.updateStyle()}createSceneGraph(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]||(this.table.rowHeightsMap.clear(),this.table.internalProps.layoutMap.clearCellRangeMap()),(this.table.isPivotChart()||this.table._hasCustomRenderOrLayout())&&this.stage.pluginService.autoEnablePlugins.getContributions().forEach((t=>{"poptipForText"===t.name&&this.stage.pluginService.register(t)})),this.clear=!1,this.frozenColCount=this.table.frozenColCount,this.frozenRowCount=this.table.frozenRowCount,this.proxy=new xB(this.table),zA(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0,!0),this.table.isPivotChart()&&(QB(this.rightTopCornerGroup,this.table.theme.cornerRightTopCellStyle||this.table.theme.cornerHeaderStyle||{}),QB(this.leftBottomCornerGroup,this.table.theme.cornerLeftBottomCellStyle||this.table.theme.cornerHeaderStyle||{}),QB(this.rightBottomCornerGroup,this.table.theme.cornerRightBottomCellStyle||this.table.theme.cornerHeaderStyle||{})),this.proxy.createGroupForFirstScreen(this.cornerHeaderGroup,this.colHeaderGroup,this.rowHeaderGroup,this.rightFrozenGroup,this.bottomFrozenGroup,this.bodyGroup,0,0),this.afterScenegraphCreated()}renderSceneGraph(){this.stage.render()}getCell(t,e,i){var o,n,r,s,l,a;let h;if(h=this.table.rightFrozenColCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e<this.table.frozenRowCount?null===(o=this.rightTopCornerGroup.getColGroup(t))||void 0===o?void 0:o.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<this.table.frozenColCount?null===(n=this.leftBottomCornerGroup.getColGroup(t))||void 0===n?void 0:n.getRowGroup(e):this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0&&t>=this.table.colCount-this.table.rightFrozenColCount&&e>=this.table.rowCount-this.table.bottomFrozenRowCount?null===(r=this.rightBottomCornerGroup.getColGroup(t))||void 0===r?void 0:r.getRowGroup(e):this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?null===(s=this.rightFrozenGroup.getColGroup(t))||void 0===s?void 0:s.getRowGroup(e):this.table.bottomFrozenRowCount>0&&e>this.table.rowCount-1-this.table.bottomFrozenRowCount?null===(l=this.bottomFrozenGroup.getColGroup(t))||void 0===l?void 0:l.getRowGroup(e):null===(a=this.getColGroup(t,e<this.frozenRowCount))||void 0===a?void 0:a.getRowGroup(e),h&&"shadow-cell"===h.role&&!i){const i=this.table.getCellRange(t,e);i.start.col===t&&i.start.row===e||(h=this.getCell(i.start.col,i.start.row))}return h||GR}highPerformanceGetCell(t,e,i){return this.proxy.highPerformanceGetCell(t,e,i)}getColGroup(t){let e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e=t<this.frozenColCount&&i?this.cornerHeaderGroup.getColGroup(t):t<this.frozenColCount?this.rowHeaderGroup.getColGroup(t):i&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightTopCornerGroup.getColGroup(t):!i&&this.table.rightFrozenColCount>0&&t>this.table.colCount-1-this.table.rightFrozenColCount?this.rightFrozenGroup.getColGroup(t):i?this.colHeaderGroup.getColGroup(t):this.bodyGroup.getColGroup(t),e||void 0}getColGroupInBottom(t){if(this.table.bottomFrozenRowCount>0)return this.bottomFrozenGroup.getColGroup(t)}getColGroupInLeftBottomCorner(t){if(this.table.bottomFrozenRowCount>0)return this.leftBottomCornerGroup.getColGroup(t)}getColGroupInRightTopCorner(t){if(this.table.rightFrozenColCount>0)return this.rightTopCornerGroup.getColGroup(t)}getColGroupInRightBottomCorner(t){if(this.table.rightFrozenColCount>0&&this.table.bottomFrozenRowCount>0)return this.rightBottomCornerGroup.getColGroup(t)}getCellSize(t,e){const i=this.getCell(t,e),o=nx(this.table,t,e);let n=i.attribute.width,r=i.attribute.height;return o&&(n/=o.end.col-o.start.col+1,r/=o.end.row-o.start.row+1),{width:n,height:r}}updateNextFrame(){this.updateContainerSync(),this.resetAllSelectComponent(),this.stage.renderNextFrame()}resetAllSelectComponent(){var t,e,i;(null===(e=null===(t=this.table.stateManager.select)||void 0===t?void 0:t.ranges)||void 0===e?void 0:e.length)>0&&((i=this).selectingRangeComponents.forEach(((t,e)=>{SB(t,e,i)})),i.selectedRangeComponents.forEach(((t,e)=>{SB(t,e,i)})))}hideHoverIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(JB(t,e,(t=>"mouseenter_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",0);const e=t.parent.getChildByName("icon-back");e&&e.setAttribute("visible",!1)}),i),i.updateNextFrame())}(t,e,this)}showHoverIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(JB(t,e,(t=>"mouseenter_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",1)}),i),i.updateNextFrame())}(t,e,this)}hideClickIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(JB(t,e,(t=>"click_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",0)}),i),i.updateNextFrame())}(t,e,this)}showClickIcon(t,e){!function(t,e,i){-1!==t&&-1!==e&&(JB(t,e,(t=>"click_cell"===t.attribute.visibleTime),(t=>{t.setAttribute("opacity",1)}),i),i.updateNextFrame())}(t,e,this)}getIcon(t,e,i,o){return function(t,e,i,o,n){let r;return n.getCell(t,e).forEachChildren((t=>{t.role&&t.role.startsWith("icon")&&t.containsPoint(i,o,bi.GLOBAL)&&(r=t)})),r}(t,e,i,o,this)}setIconHoverStyle(t,e,i,o){!function(t,e,i,o,n){var r,s;if((t.attribute.backgroundColor||t.attribute.hoverImage)&&JB(e,i,(e=>e.name===t.name),(t=>{var e,i,o,n,r,s,l,a;if(t.attribute.backgroundColor){let h=t.parent.getChildByName("icon-back");h?h.setAttributes({x:(null!==(e=t.attribute.x)&&void 0!==e?e:0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(null!==(i=t.attribute.y)&&void 0!==i?i:0)+(t.AABBBounds.height()-t.backgroundHeight)/2,dx:null!==(o=t.attribute.dx)&&void 0!==o?o:0,dy:null!==(n=t.attribute.dy)&&void 0!==n?n:0,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,visible:!0}):(h=ic({x:(null!==(r=t.attribute.x)&&void 0!==r?r:0)+(t.AABBBounds.width()-t.backgroundWidth)/2,y:(null!==(s=t.attribute.y)&&void 0!==s?s:0)+(t.AABBBounds.height()-t.backgroundHeight)/2,dx:null!==(l=t.attribute.dx)&&void 0!==l?l:0,dy:null!==(a=t.attribute.dy)&&void 0!==a?a:0,width:t.backgroundWidth,height:t.backgroundHeight,fill:t.attribute.backgroundColor,cornerRadius:5,pickable:!1,visible:!0}),h.name="icon-back"),t.parent.insertBefore(h,t)}t.attribute.hoverImage&&t.attribute.image!==t.attribute.hoverImage&&(t.image=t.attribute.hoverImage)}),n),t.tooltip){const{x1:o,x2:l,y1:a,y2:h}=t.globalAABBBounds,d={content:t.tooltip.title,referencePosition:{rect:{left:o,right:l,top:a,bottom:h,width:t.globalAABBBounds.width(),height:t.globalAABBBounds.height()},placement:t.tooltip.placement},disappearDelay:t.tooltip.disappearDelay,style:Object.assign({},null===(r=n.table.internalProps.theme)||void 0===r?void 0:r.tooltipStyle,null===(s=t.tooltip)||void 0===s?void 0:s.style)};n.table.internalProps.tooltipHandler.isBinded(d)||n.table.showTooltip(e,i,d)}}(t,e,i,0,this)}updateSortIcon(t){const{col:e,row:i,iconMark:o,order:n,oldSortCol:r,oldSortRow:s,oldIconMark:l}=t;ZB({col:e,row:i,iconMark:o,order:n,oldSortCol:r,oldSortRow:s,oldIconMark:l,scene:this})}updateFrozenIcon(t,e){!function(t){for(let e=0;e<t.table.colCount;e++)for(let i=0;i<t.table.columnHeaderLevelCount;i++)JB(e,i,(t=>"frozen"===t.attribute.funcType),(o=>{const n=t.table.internalProps.headerHelper.getFrozenIcon(e,i);wS(n,o),o.name=n.name}),t)}(this)}updateHierarchyIcon(t,e){!function(t,e,i){let o;o=i.table.isHeader(t,e)?i.table.internalProps.headerHelper.getHierarchyIcon(t,e):i.table.internalProps.bodyHelper.getHierarchyIcon(t,e),JB(t,e,(t=>t.attribute.funcType===xy.collapse||t.attribute.funcType===xy.expand),(t=>{wS(o,t),t.name=o.name}),i)}(t,e,this)}setIconNormalStyle(t,e,i){!function(t,e,i,o){(t.attribute.backgroundColor||t.attribute.hoverImage)&&JB(e,i,(e=>e.name===t.name),(t=>{const e=t.parent.getChildByName("icon-back");e&&e.setAttribute("visible",!1),t.attribute.hoverImage&&t.attribute.image!==t.attribute.originImage&&(t.image=t.attribute.originImage)}),o)}(t,e,i,this)}residentHoverIcon(t,e){!function(t,e,i){JB(t,e,(t=>t.attribute.funcType===xy.dropDown),(t=>{t.oldVisibleTime=t.attribute.visibleTime,t.setAttribute("visibleTime","always"),t.setAttribute("opacity",1)}),i)}(t,e,this)}resetResidentHoverIcon(t,e){!function(t,e,i){JB(t,e,(t=>t.attribute.funcType===xy.dropDown),(t=>{t.oldVisibleTime&&t.setAttribute("visibleTime",t.oldVisibleTime),t.setAttribute("opacity","always"===t.attribute.visibleTime?1:0)}),i)}(t,e,this)}deactivateChart(t,e){var i,o;if(-1===t||-1===e)return;const n=this.getCell(t,e);null===(o=null===(i=null==n?void 0:n.firstChild)||void 0===i?void 0:i.deactivate)||void 0===o||o.call(i)}activateChart(t,e){var i,o;if(-1===t||-1===e)return;const n=this.getCell(t,e);null===(o=null===(i=null==n?void 0:n.firstChild)||void 0===i?void 0:i.activate)||void 0===o||o.call(i,this.table)}removeInteractionBorder(t,e){const i=this.getCell(t,e);i.setAttribute("highlightStroke",void 0),i.setAttribute("highlightStrokeArrayWidth",void 0),i.setAttribute("highlightStrokeArrayColor",void 0)}createCellSelectBorder(t,e,i,o,n,r,s){!function(t,e,i,o,n,r,s,l){var a,h,d,c,u,g,p,f;let v=!!(null===(a=t.table.options.excelOptions)||void 0===a?void 0:a.fillHandle);if((null===(h=t.table.stateManager.select.ranges)||void 0===h?void 0:h.length)>1)v=!1,t.removeFillHandleFromSelectComponents();else if(1===(null===(d=t.table.stateManager.select.ranges)||void 0===d?void 0:d.length)){const e=Math.max(t.table.stateManager.select.ranges[0].start.row,t.table.stateManager.select.ranges[0].end.row),i=Math.max(t.table.stateManager.select.ranges[0].start.col,t.table.stateManager.select.ranges[0].end.col);t.table.isHeader(i,e)&&(v=!1)}!Array.isArray(l)||!1!==l[1]&&!1!==l[2]||(v=!1);const m=Math.min(e,o),b=Math.min(i,n),C=Math.max(e,o),y=Math.max(i,n),w=t.highPerformanceGetCell(m,b).globalAABBBounds,x=t.highPerformanceGetCell(C,y).globalAABBBounds,_=t.table.theme,S=null===(c=_.selectionStyle)||void 0===c?void 0:c.cellBorderColor,A=null===(u=_.selectionStyle)||void 0===u?void 0:u.cellBorderLineWidth,R=ic({pickable:!1,fill:"replace"!==(null===(g=_.selectionStyle)||void 0===g?void 0:g.selectionFillMode)&&(null!==(f=null===(p=_.selectionStyle)||void 0===p?void 0:p.cellBgColor)&&void 0!==f?f:"rgba(0, 0, 255,0.1)"),lineWidth:A,stroke:l.map((t=>!!t&&S)),x:w.x1-t.tableGroup.attribute.x,y:w.y1-t.tableGroup.attribute.y,width:0,height:0,visible:!0});let B;v&&(B=ic({pickable:!1,fill:S,stroke:S,x:x.x2-3,y:x.y2-3,width:6,height:6,visible:!0})),t.lastSelectId=s,t.selectingRangeComponents.set(`${m}-${b}-${C}-${y}-${s}`,{rect:R,fillhandle:B,role:r}),t.tableGroup.insertAfter(R,"body"===r?t.bodyGroup:"columnHeader"===r?t.colHeaderGroup:"rowHeader"===r?t.rowHeaderGroup:"cornerHeader"===r?t.cornerHeaderGroup:"rightTopCorner"===r?t.rightTopCornerGroup:"rightFrozen"===r?t.rightFrozenGroup:"leftBottomCorner"===r?t.leftBottomCornerGroup:"bottomFrozen"===r?t.bottomFrozenGroup:t.rightBottomCornerGroup),v&&t.tableGroup.insertAfter(B,"body"===r?t.bodyGroup:"columnHeader"===r?t.colHeaderGroup:"rowHeader"===r?t.rowHeaderGroup:"cornerHeader"===r?t.cornerHeaderGroup:"rightTopCorner"===r?t.rightTopCornerGroup:"rightFrozen"===r?t.rightFrozenGroup:"leftBottomCorner"===r?t.leftBottomCornerGroup:"bottomFrozen"===r?t.bottomFrozenGroup:t.rightBottomCornerGroup)}(this,t,e,i,o,n,r,s)}moveSelectingRangeComponentsToSelectedRangeComponents(){MB(this)}deleteLastSelectedRangeComponents(){var t;(t=this).selectedRangeComponents.forEach(((e,i)=>{var o;i.split("-")[4]===t.lastSelectId&&(e.rect.delete(),null===(o=e.fillhandle)||void 0===o||o.delete(),t.selectedRangeComponents.delete(i))}))}deleteAllSelectBorder(){TB(this),PB(this)}updateCellSelectBorder(t){AB(this,t,!(arguments.length>1&&void 0!==arguments[1])||arguments[1])}removeFillHandleFromSelectComponents(){this.selectedRangeComponents.forEach(((t,e)=>{var i;null===(i=t.fillhandle)||void 0===i||i.delete(),t.fillhandle=void 0}))}recreateAllSelectRangeComponents(){TB(this),this.table.stateManager.select.ranges.forEach((t=>{AB(this,t),MB(this)}))}updateColWidth(t,e,i,o){(function(t,e,i,o){o||t.table._setColWidth(e,t.table.getColWidth(e)+i,!0);const n=t.getColGroup(e,!0),r=t.getColGroupInRightTopCorner(e);n&&!r&&gA(n,i,"col-corner",t),r&&gA(r,i,"right-top",t);const s=t.getColGroup(e);s&&gA(s,i,"row-body",t);const l=t.getColGroupInLeftBottomCorner(e);l&&gA(l,i,"left-bottom",t);const a=t.getColGroupInBottom(e);a&&gA(a,i,"bottom",t);const h=t.getColGroupInRightBottomCorner(e);h&&gA(h,i,"right-bottom",t),e<t.frozenColCount?(t.cornerHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),t.rowHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))):(t.colHeaderGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),t.bodyGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))),l&&t.leftBottomCornerGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),a&&t.bottomFrozenGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)})),h&&t.rightBottomCornerGroup.forEachChildrenSkipChild(((t,o)=>{t.col>e&&t.setAttribute("x",t.attribute.x+i)}))})(this,t,Math.round(e),o),i||this.updateContainer(!0)}updateChartSizeForResizeColWidth(t){!function(t,e){const{table:i}=t,o=i.internalProps.layoutMap,n=-1===e?"all":i.internalProps.columnResizeType;if("column"===n){const o=t.getColGroup(e);if(null==o||o.forEachChildren((t=>{$B(t,i.getColWidth(t.col),i.getRowHeight(t.row))})),"adaptive"===i.widthMode&&e<i.colCount-1){const o=t.getColGroup(e+1);null==o||o.forEachChildren((t=>{$B(t,i.getColWidth(t.col),i.getRowHeight(t.row))}))}}else{let r,s,l,a=i.rowHeaderLevelCount,h=i.colCount-1;if("indicator"===n)if(o.indicatorsAsCol)r=o.getIndicatorKey(e,i.columnHeaderLevelCount);else{const t=o.getCellHeaderPaths(e,i.columnHeaderLevelCount-1),n=t.colHeaderPaths[t.colHeaderPaths.length-1];s=n.dimensionKey,l=n.value}else if("indicatorGroup"===n){const t=i.internalProps.layoutMap,e=t.getCellHeaderPaths(i.stateManager.columnResize.col,i.columnHeaderLevelCount),o=t.getHeadNodeByRowOrColDimensions(e.colHeaderPaths.slice(0,e.colHeaderPaths.length-1));a=o.startInTotal+i.frozenColCount,h=o.startInTotal+i.frozenColCount+o.size-1}for(let e=a;e<=h;e++){const a=t.getColGroup(e);if(a){if("indicator"===n){const t=o.getIndicatorKey(e,i.columnHeaderLevelCount);if(o.indicatorsAsCol&&t!==r)continue;if(!o.indicatorsAsCol){const t=o.getCellHeaderPaths(e,i.columnHeaderLevelCount-1),n=null==t?void 0:t.colHeaderPaths[t.colHeaderPaths.length-1];if(!n||s!==n.dimensionKey||l!==n.value)continue}}a.forEachChildren((t=>{$B(t,i.getColWidth(t.col),i.getRowHeight(t.row))}))}}}}(this,t)}updateChartSizeForResizeRowHeight(t){!function(t,e){var i;const{table:o}=t,n=o.internalProps.layoutMap,r=o.stateManager,s=-1===e?"all":o.internalProps.rowResizeType;let l,a,h,d=o.columnHeaderLevelCount,c=o.rowCount-1;if("indicator"===s)if(n.indicatorsAsCol){const t=n.getCellHeaderPaths(o.rowHeaderLevelCount-1,e),r=null===(i=t.rowHeaderPaths)||void 0===i?void 0:i[t.rowHeaderPaths.length-1];a=null==r?void 0:r.dimensionKey,h=null==r?void 0:r.value}else l=n.getIndicatorKey(o.rowHeaderLevelCount,e);else if("indicatorGroup"===s){const t=o.internalProps.layoutMap,i=t.getCellHeaderPaths(o.rowHeaderLevelCount,e),n=t.getHeadNodeByRowOrColDimensions(i.rowHeaderPaths.slice(0,i.rowHeaderPaths.length-1));d=n.startInTotal+o.frozenRowCount,c=n.startInTotal+o.frozenRowCount+n.size-1}for(let i=t.proxy.colStart;i<=t.proxy.colEnd;i++)if("row"===s){const n=t.highPerformanceGetCell(i,e);if("cell"!==n.role)continue;if($B(n,o.getColWidth(n.col),o.getRowHeight(n.row)),"adaptive"===o.heightMode&&e<o.rowCount-1){const n=t.highPerformanceGetCell(i,e+1);$B(n,o.getColWidth(n.col),o.getRowHeight(n.row))}}else for(let e=d;e<=c;e++){if("indicator"===s){const t=n.getIndicatorKey(r.table.rowHeaderLevelCount,e);if(!n.indicatorsAsCol&&t!==l)continue;if(n.indicatorsAsCol){const t=n.getCellHeaderPaths(r.table.rowHeaderLevelCount-1,e),i=null==t?void 0:t.rowHeaderPaths[t.rowHeaderPaths.length-1];if(!i||a!==i.dimensionKey||h!==i.value)continue}}const d=t.highPerformanceGetCell(i,e);"cell"===d.role&&$B(d,o.getColWidth(d.col),o.getRowHeight(d.row))}}(this,t)}updateChartState(t){this.table.isPivotChart()&&function(t,e){const i=t.table;if(i.isPivotChart()){const o=i._selectedDataItemsInChart.length;if((null===e||0===(null==e?void 0:e.length)||0===Object.keys(e).length)&&0===o)return;const n=[];if(Array.isArray(e))e.forEach((t=>{if(t&&0!==t.key&&Object.keys(t).length>0){const e={};for(const i in t)i.startsWith("VGRAMMAR_")||i.startsWith("__VCHART")||(e[i]=t[i]);n.push(e)}}));else if(e&&0!==e.key&&Object.keys(e).length>0){const t={};for(const i in e)i.startsWith("VGRAMMAR_")||i.startsWith("__VCHART")||(t[i]=e[i]);n.push(t)}_t(i._selectedDataItemsInChart,n)||(i._selectedDataItemsInChart=n,i.internalProps.layoutMap.updateDataStateToChartInstance(),VB(t),i.scenegraph.updateNextFrame())}}(this,t)}updateCheckboxCellState(t,e,i){var o,n;if(this.table.transpose)null===(o=this.bodyGroup.children)||void 0===o||o.forEach((t=>{var o;null===(o=t.getChildAt(e))||void 0===o||o.getChildren().forEach((t=>{"checkbox"===t.name&&t.setAttribute("checked",i)}))}));else{const e=this.getColGroup(t);null===(n=null==e?void 0:e.children)||void 0===n||n.forEach((t=>{t.getChildren().find((t=>{"checkbox"===t.name&&t.setAttribute("checked",i)}))}))}}updateHeaderCheckboxCellState(t,e,i){var o,n;this.table.transpose?null===(o=this.rowHeaderGroup.children)||void 0===o||o.forEach((t=>{t.getChildAt(e).getChildren().forEach((t=>{"checkbox"===t.name&&("indeterminate"===i?(t.setAttribute("indeterminate",!0),t.setAttribute("checked",void 0)):(t.setAttribute("indeterminate",void 0),t.setAttribute("checked",i)))}))})):null===(n=this.getColGroup(t,!0).children)||void 0===n||n.forEach((t=>{t.getChildren().find((t=>{"checkbox"===t.name&&("indeterminate"===i?(t.setAttribute("indeterminate",!0),t.setAttribute("checked",void 0)):(t.setAttribute("indeterminate",void 0),t.setAttribute("checked",i)))}))}))}updateAutoColWidth(t){this.table.internalProps._widthResizedColMap.delete(t);const e=this.table.getColWidth(t),i=zR(t,0,this.table.rowCount-1,this.table,!0);i!==e&&this.updateColWidth(t,i-e)}recalculateColWidths(){const t=this.table;"adaptive"===t.widthMode||t.autoFillWidth||t.internalProps.transpose?FR(this.table,0,this.table.colCount-1,!0):(t._clearColRangeWidthsMap(),t.frozenColCount>0&&FR(this.table,0,t.frozenColCount-1,!0),t.rightFrozenColCount>0&&FR(this.table,t.rightFrozenColCount,t.colCount-1,!0),FR(t,this.proxy.colStart,this.proxy.colEnd,!0))}recalculateRowHeights(){const t=this.table;t.internalProps.useOneRowHeightFillAll=!1,"adaptive"===t.heightMode||t.autoFillHeight?iA(this.table,0,this.table.rowCount-1,!0,!0):(t.frozenRowCount>0&&iA(this.table,0,t.frozenRowCount-1,!0,!0),t.bottomFrozenRowCount>0&&iA(this.table,t.bottomFrozenRowCount,t.rowCount-1,!0,!0),iA(t,this.proxy.rowStart,this.proxy.rowEnd,!0,!0))}resize(){this.proxy.resize(),("adaptive"===this.table.widthMode||this.table.autoFillWidth)&&(0===this.table.internalProps._widthResizedColMap.size?this.recalculateColWidths():this.dealWidthMode()),"adaptive"===this.table.heightMode?0===this.table.internalProps._heightResizedRowMap.size?this.recalculateRowHeights():this.dealHeightMode():this.table.autoFillHeight&&this.dealHeightMode(),this.resetFrozen(),this.updateTableSize(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),("adaptive"===this.table.widthMode||"adaptive"===this.table.heightMode||this.table.autoFillWidth||this.table.autoFillHeight)&&this.updateChartSizeForResizeColWidth(-1),this.proxy.progress(),this.updateNextFrame()}updateTableSize(){var t,e,i,o,n,r,s,l,a,h,d,c,u;if(this.tableGroup.setAttributes({x:this.table.tableX,y:this.table.tableY,width:Math.min(this.table.tableNoFrameWidth,Math.max(this.colHeaderGroup.attribute.width,this.bodyGroup.attribute.width,this.bottomFrozenGroup.attribute.width,0)+Math.max(this.cornerHeaderGroup.attribute.width,this.rowHeaderGroup.attribute.width,this.leftBottomCornerGroup.attribute.width,0)+Math.max(this.rightTopCornerGroup.attribute.width,this.rightFrozenGroup.attribute.width,this.rightBottomCornerGroup.attribute.width,0)),height:Math.min(this.table.tableNoFrameHeight,Math.max(this.colHeaderGroup.attribute.height,this.cornerHeaderGroup.attribute.height,this.rightTopCornerGroup.attribute.height,0)+Math.max(this.rowHeaderGroup.attribute.height,this.bodyGroup.attribute.height,this.rightFrozenGroup.attribute.height,0)+Math.max(this.leftBottomCornerGroup.attribute.height,this.bottomFrozenGroup.attribute.height,this.rightBottomCornerGroup.attribute.height,0))}),this.tableGroup.border){const g=null===(t=this.tableGroup.border)||void 0===t?void 0:t.attribute;let p,f,v,m;(null==g?void 0:g.strokeArrayWidth)?(p=g.strokeArrayWidth?g.strokeArrayWidth[0]:null!==(e=g.lineWidth)&&void 0!==e?e:0,f=g.strokeArrayWidth?g.strokeArrayWidth[1]:null!==(i=g.lineWidth)&&void 0!==i?i:0,v=g.strokeArrayWidth?g.strokeArrayWidth[2]:null!==(o=g.lineWidth)&&void 0!==o?o:0,m=g.strokeArrayWidth?g.strokeArrayWidth[3]:null!==(n=g.lineWidth)&&void 0!==n?n:0):(p=null!==(r=null==g?void 0:g.lineWidth)&&void 0!==r?r:0,f=null!==(s=null==g?void 0:g.lineWidth)&&void 0!==s?s:0,v=null!==(l=null==g?void 0:g.lineWidth)&&void 0!==l?l:0,m=null!==(a=null==g?void 0:g.lineWidth)&&void 0!==a?a:0),"rect"===this.tableGroup.border.type?(null===(h=this.table.theme.frameStyle)||void 0===h?void 0:h.innerBorder)?this.tableGroup.border.setAttributes({x:this.table.tableX+m/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-m/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2}):this.tableGroup.border.setAttributes({x:this.table.tableX-m/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+m/2+f/2,height:this.tableGroup.attribute.height+p/2+v/2}):"group"===this.tableGroup.border.type&&((null===(d=this.table.theme.frameStyle)||void 0===d?void 0:d.innerBorder)?(this.tableGroup.border.setAttributes({x:this.table.tableX+m/2,y:this.table.tableY+p/2,width:this.tableGroup.attribute.width-m/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2}),null===(c=this.tableGroup.border.firstChild)||void 0===c||c.setAttributes({x:0,y:0,width:this.tableGroup.attribute.width-m/2-f/2,height:this.tableGroup.attribute.height-p/2-v/2})):(this.tableGroup.border.setAttributes({x:this.table.tableX-m/2,y:this.table.tableY-p/2,width:this.tableGroup.attribute.width+m/2+f/2,height:this.tableGroup.attribute.height+p/2+v/2}),null===(u=this.tableGroup.border.firstChild)||void 0===u||u.setAttributes({x:m/2,y:p/2,width:this.tableGroup.attribute.width,height:this.tableGroup.attribute.height})))}this.table.bottomFrozenRowCount>0&&(this.bottomFrozenGroup.setAttribute("y",this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight()),this.leftBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight(),width:this.table.getFrozenColsWidth()}),this.rightBottomCornerGroup.setAttributes({visible:!0,y:this.tableGroup.attribute.height-this.table.getBottomFrozenRowsHeight(),height:this.table.getBottomFrozenRowsHeight()})),this.table.rightFrozenColCount>0&&(this.rightFrozenGroup.setAttribute("x",this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth()),this.rightTopCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth(),height:this.table.getFrozenRowsHeight()}),this.rightBottomCornerGroup.setAttributes({visible:!0,x:this.tableGroup.attribute.width-this.table.getRightFrozenColsWidth(),width:this.table.getRightFrozenColsWidth()}))}updateRowHeight(t,e,i){dA(this,t,e=Math.round(e),i),this.updateContainerHeight(t,e)}updateRowsHeight(t,e,i){for(let o=0;o<t.length;o++){const n=t[o];if(n>=this.proxy.rowStart&&n<=this.proxy.rowEnd){const t=e[o];dA(this,n,Math.round(t),i),this._updateContainerHeight(n,t)}}this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}updateContainerWidth(t,e){t<this.frozenColCount?(this.rowHeaderGroup.setDeltaWidth(e),this.cornerHeaderGroup.setDeltaWidth(e),this.colHeaderGroup.setDeltaX(e),this.bodyGroup.setDeltaX(e)):(this.colHeaderGroup.setDeltaWidth(e),this.bodyGroup.setDeltaWidth(e)),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}_updateContainerHeight(t,e){t<this.table.frozenRowCount?(this.colHeaderGroup.setDeltaHeight(e),this.cornerHeaderGroup.setDeltaHeight(e),this.rowHeaderGroup.setDeltaY(e),this.bodyGroup.setDeltaY(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaY(e)):t>=this.table.rowCount-this.table.bottomFrozenRowCount?(this.leftBottomCornerGroup.setDeltaHeight(e),this.bottomFrozenGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightBottomCornerGroup.setDeltaHeight(e)):(this.rowHeaderGroup.setDeltaHeight(e),this.bodyGroup.setDeltaHeight(e),this.table.rightFrozenColCount&&this.rightFrozenGroup.setDeltaHeight(e))}updateContainerHeight(t,e){this._updateContainerHeight(t,e),this.updateTableSize(),this.component.updateScrollBar(),this.updateNextFrame()}setColWidth(t,e){const i=this.table.getColWidth(t);i!==e&&(this.updateColWidth(t,e-i),this.table._clearColRangeWidthsMap(t))}setRowHeight(t,e){const i=this.table.getRowHeight(t);i!==e&&((t>=this.proxy.rowStart&&t<=this.proxy.rowEnd||t>=this.table.rowCount-this.table.bottomFrozenRowCount&&t<=this.table.rowCount-1||t<this.table.frozenRowCount)&&this.updateRowHeight(t,e-i),this.table._clearRowRangeHeightsMap(t))}setX(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.table.scenegraph.proxy.setX(-t,e)}setY(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.table.scenegraph.proxy.setY(-t,e)}setBodyAndRowHeaderY(t){var e,i;const o=null===(e=this.bodyGroup.firstChild)||void 0===e?void 0:e.firstChild,n=null===(i=this.bodyGroup.firstChild)||void 0===i?void 0:i.lastChild;0===t&&o&&o.row===this.table.frozenRowCount&&o.attribute.y+t<0?t=-o.attribute.y:n&&this.table.tableNoFrameHeight<this.table.getAllRowsHeight()&&n.row===this.table.rowCount-this.table.bottomFrozenRowCount-1&&n.attribute.y+n.attribute.height+t<this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()&&(t=this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()-n.attribute.y-n.attribute.height),this.colHeaderGroup.attribute.height+t!==this.bodyGroup.attribute.y&&(this.bodyGroup.setAttribute("y",this.colHeaderGroup.attribute.height+t),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height+t),this.table.rightFrozenColCount>0&&this.rightFrozenGroup.setAttribute("y",this.rightTopCornerGroup.attribute.height+t),this.updateNextFrame())}setBodyAndColHeaderX(t){const e=this.bodyGroup.firstChild,i=this.bodyGroup.lastChild;0===t&&e&&e.col===this.table.frozenColCount&&e.attribute.x+t<0?t=-e.attribute.x:i&&this.table.tableNoFrameWidth<this.table.getAllColsWidth()&&i.col===this.table.colCount-this.table.rightFrozenColCount-1&&i.attribute.x+i.attribute.width+t<this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()&&(t=this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()-i.attribute.x-i.attribute.width),this.table.getFrozenColsWidth()+t!==this.bodyGroup.attribute.x&&(this.bodyGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.colHeaderGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.table.bottomFrozenRowCount>0&&this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()+t),this.updateNextFrame())}afterScenegraphCreated(){this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount?this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):this.component.setFrozenColumnShadow(-1):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.table.stateManager.checkFrozen(),this.updateContainer(),this.createFrameBorder(),this.updateBorderSizeAndPosition(),this.component.updateScrollBar(),fB(this.table),this.table.options.animationAppear&&function(t){var e,i,o,n;if(!t.options.animationAppear)return;let r,s,l,a;!0===t.options.animationAppear?(r=500,s=0,l="one-by-one",a="column"):(r=null!==(e=t.options.animationAppear.duration)&&void 0!==e?e:500,s=null!==(i=t.options.animationAppear.delay)&&void 0!==i?i:0,l=null!==(o=t.options.animationAppear.type)&&void 0!==o?o:"one-by-one",a=null!==(n=t.options.animationAppear.direction)&&void 0!==n?n:"row");const{scenegraph:h,frozenColCount:d,frozenRowCount:c}=t,{colStart:u,colEnd:g,rowStart:p,rowEnd:f}=h.proxy;for(let t=0;t<=g;t++)for(let e=0;e<=f;e++){const i=h.highPerformanceGetCell(t,e);i&&"cell"===i.role&&i.forEachChildren((i=>{i.setAttribute("opacity",0),i.animate().wait("one-by-one"===l?("row"===a?e:t)*(r-s):s).to({opacity:1},r,"linear")}))}}(this.table),this.updateNextFrame()}dealWidthMode(){const t=this.table;if("adaptive"===t.widthMode){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0;for(let e=0;e<t.colCount;e++)(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=t.getColWidth(e));NR(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,!1,[],t,!0)}else if(t.autoFillWidth){t._clearColRangeWidthsMap();const e=t.tableNoFrameWidth;let i=0,o=0;for(let e=0;e<t.colCount;e++){const n=t.getColWidth(e);(e<t.rowHeaderLevelCount||t.isPivotChart()&&e>=t.colCount-t.rightFrozenColCount)&&(i+=n),o+=n}if(o<e&&o>i){NR(e-i,t.rowHeaderLevelCount,t.isPivotChart()?t.colCount-t.rightFrozenColCount:t.colCount,!1,[],t,!0)}}let e=0;this.bodyGroup.forEachChildrenSkipChild((t=>{e+=t.attribute.width})),this.bodyGroup.setAttribute("width",e);let i=0;this.colHeaderGroup.forEachChildrenSkipChild((t=>{i+=t.attribute.width})),this.colHeaderGroup.setAttribute("width",i);let o=0;this.rowHeaderGroup.forEachChildrenSkipChild((t=>{o+=t.attribute.width})),this.rowHeaderGroup.setAttribute("width",o);let n=0;this.cornerHeaderGroup.forEachChildrenSkipChild((t=>{n+=t.attribute.width})),this.cornerHeaderGroup.setAttribute("width",n),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.rowHeaderGroup.setAttribute("y",this.cornerHeaderGroup.attribute.height),this.bodyGroup.setAttributes({x:this.rowHeaderGroup.attribute.width,y:this.colHeaderGroup.attribute.height})}dealHeightMode(){var t;const e=this.table;if("adaptive"===e.heightMode){e._clearRowRangeHeightsMap();const t=e.getRowsHeight(0,e.columnHeaderLevelCount-1),i=e.isPivotChart()?e.getBottomFrozenRowsHeight():0,o=e.tableNoFrameHeight-t-i,n=e.columnHeaderLevelCount,r=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount;let s=0;for(let t=n;t<r;t++)s+=e.getRowHeight(t);const l=o/s;for(let t=n;t<r;t++){let i;i=t===r-1?o-e.getRowsHeight(n,r-2):Math.round(e.getRowHeight(t)*l),this.setRowHeight(t,i)}}else if(e.autoFillHeight){e._clearRowRangeHeightsMap();const i=e.tableNoFrameHeight;let o=0,n=0;for(let t=0;t<e.rowCount;t++){const i=e.getRowHeight(t);(t<e.columnHeaderLevelCount||e.isPivotChart()&&t>=e.rowCount-e.bottomFrozenRowCount)&&(n+=i),o+=i}if((null!==(t=this._dealAutoFillHeightOriginRowsHeight)&&void 0!==t?t:o)<i&&o-n>0){const t=e.columnHeaderLevelCount,r=e.isPivotChart()?e.rowCount-e.bottomFrozenRowCount:e.rowCount,s=(i-n)/(o-n);for(let o=t;o<r;o++){let l;l=o===r-1?i-n-e.getRowsHeight(t,r-2):Math.round(e.getRowHeight(o)*s),this.setRowHeight(o,l)}}}}dealFrozen(){!function(t){var e,i;if(t.table.frozenColCount>t.table.rowHeaderLevelCount){t.rowHeaderGroup.setAttribute("height",t.bodyGroup.attribute.height),t.rowHeaderGroup.setAttribute("y",t.bodyGroup.attribute.y),t.cornerHeaderGroup.setAttribute("height",t.colHeaderGroup.attribute.height);for(let e=0;e<t.table.frozenColCount-t.table.rowHeaderLevelCount;e++)OB(t),DB(t),GB(t)}else if(t.table.frozenColCount<t.table.rowHeaderLevelCount){t.bodyGroup.setAttribute("height",t.rowHeaderGroup.attribute.height),t.bodyGroup.setAttribute("y",t.rowHeaderGroup.attribute.y),t.colHeaderGroup.setAttribute("height",t.cornerHeaderGroup.attribute.height);for(let e=0;e<t.table.rowHeaderLevelCount-t.table.frozenColCount;e++)WB(t),NB(t),jB(t)}t.bodyGroup.setAttribute("x",t.rowHeaderGroup.attribute.width),t.colHeaderGroup.setAttribute("x",t.cornerHeaderGroup.attribute.width),t.updateContainer(),t.updateBorderSizeAndPosition(),t.isPivot||t.table.transpose?t.table.options.frozenColCount?t.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.frozenColCount&&t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):(t.component.setFrozenColumnShadow(t.table.frozenColCount-1),t.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)),t.hasFrozen=!0,t.frozenColCount=t.table.frozenColCount,t.frozenRowCount=null!==(i=null===(e=t.colHeaderGroup.firstChild)||void 0===e?void 0:e.childrenCount)&&void 0!==i?i:0}(this)}resetFrozen(){IB(this)}updateCellLayoutWidthCertainWidth(t,e,i){const o=t.attribute.width;let n=!1;return t.forEachChildren(((t,r)=>{r+=e;const s=nx(this.table,i,r);s?t=this.getCell(s.start.col,s.start.row):t.setAttribute("width",o);const l=Fx(fS("padding",this.table._getCellStyle(i,r),i,r,this.table)),a=t.getChildByName("text");let h=0,d=0;if(a)h=a.AABBBounds.height()+(l[0]+l[2]),a.setAttribute("maxLineWidth",o-(l[1]+l[3])),d=a.AABBBounds.height()+(l[0]+l[2]);else{const e=t.getChildAt(1);h=e.AABBBounds.height()+(l[0]+l[2]),e._cellWidth=o-(l[1]+l[3]),e.layout(),d=e.AABBBounds.height()+(l[0]+l[2])}const c=this.table.getRowHeight(r);t.attribute.height!==d&&(t.setAttribute("height",d),(c===h||d>c)&&(n=!0))})),n}updateHeaderPosition(t,e,i,o,n){!function(t,e,i,o,n,r){const s=r.scenegraph;for(let i=t;i<=e;i++){const t=r.getColWidth(i),e=r.scenegraph.getColGroup(i,!0),o=r.scenegraph.getColGroup(i),n=r.scenegraph.getColGroupInBottom(i),s=r.scenegraph.getColGroupInLeftBottomCorner(i),l=r.scenegraph.getColGroupInRightBottomCorner(i);e&&(e.setAttribute("width",t),e.forEachChildren((e=>{e.setAttribute("width",t)}))),o&&(o.setAttribute("width",t),o.forEachChildren((e=>{e.setAttribute("width",t)}))),n&&(n.setAttribute("width",t),n.forEachChildren((e=>{e.setAttribute("width",t)}))),l&&(l.setAttribute("width",t),l.forEachChildren((e=>{e.setAttribute("width",t)}))),s&&(s.setAttribute("width",t),s.forEachChildren((e=>{e.setAttribute("width",t)})))}if(s.updateContainer(),"column"===n)for(let i=t;i<=e;i++){const t=r.scenegraph.getColGroup(i);null==t||t.setAttribute("chartInstance",void 0);for(let t=0;t<=r.frozenRowCount-1;t++)s.updateCellContent(i,t);for(let t=s.bodyRowStart;t<=s.bodyRowEnd;t++)s.updateCellContent(i,t);for(let t=r.rowCount-r.bottomFrozenRowCount;t<=r.rowCount-1;t++)s.updateCellContent(i,t)}else{for(let t=0;t<=r.frozenColCount-1;t++){const e=r.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}for(let t=s.bodyColStart;t<=s.bodyColEnd;t++){const e=r.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}for(let t=r.colCount-r.rightFrozenColCount;t<=r.colCount-1;t++){const e=r.scenegraph.getColGroup(t);null==e||e.setAttribute("chartInstance",void 0);for(let e=i;e<=o;e++)s.updateCellContent(t,e)}}}(t,e,i,o,n,this.table)}updateContainerAttrWidthAndX(){var t,e,i;const o=XB(this.cornerHeaderGroup,0),n=XB(this.rowHeaderGroup,0),r=this.colHeaderGroup.hasChildNodes()&&this.colHeaderGroup.firstChild?XB(this.colHeaderGroup,this.colHeaderGroup.firstChild.col>0?this.table.getColsWidth(null!==(t=this.table.frozenColCount)&&void 0!==t?t:0,this.colHeaderGroup.firstChild.col-1):0):0,s=this.bodyGroup.hasChildNodes()&&this.bodyGroup.firstChild?XB(this.bodyGroup,this.bodyGroup.firstChild.col>0?this.table.getColsWidth(null!==(e=this.table.frozenColCount)&&void 0!==e?e:0,this.bodyGroup.firstChild.col-1):0):0,l=XB(this.rightFrozenGroup.childrenCount>0?this.rightFrozenGroup:this.rightTopCornerGroup,0);this.bottomFrozenGroup.hasChildNodes()&&this.bottomFrozenGroup.firstChild&&XB(this.bottomFrozenGroup,this.bottomFrozenGroup.firstChild.col>0?this.table.getColsWidth(null!==(i=this.table.frozenColCount)&&void 0!==i?i:0,this.bottomFrozenGroup.firstChild.col-1):0),XB(this.leftBottomCornerGroup,0),XB(this.rightTopCornerGroup,0),XB(this.rightBottomCornerGroup,0),this.cornerHeaderGroup.setDeltaWidth(o-this.cornerHeaderGroup.attribute.width),this.leftBottomCornerGroup.setDeltaWidth(o-this.leftBottomCornerGroup.attribute.width),this.colHeaderGroup.setDeltaWidth(r-this.colHeaderGroup.attribute.width),this.rowHeaderGroup.setDeltaWidth(n-this.rowHeaderGroup.attribute.width),this.bottomFrozenGroup.setDeltaWidth(r-this.bottomFrozenGroup.attribute.width),this.rightFrozenGroup.setDeltaWidth(l-this.rightFrozenGroup.attribute.width),this.rightTopCornerGroup.setDeltaWidth(l-this.rightTopCornerGroup.attribute.width),this.rightBottomCornerGroup.setDeltaWidth(l-this.rightBottomCornerGroup.attribute.width),this.bodyGroup.setDeltaWidth(s-this.bodyGroup.attribute.width),this.colHeaderGroup.setAttribute("x",this.cornerHeaderGroup.attribute.width),this.bottomFrozenGroup.setAttribute("x",this.table.getFrozenColsWidth()),this.bodyGroup.setAttribute("x",this.rowHeaderGroup.attribute.width)}updateContainer(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?this._needUpdateContainer||(this._needUpdateContainer=!0,setTimeout((()=>{this.updateContainerSync()}),0)):(this._needUpdateContainer=!0,this.updateContainerSync())}updateContainerSync(){this._needUpdateContainer&&(this._needUpdateContainer=!1,this.updateContainerAttrWidthAndX(),this.updateTableSize(),this.component.updateScrollBar(),this.updateDomContainer(),this.updateNextFrame())}updateCellContentWhileResize(t,e){var i;const o=(null===(i=this.table.getCellRawRecord(t,e))||void 0===i?void 0:i.vtableMerge)?"text":this.table.isHeader(t,e)?this.table._getHeaderLayoutMap(t,e).headerType:this.table.getBodyColumnType(t,e),n=this.getCell(t,e);"image"!==o&&"video"!==o||TS(n,t,e,0,0,this.table)}createFrameBorder(){this.updateTableSize();const t=!this.isPivot&&!this.table.internalProps.transpose;zA(this.bodyGroup,this.table.theme.bodyStyle.frameStyle,this.bodyGroup.role,t?[!0,!0,!0,!1]:void 0),zA(this.rowHeaderGroup,this.isPivot||this.table.internalProps.transpose?this.table.theme.rowHeaderStyle.frameStyle:this.table.theme.bodyStyle.frameStyle,this.rowHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),zA(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle,this.colHeaderGroup.role,t?[!0,!0,!0,!1]:void 0),zA(this.cornerHeaderGroup,this.isPivot?this.table.theme.cornerHeaderStyle.frameStyle:this.table.theme.headerStyle.frameStyle,this.cornerHeaderGroup.role,t?[!0,!1,!0,!0]:void 0),zA(this.tableGroup,this.table.theme.frameStyle,this.tableGroup.role,void 0)}getResizeColAt(t,e,i){let o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;if(!i){const i=this.table.getDrawRange();return e>=i.top&&e<=i.bottom&&(o=this.table.getCellAtRelativePosition(t-n,e),o.col===this.table.colCount-1)?o:{col:-1,row:-1}}return i.stage?(t<i.globalAABBBounds.x1+n?o={col:i.col-1,row:i.row,x:i.globalAABBBounds.x1}:i.globalAABBBounds.x2-n<t&&(o={col:i.col,row:i.row,x:i.globalAABBBounds.x2}),o&&this.table.rightFrozenColCount>0&&o.col>=this.table.colCount-this.table.rightFrozenColCount-1&&this.table.tableNoFrameWidth-this.table.getFrozenColsWidth()-this.table.getRightFrozenColsWidth()+this.table.scrollLeft<this.bodyGroup.attribute.width&&(o.col=o.col+1,o.rightFrozen=!0),o||{col:-1,row:-1}):{col:-1,row:-1}}getResizeRowAt(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:8;if(i){let t;if(e<i.globalAABBBounds.y1+o?t={col:i.col,row:i.row-1,y:i.globalAABBBounds.y1}:i.globalAABBBounds.y2-o<e&&(t={col:i.col,row:i.row,y:i.globalAABBBounds.y2}),t&&this.table.bottomFrozenRowCount>0&&t.row>=this.table.rowCount-this.table.bottomFrozenRowCount-1&&this.table.tableNoFrameHeight-this.table.getFrozenRowsHeight()-this.table.getBottomFrozenRowsHeight()+this.table.scrollTop<this.bodyGroup.attribute.height&&(t.row=t.row+1,t.bottomFrozen=!0),t)return t}return{col:-1,row:-1}}updateFrozen(){this.clear||(this.resetFrozen(),this.component.updateScrollBar())}dealWidthRightFrozen(t){this.clear?this.table.internalProps.rightFrozenColCount=t:function(t,e){const{table:i,proxy:o,rightTopCornerGroup:n,rightFrozenGroup:r,rightBottomCornerGroup:s,bottomFrozenGroup:l,bodyGroup:a,colHeaderGroup:h}=e,d=e.table.rightFrozenColCount;if(t>d){for(let o=i.colCount-d-1;o>=i.colCount-t;o--)UB(r,e.getColGroup(o),r.firstChild),UB(n,e.getColGroup(o,!0),n.firstChild),UB(s,e.getColGroupInBottom(o),s.firstChild);let o=0;r.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,n.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,s.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width}))}else if(t<d){for(let o=i.colCount-d;o<i.colCount-t;o++){const t=e.getColGroup(o);t.setAttribute("x",a.lastChild.attribute.x+i.getColWidth(a.lastChild.col)),a.appendChild(t);const n=e.getColGroupInRightTopCorner(o);n.setAttribute("x",h.lastChild.attribute.x+i.getColWidth(h.lastChild.col)),h.appendChild(n);const r=e.getColGroupInRightBottomCorner(o);r.setAttribute("x",l.lastChild.attribute.x+i.getColWidth(l.lastChild.col)),l.appendChild(r)}let o=0;r.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,n.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width})),o=0,s.forEachChildren((t=>{t.setAttribute("x",o),o+=t.attribute.width}))}r.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),n.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),s.setAttribute("width",i.getColsWidth(i.colCount-t,i.colCount-1)),i.internalProps.rightFrozenColCount=t,e.updateContainer(),e.component.updateScrollBar(),e.updateNextFrame()}(t,this)}dealWidthBottomFrozen(t){this.clear?this.table.internalProps.bottomFrozenRowCount=t:function(t,e){const{table:i,proxy:o,bottomFrozenGroup:n,leftBottomCornerGroup:r,rightBottomCornerGroup:s}=e;n.childrenCount||(o.table.isPivotChart()||(YR(r,0,0,0,i.frozenColCount-1,0,-1,"rowHeader",i),YR(s,0,0,i.colCount-i.rightFrozenColCount,i.colCount-1,0,-1,"body",i)),YR(n,0,0,o.colStart,o.colEnd,0,-1,"body",i));const l=e.table.bottomFrozenRowCount;if(t>l){for(let o=0;o<i.frozenColCount;o++){const n=e.getColGroupInLeftBottomCorner(o);for(let r=i.rowCount-l-1;r>=i.rowCount-t;r--)UB(n,e.getCell(o,r,!0),n.firstChild);let r=0;n.forEachChildren((t=>{t.setAttribute("y",r),r+=i.getRowHeight(t.row)}))}for(let n=o.colStart;n<=o.colEnd;n++){const o=e.getColGroupInBottom(n);for(let r=i.rowCount-l-1;r>=i.rowCount-t;r--)UB(o,e.getCell(n,r,!0),o.firstChild);let r=0;o.forEachChildren((t=>{t.setAttribute("y",r),r+=i.getRowHeight(t.row)}))}if(i.rightFrozenColCount>0)for(let o=i.colCount-i.rightFrozenColCount;o<i.colCount;o++){const n=e.getColGroupInRightBottomCorner(o);for(let r=i.rowCount-l-1;r>=i.rowCount-t;r--)UB(n,e.getCell(o,r,!0),n.firstChild);let r=0;n.forEachChildren((t=>{t.setAttribute("y",r),r+=i.getRowHeight(t.row)}))}}else if(t<l){for(let o=0;o<i.rowHeaderLevelCount;o++){const n=e.getColGroup(o);for(let r=i.rowCount-l;r<i.rowCount-t;r++){const t=e.getCell(o,r,!0);t.setAttribute("y",n.lastChild.attribute.y+i.getRowHeight(n.lastChild.row)),n.appendChild(t)}const r=e.getColGroupInLeftBottomCorner(o);let s=0;r.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}for(let n=o.colStart;n<=o.colEnd;n++){const o=e.getColGroup(n);for(let r=i.rowCount-l;r<i.rowCount-t;r++){const t=e.getCell(n,r,!0);t.setAttribute("y",o.lastChild.attribute.y+i.getRowHeight(o.lastChild.row)),o.appendChild(t)}const r=e.getColGroupInBottom(n);let s=0;r.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}if(i.rightFrozenColCount>0)for(let o=i.colCount-i.rightFrozenColCount;o<i.colCount;o++){const n=e.getColGroup(o);for(let r=i.rowCount-l;r<i.rowCount-t;r++){const t=e.getCell(o,r,!0);t.setAttribute("y",n.lastChild.attribute.y+i.getRowHeight(n.lastChild.row)),n.appendChild(t)}const r=e.getColGroupInRightBottomCorner(o);let s=0;r.forEachChildren((t=>{t.setAttribute("y",s),s+=i.getRowHeight(t.row)}))}}n.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),r.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),s.setAttribute("height",i.getRowsHeight(i.rowCount-t,i.rowCount-1)),i.internalProps.bottomFrozenRowCount=t,e.updateContainer(),e.component.updateScrollBar(),e.updateNextFrame()}(t,this)}updateBorderSizeAndPosition(){this.bodyGroup.border&&(this.bodyGroup.appendChild(this.bodyGroup.border),DA(this.bodyGroup),this.rowHeaderGroup.attribute.width,IA(this.bodyGroup,this.table.theme.bodyStyle.frameStyle)),this.colHeaderGroup.border&&(this.colHeaderGroup.appendChild(this.colHeaderGroup.border),DA(this.colHeaderGroup),this.cornerHeaderGroup.attribute.width,IA(this.colHeaderGroup,this.table.theme.headerStyle.frameStyle)),this.rowHeaderGroup.border&&(this.rowHeaderGroup.appendChild(this.rowHeaderGroup.border),DA(this.rowHeaderGroup)),this.cornerHeaderGroup.border&&(this.cornerHeaderGroup.appendChild(this.cornerHeaderGroup.border),DA(this.cornerHeaderGroup)),function(t){if(!t.theme.frameStyle.cornerRadius)return;const e=t.theme.frameStyle.cornerRadius,{cornerHeaderGroup:i,colHeaderGroup:o,rowHeaderGroup:n,bodyGroup:r,rightTopCornerGroup:s,leftBottomCornerGroup:l,rightBottomCornerGroup:a,rightFrozenGroup:h,bottomFrozenGroup:d}=t.scenegraph;i.setAttribute("cornerRadius",0),o.setAttribute("cornerRadius",0),n.setAttribute("cornerRadius",0),r.setAttribute("cornerRadius",0),s.setAttribute("cornerRadius",0),l.setAttribute("cornerRadius",0),a.setAttribute("cornerRadius",0),h.setAttribute("cornerRadius",0),d.setAttribute("cornerRadius",0);const c=fw(e);i.attribute.width>0&&i.attribute.height>0?WA(i,[c[0],0,0,0]):o.attribute.height>0?WA(o,[c[0],0,0,0]):n.attribute.width>0?WA(n,[c[0],0,0,0]):WA(r,[c[0],0,0,0]),l.attribute.width>0&&l.attribute.height>0?WA(l,[0,0,0,c[3]]):d.attribute.height>0?WA(d,[0,0,0,c[3]]):n.attribute.width>0?WA(n,[0,0,0,c[3]]):WA(r,[0,0,0,c[3]]),s.attribute.width>0&&s.attribute.height>0?WA(s,[0,c[1],0,0]):o.attribute.height>0?WA(o,[0,c[1],0,0]):h.attribute.width>0?WA(h,[0,c[1],0,0]):WA(r,[0,c[1],0,0]),a.attribute.width>0&&a.attribute.height>0?WA(a,[0,0,c[2],0]):h.attribute.width>0?WA(h,[0,0,c[2],0]):d.attribute.height>0?WA(d,[0,0,c[2],0]):WA(r,[0,0,c[2],0])}(this.table)}sortCell(){this.isPivot||(this.table.transpose?this.proxy.sortCellHorizontal():this.proxy.sortCellVertical())}getCellOverflowText(t,e){var i,o;const n=this.getCell(t,e).getChildByName("text",!0);if(n&&"text"===n.type){if(n.attribute.moreThanMaxCharacters)return this.table.getCellValue(t,e);const r=et(n.attribute.text)?n.attribute.text.join(""):n.attribute.text;let s="";if(tt(n.cache.clipedText)?s=n.cache.clipedText:null===(o=null===(i=n.cache.layoutData)||void 0===i?void 0:i.lines)||void 0===o||o.forEach((t=>{s+=t.str})),s!==r)return this.table.getCellValue(t,e)}else if(n&&"richtext"===n.type){const i=n;if(i.attribute.ellipsis&&i._frameCache&&i.attribute.height<i._frameCache.actualHeight)return i.attribute.textConfig.find((t=>t.text)),this.table.getCellValue(t,e)}return null}updateDrill(t,e,i,o,n){this.component.drillIcon.update(t,e,i,o,n,this)}updateCellContent(t,e){if(!this.clear)return IS(t,e,this.table)}setPixelRatio(t){this.stage.disableDirtyBounds(),this.stage.window.setDpr(t),this.stage.render(),this.stage.enableDirtyBounds()}updateRow(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.table.internalProps.layoutMap.clearCellRangeMap(),this.table.internalProps.useOneRowHeightFillAll=!1;const n=Jy(e.map((t=>t.row))).sort(((t,e)=>t-e)),r=Jy(i.map((t=>t.row))).sort(((t,e)=>t-e)),s=this.table.getAllRowsHeight()-[...n,...r].reduce(((t,e)=>t+this.table.getRowHeight(e)),0)<=this.table.tableNoFrameHeight;if(EB(t,e,i,this.table),o&&this.recalculateColWidths(),"adaptive"===this.table.heightMode||this.table.autoFillHeight&&(this.table.getAllRowsHeight()<=this.table.tableNoFrameHeight||s))this.table.scenegraph.recalculateRowHeights();else if("autoHeight"===this.table.heightMode)for(let t=0;t<r.length;t++){const e=r[t],i=this.table.getRowHeight(e),o=oA(e,0,this.table.colCount-1,this.table);(e>=this.proxy.rowStart&&e<=this.proxy.rowEnd||e>=this.table.rowCount-this.table.bottomFrozenRowCount&&e<=this.table.rowCount-1)&&this.table.scenegraph.updateRowHeight(e,o-i)}this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}updateCol(t,e){tM(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],this.table),this.recalculateColWidths(),this.recalculateRowHeights(),this.table.stateManager.checkFrozen(),this.isPivot||this.table.transpose?this.table.options.frozenColCount?this.component.setFrozenColumnShadow(this.table.frozenColCount-1):this.table.options.rightFrozenColCount&&this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount):(this.component.setFrozenColumnShadow(this.table.frozenColCount-1),this.component.setRightFrozenColumnShadow(this.table.colCount-this.table.rightFrozenColCount)),this.component.updateScrollBar(),this.updateNextFrame()}getColumnGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupY(t){return t<this.table.frozenRowCount?this.table.getRowsHeight(0,t-1):t<this.table.rowCount-this.table.bottomFrozenRowCount?this.table.getRowsHeight(this.table.frozenRowCount,t-1):t<this.table.rowCount?this.table.getRowsHeight(this.table.rowCount-this.table.bottomFrozenRowCount,t-1):0}getCellGroupX(t){return t<this.table.rowHeaderLevelCount?this.table.getColsWidth(0,t-1):t<this.table.colCount-this.table.rightFrozenColCount?this.table.getColsWidth(this.table.rowHeaderLevelCount,t-1):t<this.table.colCount?this.table.getColsWidth(this.table.colCount-this.table.rightFrozenColCount,t-1):0}updateDomContainer(){!function(t){const{headerDomContainer:e,bodyDomContainer:i,frozenBodyDomContainer:o,frozenHeaderDomContainer:n,rightFrozenBodyDomContainer:r,rightFrozenHeaderDomContainer:s,bottomDomContainer:l,frozenBottomDomContainer:a,rightFrozenBottomDomContainer:h}=t.internalProps;if(!(e||i||o||n||r||s||l||a||h))return;const d=t.getAllColsWidth(),c=Math.min(d,t.tableNoFrameWidth),u=t.getFrozenColsWidth(),g=t.getRightFrozenColsWidth(),p=u+g,f=Math.min(d-p,c-p),v=t.getAllRowsHeight(),m=Math.min(v,t.tableNoFrameHeight),b=t.getFrozenRowsHeight(),C=t.getBottomFrozenRowsHeight(),y=b+C,w=Math.min(v-y,m-y);t.frozenColCount>0?(e.style.left=`${t.tableX+u}px`,i.style.left=`${t.tableX+u}px`,l.style.left=`${t.tableX+u}px`):0===t.frozenColCount&&(e.style.left=`${t.tableX}px`,i.style.left=`${t.tableX}px`,l.style.left=`${t.tableX}px`),o.style.left=`${t.tableX}px`,n.style.left=`${t.tableX}px`,e.style.width=`${f}px`,e.style.height=`${b}px`,i.style.top=`${t.tableY}px`,i.style.width=`${f}px`,i.style.height=`${w}px`,i.style.top=`${t.tableY+b}px`,o.style.width=`${u}px`,o.style.height=`${w}px`,o.style.top=`${t.tableY+b}px`,n.style.width=`${u}px`,n.style.height=`${b}px`,n.style.top=`${t.tableY}px`,r.style.width=`${g}px`,r.style.height=`${w}px`,r.style.top=`${t.tableY+b}px`,r.style.left=t.tableX+c-g+"px",s.style.width=`${g}px`,s.style.height=`${b}px`,s.style.top=`${t.tableY}px`,s.style.left=t.tableX+c-g+"px",l.style.width=`${f}px`,l.style.height=`${C}px`,l.style.top=t.tableY+m-C+"px",a.style.width=`${u}px`,a.style.height=`${C}px`,a.style.top=t.tableY+m-C+"px",h.style.width=`${g}px`,h.style.height=`${C}px`,h.style.top=t.tableY+m-C+"px",h.style.left=t.tableX+c-g+"px"}(this.table)}setLoadingHierarchyState(t,e){const i=this.getCell(t,e).getChildByName("collapse",!0);if(i){wS(cS()[_y.loadingIconName],i,t,e)}}}function rM(t,e,i){const o=t.highPerformanceGetCell(e,i);if("cell"===o.role&&K(o.mergeStartCol)&&K(o.mergeStartRow)&&K(o.mergeEndCol)&&K(o.mergeEndRow)){const{colStart:e,colEnd:i,rowStart:n,rowEnd:r}=hA(o,t);for(let o=e;o<=i;o++)for(let e=n;e<=r;e++)t.highPerformanceGetCell(o,e).addUpdateBoundTag()}else o.addUpdateBoundTag()}function sM(t,e,i,o,n){const r=t.table;for(let i=0;i<r.columnHeaderLevelCount;i++)rM(t,e,i);const s=t.getColGroup(e);return null==s||s.addUpdateBoundTag(),!0}function lM(t,e,i,o,n,r){const s=t.table;for(let i=0;i<s.columnHeaderLevelCount;i++)rM(t,e,i);const l=t.getColGroup(e);return null==l||l.addUpdateBoundTag(),!0}function aM(t,e,i,o,n){const r=t.table;for(let e=0;e<r.colCount;e++)rM(t,e,i);return!0}function hM(t,e,i,o,n,r){const s=t.table;for(let e=0;e<s.colCount;e++)rM(t,e,i);return!0}function dM(t,e,i){const{table:o}=t,{scenegraph:n}=o,{highlightScope:r,singleStyle:s,disableHeader:l,cellPos:a,cellPosContainHeader:h}=t.hover,d=a.col,c=a.row;if(r===vy.none||l&&(h.col!==e||h.row!==i)){const t=h.col,o=h.row;n.hideHoverIcon(t,o),n.showHoverIcon(e,i),h.col=e,h.row=i}if((l&&o.isHeader(e,i)||r===vy.none)&&(e=-1,i=-1),d===e&&c===i)return;n.deactivateChart(d,c),n.activateChart(e,i);let u=!1;const{ranges:g,highlightScope:p}=t.select;if(-1!==d&&-1!==c&&(u=function(t,e,i,o,n,r,s){let l=!1;return r===vy.single?l=!!function(t,e,i,o,n){return rM(t,e,i),!0}(t,e,i):r===vy.row?l=!!aM(t,0,i):r===vy.column?l=!!sM(t,e):r===vy.cross&&(l=!!aM(t,0,i),l=!!sM(t,e)),l}(n,d,c,0,0,r),l||n.hideHoverIcon(d,c)),-1===e||-1===i)return a.col=-1,a.row=-1,void(!u||d===e&&c===i||t.table.scenegraph.updateNextFrame());r===vy.single?u=!!function(t,e,i,o,n){return rM(t,e,i),!0}(n,e,i):r===vy.row?u=!!hM(n,0,i):r===vy.column?u=!!lM(n,e):r===vy.cross&&(u=!!hM(n,0,i),u=!!lM(n,e)),r===vy.none||l||n.showHoverIcon(e,i),a.col=e,a.row=i,u&&t.table.scenegraph.updateNextFrame()}function cM(t,e,i,o){var n;let r,s=null,l=!1;if(Array.isArray(i.sortState))for(let o=0;o<i.sortState.length&&(r=i.sortState[o],r&&(s=i._getHeaderCellBySortState(r)),s&&(l=uM(t,e,s.col,s.row,i)),!l);o++);else r=i.sortState,r&&(s=i._getHeaderCellBySortState(r)),s&&(l=uM(t,e,s.col,s.row,i));const a=i.getHeaderDefine(t,e);if(r&&l&&(null==a?void 0:a.sort)?r.order="asc"===r.order?"desc":"desc"===r.order?"normal":"asc":(null==a?void 0:a.sort)?r={field:i.getHeaderField(t,e),order:"asc"}:l&&(null==a?void 0:a.showSort)||(r={field:i.getHeaderField(t,e),order:"normal"}),r.event=o,i.fireListeners(Aw.SORT_CLICK,r).includes(!1))return;let h=!1,d=i.internalProps.sortState?Array.isArray(i.internalProps.sortState)&&(h=!0)?i.internalProps.sortState:[i.internalProps.sortState]:[];if(Array.isArray(d)){const t=d.findIndex((t=>t.field===r.field));t>=0?d[t]=r:d.push(r)}d=d.filter((t=>"normal"!==t.order)),d=i.internalProps.multipleSort&&(h=!0)?d:d.splice(-1),d=h&&d.length?d:d[0],i.internalProps.sortState=d,i.stateManager.setSortState(d),(null==a?void 0:a.sort)&&function(t,e,i){t=Array.isArray(t)||!t?t:[t],e.dataSource.sort((t||[]).map((t=>{var i,o;const n=e.internalProps.layoutMap.headerObjects.find((e=>e&&e.field===t.field));return{field:t.field,order:t.order||"asc",orderFn:"function"==typeof(null===(i=null==n?void 0:n.define)||void 0===i?void 0:i.sort)?null===(o=null==n?void 0:n.define)||void 0===o?void 0:o.sort:qy}})))}(d,i),i.internalProps.useOneRowHeightFillAll=!1,i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.sortCell();const c=!!(null===(n=i.stateManager.select.ranges)||void 0===n?void 0:n.length);i.stateManager.updateSelectPos(-1,-1),i.stateManager.endSelectCells(!0,c)}function uM(t,e,i,o,n){return n._getLayoutCellId(t,e)===n._getLayoutCellId(i,o)}const gM=hw(Aw,{PIVOT_SORT_CLICK:"pivot_sort_click",DRILLMENU_CLICK:"drillmenu_click"});function pM(t,e,i,o,n){for(let i=t;i<=e;i++)n._clearColRangeWidthsMap(i);for(let t=i;t<=o;t++)n._clearRowRangeHeightsMap(t)}function fM(t){var e;if(!t)return;const i=(null===(e=t.role)||void 0===e?void 0:e.startsWith("icon"))?t:"richtext"===t.type?t._currentHoverIcon:void 0;return i?"richtext"===t.type?{icon:i,position:{left:t.globalAABBBounds.x1+i.globalAABBBounds.x1,right:t.globalAABBBounds.x1+i.globalAABBBounds.x2,top:t.globalAABBBounds.y1+i.globalAABBBounds.y1,bottom:t.globalAABBBounds.y1+i.globalAABBBounds.y2,width:i.globalAABBBounds.x2-i.globalAABBBounds.x1,height:i.globalAABBBounds.y2-i.globalAABBBounds.y1},type:"richtext-icon"}:{icon:i,position:{left:i.globalAABBBounds.x1,right:i.globalAABBBounds.x2,top:i.globalAABBBounds.y1,bottom:i.globalAABBBounds.y2,width:i.globalAABBBounds.x2-i.globalAABBBounds.x1,height:i.globalAABBBounds.y2-i.globalAABBBounds.y1},type:"icon"}:void 0}function vM(t,e){"adaptive"===e.table.widthMode&&e.columnResize.col<e.table.colCount-1?(e.table.scenegraph.updateColWidth(e.columnResize.col,t),e.table.scenegraph.updateColWidth(e.columnResize.col+1,-t),e.table.internalProps._widthResizedColMap.add(e.columnResize.col),e.table.internalProps._widthResizedColMap.add(e.columnResize.col+1)):(e.table.scenegraph.updateColWidth(e.columnResize.col,t),e.table.internalProps._widthResizedColMap.add(e.columnResize.col))}function mM(t,e){"adaptive"===e.table.heightMode&&e.rowResize.row<e.table.rowCount-1?(e.table.scenegraph.updateRowHeight(e.rowResize.row,t),e.table.scenegraph.updateRowHeight(e.rowResize.row+1,-t),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row+1)):(e.table.scenegraph.updateRowHeight(e.rowResize.row,t),e.table.internalProps._heightResizedRowMap.add(e.rowResize.row))}hw(Aw,{VCHART_EVENT_TYPE:"vchart_event_type"});class bM{constructor(t){this.fastScrolling=!1,this.checkedState=[],this.headerCheckedState={},this._checkboxCellTypeFields=[],this._headerCheckFuncs={},this.radioState={},this.resetInteractionState=Bw((t=>{this.updateInteractionState(null!=t?t:fy.default)}),100),this.table=t,this.initState(),this.updateVerticalScrollBar=this.updateVerticalScrollBar.bind(this),this.updateHorizontalScrollBar=this.updateHorizontalScrollBar.bind(this)}initState(){this._initState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}updateOptionSetState(){this._updateOptionSetState(),this.setHoverState(),this.setSelectState(),this.setFrozenState()}_updateOptionSetState(){this.interactionState=fy.default,this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new ke,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort=[{col:-1,row:-1,order:"normal"}],this.frozen={col:-1},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}_initState(){this.interactionState=fy.default,this.select={highlightScope:vy.single,ranges:[],cellPos:{col:-1,row:-1},selecting:!1},this.fillHandle={isFilling:!1,startX:void 0,startY:void 0},this.hover={highlightScope:vy.single,cellPos:{col:-1,row:-1}},this.hoverIcon={col:-1,row:-1,icon:null},this.columnResize={col:-1,x:0,resizing:!1},this.rowResize={row:-1,y:0,resizing:!1},this.columnMove={colSource:-1,colTarget:-1,rowSource:-1,rowTarget:-1,x:0,y:0,moving:!1},this.menu={x:-1,y:-1,isShow:!1,itemList:[],bounds:new ke,highlightIndex:-1,dropDownMenuHighlight:[]},this.sort=[{col:-1,row:-1,order:"normal"}],this.frozen={col:-1},this.scroll={horizontalBarPos:0,verticalBarPos:0},this.tablePosition={absoluteX:0,absoluteY:0},this.drill={col:-1,row:-1},this.sparkLine={col:-1,row:-1}}setHoverState(){var t;const{highlightMode:e,disableHover:i,disableHeaderHover:o}=null!==(t=this.table.options.hover)&&void 0!==t?t:{highlightMode:"cell"};i?this.hover.highlightScope=vy.none:"cross"===e?this.hover.highlightScope=vy.cross:"row"===e?this.hover.highlightScope=vy.row:"column"===e?this.hover.highlightScope=vy.column:"cell"===e&&(this.hover.highlightScope=vy.single),this.hover.singleStyle=!i,this.hover.disableHeader=o,(this.hover.highlightScope===vy.none||o)&&(this.hover.cellPosContainHeader={col:-1,row:-1})}setSelectState(){const{headerSelectMode:t,disableSelect:e,disableHeaderSelect:i,highlightMode:o,highlightInRange:n}=Object.assign({},{headerSelectMode:"inline",disableSelect:!1,disableHeaderSelect:!1,highlightMode:"cell",highlightInRange:!1},this.table.options.select);this.select.highlightScope=e?vy.none:"cross"===o?vy.cross:"row"===o?vy.row:"column"===o?vy.column:vy.single,this.select.singleStyle=!e,this.select.disableHeader=i,this.select.headerSelectMode=t,this.select.highlightInRange=n}isSelected(t,e){let i=!1;return this.select.ranges.forEach((o=>{vw(o,t,e)&&(i=!0)})),i}setSortState(t){const e=this,i=(t=!t||Array.isArray(t)?t:[t])&&t.reduce(((t,i)=>{var o,n,r;const s=null===(o=function(t){const i=[];return function t(o){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o.forEach((o=>{var r;const s=o.startInTotal?null!==(r=o.startInTotal+e.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)&&void 0!==r?r:0:n;o.columns?t(o.columns,s):i.push(Object.assign(Object.assign({},o),{startIndex:s}))}))}(t),i}(this.table.internalProps.columns))||void 0===o?void 0:o.find((t=>(null==t?void 0:t.field)===(null==i?void 0:i.field)));return this.table.internalProps.transpose?t.push({field:i.field,order:i.order,row:null!==(n=(null==s?void 0:s.startInTotal)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)&&void 0!==n?n:0,col:null==s?void 0:s.level}):t.push({field:i.field,order:i.order,col:null!==(r=(null==s?void 0:s.startInTotal)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)&&void 0!==r?r:0,row:null==s?void 0:s.level}),t}),[]);this.sort=i||[]}setFrozenState(){this.frozen.col=this.table.frozenColCount-1}updateInteractionState(t){if(this.interactionState===t)return;t===fy.scrolling&&(this.interactionStateBeforeScroll=this.interactionState);const e=this.interactionState;this.interactionState=t,e===fy.scrolling&&fy.default}updateHoverhighlightScope(t){this.hover.highlightScope!==t&&(this.hover.highlightScope=t)}updateHoverPos(t,e){dM(this,t,e)}updateSelectPos(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],l=arguments.length>7&&void 0!==arguments[7]&&arguments[7];-1!==e&&-1!==e&&(this.select.selecting=!0),function(t,e,i,o,n,r){let s=arguments.length>6&&void 0!==arguments[6]&&arguments[6],l=arguments.length>7&&void 0!==arguments[7]&&arguments[7],a=arguments.length>8&&void 0!==arguments[8]&&arguments[8];var h,d;const{table:c,interactionState:u}=t,{scenegraph:g}=c,{highlightScope:p,disableHeader:f,cellPos:v}=t.select;if((f&&c.isHeader(e,i)||"none"===p)&&!1===a&&(-1===e||-1===i||s||c._makeVisibleCell(e,i),e=-1,i=-1),-1!==e&&-1!==i&&!s)if(u===fy.grabing&&t.select.ranges.length>0){const o=t.select.ranges[t.select.ranges.length-1];e>o.start.col&&e>o.end.col&&c._makeVisibleCell(e+1,i),i>o.start.row&&i>o.end.row&&c._makeVisibleCell(e,i+1),e<o.start.col&&e<o.end.col&&c._makeVisibleCell(e-1,i),i<o.start.row&&i<o.end.row&&c._makeVisibleCell(e,i-1)}else c._makeVisibleCell(e,i);if(r){t.select.ranges=[],g.deleteAllSelectBorder();let e=0,i=0;const{disableHeaderSelect:o,disableRowSeriesNumberSelect:n}=(null===(h=c.options.keyboardOptions)||void 0===h?void 0:h.selectAllOnCtrlA)||{};o&&(e=c.rowHeaderLevelCount,i=c.columnHeaderLevelCount),(n||o&&c.transpose)&&c.options.rowSeriesNumber&&(e+=1),t.select.ranges.push({start:{col:e,row:i},end:{col:c.colCount-1,row:c.rowCount-1}});const r=t.select.ranges[t.select.ranges.length-1];g.updateCellSelectBorder(r,!1)}else if(-1===v.col||-1===v.row||-1!==e&&-1!==i)if(u!==fy.default||c.eventManager.isDraging||c.stateManager.isResizeCol()){if((u===fy.grabing||c.eventManager.isDraging)&&!c.stateManager.isResizeCol()){let o=!0;-1===v.col&&(v.col=e),-1===v.row&&(v.row=i),v.col=e,v.row=i;const n=t.select.ranges[t.select.ranges.length-1];if(n){if(c.internalProps.layoutMap.isSeriesNumberInBody(n.start.col,n.start.row))o=!1,n.end={col:c.colCount-1,row:i};else if(t.fillHandle.isFilling){if("top"===t.fillHandle.direction)if(i===t.fillHandle.beforeFillMinRow&&i===t.fillHandle.beforeFillMaxRow)n.start.row=n.end.row=i;else if(i<=t.fillHandle.beforeFillMinRow){if(n.start.row<n.end.row){const t=n.start.row;n.start.row=n.end.row,n.end.row=t}n.end.row=i}else i===t.fillHandle.beforeFillMaxRow&&(n.start.row>n.end.row?n.start.row=i:n.end.row=i);else if("bottom"===t.fillHandle.direction){if(i>=t.fillHandle.beforeFillMaxRow){if(n.start.row>n.end.row){const t=n.start.row;n.start.row=n.end.row,n.end.row=t}n.end.row=i}}else if("left"===t.fillHandle.direction)if(e===t.fillHandle.beforeFillMinCol&&e===t.fillHandle.beforeFillMaxCol)n.start.col=n.end.col=e;else if(e<=t.fillHandle.beforeFillMinCol){if(n.start.col<n.end.col){const t=n.start.col;n.start.col=n.end.col,n.end.col=t}n.end.col=e}else e===t.fillHandle.beforeFillMaxCol&&(n.start.col>n.end.col?n.start.col=e:n.end.col=e);else if("right"===t.fillHandle.direction&&e>=t.fillHandle.beforeFillMaxCol){if(n.start.col>n.end.col){const t=n.start.col;n.start.col=n.end.col,n.end.col=t}n.end.col=e}}else{n.end={col:e,row:i};const o=l?{start:{col:e,row:i},end:{col:e,row:i}}:c.getCellRange(e,i);n.start.col<o.end.col?n.end.col=o.end.col:n.start.col>o.start.col&&(n.end.col=o.start.col),n.start.row<o.end.row?n.end.row=o.end.row:n.start.row>o.start.row&&(n.end.row=o.start.row),"body"===t.select.headerSelectMode&&(c.isRowHeader(e,i)?(n.start.col=c.rowHeaderLevelCount+c.leftRowSeriesNumberCount,n.end.col=c.colCount-1):c.isColumnHeader(e,i)?(n.start.row=c.columnHeaderLevelCount,n.end.row=c.rowCount-1):c.internalProps.layoutMap.isSeriesNumberInBody(e,i)?(n.start.col=c.leftRowSeriesNumberCount,n.end.col=c.colCount-1):c.isCornerHeader(e,i)?(n.start.col=c.rowHeaderLevelCount+c.leftRowSeriesNumberCount,n.start.row=c.columnHeaderLevelCount,n.end.col=c.colCount-1,n.end.row=c.rowCount-1):c.isSeriesNumber(e,i)&&(n.start.col=c.leftRowSeriesNumberCount,n.start.row=c.columnHeaderLevelCount,n.end.col=c.colCount-1,n.end.row=c.rowCount-1)),l&&(n.skipBodyMerge=!0)}g.updateCellSelectBorder(n,o)}}}else{const r=t.select.ranges[t.select.ranges.length-1];if(o&&r){if(n||(v.col=e,v.row=i),"cell"!==t.select.headerSelectMode&&c.isColumnHeader(e,i)){const o=Math.min(r.start.col,r.end.col,e),n=Math.max(r.start.col,r.end.col,e),s=Math.min(r.start.row,r.end.row,i),l=c.rowCount-1;"body"===t.select.headerSelectMode?(r.start={col:o,row:c.columnHeaderLevelCount},r.end={col:n,row:c.rowCount-1}):(r.start={col:o,row:s},r.end={col:n,row:l})}else if("cell"!==t.select.headerSelectMode&&c.isRowHeader(e,i)){const o=Math.min(r.start.col,r.end.col,e),n=c.colCount-1,s=Math.min(r.start.row,r.end.row,i),l=Math.max(r.start.row,r.end.row,i);"body"===t.select.headerSelectMode?(r.start={col:c.leftRowSeriesNumberCount+c.rowHeaderLevelCount,row:s},r.end={col:c.colCount-1,row:l}):(r.start={col:o,row:s},r.end={col:n,row:l})}else if("cell"!==t.select.headerSelectMode&&c.isSeriesNumberInBody(e,i)){const o=Math.min(r.start.col,r.end.col,e),n=c.colCount-1,s=Math.min(r.start.row,r.end.row,i),l=Math.max(r.start.row,r.end.row,i);"body"===t.select.headerSelectMode?(r.start={col:c.leftRowSeriesNumberCount,row:s},r.end={col:c.colCount-1,row:l}):(r.start={col:o,row:s},r.end={col:n,row:l})}else r.end={col:e,row:i};g.deleteLastSelectedRangeComponents(),g.updateCellSelectBorder(r)}else{let o=!0;if(-1===v.col||-1===v.row||n||(t.select.ranges=[],g.deleteAllSelectBorder()),"cell"!==t.select.headerSelectMode&&c.isColumnHeader(e,i)){const o=c.getCellRange(e,i);"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:o.start.col,row:c.columnHeaderLevelCount},end:{col:o.end.col,row:c.rowCount-1},skipBodyMerge:!0}):t.select.ranges.push({start:{col:o.start.col,row:i},end:{col:o.end.col,row:c.rowCount-1},skipBodyMerge:!0})}else if("cell"!==t.select.headerSelectMode&&c.isRowHeader(e,i)){const o=c.getCellRange(e,i);"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:c.rowHeaderLevelCount+c.leftRowSeriesNumberCount,row:o.start.row},end:{col:c.colCount-1,row:o.end.row},skipBodyMerge:!0}):t.select.ranges.push({start:{col:e,row:o.start.row},end:{col:c.colCount-1,row:o.end.row},skipBodyMerge:!0})}else if(c.internalProps.layoutMap.isSeriesNumberInHeader(e,i))o=!1,"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:c.leftRowSeriesNumberCount,row:c.columnHeaderLevelCount},end:{col:c.colCount-1,row:c.rowCount-1},skipBodyMerge:!0}):t.select.ranges.push({start:{col:0,row:0},end:{col:c.colCount-1,row:c.rowCount-1},skipBodyMerge:!0});else if(c.internalProps.layoutMap.isSeriesNumberInBody(e,i))o=!1,"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:c.leftRowSeriesNumberCount,row:i},end:{col:c.colCount-1,row:i},skipBodyMerge:!0}):t.select.ranges.push({start:{col:e,row:i},end:{col:c.colCount-1,row:i},skipBodyMerge:!0});else if(c.internalProps.layoutMap.isCornerHeader(e,i))o=!1,"body"===t.select.headerSelectMode?t.select.ranges.push({start:{col:c.rowHeaderLevelCount+c.leftRowSeriesNumberCount,row:c.columnHeaderLevelCount},end:{col:c.colCount-1,row:c.rowCount-1},skipBodyMerge:!0}):t.select.ranges.push({start:{col:c.leftRowSeriesNumberCount,row:0},end:{col:c.colCount-1,row:c.rowCount-1},skipBodyMerge:!0});else if(e>=0&&i>=0){const o=l?{start:{col:e,row:i},end:{col:e,row:i}}:c.getCellRange(e,i);t.select.ranges.push({start:{col:o.start.col,row:o.start.row},end:{col:o.end.col,row:o.end.row},skipBodyMerge:l||void 0})}v.col=e,v.row=i;const r=null===(d=t.select.ranges)||void 0===d?void 0:d[t.select.ranges.length-1];r&&g.updateCellSelectBorder(r,o)}}else v.col=-1,v.row=-1,t.select.ranges=[],g.deleteAllSelectBorder();g.updateNextFrame()}(this,t,e,i,o,n,r,s,l)}checkCellRangeInSelect(t,e){return function(t,e,i,o){for(let o=0;o<i.length;o++)if(bw(i[o],{start:t,end:e}))return!0;return!1}(t,e,this.select.ranges,this.select.highlightScope)}updateHoverIcon(t,e,i,o){var n,r,s,l,a,h,d,c,u;if((null===(n=this.residentHoverIcon)||void 0===n?void 0:n.icon)&&i===(null===(r=this.residentHoverIcon)||void 0===r?void 0:r.icon))return;const g=fM(i);if(g)if("richtext-icon"===g.type){const i=g.icon;if(this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(l=this.residentHoverIcon)||void 0===l?void 0:l.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame()),i.attribute.tooltip){const o={content:i.attribute.tooltip.title,referencePosition:{rect:g.position,placement:i.attribute.tooltip.placement},style:Object.assign({},null===(a=this.table.internalProps.theme)||void 0===a?void 0:a.tooltipStyle,null===(h=i.tooltip)||void 0===h?void 0:h.style,null===(c=null===(d=i.attribute)||void 0===d?void 0:d.tooltip)||void 0===c?void 0:c.style),disappearDelay:i.attribute.tooltip.disappearDelay};this.table.internalProps.tooltipHandler.isBinded(o)||this.table.showTooltip(t,e,o)}}else{const i=g.icon;i!==this.hoverIcon.icon&&(this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(u=this.residentHoverIcon)||void 0===u?void 0:u.icon)&&this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=t,this.hoverIcon.row=e,this.hoverIcon.icon=i,this.table.scenegraph.setIconHoverStyle(i,t,e,o),this.table.scenegraph.updateNextFrame())}else this.hoverIcon.icon&&this.hoverIcon.icon!==(null===(s=this.residentHoverIcon)||void 0===s?void 0:s.icon)&&(this.table.scenegraph.setIconNormalStyle(this.hoverIcon.icon,this.hoverIcon.col,this.hoverIcon.row),this.hoverIcon.col=-1,this.hoverIcon.col=-1,this.hoverIcon.icon=null,this.table.scenegraph.updateNextFrame())}isResizeCol(){return this.columnResize.resizing}isResizeRow(){return this.rowResize.resizing}isFillHandle(){return this.fillHandle.isFilling}isSelecting(){return this.select.selecting}endSelectCells(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.select.selecting){if(this.select.selecting=!1,0===this.select.ranges.length)return;const e=this.select.ranges[this.select.ranges.length-1];let i=!1;for(let t=0;t<this.select.ranges.length-1;t++){const o=this.select.ranges[t];if(o&&o.start.col===e.start.col&&o.start.row===e.start.row&&o.end.col===e.end.col&&o.end.row===e.end.row){i=!0;break}}i?(this.select.ranges.pop(),PB(this.table.scenegraph),this.table.scenegraph.selectingRangeComponents.clear()):this.table.scenegraph.moveSelectingRangeComponentsToSelectedRangeComponents();const o=this.select.ranges[this.select.ranges.length-1].end.col,n=this.select.ranges[this.select.ranges.length-1].end.row;t&&this.table.fireListeners(Aw.SELECTED_CELL,{ranges:this.select.ranges,col:o,row:n})}else e&&0===this.select.ranges.length&&this.table.fireListeners(Aw.SELECTED_CLEAR,{})}endResizeCol(){setTimeout((()=>{this.columnResize.resizing=!1}),0),this.table.scenegraph.updateChartSizeForResizeColWidth(this.columnResize.col),this.checkFrozen(),this.table.scenegraph.component.hideResizeCol(),this.table.scenegraph.updateNextFrame()}startResizeCol(t,e,i,o){var n;this.columnResize.resizing=!0,this.columnResize.col=t,this.columnResize.x=e,this.columnResize.isRightFrozen=o,this.table.scenegraph.component.showResizeCol(t,i,o);const r=!!(null===(n=this.select.ranges)||void 0===n?void 0:n.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,r),this.table.scenegraph.updateNextFrame()}updateResizeCol(t,e){!function(t,e,i){t=Math.ceil(t),e=Math.ceil(e);let o=i.columnResize.isRightFrozen?i.columnResize.x-t:t-i.columnResize.x;if(Math.abs(o)<1)return;const n=i.table.getColWidth(i.columnResize.col);let r=n;r+=o;const s=i.table.getMinColWidth(i.columnResize.col),l=i.table.getMaxColWidth(i.columnResize.col);if(r<s||r>l){if(n===s||n===l)return;o=n-s>l-n?l-n:s-n}let a=i.table.getColWidth(i.columnResize.col)+o;if(a<i.table.internalProps.limitMinWidth&&(a=i.table.internalProps.limitMinWidth,o=a-i.table.getColWidth(i.columnResize.col)),"adaptive"===i.table.widthMode&&i.columnResize.col<i.table.colCount-1){const t=i.table.getColWidth(i.columnResize.col+1),e=i.table.getMinColWidth(i.columnResize.col+1),n=i.table.getMaxColWidth(i.columnResize.col+1);let r=t;if(r-=o,r<e||r>n){if(t===e||t===n)return;o=t-e>n-t?n-t:e-t}r-o<i.table.internalProps.limitMinWidth&&(o=r-i.table.internalProps.limitMinWidth)}o=Math.ceil(o),i.columnResize.col<i.table.rowHeaderLevelCount||i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount?vM(o,i):"indicator"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap;let o,n,r;if(i.indicatorsAsCol)o=i.getIndicatorKey(e.columnResize.col,e.table.columnHeaderLevelCount);else{const t=i.getCellHeaderPaths(e.columnResize.col,e.table.columnHeaderLevelCount-1),o=t.colHeaderPaths[t.colHeaderPaths.length-1];n=o.dimensionKey,r=o.value}for(let s=e.table.rowHeaderLevelCount;s<e.table.colCount-e.table.rightFrozenColCount;s++){const l=i.getIndicatorKey(s,e.table.columnHeaderLevelCount);if(i.indicatorsAsCol&&l===o)e.table.scenegraph.updateColWidth(s,t),e.table.internalProps._widthResizedColMap.add(s);else if(!i.indicatorsAsCol){const o=i.getCellHeaderPaths(s,e.table.columnHeaderLevelCount-1),l=null==o?void 0:o.colHeaderPaths[o.colHeaderPaths.length-1];l&&n===l.dimensionKey&&r===l.value&&(e.table.scenegraph.updateColWidth(s,t),e.table.internalProps._widthResizedColMap.add(s))}}}(o,i):"indicatorGroup"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap,o=i.getCellHeaderPaths(e.columnResize.col,e.table.columnHeaderLevelCount),n=i.getHeadNodeByRowOrColDimensions(o.colHeaderPaths.slice(0,o.colHeaderPaths.length-1)),r=n.startInTotal+e.table.frozenColCount,s=n.startInTotal+e.table.frozenColCount+n.size-1,l=e.table.getColsWidth(r,s),a=t;for(let t=r;t<=s;t++){if(!(e.table.internalProps.transpose||e.table.isPivotTable()&&!i.indicatorsAsCol)){const o=i.getBody(t,e.table.columnHeaderLevelCount);if(null==o?void 0:o.disableColumnResize)continue}let o=e.table.getColWidth(t)/l*a;o>0&&o<.5?o=.5:o<0&&o>=-.5&&(o=-.5),e.table.scenegraph.updateColWidth(t,o),e.table.internalProps._widthResizedColMap.add(t)}}(o,i):"all"===i.table.internalProps.columnResizeType?function(t,e){const i=e.table.internalProps.layoutMap;for(let o=e.table.frozenColCount;o<e.table.colCount-e.table.rightFrozenColCount;o++){if(!(e.table.internalProps.transpose||e.table.isPivotTable()&&!i.indicatorsAsCol)){const t=i.getBody(o,e.table.columnHeaderLevelCount);if(null==t?void 0:t.disableColumnResize)continue}e.table.scenegraph.updateColWidth(o,t),e.table.internalProps._widthResizedColMap.add(o)}}(o,i):vM(o,i),i.columnResize.x=t,i.table.scenegraph.component.updateResizeCol(i.columnResize.col,e,i.columnResize.isRightFrozen),i.columnResize.col<i.table.frozenColCount&&!i.table.isPivotTable()&&!i.table.transpose?i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1,i.columnResize.isRightFrozen):i.table.options.frozenColCount&&i.table.scenegraph.component.setFrozenColumnShadow(i.table.frozenColCount-1),(i.columnResize.col>=i.table.colCount-i.table.rightFrozenColCount&&!i.table.isPivotTable()&&!i.table.transpose||i.table.options.rightFrozenColCount)&&i.table.scenegraph.component.setRightFrozenColumnShadow(i.table.colCount-i.table.rightFrozenColCount),i.table.scenegraph.updateNextFrame()}(t,e,this)}endResizeRow(){setTimeout((()=>{this.rowResize.resizing=!1}),0),this.table.scenegraph.updateChartSizeForResizeRowHeight(this.rowResize.row),this.table.scenegraph.component.hideResizeRow(),this.table.scenegraph.updateNextFrame()}startResizeRow(t,e,i,o){var n;this.rowResize.resizing=!0,this.rowResize.row=t,this.rowResize.y=i,this.rowResize.isBottomFrozen=o,this.table.scenegraph.component.showResizeRow(t,e,o);const r=!!(null===(n=this.select.ranges)||void 0===n?void 0:n.length);this.updateSelectPos(-1,-1),this.endSelectCells(!0,r),this.table.scenegraph.updateNextFrame()}updateResizeRow(t,e){!function(t,e,i){t=Math.ceil(t),e=Math.ceil(e);let o=i.rowResize.isBottomFrozen?i.rowResize.y-e:e-i.rowResize.y;if(Math.abs(o)<1)return;i.table.getRowHeight(i.rowResize.row);let n=i.table.getRowHeight(i.rowResize.row)+o;if(n<i.table.internalProps.limitMinHeight&&(n=i.table.internalProps.limitMinHeight,o=n-i.table.getRowHeight(i.rowResize.row)),"adaptive"===i.table.heightMode&&i.rowResize.row<i.table.rowCount-1){let t=i.table.getRowHeight(i.rowResize.row+1);t-=o,t-o<i.table.internalProps.limitMinHeight&&(o=t-i.table.internalProps.limitMinHeight)}o=Math.ceil(o),i.rowResize.row<i.table.columnHeaderLevelCount||i.rowResize.row>=i.table.rowCount-i.table.bottomFrozenRowCount?mM(o,i):"indicator"===i.table.internalProps.rowResizeType?function(t,e){var i,o;const n=e.table.internalProps.layoutMap;let r,s,l;if(n.indicatorsAsCol){const t=n.getCellHeaderPaths(e.table.rowHeaderLevelCount-1,e.rowResize.row),o=null===(i=t.rowHeaderPaths)||void 0===i?void 0:i[t.rowHeaderPaths.length-1];s=null==o?void 0:o.dimensionKey,l=null==o?void 0:o.value}else r=n.getIndicatorKey(e.table.rowHeaderLevelCount,e.rowResize.row);for(let i=e.table.columnHeaderLevelCount;i<e.table.rowCount-e.table.bottomFrozenRowCount;i++){const a=n.getIndicatorKey(e.table.rowHeaderLevelCount,i);if(n.indicatorsAsCol||a!==r){if(n.indicatorsAsCol){const r=n.getCellHeaderPaths(e.table.rowHeaderLevelCount-1,i),a=null===(o=null==r?void 0:r.rowHeaderPaths)||void 0===o?void 0:o[r.rowHeaderPaths.length-1];a&&s===a.dimensionKey&&l===a.value&&(e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i))}}else e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i)}}(o,i):"indicatorGroup"===i.table.internalProps.rowResizeType?function(t,e){const i=e.table.internalProps.layoutMap,o=i.getCellHeaderPaths(e.table.rowHeaderLevelCount,e.rowResize.row),n=i.getHeadNodeByRowOrColDimensions(o.rowHeaderPaths.slice(0,o.rowHeaderPaths.length-1)),r=n.startInTotal+e.table.frozenRowCount,s=n.startInTotal+e.table.frozenRowCount+n.size-1,l=e.table.getRowsHeight(r,s),a=t;for(let t=r;t<=s;t++){let i=e.table.getRowHeight(t)/l*a;i>0&&i<.5?i=.5:i<0&&i>=-.5&&(i=-.51),e.table.scenegraph.updateRowHeight(t,i),e.table.internalProps._heightResizedRowMap.add(t)}}(o,i):"all"===i.table.internalProps.rowResizeType?function(t,e){for(let i=e.table.frozenRowCount;i<e.table.rowCount-e.table.bottomFrozenRowCount;i++)e.table.scenegraph.updateRowHeight(i,t),e.table.internalProps._heightResizedRowMap.add(i)}(o,i):mM(o,i),i.rowResize.y=e,i.table.scenegraph.component.updateResizeRow(i.rowResize.row,t,i.rowResize.isBottomFrozen),i.table.scenegraph.updateNextFrame()}(t,e,this)}startFillSelect(t,e){this.fillHandle.isFilling=!0,this.fillHandle.startX=t,this.fillHandle.startY=e;const i=this.select.ranges[this.select.ranges.length-1];this.fillHandle.beforeFillMinCol=Math.min(i.start.col,i.end.col),this.fillHandle.beforeFillMinRow=Math.min(i.start.row,i.end.row),this.fillHandle.beforeFillMaxCol=Math.max(i.start.col,i.end.col),this.fillHandle.beforeFillMaxRow=Math.max(i.start.row,i.end.row),this.table.fireListeners(Aw.MOUSEDOWN_FILL_HANDLE,{})}endFillSelect(){this.fillHandle.isFilling=!1,this.fillHandle.startX=void 0,this.fillHandle.startY=void 0,this.fillHandle.directionRow=void 0;const t=Math.min(this.select.ranges[0].start.col,this.select.ranges[0].end.col),e=Math.min(this.select.ranges[0].start.row,this.select.ranges[0].end.row),i=Math.max(this.select.ranges[0].start.col,this.select.ranges[0].end.col),o=Math.max(this.select.ranges[0].start.row,this.select.ranges[0].end.row);this.fillHandle.beforeFillMinCol===t&&this.fillHandle.beforeFillMinRow===e&&this.fillHandle.beforeFillMaxCol===i&&this.fillHandle.beforeFillMaxRow===o||this.table.eventManager.isDraging&&this.table.fireListeners(Aw.DRAG_FILL_HANDLE_END,{direction:this.fillHandle.direction}),this.fillHandle.beforeFillMaxCol=void 0,this.fillHandle.beforeFillMaxRow=void 0,this.fillHandle.beforeFillMinCol=void 0,this.fillHandle.beforeFillMinRow=void 0}startMoveCol(t,e,i,o,n){!function(t,e,i,o,n,r){var s;if(!("canMoveHeaderPosition"in n.table.internalProps.layoutMap))return;n.columnMove.moving=!0,n.columnMove.colSource=t,n.columnMove.rowSource=e,n.columnMove.x=i-n.table.tableX,n.columnMove.y=o-n.table.tableY;const l=n.table.getCellLocation(t,e),a="columnHeader"===l?n.columnMove.x:"rowHeader"===l||n.table.internalProps.layoutMap.isSeriesNumberInBody(t,e)?n.columnMove.y:0,{backX:h,lineX:d,backY:c,lineY:u}=n.table.scenegraph.component.showMoveCol(t,e,a);n.table.fireListeners(Aw.CHANGE_HEADER_POSITION_START,{col:t,row:e,x:i,y:o,backX:h,lineX:d,backY:c,lineY:u,event:r});const g=!!(null===(s=n.select.ranges)||void 0===s?void 0:s.length);n.table.stateManager.updateSelectPos(-1,-1),n.table.stateManager.endSelectCells(!0,g),n.table.scenegraph.updateNextFrame()}(t,e,i,o,this,n)}updateMoveCol(t,e,i,o,n){!function(t,e,i,o,n,r){if(!("canMoveHeaderPosition"in n.table.internalProps.layoutMap))return;const s=function(t,e,i){const o=i.getCellRange(t.col,t.row);if(i.isColumnHeader(t.col,t.row)){const n=i.getCellRange(e.col,o.start.row);e.row>=i.columnHeaderLevelCount&&(e.row=i.columnHeaderLevelCount-1),e.col>=t.col?e.col=n.end.col:e.col=n.start.col}else if(i.isRowHeader(t.col,t.row)){const n=i.internalProps.layoutMap,r=i.getCellRange(o.start.col,e.row);if(e.col>=i.rowHeaderLevelCount+n.leftRowSeriesNumberColumnCount&&(e.col=i.rowHeaderLevelCount+n.leftRowSeriesNumberColumnCount-1),"tree"===n.rowHierarchyType){const o=n.getCellHeaderPathsWithTreeNode(t.col,t.row).rowHeaderPaths,r=n.getCellHeaderPathsWithTreeNode(e.col,e.row).rowHeaderPaths;if(o.length<=r.length){const n=r[o.length-1];n&&(e.row>=t.row?e.row=n.startInTotal+n.size-1+i.columnHeaderLevelCount:e.row=n.startInTotal+i.columnHeaderLevelCount)}}else e.row>=t.row?e.row=r.end.row:e.row=r.start.row}return e}({col:n.columnMove.colSource,row:n.columnMove.rowSource},{col:t,row:e},n.table);if(n.table.internalProps.layoutMap.canMoveHeaderPosition({col:n.columnMove.colSource,row:n.columnMove.rowSource},{col:s.col,row:s.row})){let l,a,h,d;n.columnMove.x=i-n.table.tableX,n.columnMove.y=o-n.table.tableY,n.columnMove.colTarget=s.col,n.columnMove.rowTarget=s.row,n.updateCursor("grabbing");const c=n.table.getCellLocation(n.columnMove.colSource,n.columnMove.rowSource);"columnHeader"===c?(a=n.columnMove.x,l=n.table.isLeftFrozenColumn(t)?n.columnMove.colTarget>=n.columnMove.colSource?n.table.getColsWidth(0,n.columnMove.colTarget):n.table.getColsWidth(0,n.columnMove.colTarget-1):n.table.isRightFrozenColumn(t)?n.table.tableNoFrameWidth-n.table.getColsWidth(s.col+1,n.table.colCount-1):(n.columnMove.colTarget>=n.columnMove.colSource?n.table.getColsWidth(0,n.columnMove.colTarget):n.table.getColsWidth(0,n.columnMove.colTarget-1))-n.table.stateManager.scroll.horizontalBarPos):("rowHeader"===c||n.table.internalProps.layoutMap.isSeriesNumberInBody(t,e))&&(d=n.columnMove.y,h=n.table.isFrozenRow(e)?n.columnMove.rowTarget>=n.columnMove.rowSource?n.table.getRowsHeight(0,n.columnMove.rowTarget):n.table.getRowsHeight(0,n.columnMove.rowTarget-1):n.table.isBottomFrozenRow(e)?n.table.tableNoFrameHeight-n.table.getRowsHeight(s.row+1,n.table.rowCount-1):(n.columnMove.rowTarget>=n.columnMove.rowSource?n.table.getRowsHeight(0,n.columnMove.rowTarget):n.table.getRowsHeight(0,n.columnMove.rowTarget-1))-n.table.stateManager.scroll.verticalBarPos),n.table.scenegraph.component.updateMoveCol(a,l,d,h),n.table.fireListeners(Aw.CHANGING_HEADER_POSITION,{col:t,row:e,x:i,y:o,backX:a,lineX:l,backY:d,lineY:h,event:r}),n.table.scenegraph.updateNextFrame()}else n.updateCursor("not-allowed"),n.columnMove.colTarget=n.columnMove.colSource,n.columnMove.rowTarget=n.columnMove.rowSource}(t,e,i,o,this,n)}isMoveCol(){return this.columnMove.moving}endMoveCol(){return function(t){var e,i;let o=!1;if("canMoveHeaderPosition"in t.table.internalProps.layoutMap&&t.columnMove.moving&&t.columnMove.colSource>=0&&t.columnMove.rowSource>=0&&t.columnMove.colTarget>=0&&t.columnMove.rowTarget>=0&&!0!==(null===(e=t.table.options.customConfig)||void 0===e?void 0:e.notUpdateInColumnRowMove)){const e=t.table.getCellRange(t.columnMove.colSource,t.columnMove.rowSource),i=t.table.getCellRange(t.columnMove.colTarget,t.columnMove.rowTarget),n=t.table._moveHeaderPosition({col:t.columnMove.colSource,row:t.columnMove.rowSource},{col:t.columnMove.colTarget,row:t.columnMove.rowTarget});if(!n||n.targetIndex===n.sourceIndex)return t.updateCursor(),t.columnMove.moving=!1,delete t.columnMove.colSource,delete t.columnMove.rowSource,delete t.columnMove.colTarget,delete t.columnMove.rowTarget,t.table.scenegraph.component.hideMoveCol(),t.table.scenegraph.updateNextFrame(),!1;{t.table.internalProps.useOneRowHeightFillAll=!1,t.table.internalProps.layoutMap.clearCellRangeMap();const r=t.table.getCellRange(t.columnMove.colSource,t.columnMove.rowSource),s=t.table.getCellRange(t.columnMove.colTarget,t.columnMove.rowTarget),l=Math.min(r.start.col,s.start.col,e.start.col,i.start.col),a=Math.max(r.end.col,s.end.col,e.end.col,i.end.col),h=Math.min(r.start.row,s.start.row,e.start.row,i.start.row);let d=Math.max(r.end.row,s.end.row,e.end.row,i.end.row);"row"===n.moveType&&"tree"===t.table.internalProps.layoutMap.rowHierarchyType&&(d=n.targetIndex>n.sourceIndex?d+n.targetSize-1:d+n.sourceSize-1),!t.table.transpose&&t.table.internalProps.layoutMap.isSeriesNumberInBody(t.columnMove.colSource,t.columnMove.rowSource)&&(t.table.changeRecordOrder(n.sourceIndex,n.targetIndex),t.changeCheckboxAndRadioOrder(n.sourceIndex,n.targetIndex)),"column"===n.moveType?pM(l,a,0,-1,t.table):pM(0,-1,h,d,t.table),t.table.clearCellStyleCache(),t.table.internalProps.layoutMap.isSeriesNumberInBody(t.columnMove.colSource,t.columnMove.rowSource)?t.table.scenegraph.updateHeaderPosition(t.table.scenegraph.proxy.colStart,t.table.scenegraph.proxy.colEnd,t.table.scenegraph.proxy.rowStart,t.table.scenegraph.proxy.rowEnd,n.moveType):"column"===n.moveType?t.table.scenegraph.updateHeaderPosition(l,a,0,-1,n.moveType):t.table.scenegraph.updateHeaderPosition(0,-1,h,d,n.moveType),"adjustFrozenCount"===t.table.internalProps.frozenColDragHeaderMode&&t.table.isListTable()&&(t.table.isLeftFrozenColumn(t.columnMove.colTarget)&&!t.table.isLeftFrozenColumn(t.columnMove.colSource)?t.table.frozenColCount+=r.end.col-r.start.col+1:t.table.isLeftFrozenColumn(t.columnMove.colSource)&&!t.table.isLeftFrozenColumn(t.columnMove.colTarget)&&(t.table.frozenColCount-=r.end.col-r.start.col+1),t.table.isRightFrozenColumn(t.columnMove.colTarget)&&!t.table.isRightFrozenColumn(t.columnMove.colSource)?t.table.rightFrozenColCount+=r.end.col-r.start.col+1:t.table.isRightFrozenColumn(t.columnMove.colSource)&&!t.table.isRightFrozenColumn(t.columnMove.colTarget)&&(t.table.rightFrozenColCount-=r.end.col-r.start.col+1)),o=!0}}return setTimeout((()=>{t.columnMove.moving=!1,delete t.columnMove.colSource,delete t.columnMove.rowSource,delete t.columnMove.colTarget,delete t.columnMove.rowTarget}),0),t.table.scenegraph.component.hideMoveCol(),t.columnResize.col<t.table.frozenColCount&&!t.table.isPivotTable()&&!t.table.transpose?(t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1,t.columnResize.isRightFrozen),t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount)):t.columnResize.col>=t.table.colCount-t.table.rightFrozenColCount&&!t.table.isPivotTable()&&!t.table.transpose?t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount):t.table.options.frozenColCount?t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1):t.table.options.rightFrozenColCount&&t.table.scenegraph.component.setRightFrozenColumnShadow(t.table.colCount-t.table.rightFrozenColCount),t.table.scenegraph.updateNextFrame(),!0===(null===(i=t.table.options.customConfig)||void 0===i?void 0:i.notUpdateInColumnRowMove)||o}(this)}checkFrozen(){var t,e,i;let o=this.table.isListTable()&&!this.table.internalProps.transpose?this.table.options.frozenColCount:this.table.isPivotChart()?null!==(t=this.table.rowHeaderLevelCount)&&void 0!==t?t:0:Math.max((null!==(e=this.table.rowHeaderLevelCount)&&void 0!==e?e:0)+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount,null!==(i=this.table.options.frozenColCount)&&void 0!==i?i:0);if(o){if(o>this.table.colCount&&(o=this.table.colCount),this.table.tableNoFrameWidth-this.table.getColsWidth(0,o-1)<=120)return this.table._setFrozenColCount(0),this.setFrozenCol(-1),!1;if(this.table.frozenColCount!==o)return this.table._setFrozenColCount(o),this.setFrozenCol(o),!1}return!0}setFrozenCol(t){t!==this.frozen.col?(this.frozen.col=t,this.table.scenegraph.updateFrozen(),this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)):this.table.scenegraph.updateFrozenIcon(0,this.table.colCount-1)}checkVerticalScrollBarEnd(){var t,e;const i=this.table.getAllRowsHeight(),o=this.scroll.verticalBarPos,n=this.table.tableNoFrameHeight;o+n>=i&&this.table.fireListeners(Aw.SCROLL_VERTICAL_END,{scrollTop:o,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(t=this.table.theme.scrollStyle)||void 0===t?void 0:t.width,scrollWidth:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,viewHeight:n,viewWidth:this.table.tableNoFrameWidth})}checkHorizontalScrollBarEnd(){var t,e;const i=this.table.getAllColsWidth(),o=this.scroll.horizontalBarPos,n=this.table.tableNoFrameWidth;o+n>=i&&this.table.fireListeners(Aw.SCROLL_HORIZONTAL_END,{scrollTop:this.scroll.verticalBarPos,scrollLeft:o,scrollHeight:null===(t=this.table.theme.scrollStyle)||void 0===t?void 0:t.width,scrollWidth:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:n})}updateVerticalScrollBar(t){var e,i;const o=this.table.getAllRowsHeight(),n=this.scroll.verticalBarPos;this.scroll.verticalBarPos=Math.ceil(t*(o-this.table.scenegraph.height)),K(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-this.scroll.verticalBarPos,1===t),this.scroll.verticalBarPos-=this.table.scenegraph.proxy.deltaY,this.table.scenegraph.proxy.deltaY=0,this.updateHoverPos(-1,-1),this.table.fireListeners(Aw.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,scrollWidth:null===(i=this.table.theme.scrollStyle)||void 0===i?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:t}),n!==this.scroll.verticalBarPos&&this.checkVerticalScrollBarEnd()}updateHorizontalScrollBar(t){var e,i;const o=this.table.getAllColsWidth(),n=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=Math.ceil(t*(o-this.table.scenegraph.width)),K(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-this.scroll.horizontalBarPos,1===t),this.scroll.horizontalBarPos-=this.table.scenegraph.proxy.deltaX,this.table.scenegraph.proxy.deltaX=0,this.updateHoverPos(-1,-1),this.table.fireListeners(Aw.SCROLL,{event:void 0,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(e=this.table.theme.scrollStyle)||void 0===e?void 0:e.width,scrollWidth:null===(i=this.table.theme.scrollStyle)||void 0===i?void 0:i.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:t}),n!==this.scroll.horizontalBarPos&&this.checkHorizontalScrollBarEnd()}setScrollTop(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,n,r;const s=this.table.getAllRowsHeight(),l=(null===(o=this.table.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?1:0;t=Math.max(0,Math.min(t,s-this.table.scenegraph.height-l)),((t=Math.ceil(t))!==this.scroll.verticalBarPos||this.table.isPivotChart())&&this.updateHoverPos(-1,-1);const a=this.scroll.verticalBarPos;this.scroll.verticalBarPos=t,K(this.scroll.verticalBarPos)&&!isNaN(this.scroll.verticalBarPos)||(this.scroll.verticalBarPos=0),this.table.scenegraph.setY(-t);const h=t/(s-this.table.scenegraph.height);this.table.scenegraph.component.updateVerticalScrollBarPos(h),a!==t&&i&&(this.table.fireListeners(Aw.SCROLL,{event:null==e?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(n=this.table.theme.scrollStyle)||void 0===n?void 0:n.width,scrollWidth:null===(r=this.table.theme.scrollStyle)||void 0===r?void 0:r.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"vertical",scrollRatioY:h}),this.checkVerticalScrollBarEnd())}setScrollLeft(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,n,r;this.table.scrollLeft;const s=this.table.getAllColsWidth(),l=(this.table.getFrozenColsWidth(),(null===(o=this.table.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?1:0);t=Math.max(0,Math.min(t,s-this.table.scenegraph.width-l)),(t=Math.ceil(t))!==this.scroll.horizontalBarPos&&this.updateHoverPos(-1,-1);const a=this.scroll.horizontalBarPos;this.scroll.horizontalBarPos=t,K(this.scroll.horizontalBarPos)&&!isNaN(this.scroll.horizontalBarPos)||(this.scroll.horizontalBarPos=0),this.table.scenegraph.setX(-t);const h=t/(s-this.table.scenegraph.width);this.table.scenegraph.component.updateHorizontalScrollBarPos(h),a!==t&&i&&(this.table.fireListeners(Aw.SCROLL,{event:null==e?void 0:e.nativeEvent,scrollTop:this.scroll.verticalBarPos,scrollLeft:this.scroll.horizontalBarPos,scrollHeight:null===(n=this.table.theme.scrollStyle)||void 0===n?void 0:n.width,scrollWidth:null===(r=this.table.theme.scrollStyle)||void 0===r?void 0:r.width,viewHeight:this.table.tableNoFrameHeight,viewWidth:this.table.tableNoFrameWidth,scrollDirection:"horizontal",scrollRatioX:h}),this.checkHorizontalScrollBarEnd())}hideVerticalScrollBar(){this.table.scenegraph.component.hideVerticalScrollBar()}showVerticalScrollBar(t){this.table.scenegraph.component.showVerticalScrollBar(),t&&(clearTimeout(this._clearVerticalScrollBar),this._clearVerticalScrollBar=setTimeout((()=>{var t;null===(t=this.table.scenegraph)||void 0===t||t.component.hideVerticalScrollBar()}),1e3))}hideHorizontalScrollBar(){this.table.scenegraph.component.hideHorizontalScrollBar()}showHorizontalScrollBar(t){this.table.scenegraph.component.showHorizontalScrollBar(),t&&(clearTimeout(this._clearHorizontalScrollBar),this._clearHorizontalScrollBar=setTimeout((()=>{var t;null===(t=this.table.scenegraph)||void 0===t||t.component.hideHorizontalScrollBar()}),1e3))}triggerContextMenu(t,e,i,o){this.menu.isShow&&this.menu.x===i&&this.menu.y===o?this.hideMenu():this.showContextMenu(t,e,i,o)}showContextMenu(t,e,i,o){var n;(null===(n=this.table.internalProps.menu)||void 0===n?void 0:n.contextMenuItems)&&("html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.menu.x=i,this.menu.y=o,this.table.scenegraph.component.menu.attach(i,o,t,e,vA.contextmenu)),this.table.fireListeners(Aw.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"contextmenu"}))}triggerDropDownMenu(t,e,i,o,n){this.table.fireListeners(Aw.DROPDOWN_ICON_CLICK,{col:t,row:e,event:n}),this.menu.isShow?this.hideMenu():this.showDropDownMenu(t,e,i,o)}showDropDownMenu(t,e,i,o){"html"===this.table.internalProps.menu.renderMode?this.menu.isShow=!0:(this.menu.isShow=!0,this.table.scenegraph.component.menu.attach(i,o,t,e,vA.dropDown),this.menu.bounds=this.table.scenegraph.component.menu.bounds),this.table.fireListeners(Aw.SHOW_MENU,{x:i,y:o,col:t,row:e,type:"dropDown"}),this.residentHoverIcon&&this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row);const n=this.table.scenegraph.getCell(t,e);let r;n.forEachChildren((t=>t.attribute.funcType===xy.dropDown&&(r=t,!0))),r&&(this.residentHoverIcon={col:t,row:e,icon:r},this.table.scenegraph.setIconHoverStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row,n),this.table.scenegraph.residentHoverIcon(t,e))}hideMenu(){this.menu.isShow&&(this.table.fireListeners(Aw.DROPDOWN_MENU_CLEAR,null),this.table.fireListeners(Aw.HIDE_MENU,null),this.menu.isShow=!1,this.table.scenegraph.component.menu.detach(),this.residentHoverIcon&&(this.table.scenegraph.setIconNormalStyle(this.residentHoverIcon.icon,this.residentHoverIcon.col,this.residentHoverIcon.row),this.table.scenegraph.resetResidentHoverIcon(this.residentHoverIcon.col,this.residentHoverIcon.row),this.residentHoverIcon=null))}setDropDownMenuHighlight(t){this.menu.dropDownMenuHighlight=t;for(let e=0;e<t.length;e++){const{col:i,row:o}=t[e],n=this.table.getCellRange(i,o);if(n)for(let t=n.start.col;t<=n.end.col;t++)for(let e=n.start.row;e<=n.end.row;e++)this.table.scenegraph.updateCellContent(t,e)}}dropDownMenuIsHighlight(t,e,i){const o=this.menu.dropDownMenuHighlight;if(Array.isArray(o))for(let n=0;n<o.length;n++){const r=o[n];let{col:s,row:l}=r;const{field:a,menuKey:h}=r;if("number"!=typeof s||"number"!=typeof l)if(this.table.isPivotTable()){const t=this.table.internalProps.layoutMap.getPivotCellAdress(a);if(!t)continue;s=t.col,l=t.row}else{const t=this.table.internalProps.layoutMap.getHeaderCellAddressByField(a);if(!t)continue;s=t.col,l=t.row}if(K(s)&&K(l)&&this.table.isCellRangeEqual(t,e,s,l)){const o=this.table._getHeaderLayoutMap(null!=s?s:t,null!=l?l:e).dropDownMenu||this.table.globalDropDownMenu;if(o)for(let t=0;t<o.length;t++){const e=o[t];if(Z(e)&&(e.menuKey||e.text)===(h||"")&&t===i)return!0;if(tt(e)&&e===h&&t===i)return!0}}}return!1}triggerSort(t,e,i,o){if(this.table.isPivotTable()){const i=this.table.getPivotSortState(t,e),n=i?i.toUpperCase():"NORMAL",r="ASC"===n?"DESC":"DESC"===n?"NORMAL":"ASC";return this.table.sort(t,e,r),void this.table.fireListeners(gM.PIVOT_SORT_CLICK,{col:t,row:e,order:n||"normal",dimensionInfo:this.table.internalProps.layoutMap.getPivotDimensionInfo(t,e),cellLocation:this.table.getCellLocation(t,e),event:o})}const n=[...this.sort],r=this.table.internalProps.multipleSort||!n.length?null:this.sort[this.sort.length-1];cM(t,e,this.table,o);const s=this.table.getCellRange(t,e),l=this.sort.find((t=>t.col===s.start.col&&t.row===s.start.row)),a=this.table.internalProps.multipleSort||!r?null:r.col,h=this.table.internalProps.multipleSort||!r?null:r.row,d=n.findIndex((i=>i.col===t&&i.row===e));d>=0&&n.splice(d,1),this.table.scenegraph.updateSortIcon({col:t,row:e,iconMark:i,order:null==l?void 0:l.order,oldSortCol:a,oldSortRow:h,oldIconMark:null==r?void 0:r.icon}),l&&(l.icon=i),this.table.internalProps.multipleSort||n.forEach((t=>{this.table.scenegraph.updateSortIcon({col:null,row:null,iconMark:null,order:"normal",oldSortCol:t.col,oldSortRow:t.row,oldIconMark:null})})),this.table.fireListeners(gM.AFTER_SORT,{order:null==l?void 0:l.order,field:this.table.getHeaderField(t,e),event:o})}updateSortState(t){var e,i,o,n,r,s,l,a;t=Array.isArray(t)?t:[t];for(let a=0;a<t.length;a++){if(t[a].field===(null===(e=this.sort[a])||void 0===e?void 0:e.field)&&t[t.length-1].order===(null===(i=this.sort[a])||void 0===i?void 0:i.order))return;const h=this.table.internalProps.multipleSort?null:(null===(o=this.sort[a])||void 0===o?void 0:o.col)||null,d=this.table.internalProps.multipleSort?null:(null===(n=this.sort[a])||void 0===n?void 0:n.row)||null;"asc"===(null===(r=this.sort[a])||void 0===r?void 0:r.order)||null===(s=this.sort[a])||void 0===s||s.order,this.setSortState(t.slice(0,a+1));const c=this.table.internalProps.layoutMap.getHeaderCellAddressByField(t[a].field);this.sort[a].col=c.col,this.sort[a].row=c.row;let u;Qy(this.table.scenegraph.getCell(this.sort[a].col,this.sort[a].row),"children",(t=>"sort"===t.attribute.funcType&&(u=t,!0))),this.table.scenegraph.updateSortIcon({col:this.sort[a].col,row:this.sort[a].row,iconMark:u,order:this.sort[a].order,oldSortCol:h,oldSortRow:d,oldIconMark:null===(l=this.sort[a])||void 0===l?void 0:l.icon})}const h=[];this.table.internalProps.layoutMap.columnTree.tree.children.forEach((e=>{t.some((t=>t.field===e.field))||h.push(e)}));for(let t=0;t<h.length;t++){const e=h[t];this.table.scenegraph.updateSortIcon({col:null,row:null,iconMark:null,order:null,oldSortCol:null!==(a=e.startInTotal+this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount)&&void 0!==a?a:0,oldSortRow:e.level,oldIconMark:null})}}triggerFreeze(t,e,i){if(!this.table.isPivotTable()&&!this.table.transpose){if(function(t,e,i){i.frozenColCount>0?t!==i.frozenColCount-1?i.setFrozenColCount(t+1):i.setFrozenColCount(0):i.setFrozenColCount(t+1)}(t,0,this.table),this.table.hasListeners(gM.FREEZE_CLICK)){const i=this.table.internalProps.layoutMap.columnObjects.slice(0,t+1);this.table.fireListeners(gM.FREEZE_CLICK,{col:t,row:e,fields:i.reduce(((t,e)=>t.concat(e.field)),[]),colCount:this.table.frozenColCount})}this.frozen.icon=i}}updateCursor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";this.table.getElement().style.cursor=t}updateDrillState(t,e,i,o,n,r){this.drill.dimensionKey=t,this.drill.title=e,this.drill.drillDown=i,this.drill.drillUp=o,this.drill.col=n,this.drill.row=r,function(t,e,i,o,n){const r=n.getCellLocation(t,e);let s=0,l=0,a=!1;"columnHeader"===r?(s=n.getColsWidth(0,n.rowHeaderLevelCount-1)-(0===n.frozenColCount?n.scrollLeft:0),l=n.getRowsHeight(0,e-1)+n.getRowHeight(e)/2,a=!0):"rowHeader"===r&&(l=n.getRowsHeight(0,n.columnHeaderLevelCount-1),s=n.getColsWidth(0,t-1)+n.getColWidth(t)/2,a=!0),n.scenegraph.updateDrill(a,s,l,i,o)}(n,r,i,o,this.table)}updateSparklineHoverPose(t,e,i,o){-1!==this.sparkLine.col&&-1!==this.sparkLine.row&&function(t,e,i){const o=i.scenegraph.getCell(t,e).getChildByName("sparkline"),n=null==o?void 0:o.getChildByName("highlight-line"),r=null==o?void 0:o.getChildByName("highlight-symbol");n&&n.setAttributes({visible:!1,pickable:!1}),r&&r.setAttributes({visible:!1,pickable:!1}),i.scenegraph.updateNextFrame()}(this.sparkLine.col,this.sparkLine.row,this.table);let n=!1;-1!==t&&-1!==e&&(n=function(t,e,i,o,n){var r,s;const l=n.scenegraph.getCell(t,e).getChildByName("sparkline"),a=null==l?void 0:l.getChildByName("sparkline-line"),h=null==l?void 0:l.getChildByName("sparkline-symbol-group");if(!a)return!1;const d=a.bandwidth,c=a.min,u=a.max,g=a.attribute.points;let p;i-=l.globalAABBBounds.x1,l.globalAABBBounds.y1;for(let t=0;t<g.length;t++){const{x:e,y:o,defined:n,rawData:f}=g[t];if(Math.abs(i-e)<d/2&&(p={point:g[t],points:g,pointsBandWidth:d,pointData:f},n)){const t=l.getChildByName("highlight-line");if(t)t.setAttributes({points:[{x:e,y:u},{x:e,y:c}],visible:!0,pickable:!0});else{const t=Qd({points:[{x:e,y:u},{x:e,y:c}],lineWidth:null===(r=a.hover)||void 0===r?void 0:r.strokeWidth,stroke:null===(s=a.hover)||void 0===s?void 0:s.stroke});t.name="highlight-line",l.addChild(t)}const i=l.getChildByName("highlight-symbol");if(i)i.setAttributes({x:e,y:o,visible:!0,pickable:!0});else{const t=Zd({x:e,y:o,stroke:h.hover.stroke,lineWidth:h.hover.strokeWidth,fill:h.hover.fill,size:2*h.hover.size,symbolType:"circle"});t.name="highlight-symbol",l.addChild(t)}break}}if(n.scenegraph.updateNextFrame(),p){const i={col:t,row:e,field:n.getHeaderField(t,e),value:n.getCellValue(t,e),dataValue:n.getCellOriginValue(t,e),cellHeaderPaths:n.internalProps.layoutMap.getCellHeaderPaths(t,e),title:n.getBodyColumnDefine(t,e).title,cellRange:n.getCellRelativeRect(t,e),sparkline:{pointData:p.pointData},scaleRatio:n.canvas.getBoundingClientRect().width/n.canvas.offsetWidth};n.fireListeners(Aw.MOUSEOVER_CHART_SYMBOL,i)}return!0}(t,e,i,0,this.table)),n?(this.sparkLine.col=t,this.sparkLine.row=e):(this.sparkLine.col=-1,this.sparkLine.row=-1)}setCheckedState(t,e,i,o){return function(t,e,i,o,n){const r=n.table.getRecordShowIndexByCell(t,e);if(r>=0){const t=n.table.dataSource.getIndexKey(r);n.checkedState[t]||(n.checkedState[t]={}),n.checkedState[t][i]=o}}(t,e,i,o,this)}setHeaderCheckedState(t,e){return function(t,e,i){var o;i.headerCheckedState[t]=e,null===(o=i.checkedState)||void 0===o||o.forEach((i=>{i[t]=e}))}(t,e,this)}syncCheckedState(t,e,i,o){return function(t,e,i,o,n){var r,s;if(n.table.isHeader(t,e)){if(K(n.headerCheckedState[i]))return n.headerCheckedState[i];if("function"==typeof o)return;if(K(o))n.headerCheckedState[i]=o;else if((null===(r=n.checkedState)||void 0===r?void 0:r.length)>0)return n.updateHeaderCheckedState(i,t,e);return n.headerCheckedState[i]}const l=n.table.getRecordShowIndexByCell(t,e);if(l>=0){const t=n.table.dataSource.getIndexKey(l);if(K(null===(s=n.checkedState[t])||void 0===s?void 0:s[i]))return n.checkedState[t][i];n.checkedState[t]||(n.checkedState[t]={}),n.checkedState[t][i]=o}return o}(t,e,i,o,this)}initCheckedState(t){return function(t,e){e.checkedState=[],e.headerCheckedState={},e.radioState={};let i=!1;e._checkboxCellTypeFields=[],e._headerCheckFuncs={},e.table.internalProps.layoutMap.headerObjects.forEach(((t,o)=>{if("checkbox"===t.headerType){const o=t.define.checked;null==o||"function"==typeof o?(i=!0,"function"==typeof o&&(e._headerCheckFuncs[t.field]=o)):e.headerCheckedState[t.field]=o,"checkbox"!==t.define.cellType||t.fieldFormat||e._checkboxCellTypeFields.push(t.field)}})),i&&t.forEach(((t,i)=>{e._checkboxCellTypeFields.forEach((o=>{const n=t[o];let r;if(Z(n)?r=n.checked:"boolean"==typeof n&&(r=n),null==r){const t=e._headerCheckFuncs[o];if(t){const s=e.table.getCellAddrByFieldRecord(o,i);r=uw(t,{col:s.col,row:s.row,table:e.table,context:null,value:n})}}e.checkedState[i]||(e.checkedState[i]={}),e.checkedState[i][o]=r}))}))}(t,this)}updateHeaderCheckedState(t,e,i){return function(t,e,i,o){const n=e.checkedState.every(((n,r)=>{const s=e.table.getTableIndexByRecordIndex(r);return!!(e.table.transpose?e.table.getCustomMerge(s,o):e.table.getCustomMerge(i,s))||!0===(null==n?void 0:n[t])}));return n?(e.headerCheckedState[t]=!0,n):e.checkedState.every(((n,r)=>{const s=e.table.getTableIndexByRecordIndex(r);return!!(e.table.transpose?e.table.getCustomMerge(s,o):e.table.getCustomMerge(i,s))||!1===(null==n?void 0:n[t])}))?(e.headerCheckedState[t]=!1,!1):!!e.checkedState.find((e=>!0===(null==e?void 0:e[t])))&&(e.headerCheckedState[t]="indeterminate","indeterminate")}(t,this,e,i)}initLeftRecordsCheckState(t){return function(t,e){for(let i=e.checkedState.length;i<t.length;i++){const o=t[i];e._checkboxCellTypeFields.forEach((t=>{const n=o[t];let r;Z(n)?r=n.checked:"boolean"==typeof n&&(r=n),e.checkedState[i]||(e.checkedState[i]={}),e.checkedState[i][t]=r}))}}(t,this)}setRadioState(t,e,i,o,n){!function(t,e,i,o,n,r){const s=r.table.getRecordShowIndexByCell(t,e);if(s>=0){const t=r.table.dataSource.getIndexKey(s);"column"===o?nt(n)?(r.radioState[i]={},r.radioState[i][t]=n):r.radioState[i]=t:(r.radioState[i]||(r.radioState[i]={}),nt(n)?r.radioState[i][t]=n:r.radioState[i][t]=!0)}}(t,e,i,o,n,this)}syncRadioState(t,e,i,o,n,r){return function(t,e,i,o,n,r,s){var l,a,h,d,c;const u=s.table.getRecordShowIndexByCell(t,e);if(u>=0){const t=s.table.dataSource.getIndexKey(u);if("column"===o){if(!K(s.radioState[i])&&r)return nt(n)?(s.radioState[i]={},s.radioState[i][t]=n):s.radioState[i]=t,!0;if(nt(s.radioState[i])&&!nt(n))return s.radioState[i]===t;if(nt(s.radioState[i])&&nt(n))return!1;if(Z(s.radioState[i])&&!nt(n))return!1;if(Z(s.radioState[i])&&nt(n))return s.radioState[i][t]===n}else if("cell"===o){if(!K(s.radioState[i])&&r)return s.radioState[i]={},nt(n)?s.radioState[i][t]=n:s.radioState[i][t]=!0,!0;if(!K(null===(l=s.radioState[i])||void 0===l?void 0:l[t])&&r)return nt(n)?s.radioState[i][t]=n:s.radioState[i][t]=!0,!0;if($(null===(a=s.radioState[i])||void 0===a?void 0:a[t])&&!nt(n))return s.radioState[i][t];if($(null===(h=s.radioState[i])||void 0===h?void 0:h[t])&&nt(n))return!1;if(nt(null===(d=s.radioState[i])||void 0===d?void 0:d[t])&&!nt(n))return!1;if(nt(null===(c=s.radioState[i])||void 0===c?void 0:c[t])&&nt(n))return s.radioState[i][t]===n}}return r}(t,e,i,o,n,r,this)}changeCheckboxAndRadioOrder(t,e){this.checkedState.length&&function(t,e,i){const{checkedState:o,table:n}=i;if(n.internalProps.transpose?(t=n.getRecordShowIndexByCell(t,0),e=n.getRecordShowIndexByCell(e,0)):(t=n.getRecordShowIndexByCell(0,t),e=n.getRecordShowIndexByCell(0,e)),t>e){const i=o[t];for(let i=t;i>e;i--)o[i]=o[i-1];o[e]=i}else if(t<e){const i=o[t];for(let i=t;i<e;i++)o[i]=o[i+1];o[e]=i}}(t,e,this),this.radioState.length&&function(t,e,i){const{radioState:o,table:n}=i;if(n.internalProps.transpose?(t=n.getRecordShowIndexByCell(t,0),e=n.getRecordShowIndexByCell(e,0)):(t=n.getRecordShowIndexByCell(0,t),e=n.getRecordShowIndexByCell(0,e)),t>e){const i=o[t];for(let i=t;i>e;i--)o[i]=o[i-1];o[e]=i}else if(t<e){const i=o[t];for(let i=t;i<e;i++)o[i]=o[i+1];o[e]=i}}(t,e,this)}}function CM(t){if(t.eventManager.bindSparklineHoverEvent)return;let e=!1;e=t.isPivotTable()?t.internalProps.layoutMap.indicatorsDefine.some((t=>"string"!=typeof t&&"sparkline"===t.cellType)):t.internalProps.layoutMap.columnObjects.some((t=>"sparkline"===t.cellType||"function"==typeof t.cellType)),e&&(t.eventManager.bindSparklineHoverEvent=!0,t.on(Aw.MOUSEMOVE_CELL,(e=>{const{col:i,row:o,x:n,y:r}=e;"sparkline"!==t.getBodyColumnType(i,o)&&t.stateManager.updateSparklineHoverPose(-1,-1,0,0),t.stateManager.updateSparklineHoverPose(i,o,n,r)})),t.on(Aw.MOUSELEAVE_TABLE,(e=>{t.stateManager.updateSparklineHoverPose(-1,-1,0,0)})))}function yM(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o;let{deltaX:n,deltaY:r}=t;t.shiftKey&&t.deltaY&&(n=r,r=0);const[s,l]=function(t,e,i){var o,n;const r=Math.abs(t/e),s=r<=.5?0:t,l=r>2?0:e;return[Math.ceil(s*(null!==(o=i.horizontal)&&void 0!==o?o:0)),Math.ceil(l*(null!==(n=i.vertical)&&void 0!==n?n:0))]}(n,r,{horizontal:1,vertical:1});(s||l)&&e.interactionState!==fy.scrolling&&e.updateInteractionState(fy.scrolling),s&&(e.setScrollLeft(e.scroll.horizontalBarPos+s,t),e.showHorizontalScrollBar(!0)),l&&(e.setScrollTop(e.scroll.verticalBarPos+l,t),e.showVerticalScrollBar(!0)),i&&e.resetInteractionState(e.interactionStateBeforeScroll),(null===(o=t.nativeEvent)||void 0===o?void 0:o.cancelable)&&("none"===e.table.internalProps.overscrollBehavior||Math.abs(r)>=Math.abs(n)&&0!==r&&wM(r,e)||Math.abs(r)<=Math.abs(n)&&0!==n&&xM(n,e))&&t.nativeEvent.preventDefault()}function wM(t,e){return 0!=e.table.getAllRowsHeight()-e.table.scenegraph.height&&!function(t,e){return 0!=e.table.getAllRowsHeight()-e.table.scenegraph.height&&t<=0&&e.scroll.verticalBarPos<1}(t,e)&&!function(t,e){var i;const o=(null===(i=e.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0,n=e.table.getAllRowsHeight()-e.table.scenegraph.height;return 0!==n&&t>=0&&Math.abs(e.scroll.verticalBarPos-n)<1+o}(t,e)}function xM(t,e){return 0!=e.table.getAllColsWidth()-e.table.scenegraph.width&&!function(t,e){return 0!=e.table.getAllColsWidth()-e.table.scenegraph.width&&t<=0&&e.scroll.horizontalBarPos<1}(t,e)&&!function(t,e){var i;const o=(null===(i=e.table.options.customConfig)||void 0===i?void 0:i._disableColumnAndRowSizeRound)?1:0,n=e.table.getAllColsWidth()-e.table.scenegraph.width;return 0!==n&&t>=0&&Math.abs(e.scroll.horizontalBarPos-n)<1+o}(t,e)}class _M{constructor(t){this.stateManager=t}setScrollHandle(t){this.scrollHandle=t}startInertia(t,e,i){this.lastTime=Date.now(),this.speedX=t,this.speedY=e,this.friction=i,this.runingId||(this.runingId=requestAnimationFrame(this.inertia.bind(this)))}inertia(){var t;const e=Date.now(),i=e-this.lastTime;let o=!0;const n=Math.pow(this.friction,i/16),r=n*this.speedX,s=n*this.speedY;let l=0,a=0;Math.abs(r)>.05&&(o=!1,l=(this.speedX+r)/2*i),Math.abs(s)>.05&&(o=!1,a=(this.speedY+s)/2*i),null===(t=this.scrollHandle)||void 0===t||t.call(this,l,a),o?this.runingId=null:(this.lastTime=e,this.speedX=r,this.speedY=s,this.runingId=requestAnimationFrame(this.inertia.bind(this)))}endInertia(){cancelAnimationFrame(this.runingId),this.runingId=null}isInertiaScrolling(){return!!this.runingId}}function SM(t){const e=t.table,i=e.stateManager;e.scenegraph.tableGroup.addEventListener("pointermove",(o=>{var n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x;const _=null!==(r=null===(n=e.eventManager.LastPointerXY)||void 0===n?void 0:n.x)&&void 0!==r?r:o.x,S=null!==(l=null===(s=e.eventManager.LastPointerXY)||void 0===s?void 0:s.y)&&void 0!==l?l:o.y;e.eventManager.LastPointerXY={x:o.x,y:o.y},t.touchSetTimeout&&(clearTimeout(t.touchSetTimeout),t.touchSetTimeout=void 0);const A=S_(o);if(A.eventArgs&&e.hasListeners(Aw.MOUSEMOVE_TABLE)&&e.fireListeners(Aw.MOUSEMOVE_TABLE,{col:A.eventArgs.col,row:A.eventArgs.row,x:A.abstractPos.x,y:A.abstractPos.y,event:o.nativeEvent,target:null===(a=null==A?void 0:A.eventArgs)||void 0===a?void 0:a.target,mergeCellInfo:null===(h=A.eventArgs)||void 0===h?void 0:h.mergeInfo}),i.interactionState===fy.grabing&&!(null===(d=e.editorManager)||void 0===d?void 0:d.editingEditor))return void(Math.abs(_-o.x)+Math.abs(S-o.y)>=1&&(i.isResizeCol()||(i.isMoveCol()?t.dealColumnMover(A):i.isFillHandle()?t.dealFillSelect(A,!0):(null===(c=e.options.select)||void 0===c?void 0:c.disableDragSelect)||t.dealTableSelect(A,!0))));!(null===(u=e.options.select)||void 0===u?void 0:u.disableDragSelect)&&e.eventManager.isDraging&&i.isSelecting()&&!(null===(g=e.editorManager)||void 0===g?void 0:g.editingEditor)&&t.dealTableSelect(A,!0);const R=o.path.find((t=>"cell"===t.role));if(e.hasListeners(Aw.MOUSELEAVE_CELL)&&(-1===e.stateManager.hover.cellPos.col||-1===e.stateManager.hover.cellPos.row||(null==R?void 0:R.col)===e.stateManager.hover.cellPos.col&&(null==R?void 0:R.row)===e.stateManager.hover.cellPos.row||e.fireListeners(Aw.MOUSELEAVE_CELL,{col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row,cellRange:e.getCellRangeRelativeRect({col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:null===(p=null==A?void 0:A.eventArgs)||void 0===p?void 0:p.target})),e.hasListeners(Aw.MOUSEENTER_CELL)&&("cell"!==(null==R?void 0:R.role)||!K(R.col)||!K(R.row)||R.col===e.stateManager.hover.cellPos.col&&R.row===e.stateManager.hover.cellPos.row||R.col===(null===(f=e.stateManager.hover.cellPosContainHeader)||void 0===f?void 0:f.col)&&R.row===(null===(v=e.stateManager.hover.cellPosContainHeader)||void 0===v?void 0:v.row)||e.fireListeners(Aw.MOUSEENTER_CELL,{col:R.col,row:R.row,cellRange:e.getCellRangeRelativeRect({col:R.col,row:R.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:null===(m=null==A?void 0:A.eventArgs)||void 0===m?void 0:m.target,mergeCellInfo:null===(b=A.eventArgs)||void 0===b?void 0:b.mergeInfo})),t.dealIconHover(A),t.dealTableHover(A),A.eventArgs&&e.hasListeners(Aw.MOUSEMOVE_CELL)){let t,i;if(null===(C=A.eventArgs)||void 0===C?void 0:C.target){const e=fM(null===(y=A.eventArgs)||void 0===y?void 0:y.target);e&&(t=e.icon,i=e.position)}e.fireListeners(Aw.MOUSEMOVE_CELL,{col:A.eventArgs.col,row:A.eventArgs.row,x:A.abstractPos.x,y:A.abstractPos.y,event:o.nativeEvent,targetIcon:t?{name:t.name,position:i,funcType:t.attribute.funcType}:void 0,target:null===(w=null==A?void 0:A.eventArgs)||void 0===w?void 0:w.target,mergeCellInfo:null===(x=A.eventArgs)||void 0===x?void 0:x.mergeInfo})}})),e.scenegraph.tableGroup.addEventListener("pointerout",(e=>{var i;const o=S_(e),n=null===(i=null==o?void 0:o.eventArgs)||void 0===i?void 0:i.target;"table"===(null==n?void 0:n.role)&&t.dealTableHover()})),e.scenegraph.tableGroup.addEventListener("pointerover",(t=>{var i,o;const n=S_(t),r=null===(i=null==n?void 0:n.eventArgs)||void 0===i?void 0:i.target;if(r&&e.hasListeners(Aw.MOUSEOVER_CHART_SYMBOL)&&"symbol"===r.type){const i=t.composedPath().find((t=>"cell"===t.roll));if(i){const{col:r,row:s}=i,l={col:r,row:s,field:e.getHeaderField(r,s),value:e.getCellValue(r,s),dataValue:e.getCellOriginValue(r,s),cellHeaderPaths:e.internalProps.layoutMap.getCellHeaderPaths(r,s),title:e.getBodyColumnDefine(r,s).title,cellRange:e.getCellRelativeRect(r,s),event:t.nativeEvent,sparkline:{pointData:void 0},scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:null===(o=null==n?void 0:n.eventArgs)||void 0===o?void 0:o.target};e.fireListeners(Aw.MOUSEOVER_CHART_SYMBOL,l)}}})),e.scenegraph.tableGroup.addEventListener("pointerenter",(t=>{(e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.horizontalVisible||!e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.showHorizontalScrollBar(),(e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.verticalVisible||!e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.showVerticalScrollBar(),e.hasListeners(Aw.MOUSEENTER_TABLE)&&e.fireListeners(Aw.MOUSEENTER_TABLE,{event:t.nativeEvent})})),e.scenegraph.tableGroup.addEventListener("pointerleave",(o=>{i.isResizeCol()||i.isMoveCol()||i.isSelecting()||(i.updateInteractionState(fy.default),i.updateCursor()),(e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.horizontalVisible||!e.theme.scrollStyle.horizontalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.hideHorizontalScrollBar(),(e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.verticalVisible||!e.theme.scrollStyle.verticalVisible&&"focus"===e.theme.scrollStyle.visible)&&i.hideVerticalScrollBar(),e.hasListeners(Aw.MOUSELEAVE_CELL)&&-1!==e.stateManager.hover.cellPos.col&&-1!==e.stateManager.hover.cellPos.row&&e.fireListeners(Aw.MOUSELEAVE_CELL,{col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row,cellRange:e.getCellRangeRelativeRect({col:e.stateManager.hover.cellPos.col,row:e.stateManager.hover.cellPos.row}),scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,event:o.nativeEvent,target:void 0}),t.dealTableHover();const n=o.target;n&&!n.isDescendantsOf(e.scenegraph.tableGroup)&&e.fireListeners(Aw.MOUSELEAVE_TABLE,{event:o.nativeEvent})}));const o=o=>{var n;const r=o.target;if(!e.getElement().contains(r)){pw(null===(n=e.editorManager)||void 0===n?void 0:n.completeEdit(o),(e=>{!1!==e&&(i.updateInteractionState(fy.default),t.dealTableHover())}))}},n=o=>{var n;const r=o.target;if(!e.getElement().contains(r)){pw(null===(n=e.editorManager)||void 0===n?void 0:n.completeEdit(o),(o=>{var n,r;if(!1!==o&&(null===(n=e.options.select)||void 0===n?void 0:n.outsideClickDeselect)){const e=!!(null===(r=i.select.ranges)||void 0===r?void 0:r.length);t.dealTableSelect(),i.endSelectCells(!0,e)}}))}};t.globalEventListeners.push({name:"pointerup",env:"document",callback:o}),t.globalEventListeners.push({name:"pointerdown",env:"document",callback:n}),uu.addEventListener("pointerup",o),uu.addEventListener("pointerdown",n),e.scenegraph.tableGroup.addEventListener("pointerdown",(o=>{var n,r,s,l,a;if(e.hasListeners(Aw.MOUSEDOWN_TABLE)&&e.fireListeners(Aw.MOUSEDOWN_TABLE,{event:o.nativeEvent}),e.eventManager.isDown=!0,e.eventManager.LastBodyPointerXY={x:o.x,y:o.y},e.eventManager.LastPointerXY={x:o.x,y:o.y},0!==o.button)return;const h=S_(o);if(t.downIcon=void 0,i.interactionState!==fy.default)return;if(e.isPivotChart()&&"chart"!==(null===(n=null==h?void 0:h.eventArgs)||void 0===n?void 0:n.target.type)&&e.scenegraph.updateChartState(null),(null===(r=h.eventArgs)||void 0===r?void 0:r.target)!==(null===(s=i.residentHoverIcon)||void 0===s?void 0:s.icon)&&i.hideMenu(),"chart"===(null===(l=null==h?void 0:h.eventArgs)||void 0===l?void 0:l.target.type))return;pw(null===(a=e.editorManager)||void 0===a?void 0:a.completeEdit(o.nativeEvent),(n=>{var r,s,l,a,d,c,u;if(!1===n)return;const g=(null===(l=null===(s=null===(r=null==h?void 0:h.eventArgs)||void 0===r?void 0:r.target)||void 0===s?void 0:s.role)||void 0===l?void 0:l.startsWith("icon"))?h.eventArgs.target:(null===(a=o.target.role)||void 0===a?void 0:a.startsWith("icon"))?o.target:void 0;if(t.downIcon=g,g&&!1!==g.attribute.interactive)g.attribute.funcType===xy.dragReorder&&(i.startMoveCol(h.eventArgs.col,h.eventArgs.row,h.abstractPos.x,h.abstractPos.y,null===(c=null===(d=h.eventArgs)||void 0===d?void 0:d.event)||void 0===c?void 0:c.nativeEvent),i.updateInteractionState(fy.grabing));else if("touch"===o.pointerType)t.touchEnd=!1,t.touchSetTimeout=setTimeout((()=>{t.isTouchdown=!1,t.touchMove=!0,(!t.touchEnd&&(t.checkColumnResize(h,!0)||t.checkRowResize(h,!0))||!t.touchEnd&&t.chechColumnMover(h)||t.dealTableSelect(h)&&!t.touchEnd)&&i.updateInteractionState(fy.grabing)}),500),t.dealTableHover(h);else{if(!t.checkCellFillhandle(h)&&(t.checkColumnResize(h,!0)||t.checkRowResize(h,!0)))return e.scenegraph.updateChartState(null),void i.updateInteractionState(fy.grabing);if(t.chechColumnMover(h))return void i.updateInteractionState(fy.grabing);if(t.checkCellFillhandle(h,!0)&&t.dealFillSelect(h))return void i.updateInteractionState(fy.grabing);t.dealTableSelect(h)&&i.updateInteractionState(fy.grabing)}if(e.hasListeners(Aw.MOUSEDOWN_CELL)){const t=S_(o);t.eventArgs&&e.fireListeners(Aw.MOUSEDOWN_CELL,{col:t.eventArgs.col,row:t.eventArgs.row,event:o.nativeEvent,target:null===(u=null==t?void 0:t.eventArgs)||void 0===u?void 0:u.target,mergeCellInfo:t.eventArgs.mergeInfo})}}))})),e.scenegraph.tableGroup.addEventListener("pointerup",(t=>{var o,n,r,s;if(0===t.button){if("grabing"===i.interactionState){if(i.updateInteractionState(fy.default),i.isResizeCol())RM(e);else if(i.isResizeRow())BM(e);else if(i.isMoveCol()){const i=S_(t),o=e.stateManager.endMoveCol();o&&i.eventArgs&&e.hasListeners(Aw.CHANGE_HEADER_POSITION)?e.fireListeners(Aw.CHANGE_HEADER_POSITION,{target:{col:i.eventArgs.col,row:i.eventArgs.row},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource},event:t.nativeEvent}):o||e.hasListeners(Aw.CHANGE_HEADER_POSITION_FAIL)&&e.fireListeners(Aw.CHANGE_HEADER_POSITION_FAIL,{target:{col:e.stateManager.columnMove.colTarget,row:e.stateManager.columnMove.rowTarget},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource},event:t})}else if(i.isSelecting()){e.stateManager.endSelectCells(),e.stateManager.isFillHandle()&&e.stateManager.endFillSelect();const i=S_(t);if(e.eventManager.isDraging&&i.eventArgs&&e.hasListeners(Aw.DRAG_SELECT_END)){const r={event:t.nativeEvent,cells:[],col:i.eventArgs.target.col,row:i.eventArgs.target.row,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:null===(o=null==i?void 0:i.eventArgs)||void 0===o?void 0:o.target,mergeCellInfo:null===(n=i.eventArgs)||void 0===n?void 0:n.mergeInfo};r.cells=e.getSelectedCellInfos(),e.fireListeners(Aw.DRAG_SELECT_END,r)}}}else i.interactionState===fy.scrolling&&i.updateInteractionState(fy.default);if(e.hasListeners(Aw.MOUSEUP_CELL)){const i=S_(t);i.eventArgs&&e.fireListeners(Aw.MOUSEUP_CELL,{col:i.eventArgs.col,row:i.eventArgs.row,event:t.nativeEvent,target:null===(r=null==i?void 0:i.eventArgs)||void 0===r?void 0:r.target,mergeCellInfo:null===(s=i.eventArgs)||void 0===s?void 0:s.mergeInfo})}}})),e.scenegraph.tableGroup.addEventListener("rightdown",(t=>{var o,n,r,s;const l=S_(t);if(l.eventArgs){i.triggerContextMenu(l.eventArgs.col,l.eventArgs.row,l.abstractPos.x,l.abstractPos.y);const{col:a,row:h}=l.eventArgs;if(e.hasListeners(Aw.CONTEXTMENU_CELL)){const i=e.getCellInfo(a,h);let d,c;if(null===(o=l.eventArgs)||void 0===o?void 0:o.target){const t=fM(null===(n=l.eventArgs)||void 0===n?void 0:n.target);t&&(d=t.icon,c=t.position)}const u=Object.assign(Object.assign({},i),{event:t.nativeEvent,cells:[],targetIcon:d?{name:d.name,position:c,funcType:d.attribute.funcType}:void 0,target:null===(r=null==l?void 0:l.eventArgs)||void 0===r?void 0:r.target,mergeCellInfo:null===(s=l.eventArgs)||void 0===s?void 0:s.mergeInfo});!function(t,e,i){for(let o=0;o<t.length;o++){const n=t[o],r=Math.min(n.start.col,n.end.col),s=Math.max(n.start.col,n.end.col),l=Math.min(n.start.row,n.end.row),a=Math.max(n.start.row,n.end.row);if(r<=e&&e<=s&&l<=i&&i<=a||s<=e&&e<=r&&a<=i&&i<=l)return!0}return!1}(e.stateManager.select.ranges,a,h)?u.cells=[[i]]:u.cells=e.getSelectedCellInfos(),e.fireListeners(Aw.CONTEXTMENU_CELL,u)}}})),e.scenegraph.tableGroup.addEventListener("pointertap",(o=>{var n,r,s,l,a;if(e.stateManager.columnResize.resizing)return;const h=S_(o);if(!t.touchMove&&0===o.button&&h.eventArgs&&e.hasListeners(Aw.CLICK_CELL)){const{col:t,row:i}=h.eventArgs,a=e.getCellInfo(t,i);let d,c;if(null===(n=h.eventArgs)||void 0===n?void 0:n.target){const t=fM(null===(r=h.eventArgs)||void 0===r?void 0:r.target);t&&(d=t.icon,c=t.position)}const u=Object.assign(Object.assign({},a),{event:o.nativeEvent,federatedEvent:o,cells:[],targetIcon:d?{name:d.name,position:c,funcType:d.attribute.funcType}:void 0,target:null===(s=null==h?void 0:h.eventArgs)||void 0===s?void 0:s.target,mergeCellInfo:null===(l=h.eventArgs)||void 0===l?void 0:l.mergeInfo});e.fireListeners(Aw.CLICK_CELL,u)}if(!e.stateManager.columnResize.resizing&&!e.stateManager.columnMove.moving&&(t.dealIconClick(o,h),(null==h?void 0:h.eventArgs)&&t.touchSetTimeout&&"touch"===o.pointerType)){const e=S_(o);if(t.touchSetTimeout){clearTimeout(t.touchSetTimeout);const o=!!(null===(a=i.select.ranges)||void 0===a?void 0:a.length);t.dealTableSelect(e),i.endSelectCells(!0,o),t.touchSetTimeout=void 0}}})),e.scenegraph.stage.addEventListener("pointerdown",(o=>{var n,r,s,l;const a=S_(o);(null===(n=a.eventArgs)||void 0===n?void 0:n.target)&&(null===(r=a.eventArgs)||void 0===r?void 0:r.target)===(null===(s=i.residentHoverIcon)||void 0===s?void 0:s.icon)||i.hideMenu();pw(null===(l=e.editorManager)||void 0===l?void 0:l.completeEdit(o.nativeEvent),(n=>{var r;if(!1===n)return;const s=(null===(r=o.target.role)||void 0===r?void 0:r.startsWith("icon"))?o.target:void 0;if(t.downIcon=s,s||t.checkCellFillhandle(a)||i.columnResize.resizing||!t.checkColumnResize(a,!0));else{e.scenegraph.updateChartState(null),i.updateInteractionState(fy.grabing);const{eventArgs:t}=a;(null==t?void 0:t.targetCell)||e.getCellAt(a.abstractPos.x-8,a.abstractPos.y)&&e.hasListeners(Aw.MOUSEDOWN_TABLE)&&e.fireListeners(Aw.MOUSEDOWN_TABLE,{event:o.nativeEvent})}}))})),e.scenegraph.stage.addEventListener("pointerup",(t=>{"grabing"===i.interactionState&&(i.updateInteractionState(fy.default),i.isResizeCol()&&RM(e))})),e.scenegraph.stage.addEventListener("pointertap",(o=>{var n,r,s;const l=o.target;if(e.eventManager.isDraging||!l||!l.isDescendantsOf(e.scenegraph.stage)&&l.stage!==l||l.isDescendantsOf(e.scenegraph.tableGroup))e.eventManager.isDraging&&i.isSelecting()&&i.endSelectCells();else{i.updateInteractionState(fy.default),t.dealTableHover();const o=!!(null===(n=i.select.ranges)||void 0===n?void 0:n.length);(null===(s=null===(r=e.options.select)||void 0===r?void 0:r.blankAreaClickDeselect)||void 0===s||s)&&t.dealTableSelect(),i.endSelectCells(!0,o),i.updateCursor(),e.scenegraph.updateChartState(null)}})),e.scenegraph.stage.addEventListener("pointermove",(o=>{const n=S_(o);i.isResizeCol()||t.checkColumnResize(n)?e.stateManager.select&&t.checkCellFillhandle(n)?i.updateCursor("crosshair"):i.updateCursor("col-resize"):i.isResizeRow()||t.checkRowResize(n)?e.stateManager.select&&t.checkCellFillhandle(n)?i.updateCursor("crosshair"):i.updateCursor("row-resize"):i.isMoveCol()||i.updateCursor()})),e.scenegraph.tableGroup.addEventListener("checkbox_state_change",(t=>{var i,o;const n=S_(t),{col:r,row:s}=n.eventArgs,l=e.getCellInfo(r,s),a=nx(e,r,s);if(a)for(let i=a.start.col;i<=a.end.col;i++)for(let o=a.start.row;o<=a.end.row;o++)e.scenegraph.getCell(i,o).forEachChildren((e=>{"checkbox"===e.name&&e.setAttributes({checked:t.target.attribute.checked,indeterminate:t.target.attribute.indeterminate})}));const h=Object.assign(Object.assign({},l),{event:t.nativeEvent,target:null===(i=null==n?void 0:n.eventArgs)||void 0===i?void 0:i.target,mergeCellInfo:null===(o=null==n?void 0:n.eventArgs)||void 0===o?void 0:o.mergeInfo,checked:t.detail.checked});if(e.isHeader(r,s))e.stateManager.setHeaderCheckedState(l.field,t.detail.checked),"checkbox"===e.getCellType(r,s)&&e.scenegraph.updateCheckboxCellState(r,s,t.detail.checked);else if(e.stateManager.setCheckedState(r,s,l.field,t.detail.checked),"checkbox"===e.getCellType(r,s)){const t=e.stateManager.headerCheckedState[l.field],i=e.stateManager.updateHeaderCheckedState(l.field,r,s);t!==i&&e.scenegraph.updateHeaderCheckboxCellState(r,s,i)}e.fireListeners(Aw.CHECKBOX_STATE_CHANGE,h),e.scenegraph.updateNextFrame()})),e.scenegraph.tableGroup.addEventListener("radio_checked",(t=>{var i,o,n;const r=S_(t),{col:s,row:l,target:a}=r.eventArgs,h=e.getCellInfo(s,l),d=null===(i=B_.exec(a.id))||void 0===i?void 0:i[1],c=nx(e,s,l);if(c)for(let t=c.start.col;t<=c.end.col;t++)for(let i=c.start.row;i<=c.end.row;i++)e.scenegraph.getCell(t,i).forEachChildren((t=>{"radio"===t.name&&t.id===a.id&&t.setAttributes({checked:!0})}));const u=e.getBodyColumnDefine(s,l).radioCheckType||"column";if("cell"===u)if(c)for(let t=c.start.col;t<=c.end.col;t++)for(let i=c.start.row;i<=c.end.row;i++)e.scenegraph.getCell(t,i).forEachChildren((t=>{"radio"===t.name&&t.id!==a.id&&t.setAttributes({checked:!1})}));else e.scenegraph.getCell(s,l).forEachChildren((t=>{"radio"===t.name&&t.id!==a.id&&t.setAttributes({checked:!1})}));else"column"===u&&e.scenegraph.getColGroup(s).forEachChildren((t=>{t.forEachChildren((t=>{"radio"===t.name&&t.id!==a.id&&t.setAttributes({checked:!1})}))}));const g=d?Number(d):void 0;e.stateManager.setRadioState(s,l,h.field,u,g);const p=Object.assign(Object.assign({},h),{event:t.nativeEvent,target:null===(o=null==r?void 0:r.eventArgs)||void 0===o?void 0:o.target,mergeCellInfo:null===(n=null==r?void 0:r.eventArgs)||void 0===n?void 0:n.mergeInfo,radioIndexInCell:g});e.fireListeners(Aw.RADIO_STATE_CHANGE,p),e.scenegraph.updateNextFrame()})),e.scenegraph.stage.addEventListener("wheel",(t=>{var o;t.path.find((t=>"table"===t.role))&&(null===(o=e.editorManager)||void 0===o||o.completeEdit(),e.eventManager._enableTableScroll&&yM(t,i))}))}function AM(t){const e=t.table;t.gesture=new Dg(e.scenegraph.tableGroup,{tap:{interval:300}}),t.gesture.on("doubletap",(t=>{!function(t,e){var i,o,n,r,s,l;const a=S_(t);let h=-1,d=-1;a.eventArgs&&(h=a.eventArgs.col,d=a.eventArgs.row);const c=e.getCellValue(h,d),u=null===(o=null===(i=a.eventArgs)||void 0===i?void 0:i.targetCell)||void 0===o?void 0:o.globalAABBBounds;if(u&&e.internalProps.focusControl.setFocusRect(new Lw(u.x1+e.scrollLeft,u.y1+e.scrollTop,u.x2-u.x1,u.y2-u.y1),c),e.hasListeners(Aw.DBLCLICK_CELL)){const i=e.getCellInfo(h,d);let o,c;if(null===(n=a.eventArgs)||void 0===n?void 0:n.target){const t=fM(null===(r=a.eventArgs)||void 0===r?void 0:r.target);t&&(o=t.icon,c=t.position)}const u=Object.assign(Object.assign({},i),{event:t.nativeEvent,federatedEvent:t,cells:[],targetIcon:o?{name:o.name,position:c,funcType:o.attribute.funcType}:void 0,target:null===(s=null==a?void 0:a.eventArgs)||void 0===s?void 0:s.target,mergeCellInfo:null===(l=null==a?void 0:a.eventArgs)||void 0===l?void 0:l.mergeInfo});e.fireListeners(Aw.DBLCLICK_CELL,u)}}(t,e)}))}function RM(t){t.stateManager.endResizeCol();const e=[];for(let i=0;i<t.colCount;i++)e.push(t.getColWidth(i));t.fireListeners(Aw.RESIZE_COLUMN_END,{col:t.stateManager.columnResize.col,colWidths:e})}function BM(t){t.stateManager.endResizeRow(),t.fireListeners(Aw.RESIZE_ROW_END,{row:t.stateManager.rowResize.row,rowHeight:t.getRowHeight(t.stateManager.rowResize.row)})}let MM,TM=1;function PM(){return tw?TM=1:(TM=Math.ceil(window.devicePixelRatio||1),TM>1&&TM%2!=0&&(TM+=1)),TM}function EM(t){return!!t.changedTouches}function kM(t,e,i){if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"top";if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"bottom";if(t===i.rowHeaderLevelCount-1&&e>=i.rowHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"left"}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"left";if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return"right";if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return"bottom"}return"bottom"}PM();class LM{constructor(t){this.isDown=!1,this.isDraging=!1,this.globalEventListeners=[],this._enableTableScroll=!0,this.table=t,this.handleTextStickBindId=[],this.inertiaScroll=new _M(t.stateManager),"node"===Oy.mode||t.options.disableInteraction||(this.bindOuterEvent(),setTimeout((()=>{this.bindSelfEvent()}),0))}bindOuterEvent(){SM(this),function(t){const e=t.table,i=e.stateManager,o=e.internalProps.handler;function n(t){var i;if(e.hasListeners(Aw.KEYDOWN)){const o={keyCode:null!==(i=t.keyCode)&&void 0!==i?i:t.which,code:t.code,event:t,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth};e.fireListeners(Aw.KEYDOWN,o)}}o.on(e.getElement(),"blur",(e=>{t.dealTableHover()})),o.on(e.getElement(),"keydown",(o=>{var r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x,_;if("a"===o.key&&(o.ctrlKey||o.metaKey))(null===(r=e.keyboardOptions)||void 0===r?void 0:r.selectAllOnCtrlA)&&(o.preventDefault(),t.deelTableSelectAll());else if(i.select.cellPos.col>=0&&i.select.cellPos.row>=0&&("ArrowUp"===o.key||"ArrowDown"===o.key||"ArrowLeft"===o.key||"ArrowRight"===o.key)){if((null===(l=null===(s=e.options.keyboardOptions)||void 0===s?void 0:s.moveEditCellOnArrowKeys)||void 0===l||!l)&&(null===(a=e.editorManager)||void 0===a?void 0:a.editingEditor))return;let t,n;if(o.preventDefault(),o.stopPropagation(),"ArrowUp"===o.key?o.ctrlKey||o.metaKey?(t=i.select.cellPos.col,n=0):(o.shiftKey,t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row-1))):"ArrowDown"===o.key?o.ctrlKey||o.metaKey?(t=i.select.cellPos.col,n=e.rowCount-1):(o.shiftKey,t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1))):"ArrowLeft"===o.key?o.ctrlKey||o.metaKey?(t=0,n=i.select.cellPos.row):(o.shiftKey,n=i.select.cellPos.row,t=Math.min(e.colCount-1,Math.max(0,i.select.cellPos.col-1))):"ArrowRight"===o.key&&(o.ctrlKey||o.metaKey?(t=e.colCount-1,n=i.select.cellPos.row):(o.shiftKey,n=i.select.cellPos.row,t=Math.min(e.colCount-1,Math.max(0,i.select.cellPos.col+1)))),aR(e,t,n))return;e.selectCell(t,n,o.shiftKey),null!==(d=null===(h=e.options.keyboardOptions)||void 0===h?void 0:h.moveEditCellOnArrowKeys)&&void 0!==d&&d&&(null===(c=e.editorManager)||void 0===c?void 0:c.editingEditor)&&(e.editorManager.completeEdit(),e.getElement().focus(),e.getEditor(t,n)&&e.editorManager.startEditCell(t,n))}else if("Escape"===o.key)null===(u=e.editorManager)||void 0===u||u.cancelEdit(),e.getElement().focus();else if("Enter"===o.key){if(null===(g=e.editorManager)||void 0===g?void 0:g.editingEditor){if(n(o),e.editorManager.completeEdit(),e.getElement().focus(),!0===(null===(p=e.options.keyboardOptions)||void 0===p?void 0:p.moveFocusCellOnEnter)){const t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1));if(aR(e,t,n))return;e.selectCell(t,n,o.shiftKey)}return}if(!0===(null===(f=e.options.keyboardOptions)||void 0===f?void 0:f.moveFocusCellOnEnter)){const t=i.select.cellPos.col,n=Math.min(e.rowCount-1,Math.max(0,i.select.cellPos.row+1));if(aR(e,t,n))return;e.selectCell(t,n,o.shiftKey)}else if((null===(m=null===(v=e.options.keyboardOptions)||void 0===v?void 0:v.editCellOnEnter)||void 0===m||m)&&1===(null!==(C=null===(b=e.stateManager.select.ranges)||void 0===b?void 0:b.length)&&void 0!==C?C:0)){const t=e.stateManager.select.ranges[0].start.col,i=e.stateManager.select.ranges[0].start.row,o=e.stateManager.select.ranges[0].end.col,n=e.stateManager.select.ranges[0].end.row;t===o&&i===n&&e.getEditor(t,i)&&e.editorManager.startEditCell(t,i)}}else if("Tab"===o.key){if((null===(w=null===(y=e.options.keyboardOptions)||void 0===y?void 0:y.moveFocusCellOnTab)||void 0===w||w)&&i.select.cellPos.col>=0&&i.select.cellPos.row>=0){if(i.select.cellPos.col===e.colCount-1&&i.select.cellPos.row===e.rowCount-1)return;let t,n;if(o.preventDefault(),i.select.cellPos.col===e.colCount-1?(n=Math.min(e.rowCount-1,i.select.cellPos.row+1),t=e.rowHeaderLevelCount):(n=i.select.cellPos.row,t=i.select.cellPos.col+1),aR(e,t,n))return;e.selectCell(t,n),(null===(x=e.editorManager)||void 0===x?void 0:x.editingEditor)&&(e.editorManager.completeEdit(),e.getElement().focus(),e.getEditor(t,n)&&e.editorManager.startEditCell(t,n))}}else if(!(o.ctrlKey||o.metaKey||o.shiftKey)){const t=e.options.editCellTrigger;if(("keydown"===t||Array.isArray(t)&&t.includes("keydown"))&&!(null===(_=e.editorManager)||void 0===_?void 0:_.editingEditor)){const t=/^[a-zA-Z0-9+\-*\/%=.,\s]$/;o.key.match(t)&&e.editorManager.startEditCell(i.select.cellPos.col,i.select.cellPos.row,"")}}n(o)})),o.on(e.getElement(),"copy",(t=>{var i,o;if(null===(i=e.keyboardOptions)||void 0===i?void 0:i.copySelected){const i=e.getCopyValue();if(K(i)){if(t.preventDefault(),null===(o=navigator.clipboard)||void 0===o?void 0:o.write){const t=t=>{const e=["<table>"],i=['<meta name="author" content="Visactor"/>','<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join(""),o=t.split("\r\n");return o.forEach((function(t,i){const n=t.split("\t"),r=[];0===i&&e.push("<tbody>"),n.forEach((function(t,e){const i=t?t.toString().replace(/&/g,"&").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br>").replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g,"<br>\r\n").replace(/\x20{2,}/gi,(t=>`<span style="mso-spacerun: yes">${" ".repeat(t.length-1)} </span>`)).replace(/\t/gi,"	"):" ";r.push(`<td>${i}</td>`)})),e.push("<tr>",...r,"</tr>"),i===o.length-1&&e.push("</tbody>")})),e.push("</table>"),[i,e.join("")].join("")},e=t(i);navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([i],{type:"text/plain"})})])}else Cw?window.clipboardData.setData("Text",i):t.clipboardData.setData("text/plain",i);e.fireListeners(Aw.COPY_DATA,{cellRange:e.stateManager.select.ranges,copyData:i})}}})),o.on(e.getElement(),"paste",(t=>{var i,o,n,r;if((null===(i=e.keyboardOptions)||void 0===i?void 0:i.pasteValueToCell)&&e.changeCellValues){if(null===(o=e.editorManager)||void 0===o?void 0:o.editingEditor)return;if((null===(n=e.stateManager.select.ranges)||void 0===n?void 0:n.length)>0)if(null===(r=navigator.clipboard)||void 0===r?void 0:r.read)navigator.clipboard.read().then((t=>{for(const e of t)e.types.includes("text/html")?l(e):1===e.types.length&&"text/plain"===e.types[0]&&h(e)}));else{const i=e.stateManager.select.ranges,o=Math.min(i[0].start.col,i[0].end.col),n=Math.min(i[0].start.row,i[0].end.row),r=(t.clipboardData||window.Clipboard).getData("text").split("\n"),s=[];r.forEach((function(t,e){const i=t.split("\t"),o=[];s.push(o),i.forEach((function(t,e){e===i.length-1&&(t=t.trim()),o.push(t)}))})),e.changeCellValues(o,n,s)}}})),o.on(e.getElement(),"contextmenu",(t=>{var i;!1!==(null===(i=e.eventOptions)||void 0===i?void 0:i.preventDefaultContextMenu)&&t.preventDefault()})),e.options.canvas||o.on(e.getContainer(),"resize",(t=>{var i;0===t.width&&0===t.height||((e.autoFillWidth||e.autoFillHeight)&&(null===(i=e.editorManager)||void 0===i||i.completeEdit()),K(e.options.pixelRatio)||e.setPixelRatio(PM()),t.windowSizeNotChange||e.resize())}));const r=/<tr[^>]*>([\s\S]*?)<\/tr>/g,s=/<td[^>]*>([\s\S]*?)<\/td>/g;function l(t){const i=e.stateManager.select.ranges,o=i.length,n=Math.min(i[o-1].start.col,i[o-1].end.col),l=Math.min(i[o-1].start.row,i[o-1].end.row),h=Math.max(i[o-1].start.col,i[o-1].end.col),c=Math.max(i[o-1].start.row,i[o-1].end.row);let u=0,g=0,p=[];t.getType("text/html").then((t=>{t.text().then((t=>{var i,o;if(t&&/(<table)|(<TABLE)/g.test(t)){const a=Array.from(t.matchAll(r));for(const t of a){const e=t[1],o=Array.from(e.matchAll(s)).map((t=>t[1].replace(/(<(?!br)([^>]+)>)/gi,"").replace(/<br(\s*|\/)>[\r\n]?/gim,"\n").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/	/gi,"\t").replace(/ /g," ")));p.push(o),u=Math.max(u,null!==(i=null==o?void 0:o.length)&&void 0!==i?i:0)}g=null!==(o=p.length)&&void 0!==o?o:0,p=d(p,g,u,c-l+1,h-n+1),e.changeCellValues(n,l,p,!0)}else navigator.clipboard.read().then((t=>{for(const e of t)e.types.includes("text/plain")&&e.getType("text/plain").then((t=>{t.text().then(a)}))}))}))}))}function a(t){var i;const o=e.stateManager.select.ranges,n=o.length,r=Math.min(o[n-1].start.col,o[n-1].end.col),s=Math.min(o[n-1].start.row,o[n-1].end.row),l=Math.max(o[n-1].start.col,o[n-1].end.col),a=Math.max(o[n-1].start.row,o[n-1].end.row);let h=0,c=0,u=[];t.split("\n").forEach((function(t,e){var i;const o=t.split("\t"),n=[];u.push(n),o.forEach((function(t,e){e===o.length-1&&(t=t.trim()),n.push(t)})),h=Math.max(h,null!==(i=null==n?void 0:n.length)&&void 0!==i?i:0)})),c=null!==(i=u.length)&&void 0!==i?i:0,u=d(u,c,h,a-s+1,l-r+1),e.changeCellValues(r,s,u,!0)}function h(t){const i=e.stateManager.select.ranges,o=i.length,n=Math.min(i[o-1].start.col,i[o-1].end.col),r=Math.min(i[o-1].start.row,i[o-1].end.row),s=Math.max(i[o-1].start.col,i[o-1].end.col),l=Math.max(i[o-1].start.row,i[o-1].end.row);let a=0,h=0;t.getType("text/plain").then((t=>{t.text().then((t=>{var i;const o=t.replace(/\r(?!\n)/g,"\r\n").split("\r\n");let c=[];o.length>1&&""===o[o.length-1]&&o.pop(),o.forEach((function(t,e){var i;const o=t.split("\t"),n=[];c.push(n),o.forEach((function(t,e){t.includes("\n")&&(t=t.replace(/^"(.*)"$/,"$1").replace(/["]*/g,(t=>new Array(Math.floor(t.length/2)).fill('"').join("")))),n.push(t)})),a=Math.max(a,null!==(i=null==n?void 0:n.length)&&void 0!==i?i:0)})),h=null!==(i=c.length)&&void 0!==i?i:0,c=d(c,h,a,l-r+1,s-n+1),e.changeCellValues(n,r,c,!0)}))}))}function d(t,e,i,o,n){if(n>i||o>e){if(n%i==0&&o%e==0){const r=[];for(let s=0;s<o;s++){const o=[];r.push(o);for(let r=0;r<n;r++){const n=s%e,l=r%i;o.push(t[n][l])}}return r}return t}return t}const c=t=>{e.eventManager.LastBodyPointerXY={x:t.x,y:t.y},e.eventManager.isDown=!0};t.globalEventListeners.push({name:"pointerdown",env:"body",callback:c}),document.body.addEventListener("pointerdown",c);const u=t=>{t.target!==e.canvas&&(t=>{var o,n,r,s,l,a;if(i.menu.isShow&&setTimeout((()=>{e.internalProps.menuHandler.pointInMenuElement(t.clientX,t.clientY)||i.menu.isShow&&i.hideMenu()}),0),i.isResizeCol())RM(e);else if(i.isResizeRow())BM(e);else if(i.isMoveCol()){const i=e.stateManager.endMoveCol();i&&-1!==(null===(o=e.stateManager.columnMove)||void 0===o?void 0:o.colSource)&&-1!==(null===(n=e.stateManager.columnMove)||void 0===n?void 0:n.rowSource)&&-1!==(null===(r=e.stateManager.columnMove)||void 0===r?void 0:r.colTarget)&&-1!==(null===(s=e.stateManager.columnMove)||void 0===s?void 0:s.rowTarget)?e.hasListeners(Aw.CHANGE_HEADER_POSITION)&&e.fireListeners(Aw.CHANGE_HEADER_POSITION,{target:{col:e.stateManager.columnMove.colTarget,row:e.stateManager.columnMove.rowTarget},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource},event:t}):i||e.hasListeners(Aw.CHANGE_HEADER_POSITION_FAIL)&&e.fireListeners(Aw.CHANGE_HEADER_POSITION_FAIL,{target:{col:e.stateManager.columnMove.colTarget,row:e.stateManager.columnMove.rowTarget},source:{col:e.stateManager.columnMove.colSource,row:e.stateManager.columnMove.rowSource},event:t})}else if(i.isSelecting()&&(null===(a=null===(l=e.stateManager.select)||void 0===l?void 0:l.ranges)||void 0===a?void 0:a.length)){const i=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end.col,o=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end.row;if(e.stateManager.endSelectCells(),e.hasListeners(Aw.DRAG_SELECT_END)){const n={event:t,cells:[],col:i,row:o,scaleRatio:e.canvas.getBoundingClientRect().width/e.canvas.offsetWidth,target:void 0};n.cells=e.getSelectedCellInfos(),e.fireListeners(Aw.DRAG_SELECT_END,n)}}})(t),e.eventManager.LastBodyPointerXY=null,e.eventManager.isDown=!1,e.eventManager.isDraging=!1,e.eventManager.inertiaScroll.endInertia(),"grabing"===i.interactionState&&i.isResizeCol()?RM(e):"grabing"===i.interactionState&&i.isResizeRow()&&BM(e)};t.globalEventListeners.push({name:"pointerup",env:"document",callback:u}),document.addEventListener("pointerup",u);const g=o=>{var n,r,s,l,a;if(e.eventManager.isDown&&e.eventManager.LastBodyPointerXY){const t=null!==(r=null===(n=e.eventManager.LastBodyPointerXY)||void 0===n?void 0:n.x)&&void 0!==r?r:o.x,i=null!==(l=null===(s=e.eventManager.LastBodyPointerXY)||void 0===s?void 0:s.y)&&void 0!==l?l:o.y;(Math.abs(t-o.x)>1||Math.abs(i-o.y)>1)&&(e.eventManager.isDraging=!0)}const{x:h,y:d}=e._getMouseAbstractPoint(o,!1);i.interactionState===fy.grabing&&(i.isResizeCol()?(t.dealColumnResize(h,d),e.hasListeners(Aw.RESIZE_COLUMN)&&e.fireListeners(Aw.RESIZE_COLUMN,{col:e.stateManager.columnResize.col,colWidth:e.getColWidth(e.stateManager.columnResize.col)})):i.isResizeRow()&&(t.dealRowResize(h,d),e.hasListeners(Aw.RESIZE_ROW)&&e.fireListeners(Aw.RESIZE_ROW,{row:e.stateManager.rowResize.row,rowHeight:e.getRowHeight(e.stateManager.rowResize.row)})));const c=e.stateManager.isSelecting();if(t._enableTableScroll&&t.isDraging&&c&&(null===(a=e.stateManager.select.ranges)||void 0===a?void 0:a.length)>0){const t=e.getDrawRange(),i=e.getFrozenRowsHeight(),o=e.getBottomFrozenRowsHeight(),n=e.getFrozenColsWidth(),r=e.getRightFrozenColsWidth(),s=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].start;if(e.isSeriesNumber(s.col,s.row))return;const l=e.stateManager.select.ranges[e.stateManager.select.ranges.length-1].end,a=(!1===e.isFrozenRow(s.row)||!1===e.isFrozenRow(l.row))&&e.getAllRowsHeight()>e.tableNoFrameHeight,c=(!1===e.isFrozenColumn(s.col)||!1===e.isFrozenColumn(l.col))&&e.getAllColsWidth()>e.tableNoFrameWidth;if((d>t.bottom-o||d<t.top+i)&&a||(h>t.right-r||h<t.left+n)&&c){e.eventManager.scrollXSpeed=0,e.eventManager.scrollYSpeed=0;let s=!1,l=!1,u=!1,g=!1;d>t.bottom-o&&a&&e.scrollTop+e.tableNoFrameHeight<e.getAllRowsHeight()?(s=!0,e.eventManager.scrollYSpeed=-(d-t.bottom+o)/50):d<t.top+i&&a&&e.scrollTop>0&&(l=!0,e.eventManager.scrollYSpeed=-(d-t.top-i)/50),h>t.right-r&&c&&e.scrollLeft+e.tableNoFrameWidth<e.getAllColsWidth()?(u=!0,e.eventManager.scrollXSpeed=-(h-t.right+r)/50):h<t.left+n&&c&&e.scrollLeft>0&&(g=!0,e.eventManager.scrollXSpeed=-(h-t.left-n)/50),e.eventManager.inertiaScroll.startInertia(e.eventManager.scrollXSpeed,e.eventManager.scrollYSpeed,1),e.eventManager.inertiaScroll.setScrollHandle(((a,c)=>{let p,f;yM({deltaX:-a,deltaY:-c},e.stateManager,!1),s?f=e.scrollTop+t.height-o-20:l&&(f=e.scrollTop+i+20),u?p=e.scrollLeft+t.width-r-20:g&&(p=e.scrollLeft+n+20);let v=!1,m=!1;u||g||(h>e.tableNoFrameWidth-e.getRightFrozenColsWidth()&&h<e.tableNoFrameWidth||h>0&&h<e.getFrozenColsWidth()?(p=h,m=!0):p=e.scrollLeft+h),s||l||(d>e.tableNoFrameHeight-e.getBottomFrozenRowsHeight()&&d<e.tableNoFrameHeight||d>0&&d<e.getFrozenRowsHeight()?(f=d,v=!0):f=e.scrollTop+d),e.stateManager.updateInteractionState(fy.grabing);const b=e.getTargetColAtConsiderRightFrozen(p,m),C=e.getTargetRowAtConsiderBottomFrozen(f,v);K(b)&&K(C)&&e.stateManager.updateSelectPos(b.col,C.row,!1,!1,!1,!0)}))}else e.eventManager.inertiaScroll.isInertiaScrolling()?e.eventManager.inertiaScroll.endInertia():e.eventManager.scrollYSpeed=0}};t.globalEventListeners.push({name:"pointermove",env:"body",callback:g}),document.body.addEventListener("pointermove",g)}(this),function(t){const e=t.table,i=e.stateManager,o=e.scenegraph;o.component.vScrollBar.addEventListener("pointerover",(t=>{i.showVerticalScrollBar()})),o.component.hScrollBar.addEventListener("pointerover",(t=>{i.showHorizontalScrollBar()})),o.component.vScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==fy.scrolling&&i.hideVerticalScrollBar()})),o.component.hScrollBar.addEventListener("pointerout",(t=>{i.interactionState!==fy.scrolling&&i.hideHorizontalScrollBar()})),o.component.vScrollBar.addEventListener("pointermove",(t=>{o.table.stateManager.updateCursor("default"),t.stopPropagation()})),o.component.vScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation(),o.table.hasListeners(Aw.MOUSEDOWN_TABLE)&&o.table.fireListeners(Aw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.vScrollBar.addEventListener("scrollDown",(t=>{var e;o.table.eventManager.LastBodyPointerXY={x:t.x,y:t.y},o.table.eventManager.isDown=!0,i.interactionState!==fy.scrolling&&i.updateInteractionState(fy.scrolling),o.table.stateManager.hideMenu(),null===(e=o.table.editorManager)||void 0===e||e.completeEdit(),o.table.hasListeners(Aw.MOUSEDOWN_TABLE)&&o.table.fireListeners(Aw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.vScrollBar.addEventListener("pointerup",(()=>{i.fastScrolling=!1,o.table.eventManager.isDraging=!1,i.interactionState===fy.scrolling&&i.updateInteractionState(fy.default)})),o.component.vScrollBar.addEventListener("pointerupoutside",(()=>{i.fastScrolling=!1,i.interactionState===fy.scrolling&&i.updateInteractionState(fy.default)})),o.component.vScrollBar.addEventListener("scrollUp",(t=>{o.table.eventManager.isDraging=!1})),o.component.hScrollBar.addEventListener("pointermove",(t=>{o.table.stateManager.updateCursor("default"),t.stopPropagation()})),o.component.hScrollBar.addEventListener("pointerdown",(t=>{t.stopPropagation(),o.table.hasListeners(Aw.MOUSEDOWN_TABLE)&&o.table.fireListeners(Aw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.hScrollBar.addEventListener("scrollDown",(t=>{var e;o.table.eventManager.LastBodyPointerXY={x:t.x,y:t.y},o.table.eventManager.isDown=!0,i.interactionState!==fy.scrolling&&i.updateInteractionState(fy.scrolling),o.table.stateManager.hideMenu(),null===(e=o.table.editorManager)||void 0===e||e.completeEdit(),o.table.hasListeners(Aw.MOUSEDOWN_TABLE)&&o.table.fireListeners(Aw.MOUSEDOWN_TABLE,{event:t.nativeEvent})})),o.component.hScrollBar.addEventListener("pointerup",(()=>{i.fastScrolling=!1,o.table.eventManager.isDraging=!1,i.interactionState===fy.scrolling&&i.updateInteractionState(fy.default)})),o.component.hScrollBar.addEventListener("pointerupoutside",(()=>{i.fastScrolling=!1,i.interactionState===fy.scrolling&&i.updateInteractionState(fy.default)})),o.component.hScrollBar.addEventListener("scrollUp",(t=>{o.table.eventManager.isDraging=!1}));const n=$y(i.updateVerticalScrollBar,20),r=$y(i.updateHorizontalScrollBar,20);o.component.vScrollBar.addEventListener("scrollDrag",(t=>{o.table.eventManager.isDown&&(o.table.eventManager.isDraging=!0),i.fastScrolling=!0,i.interactionState!==fy.scrolling&&i.updateInteractionState(fy.scrolling);const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);n(e,t)})),o.component.hScrollBar.addEventListener("scrollDrag",(t=>{o.table.eventManager.isDown&&(o.table.eventManager.isDraging=!0),i.fastScrolling=!0,i.interactionState!==fy.scrolling&&i.updateInteractionState(fy.scrolling);const e=t.detail.value[0]/(1-t.detail.value[1]+t.detail.value[0]);r(e)}))}(this),function(t){const e=t.table,i=e.stateManager,o=e.scenegraph;t.touchMovePoints=[],e.scenegraph.tableGroup.addEventListener("touchstart",(e=>{e.target.isChildOf(o.component.vScrollBar)||e.target.isChildOf(o.component.vScrollBar)||(t.isTouchdown=!0,t.touchMovePoints.push({x:e.page.x,y:e.page.y,timestamp:Date.now()}))}));const n=o=>{var n,r;if(t.touchMove&&o.preventDefault(),t.isTouchdown&&EM(o))if((null===(r=null===(n=t.downIcon)||void 0===n?void 0:n.attribute)||void 0===r?void 0:r.funcType)===xy.dragReorder)o.preventDefault();else if(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:o.changedTouches[0].pageX,y:o.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll){const n=-t.touchMovePoints[t.touchMovePoints.length-1].x+t.touchMovePoints[t.touchMovePoints.length-2].x,r=-t.touchMovePoints[t.touchMovePoints.length-1].y+t.touchMovePoints[t.touchMovePoints.length-2].y;yM({deltaX:n,deltaY:r},i),o.cancelable&&("none"===e.internalProps.overscrollBehavior||Math.abs(r)>=Math.abs(n)&&0!==r&&wM(r,i)||Math.abs(r)<=Math.abs(n)&&0!==n&&xM(n,i))&&o.preventDefault()}};window.addEventListener("touchmove",n,{passive:!1}),t.globalEventListeners.push({name:"touchmove",env:"window",callback:n});const r=i=>{var o,n,r,s;if(t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&EM(i)){if((null===(n=null===(o=t.downIcon)||void 0===o?void 0:o.attribute)||void 0===n?void 0:n.funcType)===xy.dragReorder)i.preventDefault();else if((null===(r=t.touchMovePoints)||void 0===r?void 0:r.length)&&(t.touchMovePoints.length>4&&t.touchMovePoints.shift(),t.touchMovePoints.push({x:i.changedTouches[0].pageX,y:i.changedTouches[0].pageY,timestamp:Date.now()}),t._enableTableScroll)){const i=t.touchMovePoints[0],o=t.touchMovePoints[(null===(s=t.touchMovePoints)||void 0===s?void 0:s.length)-1],n=(o.x-i.x)/(o.timestamp-i.timestamp),r=(o.y-i.y)/(o.timestamp-i.timestamp);t.inertiaScroll.startInertia(n,r,.95),e.eventManager.inertiaScroll.setScrollHandle(((t,i)=>{yM({deltaX:-t,deltaY:-i},e.stateManager)}))}t.isTouchdown=!1,t.touchMovePoints=[]}};window.addEventListener("touchend",r),t.globalEventListeners.push({name:"touchend",env:"window",callback:r});const s=e=>{t.touchEnd=!0,t.touchMove=!1,t.isTouchdown&&(t.isTouchdown=!1,t.touchMovePoints=[])};window.addEventListener("touchcancel",s),t.globalEventListeners.push({name:"touchcancel",env:"window",callback:s})}(this),AM(this)}updateEventBinder(){setTimeout((()=>{var t;this.table.isReleased||(yB(this.table)&&0===(null===(t=this.handleTextStickBindId)||void 0===t?void 0:t.length)?(this.handleTextStickBindId.push(this.table.on(Aw.SCROLL,(t=>{fB(this.table)}))),this.handleTextStickBindId.push(this.table.on(Aw.RESIZE_COLUMN_END,(t=>{fB(this.table)}))),this.handleTextStickBindId.push(this.table.on(Aw.RESIZE_ROW_END,(t=>{fB(this.table)})))):!yB(this.table)&&this.handleTextStickBindId&&(this.handleTextStickBindId.forEach((t=>{this.table.off(t)})),this.handleTextStickBindId=[]),CM(this.table))}),0)}bindSelfEvent(){if(this.table.isReleased)return;const t=this.table.stateManager;var e;this.table.on(Aw.ICON_CLICK,(e=>{var i;const{col:o,row:n,x:r,y:s,funcType:l,icon:a,event:h}=e;if(l===xy.dropDown)t.triggerDropDownMenu(o,n,r,s,h);else if(l===xy.sort)t.triggerSort(o,n,a,h);else if(l===xy.frozen)t.triggerFreeze(o,n,a);else if(l===xy.drillDown)(d=this.table).fireListeners(gM.DRILLMENU_CLICK,d.stateManager.drill);else if(l===xy.collapse||l===xy.expand){const e=!!(null===(i=t.select.ranges)||void 0===i?void 0:i.length);t.updateSelectPos(-1,-1),t.endSelectCells(!0,e),this.table.toggleHierarchyState(o,n)}var d})),this.table.on(Aw.DROPDOWN_MENU_CLICK,(()=>{t.hideMenu()})),this.updateEventBinder(),e=this.table,"browser"===Oy.mode&&e.on(Aw.CLICK_CELL,(t=>{const{col:i,row:o}=t;if("image"===t.target.type&&t.target.role&&t.target.role.startsWith("icon"))return;let n;n=e.internalProps.layoutMap.isHeader(i,o)?e.isPivotTable()?e._getHeaderLayoutMap(i,o).headerType:e.getHeaderDefine(i,o).headerType:e.getBodyColumnType(i,o);const r=e.isHeader(i,o)?e.getHeaderDefine(i,o):e.getBodyColumnDefine(i,o),s=e.getCellValue(i,o),l=e.getCellOriginValue(i,o);if("link"===n){if(!1===r.linkJump)return;const t=r.templateLink,n=!1!==r.linkDetect;let a;if(t){const n=e.getCellOriginRecord(i,o),r=Object.assign({__value:s,__dataValue:l},n),h=/\{\s*(\S+?)\s*\}/g;a=t.replace(h,((t,e)=>r[e]))}else if(n){if(!Gw.test(s))return;a=s}else a=s;const h=r.linkTarget,d=r.linkWindowFeatures;window.open(a,h,d)}else if("image"===n){const{clickToPreview:t}=r;if(!1===t)return;const e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.backgroundColor="rgba(30, 30, 30, 0.4)",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.overflow="hidden",e.style.zIndex="9999",e.addEventListener("click",(t=>{t.target===e&&document.body.removeChild(e)}));const i=new Image;i.src=s,i.style.maxWidth="80%",i.style.maxHeight="80%",e.appendChild(i),document.body.appendChild(e)}else if("video"===n){const{clickToPreview:t}=r;if(!1===t)return;const e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.backgroundColor="rgba(30, 30, 30, 0.4)",e.style.display="flex",e.style.justifyContent="center",e.style.alignItems="center",e.style.overflow="hidden",e.style.zIndex="9999",e.addEventListener("click",(t=>{t.target===e&&document.body.removeChild(e)}));const i=document.createElement("video");i.src=s,i.style.maxWidth="80%",i.style.maxHeight="80%",i.setAttribute("preload","auto"),i.setAttribute("controls","true"),e.appendChild(i),document.body.appendChild(e)}})),this.table.on(Aw.DBLCLICK_CELL,(t=>{var e;if(t.federatedEvent){const i=S_(t.federatedEvent),o=this.table.scenegraph.getResizeColAt(i.abstractPos.x,i.abstractPos.y,null===(e=i.eventArgs)||void 0===e?void 0:e.targetCell);if(this.table.eventManager.checkCellFillhandle(i))this.table.fireListeners(Aw.DBLCLICK_FILL_HANDLE,{});else if(this.table._canResizeColumn(o.col,o.row)&&o.col>=0){this.table.scenegraph.updateAutoColWidth(o.col),this.table.internalProps._widthResizedColMap.add(o.col),this.table.scenegraph.updateChartSizeForResizeColWidth(o.col);const t=this.table.stateManager;t.columnResize.col<t.table.frozenColCount&&!t.table.isPivotTable()&&!t.table.transpose&&t.table.scenegraph.component.setFrozenColumnShadow(t.table.frozenColCount-1,t.columnResize.isRightFrozen);const e=[];for(let t=0;t<this.table.colCount;t++)e.push(this.table.getColWidth(t));this.table.fireListeners(Aw.RESIZE_COLUMN_END,{col:o.col,colWidths:e})}}})),this.table.isPivotTable()&&function(t){const e=t.internalProps.layoutMap.rowsDefine,i=t.internalProps.layoutMap.columnsDefine;for(let t=0;t<e.length;t++){const i=e[t];if("string"!=typeof i&&(i.drillDown||i.drillUp))return!0}for(let t=0;t<i.length;t++){const e=i[t];if("string"!=typeof e&&(e.drillDown||e.drillUp))return!0}return!1}(this.table)&&function(t){t.on(Aw.MOUSEENTER_CELL,(e=>{const{col:i,row:o}=e;if(-1===i||-1===o)return;const n=t.internalProps.layoutMap.getHeaderDimension(i,o);(null==n?void 0:n.drillDown)||(null==n?void 0:n.drillUp)?t.stateManager.updateDrillState(n.dimensionKey,n.title,n.drillDown,n.drillUp,i,o):t.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)})),t.on(Aw.MOUSELEAVE_TABLE,(e=>{t.stateManager.updateDrillState(void 0,void 0,!1,!1,-1,-1)}))}(this.table),CM(this.table),function(t){t.isPivotChart()&&t.scenegraph.tableGroup.addEventListener("click",(e=>{var i;if(!t.stateManager.columnMove.moving&&!t.stateManager.columnResize.resizing)if("axis-label"===e.target.name){const i=S_(e),{col:o,row:n}=i.eventArgs,r=t.internalProps.layoutMap;let s,l;r.indicatorsAsCol?(s=r.getDimensionKeyInChartSpec(r.rowHeaderLevelCount,n),l=r.getCellHeaderPaths(r.rowHeaderLevelCount-2,n).rowHeaderPaths):(s=r.getDimensionKeyInChartSpec(o,r.columnHeaderLevelCount),l=r.getCellHeaderPaths(o,r.columnHeaderLevelCount-1).colHeaderPaths);const a=l.map((t=>({key:t.dimensionKey,value:t.value}))).filter((t=>t.key));if(a.push({key:s,value:e.target.attribute.text}),t._selectedDimensionInChart.length&&function(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(t[i].key!==e[i].key||t[i].value!==e[i].value)return!1;return!0}(t._selectedDimensionInChart,a))return;t._selectedDimensionInChart=a,r.updateDataStateToChartInstance(),VB(t.scenegraph),t.scenegraph.updateNextFrame()}else(null===(i=t._selectedDimensionInChart)||void 0===i?void 0:i.length)&&(t._selectedDimensionInChart.length=0,t.internalProps.layoutMap.updateDataStateToChartInstance(),VB(t.scenegraph),t.scenegraph.updateNextFrame())}))}(this.table),function(t){t.isPivotChart()&&(t.on(Aw.MOUSEENTER_CELL,(e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((i=>{if("axis"===i.name){const i=kM(e.col,e.row,t.internalProps.layoutMap);e.axisPosition=i,t.fireListeners(Aw.MOUSEENTER_AXIS,e)}}))})),t.on(Aw.MOUSELEAVE_CELL,(e=>{t.scenegraph.getCell(e.col,e.row).forEachChildren((i=>{if("axis"===i.name){const i=kM(e.col,e.row,t.internalProps.layoutMap);e.axisPosition=i,t.fireListeners(Aw.MOUSELEAVE_AXIS,e)}}))})))}(this.table)}dealTableHover(t){if(!t)return void this.table.stateManager.updateHoverPos(-1,-1);const{eventArgs:e}=t;e?this.table.stateManager.updateHoverPos(e.col,e.row):this.table.stateManager.updateHoverPos(-1,-1)}dealIconHover(t){const{eventArgs:e}=t;e?this.table.stateManager.updateHoverIcon(e.col,e.row,e.target,e.targetCell):this.table.stateManager.updateHoverIcon(-1,-1,void 0,void 0)}dealMenuHover(t){}dealTableSelect(t,e){var i,o,n,r;if(!t)return this.table.stateManager.updateSelectPos(-1,-1),!1;const{eventArgs:s}=t;if(s){if("checkbox"===s.target.name||"radio"===s.target.name)return!1;const l=this.table.getBodyColumnDefine(s.col,s.row);if(this.table.isHeader(s.col,s.row)&&((null==l?void 0:l.disableHeaderSelect)||(null===(i=this.table.stateManager.select)||void 0===i?void 0:i.disableHeader)))return e||this.table.stateManager.updateSelectPos(-1,-1),!1;if(!this.table.isHeader(s.col,s.row)&&(null==l?void 0:l.disableSelect)){if(!e){const t=!!(null===(o=this.table.stateManager.select.ranges)||void 0===o?void 0:o.length);this.table.stateManager.updateSelectPos(-1,-1),t&&this.table.stateManager.endSelectCells(!0,t)}return!1}return!this.table.isPivotChart()||"axis-label"!==(null===(n=null==t?void 0:t.eventArgs)||void 0===n?void 0:n.target.name)&&"chart"!==(null===(r=null==t?void 0:t.eventArgs)||void 0===r?void 0:r.target.type)?(this.table.stateManager.updateSelectPos(s.col,s.row,s.event.shiftKey,s.event.ctrlKey||s.event.metaKey,!1,e),!0):(this.table.stateManager.updateSelectPos(-1,-1),!1)}return!1}dealFillSelect(t,e){var i,o;const{eventArgs:n}=t;if(n){if((null===(o=null===(i=this.table.stateManager.select)||void 0===i?void 0:i.ranges)||void 0===o?void 0:o.length)&&this.table.stateManager.isFillHandle()){let i,o;const r=this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1];e&&(K(this.table.stateManager.fillHandle.directionRow)||(Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.directionRow=!0:this.table.stateManager.fillHandle.directionRow=!1),Math.abs(this.table.stateManager.fillHandle.startY-t.abstractPos.y)>=Math.abs(this.table.stateManager.fillHandle.startX-t.abstractPos.x)?this.table.stateManager.fillHandle.startY-t.abstractPos.y>0?this.table.stateManager.fillHandle.direction="top":this.table.stateManager.fillHandle.direction="bottom":this.table.stateManager.fillHandle.startX-t.abstractPos.x>0?this.table.stateManager.fillHandle.direction="left":this.table.stateManager.fillHandle.direction="right",this.table.stateManager.fillHandle.directionRow?(i=n.row,o=r.end.col):(i=r.end.row,o=n.col)),this.table.stateManager.updateSelectPos(e?o:r.end.col,e?i:r.end.row,!0,n.event.ctrlKey||n.event.metaKey,!1,e)}else this.table.stateManager.updateSelectPos(n.col,n.row,n.event.shiftKey,n.event.ctrlKey||n.event.metaKey,!1,e);return!0}return!1}deelTableSelectAll(){this.table.stateManager.updateSelectPos(-1,-1,!1,!1,!0),this.table.fireListeners(Aw.SELECTED_CELL,{ranges:this.table.stateManager.select.ranges,col:0,row:0})}dealMenuSelect(t){}checkColumnResize(t,e){const{eventArgs:i}=t;if(this.table.options.enableTreeStickCell&&!i)return!1;const o=this.table.scenegraph.getResizeColAt(t.abstractPos.x,t.abstractPos.y,null==i?void 0:i.targetCell);return!!(this.table._canResizeColumn(o.col,o.row)&&o.col>=0)&&(e&&this.table.stateManager.startResizeCol(o.col,t.abstractPos.x,t.abstractPos.y,o.rightFrozen),!0)}checkRowResize(t,e){const{eventArgs:i}=t;if(i){const o=this.table.scenegraph.getResizeRowAt(t.abstractPos.x,t.abstractPos.y,i.targetCell);if(this.table._canResizeRow(o.col,o.row)&&o.row>=0)return e&&this.table.stateManager.startResizeRow(o.row,t.abstractPos.x,t.abstractPos.y,o.bottomFrozen),!0}return!1}checkCellFillhandle(t,e){var i,o,n,r;if(null===(i=this.table.options.excelOptions)||void 0===i?void 0:i.fillHandle){const{eventArgs:i}=t;if(i&&(null===(n=null===(o=this.table.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===n?void 0:n.length)){const i=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.col,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.col),o=Math.max(this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].start.row,this.table.stateManager.select.ranges[this.table.stateManager.select.ranges.length-1].end.row),n=this.table.scenegraph.highPerformanceGetCell(i,o).globalAABBBounds,s=Math.abs(t.abstractPos.x-n.x2),l=Math.abs(t.abstractPos.y-n.y2),a=18;if((null===(r=this.table.stateManager.fillHandle)||void 0===r?void 0:r.isFilling)||s<=a/2&&l<=a/2)return e&&this.table.stateManager.startFillSelect(t.abstractPos.x,t.abstractPos.y),!0}}return!1}dealColumnResize(t,e){this.table.stateManager.updateResizeCol(t,e)}dealRowResize(t,e){this.table.stateManager.updateResizeRow(t,e)}chechColumnMover(t){var e,i,o;const{eventArgs:n}=t;return!!(n&&this.table.isHeader(n.col,n.row)&&(function(t,e,i){for(let o=0;o<i.length;o++)if(vw(i[o],t,e))return!0;return!1}(n.col,n.row,this.table.stateManager.select.ranges)||(null===(e=this.table.options.select)||void 0===e?void 0:e.disableHeaderSelect)||(null===(i=this.table.options.select)||void 0===i?void 0:i.disableSelect))&&this.table._canDragHeaderPosition(n.col,n.row))&&(this.table.stateManager.startMoveCol(n.col,n.row,t.abstractPos.x,t.abstractPos.y,null===(o=null==n?void 0:n.event)||void 0===o?void 0:o.nativeEvent),!0)}dealColumnMover(t){var e;const{eventArgs:i}=t;K(i.col)&&K(i.row)&&this.table.stateManager.updateMoveCol(i.col,i.row,t.abstractPos.x,t.abstractPos.y,null===(e=null==i?void 0:i.event)||void 0===e?void 0:e.nativeEvent)}startColumnResize(t){}dealIconClick(t,e){const{eventArgs:i}=e,{target:o,event:n,col:r,row:s}=i||{target:t.target,event:t,col:-1,row:-1},l=o;if(l.role&&l.role.startsWith("icon-"))return this.table.fireListeners(Aw.ICON_CLICK,{name:l.name,x:(l.globalAABBBounds.x1+l.globalAABBBounds.x2)/2,y:l.globalAABBBounds.y2,col:r,row:s,funcType:l.attribute.funcType,icon:l,event:n}),!0;if(o instanceof uc){const t=o.pickIcon(n.global);if(t)return this.table.fireListeners(Aw.ICON_CLICK,{name:t.attribute.id,x:t.globalX+t.globalAABBBounds.width()/2,y:t.globalY+t.AABBBounds.height(),col:r,row:s,funcType:t.attribute.funcType,icon:t,event:n}),!0}return!1}release(){this.gesture.release(),this.globalEventListeners.forEach((t=>{"document"===t.env?document.removeEventListener(t.name,t.callback):"body"===t.env?document.body.removeEventListener(t.name,t.callback):"window"===t.env&&window.removeEventListener(t.name,t.callback)})),this.globalEventListeners=[]}enableScroll(){this._enableTableScroll=!0}disableScroll(){this._enableTableScroll=!1}}const HM=t=>{const e=t.value;return Number(e)>80?"#20a8d8":Number(e)>50?"#4dbd74":Number(e)>20?"#ffc107":"#f86c6b"};class FM extends Ey{static get DEFAULT(){return MM||(MM=new FM)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e,i,o,n,r,s,l,a,h,d,c,u,g,p,f;super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this._showBar=null===(e=t.showBar)||void 0===e||e,this._barColor=null!==(i=t.barColor)&&void 0!==i?i:HM,this._barPositiveColor=null!==(o=t.barPositiveColor)&&void 0!==o?o:"#4dbd74",this._barNegativeColor=null!==(n=t.barNegativeColor)&&void 0!==n?n:"#f86c6b",this._barAxisColor=null!==(r=t.barAxisColor)&&void 0!==r?r:"black",this._barBgColor=t.barBgColor,this._barHeight=null!==(s=t.barHeight)&&void 0!==s?s:3,this._barHeight=null!==(l=t.barHeight)&&void 0!==l?l:3,this._barBottom=null!==(a=t.barBottom)&&void 0!==a?a:0,this._barPadding=null!==(h=t.barPadding)&&void 0!==h?h:[0,0,0,0],this._showBarMark=null!==(d=t.showBarMark)&&void 0!==d&&d,this._barMarkPositiveColor=null!==(c=t.barMarkPositiveColor)&&void 0!==c?c:"#4dbd74",this._barMarkNegativeColor=null!==(u=t.barMarkNegativeColor)&&void 0!==u?u:"#f86c6b",this._barMarkWidth=null!==(g=t.barMarkWidth)&&void 0!==g?g:2,this._barMarkPosition=null!==(p=t.barMarkPosition)&&void 0!==p?p:"right",this._barRightToLeft=null!==(f=t.barRightToLeft)&&void 0!==f&&f}get showBar(){return this._showBar}set showBar(t){this._showBar=t}get barColor(){return this._barColor}set barColor(t){this._barColor=t}get barBgColor(){return this._barBgColor}set barBgColor(t){this._barBgColor=t}get barHeight(){return this._barHeight}set barHeight(t){this._barHeight=t}get barBottom(){return this._barBottom}set barBottom(t){this._barBottom=t}get barPositiveColor(){return this._barPositiveColor}set barPositiveColor(t){this._barPositiveColor=t}get barNegativeColor(){return this._barNegativeColor}set barNegativeColor(t){this._barNegativeColor=t}get barAxisColor(){return this._barAxisColor}set barAxisColor(t){this._barAxisColor=t}get barPadding(){return this._barPadding}set barPadding(t){this._barPadding=t}get showBarMark(){return this._showBarMark}set showBarMark(t){this._showBarMark=t}get barMarkPositiveColor(){return this._barMarkPositiveColor}set barMarkPositiveColor(t){this._barMarkPositiveColor=t}get barMarkNegativeColor(){return this._barMarkNegativeColor}set barMarkNegativeColor(t){this._barMarkNegativeColor=t}get barMarkWidth(){return this._barMarkWidth}set barMarkWidth(t){this._barMarkWidth=t}get barMarkPosition(){return this._barMarkPosition}set barMarkPosition(t){this._barMarkPosition=t}get barRightToLeft(){return this._barRightToLeft}set barRightToLeft(t){this._barRightToLeft=t}clone(){return new FM(this,null)}}const zM=["type","content","font","color","width","height","marginRight","marginLeft","src","svg","name","path","positionType","tooltip","hover","cursor","shape","interactive","isGif"];class IM{constructor(t){this._table=t;const e=cS();this.expandIcon=e[_y.expandIconName],this.collapseIcon=e[_y.collapseIconName]}getIcons(t,e,i,o,n){const r=[],s=this.getHierarchyIcon(t,e);s&&r.push(s);const{icon:l}=this._table.getBodyColumnDefine(t,e);if(l){let n;n="function"==typeof l?l({col:t,row:e,value:i,dataValue:o,table:this._table}):l;const s=cS(),a=t=>{let e;e="string"==typeof t?s[t]:t,e&&r.push(e)};Array.isArray(n)?n.forEach(((t,e)=>{a(t)})):a(n)}return n&&r.forEach(((i,o)=>{(i.content||i.src)&&(r[o]=this.getCellIconFromRecordValue(i,t,e))})),r}getStyleClass(t){switch(t){case"text":case"link":return Ly;case"image":case"video":return ky;case"chart":case"sparkline":return Ey;case"progressbar":return FM;case"checkbox":return Fy;case"radio":return zy}return Ly}getCellIconFromRecordValue(t,e,i){if(Array.isArray(t))return t.map((t=>this.getCellIconFromRecordValue(t,e,i)));if(!yw.isObject(t)||"function"==typeof t)return this._table.getFieldData(t,e,i);const o={},n=t;return zM.forEach((t=>{var r,s;if(void 0!==n[t]){const l=this._table.getFieldData(n[t],e,i);K(l)?o[t]=l:(null===(s=(r=this._table)._hasField)||void 0===s?void 0:s.call(r,n[t],e,i))||(o[t]=n[t])}})),o}getHierarchyIcon(t,e){const i=this._table.getHierarchyState(t,e);return i===by.expand?this.expandIcon:i===by.collapse?this.collapseIcon:void 0}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+(null!==(t=this.expandIcon.marginLeft)&&void 0!==t?t:0)+(null!==(e=this.expandIcon.marginRight)&&void 0!==e?e:0)}}function OM(t,e){const i=document.createElement(t);return e&&i.classList.add(...e),i}!function(){if("node"===Oy.mode)return;const t=document.createElement("style");t.id="vtable-menu-styleSheet",t.textContent="\n@keyframes vtable__menu-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__menu-element {\n\tposition: absolute;\n\tbox-sizing: border-box;\n\tborder-radius: 4px;\n\tbackground-color: #fff;\n\tpadding: 6px 0;\n\t/* pointer-events: none; */\n\tuser-select: none;\n\tcolor: #000;\n\tmax-width: 300px;\n\tz-index: 99999;\n\tborder: #CCC 0.5px solid;\n\tcursor: default;\n\twidth: max-content;\n\tbox-shadow: 0px 8px 16px rgba(27, 31, 35, 0.12);\n max-height: 100%;\n overflow-y: auto;\n}\n.vtable__menu-element--hidden {\n\topacity: 0;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n\tz-index: -9999;\n}\n.vtable__menu-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__menu-element--shown-animation 150ms ease-out;\n}\n.vtable__menu-element__content {\n\tfont-family: Roboto;\n\tfont-size: 12px;\n\toverflow: hidden;\n\tdisplay: inline-block;\n\t/* height: 100%; */\n\tline-height: 30px;\n}\n.vtable__menu-element__item {\n\theight: 32px;\n\tpadding: 0px 12px;\n\tcursor: pointer;\n\tposition: relative;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-start;\n}\n.vtable__menu-element__item:hover {\n\tbackground-color: rgba(27, 31, 35, 0.06);\n}\n.vtable__menu-element__icon{\n\t/* vertical-align: top; */\n\tdisplay: flex;\n\t/* line-height: 30px; */\n\tmargin-right: 6px;\n}\n.vtable__menu-element__no-event {\n\tpointer-events: none;\n}\n.vtable__menu-element--select {\n\tcolor: #2E68CF;\n}.vtable__menu-element--normal {\n\tcolor: rgba(20, 20, 20, 0.9);;\n}\n.vtable__menu-element__split {\n\theight: 0px;\n\tborder: 1px solid rgb(209, 213, 218);\n\tmargin: 5px 0;\n}\n.vtable__menu-element__title {\n\tcolor: rgb(149, 149, 149);\n}\n.vtable__menu-element__arrow {\n\tposition: absolute;\n\tright: 3px;\n\tfont-weight: bold;\n\tmargin-top: 1px;\n}\n.vtable__menu-element__item-text {\n\tmargin-right: 15px;\n}\n",document.head.appendChild(t)}();const DM="vtable__menu-element",WM=`${DM}__item`,NM=`${DM}__content`,GM=`${DM}--hidden`,jM=`${DM}--shown`,UM=`${DM}--normal`,VM=`${DM}--select`,$M=`${DM}__icon`,YM=`${DM}__split`,XM=`${DM}__title`,KM=`${DM}__arrow`,ZM=`${DM}__no-event`,qM=`${DM}__item-text`;function JM(){return OM("div",[DM,GM])}function QM(t,e,i,o,n,r){const s=t.getCellRange(o,n);for(let o=0;o<e.length;o++){const n=e[o];let{col:r,row:l}=n;const{field:a,menuKey:h}=n;if("number"!=typeof r||"number"!=typeof l)if(t.isPivotTable()){const e=t.internalProps.layoutMap.getPivotCellAdress(a);if(!e)continue;r=e.col,l=e.row}else{const e=t.internalProps.layoutMap.getHeaderCellAddressByField(a);if(!e)continue;r=e.col,l=e.row}if(K(r)&&K(l)&&vw(s,r,l)&&i===h)return!0}return!1}class tT{constructor(t){var e,i,o,n,r,s,l,a,h,d;this._handler=new Pw,this._rootElement=JM(),this._secondElement=JM(),this._secondElement.sub=!0,this._showChildrenIndex=-1,this._rootElement.addEventListener("wheel",(t=>{t.stopPropagation()})),null===(e=this._rootElement)||void 0===e||e.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),null===(i=this._rootElement)||void 0===i||i.addEventListener("touchend",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(GM))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o),h=t._dropDownMenuIsHighlight(i,o,n);t.fireListeners(Aw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(Aw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(Aw.HIDE_MENU,null),e.stopPropagation()})),null===(o=this._rootElement)||void 0===o||o.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(GM))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o),h=t._dropDownMenuIsHighlight(i,o,n);t.fireListeners(Aw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(Aw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(Aw.HIDE_MENU,null),e.stopPropagation()})),null===(n=this._rootElement)||void 0===n||n.addEventListener("mousemove",(e=>{var i,o;if(this._rootElement.classList.contains(GM))return;e.stopPropagation();const{hasChildren:n,dropDownIndex:r,col:s,row:l,sub:a}=e.target;if(n){this._showChildrenIndex=r;const o=this._secondElement;null==o||o.classList.remove(GM),null==o||o.classList.add(jM),o.innerHTML="";const n=null===(i=this._menuInstanceInfo.content[r])||void 0===i?void 0:i.children;for(let e=0;e<n.length;e++){const i=n[e],r=eT(i,!!t.stateManager.menu.dropDownMenuHighlight&&QM(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof i?(null==i?void 0:i.menuKey)||(null==i?void 0:i.text):i,s,l));r.col=s,r.row=l,r.dropDownIndex=e,"string"==typeof i?(r.text=i,r.menuKey=i):"object"==typeof i&&(r.text=i.text,r.menuKey=i.menuKey||i.text),r.sub=!0,r.sub=!0,o.appendChild(r)}const a=e.target.getBoundingClientRect();this._bindSecondElement(t,s,l,a.right,a.top)}else if(n&&this._showChildrenIndex===r){const t=this._secondElement;null==t||t.classList.remove(GM),null==t||t.classList.add(jM)}else!a&&(null===(o=this._secondElement)||void 0===o?void 0:o.classList.contains(jM))&&setTimeout((()=>{if(!0!==this._mouseEnterSecondElement){this._showChildrenIndex=-1;const t=this._secondElement;null==t||t.classList.remove(jM),null==t||t.classList.add(GM)}}),300)})),null===(r=this._secondElement)||void 0===r||r.addEventListener("wheel",(t=>{t.stopPropagation()})),null===(s=this._secondElement)||void 0===s||s.addEventListener("mousemove",(t=>{this._rootElement.classList.contains(GM)||t.stopPropagation()})),null===(l=this._secondElement)||void 0===l||l.addEventListener("mouseenter",(t=>{this._mouseEnterSecondElement=!0})),null===(a=this._secondElement)||void 0===a||a.addEventListener("mouseleave",(t=>{this._mouseEnterSecondElement=!1})),null===(h=this._secondElement)||void 0===h||h.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),null===(d=this._secondElement)||void 0===d||d.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._secondElement.classList.contains(GM))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o);let h=!1;this._menuInstanceInfo.content.forEach(((e,n)=>{if("object"==typeof e&&e.children&&e.children.length)for(let n=0;n<e.children.length;n++){const s=e.children[n];if(QM(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof s?null==s?void 0:s.menuKey:s,i,o)&&r===("object"==typeof s?null==s?void 0:s.menuKey:s))return void(h=!0)}})),t.fireListeners(Aw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,cellHeaderPaths:t.isPivotTable()?t.getCellHeaderPaths(i,o):void 0,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(Aw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(Aw.HIDE_MENU,null),e.stopPropagation()}))}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;(null==t?void 0:t.parentElement)&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,i,o){var n,r;const s=this._rootElement,l=this._secondElement;if(this._menuInstanceInfo=o,null==s||s.classList.remove(jM),null==s||s.classList.add(GM),null==l||l.classList.remove(jM),null==l||l.classList.add(GM),this._canBindToCell(t,e,i)){if(s.innerHTML="",Array.isArray(o.content)){const l=o.content;for(let o=0;null!==(n=o<(null==l?void 0:l.length))&&void 0!==n&&n;o++){const n=l[o];let a=!!t.stateManager.menu.dropDownMenuHighlight&&QM(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof n?(null==n?void 0:n.menuKey)||(null==n?void 0:n.text):n,e,i);if(t.stateManager.menu.dropDownMenuHighlight&&"object"==typeof n&&Array.isArray(n.children)&&n.children.length)for(let o=0;o<n.children.length;o++){const r=n.children[o];if(QM(t,t.stateManager.menu.dropDownMenuHighlight,"object"==typeof r?(null==r?void 0:r.menuKey)||(null==r?void 0:r.text):r,e,i)){a=!0;break}}const h=eT(n,a);h.col=e,h.row=i,h.dropDownIndex=o,"string"==typeof n?(h.text=n,h.menuKey=n):"object"==typeof n&&(h.text=n.text,h.menuKey=n.menuKey||n.text,(null===(r=n.children)||void 0===r?void 0:r.length)&&(h.hasChildren=!0)),s.appendChild(h)}}if(this._bindToCell(t,e,i,o.position,o.referencePosition))return null==s||s.classList.add(jM),null==s||s.classList.remove(GM),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement,e=this._secondElement;this._menuInstanceInfo=void 0,(null==t?void 0:t.parentElement)&&(t.classList.remove(jM),t.classList.add(GM)),(null==e?void 0:e.parentElement)&&(e.classList.remove(jM),e.classList.add(GM))}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),n=t.getElement(),{top:r,bottom:s,left:l,right:a}=o;if(t.isFrozenCell(e,i))return!0;if(s<t.getFrozenRowsHeight()||a<t.getFrozenColsWidth()||l>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||r>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:h,offsetWidth:d}=n;return!(h<r||d<l)}_bindToCell(t,e,i,o,n){const r=this._rootElement,s=t.getElement(),{width:l,height:a}=t.internalProps.element.getBoundingClientRect();if(r){r.parentElement!==s&&s.appendChild(r),r.style.left="0px";const t=.8*l;r.style.maxWidth=`${t}px`;const e=r.offsetWidth,i=r.offsetHeight;let h,d;o?(h=o.x,d=o.y):n&&(h=n.rect.right-e,d=n.rect.bottom);const c=s.getBoundingClientRect(),u=c.width/s.offsetWidth,g=c.height/s.offsetHeight;return d*g+i>a&&(d=(a-i)/g),d<0&&(d/=2),r.style.top=`${d}px`,h<0?h=0:h*u+e>l&&(h=(l-e)/u),r.style.left=`${h}px`,!0}return!1}_bindSecondElement(t,e,i,o,n){const r=this._secondElement,s=this._rootElement,l=t.getElement(),{width:a,left:h,top:d}=t.internalProps.element.getBoundingClientRect(),{x:c,y:u,width:g}=s.getBoundingClientRect();if(r){r.parentElement!==l&&l.appendChild(r),r.style.left="0px";const t=.8*a;r.style.maxWidth=`${t}px`;const e=r.clientWidth,i=n-4-d,s=o-h;r.style.top=`${i}px`;let c=s;return c+e>a?c=c-e-g:c+=4,r.style.left=`${c}px`,!0}return!1}pointInMenuElement(t,e){const i=this._rootElement,{x:o,y:n,width:r,height:s}=i.getBoundingClientRect();if(t>o-5&&t<o+r+5&&e>n-5&&e<n+s+5)return!0;if(this._secondElement){const{x:o,y:n,width:r,height:s}=i.getBoundingClientRect();if(t>o-5&&t<o+r+5&&e>n-5&&e<n+s+5)return!0}return!1}}function eT(t,e){var i,o,n;const r=OM("div",[WM,e?VM:UM]);if("string"==typeof t){const e=OM("span",[NM,ZM,qM]);e.innerHTML=t,r.appendChild(e)}else if("object"==typeof t){const s=null!==(i=t.type)&&void 0!==i?i:"item";if("split"===s)return null==r||r.classList.add(YM),r;if(null===(o=null==t?void 0:t.icon)||void 0===o?void 0:o.svg)if(Gw.test(t.icon.svg)){const e=new Image;t.icon.width?e.style.width=t.icon.width.toString()+"px":e.style.width="16px",t.icon.height?e.style.height=t.icon.height.toString()+"px":e.style.height="16px",e.src=t.icon.svg,r.appendChild(e)}else{const i=OM("span",[$M,ZM]);i.innerHTML=e&&t.selectedIcon&&t.selectedIcon.svg?t.selectedIcon.svg:t.icon.svg,t.icon.width&&i.children[0].setAttribute("width",t.icon.width.toString()),t.icon.height&&i.children[0].setAttribute("height",t.icon.height.toString()),r.appendChild(i)}const l=OM("span",[NM,ZM,qM]);if(l.innerHTML=t.text,r.appendChild(l),"title"===s)null==r||r.classList.add(ZM,XM);else if(null===(n=null==t?void 0:t.children)||void 0===n?void 0:n.length){const t=OM("span",[NM,ZM,KM]);t.innerHTML=e?'<svg width="8" height="12" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg" style="vertical-align: baseline"><path d="M1.78186 16.7729L0.300378 15.2915L6.8189 8.77295L0.300377 2.25443L1.78186 0.77295L9.78186 8.77295L1.78186 16.7729Z" fill="#2E68CF" fill-opacity="0.65"></path></svg>':'<svg width="8" height="12" viewBox="0 0 10 17" fill="none" xmlns="http://www.w3.org/2000/svg" style="vertical-align: baseline"><path d="M1.78186 16.7729L0.300378 15.2915L6.8189 8.77295L0.300377 2.25443L1.78186 0.77295L9.78186 8.77295L1.78186 16.7729Z" fill="#141414" fill-opacity="0.65"></path></svg>',r.appendChild(t)}}return r}let iT;const oT={CHANGE_STYLE:"change_style"};class nT extends Ry{static get EVENT_TYPE(){return oT}static get DEFAULT(){return iT||(iT=new nT)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x,_,S,A,R,B,M,T,P,E,k,L;super(),this._defaultPadding=[10,16,10,16],this._color=null!==(i=t.color)&&void 0!==i?i:null==e?void 0:e.color,this._strokeColor=null!==(o=null==t?void 0:t.strokeColor)&&void 0!==o?o:null==e?void 0:e.strokeColor,this._fontSize=null!==(n=t.fontSize)&&void 0!==n?n:null==e?void 0:e.fontSize,this._fontFamily=null!==(r=t.fontFamily)&&void 0!==r?r:null==e?void 0:e.fontFamily,this._fontWeight=null!==(s=t.fontWeight)&&void 0!==s?s:null==e?void 0:e.fontWeight,this._fontVariant=null!==(l=t.fontVariant)&&void 0!==l?l:null==e?void 0:e.fontVariant,this._fontStyle=null!==(a=t.fontStyle)&&void 0!==a?a:null==e?void 0:e.fontStyle,this._textOverflow=(null!==(h=t.textOverflow)&&void 0!==h?h:null==e?void 0:e.textOverflow)||"ellipsis",this._textStick=null!==(c=null!==(d=t.textStick)&&void 0!==d?d:null==e?void 0:e.textStick)&&void 0!==c&&c,this._textStickBaseOnAlign=null!==(g=null!==(u=t.textStickBaseOnAlign)&&void 0!==u?u:null==e?void 0:e.textStickBaseOnAlign)&&void 0!==g&&g,this._marked=null!==(f=null!==(p=t.marked)&&void 0!==p?p:null==e?void 0:e.marked)&&void 0!==f&&f,this._textAlign=(null!==(v=t.textAlign)&&void 0!==v?v:null==e?void 0:e.textAlign)||"left",this._textBaseline=(null!==(m=t.textBaseline)&&void 0!==m?m:null==e?void 0:e.textBaseline)||"middle",this._bgColor=null!==(b=t.bgColor)&&void 0!==b?b:null==e?void 0:e.bgColor,this._padding=null!==(y=null!==(C=t.padding)&&void 0!==C?C:null==e?void 0:e.padding)&&void 0!==y?y:this._defaultPadding,this._borderColor=null!==(w=t.borderColor)&&void 0!==w?w:null==e?void 0:e.borderColor,this._lineHeight=null!==(x=t.lineHeight)&&void 0!==x?x:null==e?void 0:e.lineHeight,this._underline=null!==(_=t.underline)&&void 0!==_?_:null==e?void 0:e.underline,this._underlineColor=null!==(S=t.underlineColor)&&void 0!==S?S:null==e?void 0:e.underlineColor,this._underlineDash=null!==(A=t.underlineDash)&&void 0!==A?A:null==e?void 0:e.underlineDash,this._underlineOffset=null!==(R=t.underlineOffset)&&void 0!==R?R:null==e?void 0:e.underlineOffset,this._lineThrough=null!==(B=t.lineThrough)&&void 0!==B?B:null==e?void 0:e.lineThrough,this._lineThroughColor=null!==(M=t.lineThroughColor)&&void 0!==M?M:null==e?void 0:e.lineThroughColor,this._lineThroughDash=null!==(T=t.lineThroughDash)&&void 0!==T?T:null==e?void 0:e.lineThroughDash,this._linkColor=null!==(P=t.linkColor)&&void 0!==P?P:null==e?void 0:e.linkColor,this._cursor=null!==(E=t.cursor)&&void 0!==E?E:null==e?void 0:e.cursor,this._borderLineWidth=null!==(k=t.borderLineWidth)&&void 0!==k?k:null==e?void 0:e.borderLineWidth,this._borderLineDash=null!==(L=t.borderLineDash)&&void 0!==L?L:null==e?void 0:e.borderLineDash}get bgColor(){return this._bgColor}set bgColor(t){this._bgColor=t}get color(){return this._color}set color(t){this._color=t}get strokeColor(){return this._strokeColor}set strokeColor(t){this._strokeColor=t}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily=t}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight=t}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant=t}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle=t}get textOverflow(){return this._textOverflow}set textOverflow(t){this._textOverflow=t}get padding(){var t;return null!==(t=this._padding)&&void 0!==t?t:this._defaultPadding}set padding(t){this._padding=t}get borderColor(){return this._borderColor}set borderColor(t){this._borderColor=t}get textStick(){return this._textStick}set textStick(t){this._textStick=t}get textStickBaseOnAlign(){return this._textStickBaseOnAlign}set textStickBaseOnAlign(t){this._textStickBaseOnAlign=t}get marked(){return this._marked}set marked(t){this._marked=t}get textAlign(){return this._textAlign}set textAlign(t){this._textAlign=t}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline=t}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight=t}get underline(){return this._underline}set underline(t){this._underline=t}get underlineColor(){return this._underlineColor}set underlineColor(t){this._underlineColor=t}get underlineDash(){return this._underlineDash}set underlineDash(t){this._underlineDash=t}get underlineOffset(){return this._underlineOffset}set underlineOffset(t){this._underlineOffset=t}get lineThrough(){return this._lineThrough}set lineThrough(t){this._lineThrough=t}get lineThroughColor(){return this._lineThroughColor}set lineThroughColor(t){this._lineThroughColor=t}get lineThroughDash(){return this._lineThroughDash}set lineThroughDash(t){this._lineThroughDash=t}get linkColor(){return this._linkColor}set linkColor(t){this._linkColor=t}get cursor(){return this._cursor}set cursor(t){this._cursor=t}get borderLineWidth(){return this._borderLineWidth}set borderLineWidth(t){this._borderLineWidth=t}get borderLineDash(){return this._borderLineDash}set borderLineDash(t){this._borderLineDash=t}clone(){return new nT(this)}}let rT,sT,lT;class aT extends nT{static get DEFAULT(){return rT||(rT=new aT)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;super(t,e),this.textAlign=(null!==(i=t.textAlign)&&void 0!==i?i:null==e?void 0:e.textAlign)||"center"}clone(){return new aT(this)}}class hT extends nT{static get DEFAULT(){return sT||(sT=new hT)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;var i,o;super(t,e),this._autoWrapText=null!==(i=null==t?void 0:t.autoWrapText)&&void 0!==i?i:null==e?void 0:e.autoWrapText,this._lineClamp=null!==(o=null==t?void 0:t.lineClamp)&&void 0!==o?o:null==e?void 0:e.lineClamp}clone(){return new hT(this,null)}get lineClamp(){return this._lineClamp}set lineClamp(t){this._lineClamp=t}get autoWrapText(){return this._autoWrapText}set autoWrapText(t){this._autoWrapText=t}}class dT extends nT{static get DEFAULT(){return lT||(lT=new dT)}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x,_,S;super(t,e),this._size=(null!==(n=null!==(o=null==t?void 0:t.size)&&void 0!==o?o:null==e?void 0:e.size)&&void 0!==n?n:null==i?void 0:i.size)||14,this._spaceBetweenTextAndIcon=(null!==(s=null!==(r=null==t?void 0:t.spaceBetweenTextAndIcon)&&void 0!==r?r:null==e?void 0:e.spaceBetweenTextAndIcon)&&void 0!==s?s:null==i?void 0:i.spaceBetweenTextAndIcon)||8,this._defaultFill=null!==(a=null===(l=null==t?void 0:t.checkboxStyle)||void 0===l?void 0:l.defaultFill)&&void 0!==a?a:null==i?void 0:i.defaultFill,this._defaultStroke=null!==(d=null===(h=null==t?void 0:t.checkboxStyle)||void 0===h?void 0:h.defaultStroke)&&void 0!==d?d:null==i?void 0:i.defaultStroke,this._disableFill=null!==(u=null===(c=null==t?void 0:t.checkboxStyle)||void 0===c?void 0:c.disableFill)&&void 0!==u?u:null==i?void 0:i.disableFill,this._checkedFill=null!==(p=null===(g=null==t?void 0:t.checkboxStyle)||void 0===g?void 0:g.checkedFill)&&void 0!==p?p:null==i?void 0:i.checkedFill,this._checkedStroke=null!==(v=null===(f=null==t?void 0:t.checkboxStyle)||void 0===f?void 0:f.checkedStroke)&&void 0!==v?v:null==i?void 0:i.checkedStroke,this._disableCheckedFill=null!==(b=null===(m=null==t?void 0:t.checkboxStyle)||void 0===m?void 0:m.disableCheckedFill)&&void 0!==b?b:null==i?void 0:i.disableCheckedFill,this._disableCheckedStroke=null!==(y=null===(C=null==t?void 0:t.checkboxStyle)||void 0===C?void 0:C.disableCheckedStroke)&&void 0!==y?y:null==i?void 0:i.disableCheckedStroke,this._checkIconImage=null!==(x=null===(w=null==t?void 0:t.checkboxStyle)||void 0===w?void 0:w.checkIconImage)&&void 0!==x?x:null==i?void 0:i.checkIconImage,this._indeterminateIconImage=null!==(S=null===(_=null==t?void 0:t.checkboxStyle)||void 0===_?void 0:_.indeterminateIconImage)&&void 0!==S?S:null==i?void 0:i.indeterminateIconImage}get size(){return this._size}set size(t){this._size=t}get spaceBetweenTextAndIcon(){return this._spaceBetweenTextAndIcon}set spaceBetweenTextAndIcon(t){this._spaceBetweenTextAndIcon=t}get defaultFill(){return this._defaultFill}set defaultFill(t){this._defaultFill=t}get defaultStroke(){return this._defaultStroke}set defaultStroke(t){this._defaultStroke=t}get disableFill(){return this._disableFill}set disableFill(t){this._disableFill=t}get checkedFill(){return this._checkedFill}set checkedFill(t){this._checkedFill=t}get checkedStroke(){return this._checkedStroke}set checkedStroke(t){this._checkedStroke=t}get disableCheckedFill(){return this._disableCheckedFill}set disableCheckedFill(t){this._disableCheckedFill=t}get disableCheckedStroke(){return this._disableCheckedStroke}set disableCheckedStroke(t){this._disableCheckedStroke=t}get checkIconImage(){return this._checkIconImage}set checkIconImage(t){this._checkIconImage=t}get indeterminateIconImage(){return this._indeterminateIconImage}set indeterminateIconImage(t){this._indeterminateIconImage=t}getStyle(t){return new dT(t,this)}clone(){return new dT(this)}}function cT(t,e,i,o,n,r){var s;return t||e?t instanceof nT?t:"function"==typeof t?cT(t(i),e,i,o,n,r):(t||(t={}),n&&!K(t.autoWrapText)&&(t.autoWrapText=!0),o===dT?new dT(null!=t?t:{},null!=e?e:{},null!==(s=r.checkboxStyle)&&void 0!==s?s:{}):new o(null!=t?t:{},null!=e?e:{})):o.DEFAULT}class uT{constructor(t){this._table=t;const e=cS();this.freezeIcon=e[_y.freezeIconName],this.frozenIcon=e[_y.frozenIconName],this.frozenCurrentIcon=e[_y.frozenCurrentIconName],this.normalIcon=e[_y.normalIconName],this.upIcon=e[_y.upwardIconName],this.downIcon=e[_y.downwardIconName],this.dropDownAbsoluteIcon=e[_y.dropdownIconName],this.expandIcon=e[_y.expandIconName],this.collapseIcon=e[_y.collapseIconName]}getIcons(t,e){const i=[];if(this._table.isPivotTable()){const{showSort:o,sort:n}=this._table.internalProps.layoutMap.getHeader(t,e);if(o){let o=this._table.getPivotSortState(t,e);o&&(o=o.toUpperCase());const n="ASC"===o?this.upIcon:"DESC"===o?this.downIcon:this.normalIcon;n&&i.push(n)}else if(n){const o=this.getSortIconForPivotTable(this._table.getPivotSortState(t,e),this._table,t,e);o&&i.push(o)}}else{const o=this._table.sortState;let n;n=void 0;const r=this._table.getCellRange(t,e);if(o)if(Array.isArray(o))for(let t=0;t<o.length;t++){const e=o[t],i=this._table._getHeaderCellBySortState(e);if(i&&vw(r,i.col,i.row)){({order:n}=e);break}}else{const t=this._table._getHeaderCellBySortState(o);t&&vw(r,t.col,t.row)&&({order:n}=o)}const s=this.getSortIcon(n,this._table,t,e);s&&i.push(s)}if(this._table.showFrozenIcon&&t<this._table.allowFrozenColCount){const o=this.getFrozenIcon(t,e);o&&i.push(o)}if(this.checkDropDownIcon(this._table,t,e)){const t=this.dropDownAbsoluteIcon;i.push(t)}const o=this.getDropDownStateIcons(this._table,t,e);o.length&&i.push(...o);const{headerIcon:n}=this._table._getHeaderLayoutMap(t,e),r=this.getHierarchyIcon(t,e);if(r&&i.push(r),n){let o;o="function"==typeof n?n({col:t,row:e,value:this._table.getCellValue(t,e),dataValue:this._table.getCellOriginValue(t,e),table:this._table}):n;const r=cS(),s=t=>{let e;e="string"==typeof t?r[t]:t,e&&i.push(e)};Array.isArray(o)?o.forEach(((t,e)=>{s(t)})):s(o)}return i}getFrozenIcon(t,e){if(this._table.isPivotTable()||this._table.transpose)return null;if(this._table.rightFrozenColCount&&t>=this._table.colCount-this._table.rightFrozenColCount)return null;const i=this._table.getHeaderDefine(t,e);if(i.columns&&i.columns.length>0)return null;let o=this.freezeIcon;return this._table.options.frozenColCount-1>t?o=this.frozenIcon:this._table.options.frozenColCount-1===t&&(o=this.frozenCurrentIcon),o}getSortIcon(t,e,i,o){const n="asc"===t?this.upIcon:"desc"===t?this.downIcon:this.normalIcon,r=e.getHeaderDefine(i,o);return!r||!1===r.showSort||!K(r.showSort)&&!r.sort||r.columns&&r.columns.length>0?null:n}getSortIconForPivotTable(t,e,i,o){const n=e.getHeaderDefine(i,o);return!n||!1===n.showSort||!K(n.showSort)&&!n.sort||n.columns&&n.columns.length>0?null:"ASC"===(null==t?void 0:t.toUpperCase())?this.upIcon:"DESC"===(null==t?void 0:t.toUpperCase())?this.downIcon:this.normalIcon}getDropDownStateIcons(t,e,i){var o,n,r;const s=t.getHeaderDefine(e,i),l=t._getHeaderLayoutMap(e,i),{dropDownMenu:a}=l,h=[];if(Array.isArray(a)&&a.length||Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(null===(o=null==s?void 0:s.columns)||void 0===o?void 0:o.length)){const o=a||t.globalDropDownMenu;let s=-1,l=-1;for(let a=0;a<o.length;a++){const h=o[a];if("object"==typeof h&&h.children&&h.children.length)for(let o=0;o<h.children.length;o++){const d=h.children[o];if((null===(n=t.stateManager.menu)||void 0===n?void 0:n.dropDownMenuHighlight)&&QM(t,null===(r=t.stateManager.menu)||void 0===r?void 0:r.dropDownMenuHighlight,"object"==typeof d?null==d?void 0:d.menuKey:d,e,i)){s=a,l=o;break}}if(t._dropDownMenuIsHighlight(e,i,a)){s=a;break}}if(-1!==s){let e;e=-1!==l?(a||t.globalDropDownMenu)[s].children[l]:(a||t.globalDropDownMenu)[s],e.stateIcon&&(e.stateIcon.svg?h.push({type:"svg",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,svg:e.stateIcon.svg,positionType:wy.right,marginRight:0,funcType:xy.dropDownState,interactive:!1}):e.stateIcon.src&&h.push({type:"image",name:e.stateIcon.src||e.stateIcon.svg,width:e.stateIcon.width||22,height:e.stateIcon.height||22,src:e.stateIcon.src,positionType:wy.right,marginRight:0,funcType:xy.dropDownState,interactive:!1}))}}return h}getDropDownIconRect(t,e,i){var o,n,r,s,l,a,h,d;const c=null!==(s=null!==(n=null===(o=this.downIcon.hover)||void 0===o?void 0:o.width)&&void 0!==n?n:null===(r=this.downIcon)||void 0===r?void 0:r.width)&&void 0!==s?s:0,u=null!==(d=null!==(a=null===(l=this.downIcon.hover)||void 0===l?void 0:l.height)&&void 0!==a?a:null===(h=this.downIcon)||void 0===h?void 0:h.height)&&void 0!==d?d:0,g=t.right-2-c,p=t.right-2;let f;return f="middle"===i?t.top+t.height/2-c/2:"top"===i?t.top+e/2:"bottom"===i?t.bottom-2*e:t.top,{left:g,right:p,top:f,bottom:u+f,width:c,height:u}}getHierarchyIcon(t,e){const{hierarchyState:i}=this._table._getHeaderLayoutMap(t,e);if(i){if(i===by.expand)return this.expandIcon;if(i===by.collapse)return this.collapseIcon}}getHierarchyIconWidth(){var t,e;return this.expandIcon.width+(null!==(t=this.expandIcon.marginLeft)&&void 0!==t?t:0)+(null!==(e=this.expandIcon.marginRight)&&void 0!==e?e:0)}checkDropDownIcon(t,e,i){var o;if(t.isPivotTable()){const o=t._getHeaderLayoutMap(e,i);if(Array.isArray(o.dropDownMenu)&&o.dropDownMenu.length)return!0}else{const n=t.getHeaderDefine(e,i);if(Array.isArray(n.dropDownMenu)&&n.dropDownMenu.length||(!Array.isArray(n.dropDownMenu)||0!==n.dropDownMenu.length)&&Array.isArray(t.globalDropDownMenu)&&t.globalDropDownMenu.length&&!(null===(o=null==n?void 0:n.columns)||void 0===o?void 0:o.length))return!0}return!1}getStyleClass(t){switch(t){case"text":case"link":return hT;case"image":case"video":return aT;case"checkbox":return dT}}setTableColumnsEditor(){const t=(e,i)=>{null==e||e.forEach(((e,o)=>{e.editor&&(i[o].editor=e.editor),e.columns&&t(e.columns,i[o].columns)}))};t(this._table.options.columns,this._table.internalProps.columns)}}class gT extends EventTarget{constructor(t,e){if(super(),this._table=t,"node"===Oy.mode)return;const i=document.createElement("div");i.style.opacity="0",i.dataset.vtable="vtable",i.style.pointerEvents="none",i.classList.add("input-container");const o=this._input=document.createElement("input");i.appendChild(o),o.classList.add("table-focus-control"),o.dataset.vtable="vtable",o.readOnly=!0,e.appendChild(i),this._container=i}focus(){this._input.focus({preventScroll:!0})}setFocusRect(t,e){const i=this._input;i.value=e,i.select();const o=t.top-this._table.scrollTop,n=t.left-this._table.scrollLeft;i.style.top=`${o.toFixed()}px`,i.style.left=`${n.toFixed()}px`,i.style.width=`${t.width.toFixed()}px`,i.style.height=`${t.height.toFixed()}px`}get input(){return this._input}release(){var t;null===(t=this._container.parentElement)||void 0===t||t.removeChild(this._container)}}class pT{constructor(t){this.isUpdate=!1,this._keys=[],this._sorted=!1,this.data=new Map,this._keys.length=0,this.cumulativeSum=new Map,this.difference=new Map,this.totalSum=0,this.table=t}get length(){return this.data.size}clear(){this._keys=[],this.data.clear(),this.cumulativeSum.clear(),this.difference.clear(),this.totalSum=0}clearRange(){this.cumulativeSum.clear(),this.difference.clear()}add(t,e){if(!K(e))return;const i=this.table.getRowHeight(t);this.data.has(t)||(this._keys.push(t),this._sorted=!1),this.data.set(t,e),this.totalSum+=e,this.updateDifference(t,e-i)}remove(t){if(this.data.has(t)){const e=this.data.get(t);this.data.delete(t);const i=this._keys.indexOf(t);-1!==i&&this._keys.splice(i,1),this.totalSum-=e;const o=this.table.getRowHeight(t);this.updateDifference(t,o-e)}}put(t,e){if(K(e))if(this.data.has(t)){const i=this.data.get(t);if(i===e)return;this.data.set(t,e);const o=e-i;this.totalSum+=o,this.updateDifference(t,o)}else this.add(t,e)}get(t){return this.data.get(t)}has(t){return this.data.has(t)}_sort(){const{_keys:t}=this;this._sorted||(t.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0)}updateDifference(t,e){var i;const o=null!==(i=this.difference.get(t))&&void 0!==i?i:0;this.difference.set(t,o+e),this.update()}getSumInRange(t,e){return this.calculatePrefixSum(e)-this.calculatePrefixSum(t-1)}updateCumulativeSum(t,e){for(const[i,o]of this.cumulativeSum)i>=t&&this.cumulativeSum.set(i,o+e)}calculatePrefixSum(t){if(t<0)return 0;if(this.cumulativeSum.has(t)){let e=this.cumulativeSum.get(t);for(const[i,o]of this.difference)i<=t&&(e+=o);return e}return this.dealDiffenence(),this.getCumulativeSum(t)}getCumulativeSum(t){var e;let i=0;for(let o=t;o>=0;o--){if(this.cumulativeSum.has(o)){i+=this.cumulativeSum.get(o);break}i+=null!==(e=this.data.get(o))&&void 0!==e?e:this.table.getRowHeight(o)}return this.cumulativeSum.set(t,i),i}update(){this.isUpdate||(this.isUpdate=!0,setTimeout((()=>{this.dealDiffenence(),this.isUpdate=!1}),0))}dealDiffenence(){for(const[t]of this.cumulativeSum)for(const[e,i]of this.difference)if(t>=e){const e=this.cumulativeSum.get(t);this.cumulativeSum.set(t,e+i)}this.difference.clear()}insert(t,e){for(let e=t;e<=this.getLastIndex();e++)this.cumulativeSum.delete(e);const i=this.getLastIndex()+1;this.adjustOrder(t,t+1,i-t),K(e)&&this.put(t,e)}getLastIndex(){return this._sort(),this._keys[this._keys.length-1]}delLast(){const t=this.getLastIndex();this.remove(t)}delete(t){if(!this.has(t))return;for(let e=t;e<=this.getLastIndex();e++)this.cumulativeSum.delete(e);const e=this.getLastIndex();this.adjustOrder(t+1,t,e-t),this.delLast()}adjustOrder(t,e,i){this.clearRange(),this._sort();const{_keys:o}=this;if(t>e){const n=[];for(let r=fT(o,t+i-1);r>=0;r--){const s=o[r];if(s>=t)n.push(this.get(s));else if(e<=s&&s<t)this.put(s+i,this.get(s));else if(s<e)break}for(let t=0;t<i;t++)this.put(e+t,n[i-1-t])}const{length:n}=o;if(t<e){const r=[];for(let s=fT(o,t);s<n;s++){const n=o[s];if(n>=t&&n<t+i)r.push(this.get(n));else if(t+i<=n&&n<=e)this.put(n-i,this.get(n));else if(n>e)break}for(let t=0;t<i;t++)this.put(e+t,r[t])}}exchangeOrder(t,e,i,o,n){const{_keys:r}=this;if(this._sorted||(r.sort(((t,e)=>t<e?-1:t>e?1:0)),this._sorted=!0),t>i){const o=[],s=[];for(let n=fT(r,i);n<t+e;n++){const i=r[n];i>=t&&i<t+e?s.push(this.get(i)):o.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,s[t]);for(let t=0;t<o.length;t++)this.put(n+e+t,o[t])}else{const s=[],l=[];for(let n=fT(r,t);n<i+o;n++){const i=r[n];i>=t&&i<t+e?l.push(this.get(i)):s.push(this.get(i))}for(let t=0;t<e;t++)this.put(n+t,l[t]);for(let e=0;e<s.length;e++)this.put(t+e,s[e])}}}function fT(t,e){let i=0,o=t.length-1;for(;i<=o;){const n=Math.floor((i+o)/2);if(t[n]===e)return n;t[n]>e?o=n-1:i=n+1}return o<0?0:o}class vT{constructor(t){this._table=t;const e=cS();this.dragReorderIconName=e[_y.dragReorderIconName]}getIcons(t,e){return[this.dragReorderIconName]}}class mT{constructor(t,e,i){this.table=t,this.customCellStyle=e,this.customCellStyleArrangement=i}getCustomCellStyle(t,e){const i=this.getCustomCellStyleId(t,e);if(i){const t=this.getCustomCellStyleOption(i);return null==t?void 0:t.style}}getCustomCellStyleId(t,e){let i;const o=this.table.getCellRange(t,e);for(let t=o.start.col;t<=o.end.col;t++)for(let e=o.start.row;e<=o.end.row;e++)this.customCellStyleArrangement.forEach((o=>{o.cellPosition.range?o.cellPosition.range.start.col<=t&&o.cellPosition.range.end.col>=t&&o.cellPosition.range.start.row<=e&&o.cellPosition.range.end.row>=e&&(i=o.customStyleId):o.cellPosition.col===t&&o.cellPosition.row===e&&(i=o.customStyleId)}));return i}getCustomCellStyleOption(t){return this.customCellStyle.find((e=>e.id===t))}registerCustomCellStyle(t,e){const i=this.customCellStyle.findIndex((e=>e.id===t));-1===i?this.customCellStyle.push({id:t,style:e}):this.customCellStyle[i]={id:t,style:e},this.customCellStyleArrangement.forEach((e=>{const i=e.cellPosition;if(e.customStyleId===t)if(i.range)for(let t=i.range.start.col;t<=i.range.end.col;t++)for(let e=i.range.start.row;e<=i.range.end.row;e++)this.table.scenegraph.updateCellContent(t,e);else this.table.scenegraph.updateCellContent(i.col,i.row)})),this.table.scenegraph.updateNextFrame()}arrangeCustomCellStyle(t,e){const i=this.customCellStyleArrangement.findIndex((e=>e.cellPosition.range&&t.range?e.cellPosition.range.start.col===t.range.start.col&&e.cellPosition.range.start.row===t.range.start.row&&e.cellPosition.range.end.col===t.range.end.col&&e.cellPosition.range.end.row===t.range.end.row:e.cellPosition.col===t.col&&e.cellPosition.row===t.row));if(-1!==i||e){if(-1===i&&e)this.customCellStyleArrangement.push({cellPosition:{col:t.col,row:t.row,range:t.range},customStyleId:e});else{if(this.customCellStyleArrangement[i].customStyleId===e)return;e?this.customCellStyleArrangement[i].customStyleId=e:this.customCellStyleArrangement.splice(i,1)}if(t.range)for(let e=t.range.start.col;e<=t.range.end.col;e++)for(let i=t.range.start.row;i<=t.range.end.row;i++){const t=this.table.getCellRange(e,i);for(let e=t.start.col;e<=t.end.col;e++)for(let i=t.start.row;i<=t.end.row;i++)this.table.scenegraph.updateCellContent(e,i)}else this.table.scenegraph.updateCellContent(t.col,t.row);e||this.customCellStyleArrangement.splice(i,1),this.table.scenegraph.updateNextFrame()}}updateCustomCell(t,e){this.customCellStyle.length=0,this.customCellStyleArrangement.length=0,t.forEach((t=>{this.registerCustomCellStyle(t.id,t.style)})),e.forEach((t=>{this.arrangeCustomCellStyle(t.cellPosition,t.customStyleId)}))}hasCustomCellStyle(t){return this.customCellStyle.some((e=>e.id===t))}}function bT(t,e){t=t.clone();for(const i in e){const o=e[i];o&&(t[`_${i}`]=o)}return t}class CT{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"grid",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;this.sizeIncludeParent=!1,this.tree={id:0,dimensionKey:"",value:"",children:[],level:-1,levelSpan:1,startIndex:0,size:0,startInTotal:0,hierarchyState:void 0},this.totalLevel=0,this.dimensionKeys=new kw,this.dimensionKeysIncludeVirtual=new kw,this.cache=new Map,this.sizeIncludeParent=null!=o,this.rowExpandLevel=o,this.hierarchyType=i,this.sharedVar=e,this.reset(t)}reset(t){this.cache.clear(),this.dimensionKeys=new kw,this.dimensionKeysIncludeVirtual=new kw,this.tree.children=t,this.setTreeNode(this.tree,0,this.tree)}setTreeNode(t,e,i){var o,n;t.startIndex=e,t.startInTotal=(null!==(o=i.startInTotal)&&void 0!==o?o:0)+t.startIndex,(null!==(n=t.dimensionKey)&&void 0!==n?n:t.indicatorKey)&&(t.virtual||this.dimensionKeys.contain(t.indicatorKey?jw:t.dimensionKey)||this.dimensionKeys.put(t.level,t.indicatorKey?jw:t.dimensionKey),this.dimensionKeysIncludeVirtual.contain(t.indicatorKey?jw:t.dimensionKey)||this.dimensionKeysIncludeVirtual.put(t.level,t.indicatorKey?jw:t.dimensionKey),t.id||(t.id=++this.sharedVar.seqId));let r=t.dimensionKey&&this.sizeIncludeParent?1:0;const s=t.children||t.columns;return"grid"===this.hierarchyType?(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),r+=this.setTreeNode(e,r,t)})):r=1:t.hierarchyState===by.expand&&(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),r+=this.setTreeNode(e,r,t)})):t.hierarchyState===by.collapse&&(null==s?void 0:s.length)>=1?s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),this.setTreeNode(e,r,t)})):!t.hierarchyState&&t.level+1<this.rowExpandLevel&&((null==s?void 0:s.length)>=1||!0===s)?(t.hierarchyState=by.expand,(null==s?void 0:s.length)>=1&&s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),r+=this.setTreeNode(e,r,t)}))):(null==s?void 0:s.length)>=1||!0===s?(t.hierarchyState=by.collapse,(null==s?void 0:s.length)>=1&&s.forEach((e=>{var i;e.level=(null!==(i=t.level)&&void 0!==i?i:0)+1,this.totalLevel=Math.max(this.totalLevel,e.level+1),this.setTreeNode(e,r,t)}))):(t.hierarchyState=by.none,r=1),t.size=r,r}getTreePath(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;const i=[];return this.searchPath(t,this.tree,i,e),i.shift(),i}getTreePathByCellIds(t){const e=[];let i=this.tree.children;for(let o=0;o<t.length;o++){const n=t[o],r=this.findNodeById(i,n);if(!r)break;e.push(r),i=r.children}return e}findNodeById(t,e){return t.find((t=>t.id===e))}searchPath(t,e,i,o){if(!e)return;if(t<e.startIndex||t>=e.startIndex+e.size)return;if(i.push(e),!e.children||0===e.children.length||e.level>=o)return;const n=t-e.startIndex;if(this.cache.has(e.level+1)){const t=this.cache.get(e.level+1);if(n>=t.startIndex&&n<t.startIndex+t.size)return void this.searchPath(n,t,i,o)}let r=0,s=e.children.length-1;for(;r<=s;){const t=Math.floor((r+s)/2),l=e.children[t];if(n>=l.startIndex&&n<l.startIndex+l.size){this.cache.set(l.level,l);const t=[];this.cache.forEach(((e,i)=>{i>l.level&&t.push(i)})),t.forEach((t=>{this.cache.delete(t)})),this.searchPath(n,l,i,o);break}n<l.startIndex?s=t-1:r=t+1}}movePosition(t,e,i){let o,n,r;const s=(l,a)=>{if(void 0!==n&&void 0!==r)return;l.level===t&&(l.startInTotal===e&&(n=a),l.startInTotal<=i&&i<=l.startInTotal+l.size-1&&(r=a));const h=l.children||l.columns;if(h&&l.level<t){o=l;for(let t=0;t<h.length;t++)(e>=h[t].startInTotal&&e<=h[t].startInTotal+h[t].size||i>=h[t].startInTotal&&i<=h[t].startInTotal+h[t].size)&&s(h[t],t)}};s(this.tree,0);const l=o.children||o.columns,a=l.splice(n,1);a.unshift(r,0),Array.prototype.splice.apply(l,a)}getCopiedTree(){const t=vt(this.tree.children);return yT(t),t}}function yT(t){for(let e=0;e<t.length;e++){const i=t[e];delete i.level,delete i.startIndex,delete i.id,delete i.levelSpan,delete i.size,delete i.startInTotal;const o=i.children||i.columns;o&&yT(o)}}function wT(t,e){const i=function(t,e){if(!t.internalProps.frozenRowCount)return null;let{scrollTop:i}=t;const o=t.internalProps.frozenRowCount;for(let n=0;n<o;n++){const o=t.getRowHeight(n),r=i+o;if(r>e)return{top:i,row:n,bottom:r,height:o};i=r}return null}(e,t);if(i)return i;let o=ST(t,e);return o||(o={top:-1,row:-1,bottom:-1,height:-1}),o}function xT(t,e){const i=function(t,e){if(!t.internalProps.frozenColCount)return null;let{scrollLeft:i}=t;const o=t.internalProps.frozenColCount;for(let n=0;n<o;n++){const o=t.getColWidth(n),r=i+o;if(r>e)return{left:i,col:n,right:r,width:o};i=r}return null}(e,t);if(i)return i;let o=_T(t,e);return o||(o={left:-1,col:-1,right:-1,width:1}),o}function _T(t,e){if(0===t)return{left:0,col:0,right:0,width:0};const i=function(t,e){if(e._colRangeWidthsMap.get("$0$"+(e.colCount-1))){let i=0,o=e.colCount-1;for(;o-i>1;){const n=Math.floor((i+o)/2);if(t<e._colRangeWidthsMap.get(`$0$${n}`))o=n;else{if(!(t>e._colRangeWidthsMap.get(`$0$${n}`)))return n;i=n}}return o}return Math.min(Math.ceil(t/e.internalProps.defaultColWidth),e.colCount-1)}(t,e),o=e.getColsWidth(0,i);return t>=o?((i,o)=>{let n=o-e.getColWidth(i);const{colCount:r}=e.internalProps;for(let o=i;o<r;o++){const i=e.getColWidth(o),r=n+i;if(Math.round(n)<=Math.round(t)&&Math.round(t)<Math.round(r))return{left:n,col:o,right:r,width:i};n=r}return null})(i,o):((i,o)=>{let n=o;for(let o=i;o>=0;o--){const i=e.getColWidth(o),r=n-i;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(n))return{left:r,col:o,right:n,width:i};n=r}return null})(i,o)}function ST(t,e){if(0===t)return{top:0,row:0,bottom:0,height:0};const i=function(t,e){let i=e.internalProps.defaultRowHeight;return e._rowRangeHeightsMap.get("$0$"+(e.rowCount-1))&&(i=e._rowRangeHeightsMap.get("$0$"+(e.rowCount-1))/e.rowCount),Math.min(Math.ceil(t/i),e.rowCount-1)}(t,e),o=e.getRowsHeight(0,i);return t>=o?((i,o)=>{let n=o-e.getRowHeight(i);const{rowCount:r}=e.internalProps;for(let o=i;o<r;o++){const i=e.getRowHeight(o),r=n+i;if(Math.round(n)<=Math.round(t)&&Math.round(t)<Math.round(r))return{top:n,row:o,bottom:r,height:i};n=r}return null})(i,o):((i,o)=>{let n=o;for(let o=i;o>=0;o--){const i=e.getRowHeight(o),r=n-i;if(Math.round(r)<=Math.round(t)&&Math.round(t)<Math.round(n))return{top:r,row:o,bottom:n,height:i};n=r}return null})(i,o)}function AT(t,e,i){if(0===t)return{left:0,col:0,right:0,width:0};if(e&&t>i.tableNoFrameWidth-i.getRightFrozenColsWidth()&&t<i.tableNoFrameWidth&&t<=i.getAllColsWidth())for(let e=0;e<i.rightFrozenColCount;e++)if(t>i.tableNoFrameWidth-i.getColsWidth(i.colCount-e-1,i.colCount-1))return{col:i.colCount-e-1,left:void 0,right:void 0,width:void 0};return _T(t,i)}function RT(t,e,i){if(0===t)return{top:0,row:0,bottom:0,height:0};if(t-=i.tableY,e&&t>i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()&&t<i.tableNoFrameHeight)for(let e=0;e<i.rightFrozenColCount;e++)if(t>i.tableNoFrameHeight-i.getRowsHeight(i.rowCount-e-1,i.rowCount-1))return{row:i.rowCount-e-1,top:void 0,bottom:void 0,height:void 0};return ST(t,i)}function BT(t){return 2===t.length&&rt(t[0])&&rt(t[1])&&t[1]>=t[0]}function MT(t){const e=t[1]-t[0],i=t[1]*t[0]<0;let o=t[0]<=0?0-t[0]:0,n=t[1]>0?t[1]-0:0;return 0===e?t[0]<0?(o=1,n=0):t[0]>0&&(o=0,n=1):(o/=e,n/=e),{total:e,negative:o,positive:n,includeZero:i,domain:t,extendable_min:!0,extendable_max:!0}}function TT(t,e){const{positive:i,negative:o,extendable_min:n,extendable_max:r,domain:s}=t,{positive:l,negative:a,extendable_min:h,extendable_max:d,domain:c}=e;if(l>0){if(!h)return!1;let t=o/i;r&&(t=o/Math.max(i,l),s[1]=-s[0]/t),c[0]=-c[1]*t}else if(a>0){if(!d)return!1;let t=i/o;n&&(t=i/Math.max(o,o),s[0]=-s[1]/t),c[1]=-c[0]*t}return!0}function PT(t,e){const{extendable_min:i,extendable_max:o,domain:n}=t,{positive:r,negative:s,domain:l}=e;return!(0===r&&0===s||r>0&&!o||s>0&&!i||(n[0]=l[0],n[1]=l[1],0))}function ET(t,e){const{positive:i,negative:o,extendable_max:n,domain:r}=t,{positive:s,negative:l,extendable_min:a,domain:h}=e;if(n&&a){const t=Math.max(o,l)/Math.max(i,s);r[1]=-r[0]/t,h[0]=-h[1]*t}else if(a){const t=o/i;h[0]=-h[1]*t}else{if(!n)return!1;{const t=l/s;r[1]=-r[0]/t}}return!0}function kT(t,e){const{extendable_min:i,domain:o}=t,{extendable_max:n,domain:r}=e;return!(!i||!n||(o[0]=-o[1],r[1]=-r[0],0))}function LT(t,e){const i=[t.min,t.max],o=[e.min,e.max];if(!BT(i)||!BT(o))return;const n=MT(i),r=MT(o),{positive:s,negative:l,extendable_min:a,extendable_max:h,includeZero:d}=n,{positive:c,negative:u,extendable_min:g,extendable_max:p,includeZero:f}=r;if(0===s&&0===l){if(!PT(n,r))return}else if(0===c&&0===u){if(!PT(r,n))return}else if(d||f)if(d&&!f){if(!TT(n,r))return}else if(f&&!d){if(!TT(r,n))return}else{if(l===u)return;if(l>u){if(!ET(n,r))return}else if(!ET(r,n))return}else{if(0===l&&0===c){if(!kT(n,r))return}else if(0===u&&0===s&&!kT(r,n))return;if(0===l&&0===u)if(0===i[0]&&o[0]>0){if(!g)return;o[0]=0}else{if(!(0===o[0]&&i[0]>0))return;if(!a)return;i[0]=0}if(0===s&&0===c)if(0===i[1]&&o[1]>0){if(!p)return;o[1]=0}else{if(!(0===o[1]&&i[1]>0))return;if(!h)return;i[1]=0}}return{range1:i,range2:o}}function HT(t,e,i){var o,n,r,s,l,a,h;if(i._table.isPivotChart())if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount){const o=OT("top",t,e+1,t,i.columnHeaderLevelCount-1,t,e,1,i);if(!o)return;const n=Fx(fS("padding",i._table._getCellStyle(t,e+1),t,e+1,i._table)),{range:r,ticks:s,axisOption:l,isZeroAlign:a,theme:h}=o;if(a){const o=OT("bottom",t,e+1,t,i.columnHeaderLevelCount-1,t,e,0,i);if(o){const{range:t}=o,e=LT(r,t);e&&(r.min=e.range1[0],r.max=e.range1[1])}}return nt(null==l?void 0:l.min)&&(r.min=l.min,r.min>0&&(l.zero=!1)),nt(null==l?void 0:l.max)&&(r.max=l.max,r.max<0&&(l.zero=!1)),yt({range:r},l,{orient:"top",type:(null==l?void 0:l.type)||"linear",label:{flush:!0},__ticksForVTable:s,__vtableChartTheme:h,__vtablePadding:n})}if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount){const o=i.getIndicatorKeyInChartSpec(t,e).slice(0,2);let n=null;null==o||o.forEach((t=>{const e=i.getIndicatorInfo(t);e&&(n=e)}));const r=OT("bottom",t,e-1,t,e,t,e,0,i);if(!r)return;const s=Fx(fS("padding",i._table._getCellStyle(t,e-1),t,e-1,i._table)),{range:l,ticks:a,axisOption:h,isZeroAlign:d,theme:c}=r;if(d){const o=OT("top",t,e-1,t,e,t,e,1,i);if(o){const{range:t}=o,e=LT(l,t);e&&(l.min=e.range1[0],l.max=e.range1[1])}}return nt(null==h?void 0:h.min)&&(l.min=h.min,l.min>0&&(h.zero=!1)),nt(null==h?void 0:h.max)&&(l.max=h.max,l.max<0&&(h.zero=!1)),yt({title:{visible:!0,text:null==n?void 0:n.title},range:l},h,{orient:"bottom",type:(null==h?void 0:h.type)||"linear",label:{flush:!0},__ticksForVTable:a,__vtableChartTheme:c,__vtablePadding:s})}if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount){let l=i.getDimensionKeyInChartSpec(i.rowHeaderLevelCount,e);et(l)&&(l=l[0]);const a=null!==(o=i.dataset.collectedValues[l])&&void 0!==o?o:[],h=i.getRowKeysPath(t,e),d=null!==(n=a[null!=h?h:""])&&void 0!==n?n:[],{axisOption:c,theme:u,chartType:g}=FT(t+1,e,"left",i);if(!1===(null==c?void 0:c.visible))return;const p=Fx(fS("padding",i._table._getCellStyle(t+1,e),t+1,e,i._table)),f=i.getRawChartSpec(t+1,e);return yt({domain:"linear"===(null==c?void 0:c.type)?void 0:Array.from(d),range:"linear"===(null==c?void 0:c.type)?d:void 0,title:{autoRotate:!0}},c,{orient:"left",type:null!==(r=null==c?void 0:c.type)&&void 0!==r?r:"band",__vtableChartTheme:u,inverse:WT(c,"horizontal"===(null!==(s=null==f?void 0:f.direction)&&void 0!==s?s:"scatter"===g?"vertical":"horizontal")),__vtablePadding:p})}}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount){const o=i.getIndicatorKeyInChartSpec(t,e).slice(0,2);let n=null;null==o||o.forEach((t=>{const e=i.getIndicatorInfo(t);e&&(n=e)}));const r=OT("left",t+1,e,t,e,t,e,0,i);if(!r)return;const s=Fx(fS("padding",i._table._getCellStyle(t+1,e),t+1,e,i._table)),{range:l,ticks:a,axisOption:h,isZeroAlign:d,theme:c}=r;if(d){const o=OT("right",t+1,e,t,e,t,e,1,i);if(o){const{range:t}=o,e=LT(l,t);e&&(l.min=e.range1[0],l.max=e.range1[1])}}return nt(null==h?void 0:h.min)&&(l.min=h.min,l.min>0&&(h.zero=!1)),nt(null==h?void 0:h.max)&&(l.max=h.max,l.max<0&&(h.zero=!1)),yt({title:{visible:!0,text:null==n?void 0:n.title,autoRotate:!0},range:l},h,{orient:"left",type:(null==h?void 0:h.type)||"linear",label:{flush:!0},__ticksForVTable:a,__vtableChartTheme:c,__vtablePadding:s})}if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount){const o=OT("right",t-1,e,i.rowHeaderLevelCount-1,e,t,e,1,i);if(!o)return;const n=Fx(fS("padding",i._table._getCellStyle(t-1,e),t-1,e,i._table)),{range:r,ticks:s,axisOption:l,isZeroAlign:a,theme:h}=o;if(a){const o=OT("left",t-1,e,i.rowHeaderLevelCount-1,e,t,e,0,i);if(o){const{range:t}=o,e=LT(r,t);e&&(r.min=e.range1[0],r.max=e.range1[1])}}return nt(null==l?void 0:l.min)&&(r.min=l.min,r.min>0&&(l.zero=!1)),nt(null==l?void 0:l.max)&&(r.max=l.max,r.max<0&&(l.zero=!1)),yt({range:r,title:{autoRotate:!0}},l,{orient:"right",type:(null==l?void 0:l.type)||"linear",label:{flush:!0},__ticksForVTable:s,__vtableChartTheme:h,__vtablePadding:n})}if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount){let o=i.getDimensionKeyInChartSpec(t,i.columnHeaderLevelCount);et(o)&&(o=o[0]);const n=null!==(l=i.dataset.collectedValues[o])&&void 0!==l?l:[],r=i.getColKeysPath(t,e),s=null!==(a=null==n?void 0:n[null!=r?r:""])&&void 0!==a?a:[],{axisOption:d,isPercent:c,theme:u,chartType:g}=FT(t,e-1,"bottom",i);if(!1===(null==d?void 0:d.visible))return;const p=Fx(fS("padding",i._table._getCellStyle(t,e-1),t,e-1,i._table));return yt({domain:"linear"===(null==d?void 0:d.type)?void 0:Array.from(s),range:"linear"===(null==d?void 0:d.type)?s:void 0},d,{orient:"bottom",type:null!==(h=null==d?void 0:d.type)&&void 0!==h?h:"band",__vtableChartTheme:u,__vtablePadding:p})}}}function FT(t,e,i,o){var n,r;const s=o.getRawChartSpec(t,e),l=null!==(n=s.axes)&&void 0!==n?n:[];if(o._table.pivotChartAxes.forEach((t=>{-1===l.findIndex((e=>t.orient===e.orient))&&l.push(t)})),s&&et(l)){const t=l.find((t=>t.orient===i));if(t){const{seriesIndex:e,seriesId:n}=t;let l,a;return K(n)&&et(s.series)?l=(et(n)?n:[n]).map((t=>{const e=s.series.findIndex((e=>e.id===t));return e>=0&&(a=s.series[e]),e})):K(e)&&et(s.series)&&(l=e),{axisOption:t,isPercent:s.percent,isZeroAlign:zT(s,i,o),seriesIndice:l,theme:s.theme,chartType:null!==(r=null==a?void 0:a.type)&&void 0!==r?r:s.type}}}return{axisOption:o._table.pivotChartAxes.find((t=>t.orient===i)),isPercent:!1,isZeroAlign:zT(s,i,o),theme:s.theme,chartType:s.type}}function zT(t,e,i){const o=[];let n;if("left"===e||"right"===e?o.push("left","right"):"top"!==e&&"bottom"!==e||o.push("top","bottom"),n=t&&et(t.axes)?t.axes:i._table.pivotChartAxes,et(n)){const t=[];n.forEach((e=>{o.includes(e.orient)&&t.push(e)}));for(let e=0;e<t.length;e++){const i=t[e];if(i.sync&&i.sync.zeroAlign&&i.sync.axisId&&t.find((t=>t.id===i.sync.axisId)))return!0}}return!1}function IT(t,e,i,o,n){var r;if(et(n)){const r={min:1/0,max:-1/0};for(let s=0;s<n.length;s++){const l=IT(t,e,i,o,n[s]);l&&(r.min=Math.min(r.min,l.min),r.max=Math.max(r.max,l.max))}return isFinite(r.min)&&isFinite(r.max)?r:null}let s=null==e?void 0:e[n];if(et(s)&&(s=s[0]),!s)return null;const l=t[s],a=yt({},null!==(r=null==l?void 0:l[null!=o?o:""])&&void 0!==r?r:{min:0,max:1});return a.positiveMax&&a.positiveMax>a.max&&(a.max=a.positiveMax),a.negativeMin&&a.negativeMin<a.min&&(a.min=a.negativeMin),a.min===a.max&&(a.min>0?a.min=0:a.max=0),a}function OT(t,e,i,o,n,r,s,l,a){const{axisOption:h,isPercent:d,isZeroAlign:c,seriesIndice:u,theme:g,chartType:p}=FT(e,i,t,a);if(!1===(null==h?void 0:h.visible))return;const f=a.getIndicatorKeyInChartSpec(o,n).slice(0,2);let v;v="top"===t||"bottom"===t?a.getColKeysPath(r,s):a.getRowKeysPath(r,s);const m=IT(a.dataset.collectedValues,f,c,v,null!=u?u:l);if(!m)return;d&&(m.min=m.min<0?-1:0,m.max=m.max>0?1:0);const b=rx.getFunction("getAxisDomainRangeAndLabels"),{range:C,ticks:y}=b(m.min,m.max,h,c,"bottom"===t||"top"===t?a._table.getColWidth(r)||a._table.tableNoFrameWidth:a._table.getRowHeight(s)||a._table.tableNoFrameHeight);return m.min=isNaN(C[0])?0:C[0],m.max=isNaN(C[1])?1:C[1],nt(null==h?void 0:h.min)&&(m.min=h.min,m.min>0&&(h.zero=!1)),nt(null==h?void 0:h.max)&&(m.max=h.max,m.max<0&&(h.zero=!1)),{axisOption:h,isZeroAlign:c,range:m,ticks:y,theme:g,chartType:p}}var DT;function WT(t,e){let i=null==t?void 0:t.inverse;return e&&!("bottom"===(o=null==t?void 0:t.orient)||"top"===o)&&(i=!K(null==t?void 0:t.inverse)||!(null==t?void 0:t.inverse)),i;var o}!function(t){t.vertical="vertical",t.horizontal="horizontal"}(DT||(DT={}));const NT={};class GT extends jn{onUpdate(t,e,i){if(this.from.x!==this.to.x){const i=t?this.to.x:this.from.x+Math.floor((this.to.x-this.from.x)*e);this.params.table.scrollLeft=i}if(this.from.y!==this.to.y){const i=t?this.to.y:this.from.y+Math.floor((this.to.y-this.from.y)*e);this.params.table.scrollTop=i}}}class jT{constructor(t){this.table=t,this.timeline=new Nn,this.ticker=new Dn,this.ticker.addTimeline(this.timeline),this.ticker.setFPS(60),this.tempGraphic=ic({})}scrollTo(t,i){var o,n,r,s;const l={x:this.table.scrollLeft,y:this.table.scrollTop},a=this.table.getCellRect(null!==(o=t.col)&&void 0!==o?o:0,null!==(n=t.row)&&void 0!==n?n:0),h={x:nt(t.col)?a.left-this.table.getFrozenColsWidth():this.table.scrollLeft,y:nt(t.row)?a.top-this.table.getFrozenRowsHeight():this.table.scrollTop},d=$(i)?i?3e3:0:null!==(r=null==i?void 0:i.duration)&&void 0!==r?r:3e3,c=$(i)?i?"linear":"":null!==(s=null==i?void 0:i.easing)&&void 0!==s?s:"linear";new Vn(e.GenAutoIncrementId(),this.timeline).bind(this.tempGraphic).play(new GT(l,h,d,c,{graphic:this.tempGraphic,table:this.table})),this.ticker.start()}clear(){this.timeline.clear(),this.ticker.stop()}}const{toBoxArray:UT}=_w,{isTouchEvent:VT}=xw,$T=/^\$(\d+)\$(\d+)$/;!function(){if("node"===Oy.mode)return;const t=document.createElement("style");t.id="vtable-style-styleSheet",t.textContent="\n.vtable .input-container {\n\tposition: absolute;\n\ttop:0px;\n}\n.vtable .table-scrollable {\n\tposition: absolute;\n\toverflow: scroll;\n}\n.vtable .table-scrollable::-webkit-scrollbar-button{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-track-piece{\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-corner {\n\tbackground-color: transparent;\n}\n.vtable .table-scrollable::-webkit-scrollbar-thumb {\n\tborder-radius : 4px;\n\tbackground-color : rgba(100, 100, 100, .5);\n}\n\n.vtable .table-scroll-end-point {\n\topacity: 0;\n\tposition: relative;\n}\n.vtable {\n\t/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */\n\t/* overflow: auto; */\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: left;\n -webkit-font-smoothing:auto;\n\n overflow: hidden; // for react-vtable dom custom element\n}\n\n.vtable-gantt {\n\t/* 设置overflow: auto 应该是为了滚动条的某个问题 但设置了auto之后 dom的下拉菜单只能显示在vtable节点中 超出会截断;现在去掉auto 暂时滚动条的问题没有发现 */\n\t/* overflow: auto; */\n\tposition: absolute;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: left;\n -webkit-font-smoothing:auto;\n\n overflow: hidden; // for react-vtable dom custom element\n}\n.vtable .table-component-container {\n pointer-events: none;\n overflow: hidden;\n position: absolute;\n top: 0px;\n left: 0px;\n}\n.vtable > canvas {\n\tposition: absolute;\n\twidth: 0;\n\theight: 0;\n}\n.vtable .table-focus-control {\n\tposition: relative !important;\n\twidth: 1px;\n\theight: 1px;\n\topacity: 0;\n\tpadding: 0;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\tpointer-events: none;\n\tmax-width: 500px;\n\tmax-height: 500px;\n\tfloat: none !important;\n}\n.vtable input.table-focus-control::-ms-clear {\n\tvisibility: hidden;\n}\n.vtable input.table-focus-control.composition {\n\topacity: 1;\n\tmax-width: none;\n\tmax-height: none;\n}\n",document.head.appendChild(t)}();class YT extends Ry{static get EVENT_TYPE(){return Aw}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,o,n,r,s,l,a,h,d,c;if(super(),this.showFrozenIcon=!0,this.version="1.10.5",this.id=`VTable${Date.now()}`,this.isReleased=!1,this._chartEventMap={},this.throttleInvalidate=function(t,e){let i=null;return function(){for(var o=arguments.length,n=new Array(o),r=0;r<o;r++)n[r]=arguments[r];i||(i=setTimeout((()=>{t.apply(this,n),i=null}),e))}}(this.render.bind(this),200),!t&&"node"!==e.mode&&!e.canvas)throw new Error("vtable's container is undefined");const{frozenColCount:u=0,frozenRowCount:g,defaultRowHeight:p=40,defaultHeaderRowHeight:f,defaultColWidth:v=80,defaultHeaderColWidth:m,widthMode:b="standard",heightMode:C="standard",autoFillWidth:y=!1,autoFillHeight:w=!1,widthAdaptiveMode:x="only-body",heightAdaptiveMode:_="only-body",keyboardOptions:S,eventOptions:A,rowSeriesNumber:R,columnResizeMode:B,rowResizeMode:M="none",dragHeaderMode:T,showFrozenIcon:P,allowFrozenColCount:E,padding:k,hover:L,menu:H,select:F,customRender:z,pixelRatio:I=TM,renderChartAsync:O,renderChartAsyncBatchCount:D,mode:W,modeParams:N,canvasWidth:G,canvasHeight:j,overscrollBehavior:U,limitMinWidth:V,limitMinHeight:$,clearDOM:Y=!0}=e;this.container=t,this.options=e,this._widthMode=b,this._heightMode=C,this._widthAdaptiveMode=x,this._heightAdaptiveMode=_,this._autoFillWidth=y,this._autoFillHeight=w,this.customRender=z,this.padding={top:0,right:0,left:0,bottom:0},k&&("number"==typeof k?(this.padding.top=k,this.padding.left=k,this.padding.bottom=k,this.padding.right=k):(k.top&&(this.padding.top=k.top),k.bottom&&(this.padding.bottom=k.bottom),k.left&&(this.padding.left=k.left),k.right&&(this.padding.right=k.right))),K(j)&&K(G)&&(this.canvasSizeSeted=!0),this.tableNoFrameWidth=0,this.tableNoFrameHeight=0,this.canvasWidth=G,this.canvasHeight=j,this.columnWidthComputeMode=null!==(i=e.columnWidthComputeMode)&&void 0!==i?i:"normal";const X=this.internalProps={};if(void 0!==P&&(this.showFrozenIcon=P),"number"==typeof E&&E<=0&&(this.showFrozenIcon=!1),this.options.canvas?(X.element=this.options.canvas.parentElement,X.element.style.position="relative",X.focusControl=new gT(this,X.element),X.canvas=this.options.canvas,X.context=X.canvas.getContext("2d")):"node"!==Oy.mode&&(X.element=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"vtable";var i,o;const n=document.createElement("div");n.setAttribute("tabindex","0"),n.classList.add(e),n.style.outline="none",n.style.margin=`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;const r=(n.offsetWidth||(null===(i=n.parentElement)||void 0===i?void 0:i.offsetWidth)||1)-1,s=(n.offsetHeight||(null===(o=n.parentElement)||void 0===o?void 0:o.offsetHeight)||1)-1;return n.style.width=r&&r-t.left-t.right+"px"||"0px",n.style.height=s&&s-t.top-t.bottom+"px"||"0px",n}(this.padding),X.focusControl=new gT(this,X.element),X.canvas=document.createElement("canvas"),X.element.appendChild(X.canvas),X.context=X.canvas.getContext("2d"),(null===(o=e.customConfig)||void 0===o?void 0:o.createReactContainer)&&function(t){const{internalProps:e}=t;e.bodyDomContainer=document.createElement("div"),e.bodyDomContainer.id="vtable-body-dom-container",e.bodyDomContainer.classList.add("table-component-container"),e.element.appendChild(e.bodyDomContainer),e.headerDomContainer=document.createElement("div"),e.headerDomContainer.id="vtable-header-dom-container",e.headerDomContainer.classList.add("table-component-container"),e.element.appendChild(e.headerDomContainer),e.frozenBodyDomContainer=document.createElement("div"),e.frozenBodyDomContainer.id="vtable-frozen-body-dom-container",e.frozenBodyDomContainer.classList.add("table-component-container"),e.element.appendChild(e.frozenBodyDomContainer),e.frozenHeaderDomContainer=document.createElement("div"),e.frozenHeaderDomContainer.id="vtable-frozen-header-dom-container",e.frozenHeaderDomContainer.classList.add("table-component-container"),e.element.appendChild(e.frozenHeaderDomContainer),e.rightFrozenBodyDomContainer=document.createElement("div"),e.rightFrozenBodyDomContainer.id="vtable-right-frozen-body-dom-container",e.rightFrozenBodyDomContainer.classList.add("table-component-container"),e.element.appendChild(e.rightFrozenBodyDomContainer),e.rightFrozenHeaderDomContainer=document.createElement("div"),e.rightFrozenHeaderDomContainer.id="vtable-right-frozen-header-dom-container",e.rightFrozenHeaderDomContainer.classList.add("table-component-container"),e.element.appendChild(e.rightFrozenHeaderDomContainer),e.frozenBottomDomContainer=document.createElement("div"),e.frozenBottomDomContainer.id="vtable-frozen-bottom-dom-container",e.frozenBottomDomContainer.classList.add("table-component-container"),e.element.appendChild(e.frozenBottomDomContainer),e.bottomDomContainer=document.createElement("div"),e.bottomDomContainer.id="vtable-bottom-dom-container",e.bottomDomContainer.classList.add("table-component-container"),e.element.appendChild(e.bottomDomContainer),e.rightFrozenBottomDomContainer=document.createElement("div"),e.rightFrozenBottomDomContainer.id="vtable-right-frozen-bottom-dom-container",e.rightFrozenBottomDomContainer.classList.add("table-component-container"),e.element.appendChild(e.rightFrozenBottomDomContainer)}(this)),X.handler=new Pw,nt(this.options.resizeTime)&&(X.handler.resizeTime=this.options.resizeTime),X.pixelRatio=I,X.frozenColCount=u,X.frozenRowCount=g,X.defaultRowHeight=p,X.defaultHeaderRowHeight=null!=f?f:p,X.defaultColWidth=v,X.defaultHeaderColWidth=null!=m?m:v,X.keyboardOptions=S,X.eventOptions=A,X.rowSeriesNumber=R,X.columnResizeMode=B,X.rowResizeMode=M,X.dragHeaderMode=null!=T?T:"none",X.renderChartAsync=O,YA(D),X.overscrollBehavior=null!=U?U:"auto",X._rowHeightsMap=new pT(this),X._rowRangeHeightsMap=new Map,X._colRangeWidthsMap=new Map,X._widthResizedColMap=new Set,X._heightResizedRowMap=new Set,this.colWidthsMap=new kw,this.colContentWidthsMap=new kw,this.colWidthsLimit={},X.calcWidthContext={_:X,get full(){var t;return"node"===Oy.mode?G/(null!=I?I:1):this._.canvas.width/(null!==(t=this._.context.pixelRatio)&&void 0!==t?t:window.devicePixelRatio)}},X.cellTextOverflows={},X.focusedTable=!1,X.theme=ox.of(null!==(n=e.theme)&&void 0!==n?n:ox.DEFAULT),X.theme.isPivot=this.isPivotTable(),hS(X.theme.functionalIconsStyle),t?(Y&&(t.innerHTML=""),t.appendChild(X.element),this._updateSize()):this._updateSize(),X.bodyHelper=new IM(this),X.headerHelper=new uT(this),X.rowSeriesNumberHelper=new vT(this),X.autoWrapText=e.autoWrapText,X.enableLineBreak=e.enableLineBreak,X.allowFrozenColCount=null!==(r=e.allowFrozenColCount)&&void 0!==r?r:0,X.limitMaxAutoWidth=null!==(s=e.limitMaxAutoWidth)&&void 0!==s?s:450,X.limitMinWidth=null!=V?"number"==typeof V?V:V?10:0:10,X.limitMinHeight=null!=$?"number"==typeof $?$:$?10:0:10,this.scenegraph=new nM(this),this.stateManager=new bM(this),this.eventManager=new LM(this),this.animationManager=new jT(this),e.legends){X.legends=[];const t=rx.getFunction("createLegend");if(Array.isArray(e.legends)){for(let i=0;i<e.legends.length;i++)X.legends.push(t(e.legends[i],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else X.legends.push(t(e.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(X.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},e.tooltip),"html"===X.tooltip.renderMode){const t=rx.getComponent("tooltipHandler");t&&(X.tooltipHandler=new t(this,X.tooltip.confine))}if(X.menu=Object.assign({renderMode:"html"},e.menu),Array.isArray(null===(l=e.menu)||void 0===l?void 0:l.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(null===(a=e.menu)||void 0===a?void 0:a.dropDownMenuHighlight),Array.isArray(null===(h=e.menu)||void 0===h?void 0:h.defaultHeaderMenuItems)&&(this.globalDropDownMenu=e.menu.defaultHeaderMenuItems),"html"===X.menu.renderMode){const t=rx.getComponent("menuHandler");X.menuHandler=new t(this)}this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyMergeTitleCache=new Map,this.bodyBottomStyleCache=new Map,X.stick={changedCells:new Map},X.customMergeCell=e.customMergeCell,this.customCellStylePlugin=new mT(this,null!==(d=e.customCellStyle)&&void 0!==d?d:[],null!==(c=e.customCellStyleArrangement)&&void 0!==c?c:[])}getContainer(){return this.container}getElement(){return this.internalProps.element}get canvas(){return this.internalProps.canvas}setCanvasSize(t,e){this.canvasWidth=t,this.canvasHeight=e,this.options.canvasHeight=e,this.options.canvasWidth=t,this.resize()}resize(){var t;this._updateSize(),null===(t=this.internalProps.legends)||void 0===t||t.forEach((t=>{null==t||t.resize()})),this.internalProps.title&&this.internalProps.title.resize(),this.internalProps.emptyTip&&this.internalProps.emptyTip.resize(),this.scenegraph.resize()}get rowCount(){return this.internalProps.rowCount}set rowCount(t){this.internalProps.rowCount=t}get colCount(){var t;return null!==(t=this.internalProps.colCount)&&void 0!==t?t:0}set colCount(t){this.internalProps.colCount=t}get frozenColCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.frozenColCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.frozenColCount)&&void 0!==n?n:0}set frozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t,this.options.frozenColCount=t,this.tableNoFrameWidth-this.getColsWidth(0,t-1)<=120&&(this.internalProps.frozenColCount=0),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}_setFrozenColCount(t){t>=this.colCount&&(t=0),this.internalProps.frozenColCount=t}_resetFrozenColCount(){this.options.frozenColCount&&(this.tableNoFrameWidth-this.getColsWidth(0,this.options.frozenColCount-1)<=120?this._setFrozenColCount(0):this.frozenColCount!==this.options.frozenColCount&&this._setFrozenColCount(this.options.frozenColCount))}get frozenRowCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.frozenRowCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.frozenRowCount)&&void 0!==n?n:0}set frozenRowCount(t){this.internalProps.frozenRowCount=t}get rightFrozenColCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.rightFrozenColCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.rightFrozenColCount)&&void 0!==n?n:0}set rightFrozenColCount(t){this.scenegraph.dealWidthRightFrozen(t)}get bottomFrozenRowCount(){var t,e,i,o,n;return null!==(n=null!==(i=null===(e=null===(t=this.internalProps)||void 0===t?void 0:t.layoutMap)||void 0===e?void 0:e.bottomFrozenRowCount)&&void 0!==i?i:null===(o=this.internalProps)||void 0===o?void 0:o.bottomFrozenRowCount)&&void 0!==n?n:0}set bottomFrozenRowCount(t){this.scenegraph.dealWidthBottomFrozen(t)}get defaultRowHeight(){return this.internalProps.defaultRowHeight}set defaultRowHeight(t){this.internalProps.defaultRowHeight=t,this.options.defaultRowHeight=t}get defaultHeaderRowHeight(){return this.internalProps.defaultHeaderRowHeight}set defaultHeaderRowHeight(t){this.internalProps.defaultHeaderRowHeight=t,this.options.defaultHeaderRowHeight=t}get defaultColWidth(){return this.internalProps.defaultColWidth}set defaultColWidth(t){this.internalProps.defaultColWidth=t,this.options.defaultColWidth=t}get defaultHeaderColWidth(){return this.internalProps.defaultHeaderColWidth}set defaultHeaderColWidth(t){this.internalProps.defaultHeaderColWidth=t,this.options.defaultHeaderColWidth=t}get colWidthsMap(){return this.internalProps._colWidthsMap}set colWidthsMap(t){this.internalProps._colWidthsMap=t}get colContentWidthsMap(){return this.internalProps._colContentWidthsMap}set colContentWidthsMap(t){this.internalProps._colContentWidthsMap=t}get _colRangeWidthsMap(){return this.internalProps._colRangeWidthsMap}set _colRangeWidthsMap(t){this.internalProps._colRangeWidthsMap=t}get _rowRangeHeightsMap(){return this.internalProps._rowRangeHeightsMap}set _rowRangeHeightsMap(t){this.internalProps._rowRangeHeightsMap=t}get rowHeightsMap(){return this.internalProps._rowHeightsMap}set rowHeightsMap(t){this.internalProps._rowHeightsMap=t}get colWidthsLimit(){return this.internalProps._colWidthsLimit}set colWidthsLimit(t){this.internalProps._colWidthsLimit=t}get keyboardOptions(){var t;return null!==(t=this.internalProps.keyboardOptions)&&void 0!==t?t:null}set keyboardOptions(t){this.internalProps.keyboardOptions=null!=t?t:void 0}get eventOptions(){var t;return null!==(t=this.internalProps.eventOptions)&&void 0!==t?t:null}set eventOptions(t){this.internalProps.eventOptions=null!=t?t:void 0}get widthMode(){return this._widthMode}set widthMode(t){t!==this._widthMode&&(this._widthMode=t,this.options.widthMode=t)}get heightMode(){return this._heightMode}set heightMode(t){t!==this._heightMode&&(this._heightMode=t,this.options.heightMode=t)}get autoFillWidth(){return this._autoFillWidth}set autoFillWidth(t){t!==this._autoFillWidth&&(this._autoFillWidth=t)}get autoFillHeight(){return this._autoFillHeight}set autoFillHeight(t){t!==this._autoFillHeight&&(this._autoFillHeight=t)}get widthAdaptiveMode(){return this._widthAdaptiveMode}set widthAdaptiveMode(t){t!==this._widthAdaptiveMode&&(this._widthAdaptiveMode=t)}get heightAdaptiveMode(){return this._heightAdaptiveMode}set heightAdaptiveMode(t){t!==this._heightAdaptiveMode&&(this._heightAdaptiveMode=t)}_colWidthDefineToPxWidth(t){return"auto"===t?0:m_(this,t)}_getColWidthLimits(t){const e=this.colWidthsLimit[t];if(!e)return null;const i={};return e.min&&(i.min=m_(this,e.min),i.minDef=e.min),e.max&&(i.max=m_(this,e.max),i.maxDef=e.max),i}_adjustColWidth(t,e){const i=this._getColWidthLimits(t);return Math.max(function(t,e){return t?t.min&&t.min>e?t.min:t.max&&t.max<e?t.max:e:e}(i,e),0)}setPixelRatio(t){if(t!==this.internalProps.pixelRatio){this.internalProps.pixelRatio=t;const e=this.options.canvasWidth;this.internalProps.calcWidthContext={_:this.internalProps,get full(){var i;return"node"===Oy.mode?e/(null!=t?t:1):this._.canvas.width/(null!==(i=this._.context.pixelRatio)&&void 0!==i?i:window.devicePixelRatio)}},this.scenegraph.setPixelRatio(t)}}_updateSize(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x,_,S,A;const{padding:R}=this;let B=0,M=0;if(this.tableX=0,this.tableY=0,this.options.canvas&&this.options.viewBox)B=this.options.viewBox.x2-this.options.viewBox.x1,M=this.options.viewBox.y2-this.options.viewBox.y1,(null===(t=null==this?void 0:this.scenegraph)||void 0===t?void 0:t.stage)&&(this.options.viewBox?this.scenegraph.stage.setViewBox(this.options.viewBox,!1):this.scenegraph.stage.resize(B,M));else if("browser"===Oy.mode){const t=this.getElement();let s=0,l=0;if(this.canvasSizeSeted)s=this.canvasWidth,l=this.canvasHeight;else if(t.parentElement){const e=t.parentElement.style||window.getComputedStyle(t.parentElement);s=t.parentElement.offsetWidth-parseInt(e.paddingLeft||"0px",10)-parseInt(e.paddingRight||"0px",10),l=t.parentElement.offsetHeight-parseInt(e.paddingTop||"0px",10)-parseInt(e.paddingBottom||"0px",20)}const a=null!=s?s:0,h=null!=l?l:0;t.style.width=a&&a-R.left-R.right+"px"||"0px",t.style.height=h&&h-R.top-R.bottom+"px"||"0px";const{canvas:d}=this.internalProps;B=null!==(i=null===(e=d.parentElement)||void 0===e?void 0:e.offsetWidth)&&void 0!==i?i:0,M=null!==(n=null===(o=d.parentElement)||void 0===o?void 0:o.offsetHeight)&&void 0!==n?n:0,(null===(r=null==this?void 0:this.scenegraph)||void 0===r?void 0:r.stage)?this.scenegraph.stage.resize(B,M):(d.style.width="",d.style.height="",d.width=B,d.height=M,d.style.width=`${B}px`,d.style.height=`${M}px`)}else"node"===Oy.mode&&(B=this.canvasWidth-1,M=this.canvasHeight-1);const T=Math.floor(B-function(t){var e;return(null==t?void 0:t.hoverOn)||(null==t?void 0:t.verticalVisible)&&"none"===(null==t?void 0:t.verticalVisible)||!(null==t?void 0:t.verticalVisible)&&"none"===(null==t?void 0:t.visible)?0:null!==(e=null==t?void 0:t.width)&&void 0!==e?e:7}(this.getTheme().scrollStyle)),P=Math.floor(M-function(t){var e;return(null==t?void 0:t.hoverOn)||(null==t?void 0:t.horizontalVisible)&&"none"===(null==t?void 0:t.horizontalVisible)||!(null==t?void 0:t.horizontalVisible)&&"none"===(null==t?void 0:t.visible)?0:null!==(e=null==t?void 0:t.width)&&void 0!==e?e:7}(this.getTheme().scrollStyle));if(null===(s=this.internalProps.theme)||void 0===s?void 0:s.frameStyle){const t=UT(null!==(a=null===(l=this.internalProps.theme.frameStyle)||void 0===l?void 0:l.borderLineWidth)&&void 0!==a?a:[null]),e=UT(null!==(d=null===(h=this.internalProps.theme.frameStyle)||void 0===h?void 0:h.shadowBlur)&&void 0!==d?d:[0]);(null===(c=this.theme.frameStyle)||void 0===c?void 0:c.innerBorder)?(this.tableX=0,this.tableY=0,this.tableNoFrameWidth=T-(null!==(u=e[1])&&void 0!==u?u:0),this.tableNoFrameHeight=P-(null!==(g=e[2])&&void 0!==g?g:0)):(this.tableX=(null!==(p=t[3])&&void 0!==p?p:0)+(null!==(f=e[3])&&void 0!==f?f:0),this.tableY=(null!==(v=t[0])&&void 0!==v?v:0)+(null!==(m=e[0])&&void 0!==m?m:0),this.tableNoFrameWidth=T-((null!==(b=t[1])&&void 0!==b?b:0)+(null!==(C=e[1])&&void 0!==C?C:0))-((null!==(y=t[3])&&void 0!==y?y:0)+(null!==(w=e[3])&&void 0!==w?w:0)),this.tableNoFrameHeight=P-((null!==(x=t[0])&&void 0!==x?x:0)+(null!==(_=e[0])&&void 0!==_?_:0))-((null!==(S=t[2])&&void 0!==S?S:0)+(null!==(A=e[2])&&void 0!==A?A:0)))}}updateViewBox(t){var e,i,o,n,r,s,l,a;const h=null!==(n=null!==(i=null===(e=this.options)||void 0===e?void 0:e.viewBox.x2)&&void 0!==i?i:0-(null===(o=this.options)||void 0===o?void 0:o.viewBox.x1))&&void 0!==n?n:0,d=null!==(a=null!==(s=null===(r=this.options)||void 0===r?void 0:r.viewBox.y2)&&void 0!==s?s:0-(null===(l=this.options)||void 0===l?void 0:l.viewBox.y1))&&void 0!==a?a:0,c=t.x2-t.x1,u=t.y2-t.y1;this.options.viewBox=t,h!==c||d!==u?this.resize():this.scenegraph.stage.setViewBox(this.options.viewBox,!0)}setViewBoxTransform(t,e,i,o,n,r){this.internalProps.modifiedViewBoxTransform=!0,this.scenegraph.stage.window.setViewBoxTransform(t,e,i,o,n,r)}get rowHierarchyType(){return"grid"}getColsWidth(t,e){var i;if(t>e)return 0;t=Math.max(t,0),e=Math.min(e,(null!==(i=this.colCount)&&void 0!==i?i:1/0)-1);const o=this._colRangeWidthsMap.get(`$${t}$${e}`);if(null!=o)return o;const n=this._colRangeWidthsMap.get(`$${t}$${e-1}`);if(null!=n){const i=n+this.getColWidth(e);return t>=0&&e>=0&&!Number.isNaN(i)&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(i)),Math.round(i)}let r=0;for(let i=t;i<=e;i++)r+=this.getColWidth(i);return t>=0&&e>=0&&this._colRangeWidthsMap.set(`$${t}$${e}`,Math.round(r)),Math.round(r)}getRowHeight(t){var e;if(K(this.rowHeightsMap.get(t))){if(null===(e=this.options.customConfig)||void 0===e?void 0:e._disableColumnAndRowSizeRound){const e=this.rowHeightsMap.get(t);let i;return i=t<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,t):t>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(t,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,t),i=Number(i.toFixed(2)),Number.isInteger(i)?Math.ceil(e):Math.floor(e)}return this.rowHeightsMap.get(t)}const i=this.getDefaultRowHeight(t);return nt(i)?i:this.defaultRowHeight}getDefaultColumnWidth(t){var e,i;return this.isRowHeader(t,0)||this.isCornerHeader(t,0)?Array.isArray(this.defaultHeaderColWidth)?null!==(e=this.defaultHeaderColWidth[t])&&void 0!==e?e:this.defaultColWidth:this.defaultHeaderColWidth:this.isRightFrozenColumn(t,this.columnHeaderLevelCount)&&this.isPivotTable()?Array.isArray(this.defaultHeaderColWidth)?null!==(i=this.defaultHeaderColWidth[this.rowHeaderLevelCount-this.rightFrozenColCount])&&void 0!==i?i:this.defaultColWidth:this.defaultHeaderColWidth:this.defaultColWidth}getDefaultRowHeight(t){var e,i;return this.isColumnHeader(0,t)||this.isCornerHeader(0,t)||this.isSeriesNumberInHeader(0,t)?Array.isArray(this.defaultHeaderRowHeight)?null!==(e=this.defaultHeaderRowHeight[t])&&void 0!==e?e:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.isBottomFrozenRow(t)?Array.isArray(this.defaultHeaderRowHeight)?null!==(i=this.defaultHeaderRowHeight[this.columnHeaderLevelCount>0?this.columnHeaderLevelCount-this.bottomFrozenRowCount:0])&&void 0!==i?i:this.internalProps.defaultRowHeight:this.defaultHeaderRowHeight:this.internalProps.defaultRowHeight}_setRowHeight(t,e,i){var o;this.rowHeightsMap.put(t,(null===(o=this.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound)?e:Math.round(e)),i&&this._clearRowRangeHeightsMap(t)}setRowHeight(t,e){this.scenegraph.setRowHeight(t,e),this.scenegraph.updateChartSizeForResizeRowHeight(t),this.internalProps._heightResizedRowMap.add(t)}getRowsHeight(t,e){var i,o;if(t>e||0===this.rowCount)return 0;t=Math.max(t,0),e=Math.min(e,(null!==(i=this.rowCount)&&void 0!==i?i:1/0)-1);let n=0;if("standard"!==this.heightMode||this.autoFillHeight||!this.internalProps.layoutMap||this.hasAutoImageColumn()||0!==this.internalProps._heightResizedRowMap.size){if(null===(o=this.options.customConfig)||void 0===o?void 0:o._disableColumnAndRowSizeRound){const i=this.rowHeightsMap.getSumInRange(t,e);let o;return o=e<this.frozenRowCount?this.rowHeightsMap.getSumInRange(0,e):e>=this.rowCount-this.bottomFrozenRowCount?this.rowHeightsMap.getSumInRange(e,this.rowCount-1):this.rowHeightsMap.getSumInRange(this.frozenRowCount,e),o=Number(o.toFixed(2)),Number.isInteger(o)?Math.ceil(i):Math.floor(i)}n=this.rowHeightsMap.getSumInRange(t,e)}else{for(let i=t;i<Math.min(e+1,this.columnHeaderLevelCount);i++)n+=this.getRowHeight(i);e>=this.columnHeaderLevelCount&&(n+=this.defaultRowHeight*(Math.min(e,this.rowCount-this.bottomFrozenRowCount-1)-Math.max(this.columnHeaderLevelCount,t)+1));for(let t=this.rowCount-this.bottomFrozenRowCount;t<e+1;t++)n+=this.getRowHeight(t)}return Math.round(n)}getColWidthDefined(t){var e;const{layoutMap:i}=this.internalProps;if("autoWidth"===this.widthMode)return"auto";const{width:o}=null!==(e=null==i?void 0:i.getColumnWidthDefined(t))&&void 0!==e?e:{};return"number"==typeof o&&o<=0?0:o||this.getDefaultColumnWidth(t)}getColWidthDefinedNumber(t){const e=this.getColWidthDefined(t);return this._adjustColWidth(t,this._colWidthDefineToPxWidth(e))}isAutoRowHeight(t){return"autoHeight"===this.heightMode||t>=0&&t<this.columnHeaderLevelCount&&"auto"===this.getDefaultRowHeight(t)}getColWidth(t){var e;const i=null!==(e=this.colWidthsMap.get(t))&&void 0!==e?e:this.getDefaultColumnWidth(t);return"adaptive"===this.widthMode&&"number"==typeof i||this.transpose&&"number"==typeof i?this._colWidthDefineToPxWidth(i):this._adjustColWidth(t,this._colWidthDefineToPxWidth(i))}_setColWidth(t,e,i,o){this.colWidthsMap.put(t,"number"==typeof e?Math.round(e):e),i&&this._clearColRangeWidthsMap(t),o||this.stateManager.checkFrozen()}setColWidth(t,e){this.scenegraph.setColWidth(t,e),this.scenegraph.updateChartSizeForResizeColWidth(t),this.internalProps._widthResizedColMap.add(t)}_clearColRangeWidthsMap(t){if("number"!=typeof t)this._colRangeWidthsMap.clear();else{const e=this._colRangeWidthsMap.keys();for(const i of e){const e=$T.exec(i);if(e){const o=Number(e[1]),n=Number(e[2]);t>=o&&t<=n&&this._colRangeWidthsMap.delete(i)}}}}_clearRowRangeHeightsMap(t){this.rowHeightsMap.clearRange()}_getColContentWidth(t){return Number(this.colContentWidthsMap.get(t))}_setColContentWidth(t,e){this.colContentWidthsMap.put(t,e)}getAllRowsHeight(){return this.internalProps.rowCount<=0?0:this.getRowsHeight(0,this.internalProps.rowCount-1)}getAllColsWidth(){return this.internalProps.colCount<=0?0:this.getColsWidth(0,this.internalProps.colCount-1)}getMaxColWidth(t){var e;const i=this.colWidthsLimit[t];let o=null!==(e=i&&i.max)&&void 0!==e?e:1/0;return"string"==typeof o&&(o=m_(this,o)),o}setMaxColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).max=e}getMinColWidth(t){var e;const i=this.colWidthsLimit[t];let o=null!==(e=i&&i.min)&&void 0!==e?e:0;return"string"==typeof o&&(o=m_(this,o)),o}setMinColWidth(t,e){(this.colWidthsLimit[t]||(this.colWidthsLimit[t]={})).min=e}getCellRect(t,e){var i,o;const n=this.isFrozenCell(t,e);let r;const s=this.getColWidth(t);let l;r=n&&n.col&&this.isRightFrozenColumn(t,e)?this.getAllColsWidth()<=this.tableNoFrameWidth?this.getColsWidth(0,t-1)||0:this.tableNoFrameWidth-(null!==(i=this.getColsWidth(t,this.colCount-1))&&void 0!==i?i:0):this.getColsWidth(0,t-1)||0;const a=this.getRowHeight(e);return l=n&&n.row&&this.isBottomFrozenRow(t,e)?this.getAllRowsHeight()<=this.tableNoFrameHeight?this.getRowsHeight(0,e-1):this.tableNoFrameHeight-(null!==(o=this.getRowsHeight(e,this.rowCount-1))&&void 0!==o?o:0):this.getRowsHeight(0,e-1),new Lw(Math.round(r),Math.round(l),Math.round(s),Math.round(a))}getMergeCellRect(t,e){const i=this.getCellRange(t,e),o=this.getColsWidth(0,i.start.col-1)||0,n=this.getColsWidth(i.start.col,i.end.col),r=this.getRowsHeight(0,i.start.row-1)||0,s=this.getRowsHeight(i.start.row,i.end.row);return new Lw(Math.round(o),Math.round(r),Math.round(n),Math.round(s))}getCellRelativeRect(t,e){const i=this.isFrozenCell(t,e);let o=!0,n=!0;(null==i?void 0:i.col)&&(null==i?void 0:i.row)?(o=!1,n=!1):(null==i?void 0:i.col)?o=!1:(null==i?void 0:i.row)&&(n=!1);const r=this.getCellRect(t,e);return this._toRelativeRect(r,o,n)}getCellRangeRelativeRect(t){if(t.start){const e=this.isFrozenCell(t.start.col,t.start.row);let i=!0,o=!0;return(null==e?void 0:e.col)&&(null==e?void 0:e.row)?(i=!1,o=!1):(null==e?void 0:e.col)?i=!1:(null==e?void 0:e.row)&&(o=!1),this._toRelativeRect(this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row),i,o)}const e=this.getCellRange(t.col,t.row),i=this.isFrozenCell(t.col,t.row);let o=!0,n=!0;return(null==i?void 0:i.col)&&(null==i?void 0:i.row)?(o=!1,n=!1):(null==i?void 0:i.col)?o=!1:(null==i?void 0:i.row)&&(n=!1),this._toRelativeRect(this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row),o,n)}getVisibleCellRangeRelativeRect(t){let e;return e=t.start?t:this.getCellRange(t.col,t.row),this._getVisiableRect(this.getCellRangeRelativeRect(t),e)}_getVisiableRect(t,e){const i=e.start.col>=this.frozenColCount?Math.max(t.left,this.frozenColCount>=1?this.getColsWidth(0,this.frozenColCount-1):0):t.left,o=Math.min(t.right,this.tableNoFrameWidth),n=t.copy();n.left=i,n.right=o;const r=e.start.row>=this.frozenRowCount?Math.max(t.top,this.frozenRowCount>=1?this.getRowsHeight(0,this.frozenRowCount-1):0):t.top,s=Math.min(t.bottom,this.tableNoFrameHeight);return n.top=r,n.bottom=s,n}getCellsRect(t,e,i,o){var n,r,s,l,a,h;let d=this.getColsWidth(0,t-1)||0,c=this.getColsWidth(t,i);const u=this.scrollLeft;this.isLeftFrozenColumn(t)&&this.isRightFrozenColumn(i)?c=this.tableNoFrameWidth-(null!==(n=this.getColsWidth(t+1,this.colCount-1))&&void 0!==n?n:0)-d:this.isLeftFrozenColumn(t)&&!this.isLeftFrozenColumn(i)?c=Math.max(c-u,this.getColsWidth(t,this.frozenColCount-1)):!this.isRightFrozenColumn(t)&&this.isRightFrozenColumn(i)?(d=Math.min(d-u,this.tableNoFrameWidth-this.getRightFrozenColsWidth()),c=this.tableNoFrameWidth-(null!==(r=this.getColsWidth(t+1,this.colCount-1))&&void 0!==r?r:0)-d):this.isRightFrozenColumn(t)&&(d=this.tableNoFrameWidth-(null!==(s=this.getColsWidth(t,this.colCount-1))&&void 0!==s?s:0));let g=this.getRowsHeight(0,e-1),p=this.getRowsHeight(e,o);const f=this.scrollTop;return this.isTopFrozenRow(e)&&this.isBottomFrozenRow(o)?p=this.tableNoFrameHeight-(null!==(l=this.getRowsHeight(e+1,this.rowCount-1))&&void 0!==l?l:0)-g:this.isTopFrozenRow(e)&&!this.isTopFrozenRow(o)?p=Math.max(p-f,this.getRowsHeight(e,this.frozenRowCount-1)):!this.isBottomFrozenRow(e)&&this.isBottomFrozenRow(o)?(g=Math.min(g-f,this.tableNoFrameHeight-this.getBottomFrozenRowsHeight()),p=this.tableNoFrameHeight-(null!==(a=this.getRowsHeight(e+1,this.rowCount-1))&&void 0!==a?a:0)-g):this.isBottomFrozenRow(e)&&(g=this.tableNoFrameHeight-(null!==(h=this.getRowsHeight(e,this.rowCount-1))&&void 0!==h?h:0)),new Lw(Math.round(d),Math.round(g),Math.round(c),Math.round(p))}getCellsRectWidth(t,e,i,o){const n=this.isFrozenCell(t,e),r=this.isFrozenCell(i,o);let s=this.getColsWidth(t,i);if(n&&n.col){const e=this.scrollLeft;r&&r.col||(s-=e,s=Math.max(s,this.getColsWidth(t,this.frozenColCount-1)))}return s}getCellRangeRect(t){if(t.start)return this.getCellsRect(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRect(e.start.col,e.start.row,e.end.col,e.end.row)}getCellRangeRectWidth(t){if(t.start)return this.getCellsRectWidth(t.start.col,t.start.row,t.end.col,t.end.row);const e=this.getCellRange(t.col,t.row);return this.getCellsRectWidth(e.start.col,e.start.row,e.end.col,e.end.row)}isFrozenCell(t,e){const i=this.isFrozenRow(e),o=this.isFrozenColumn(t);return i||o?{row:i,col:o}:null}getRowAt(t){return wT(t,this)}getColAt(t){return xT(t,this)}getCellAt(t,e){return function(t,e,i){const o=wT(e,i),{row:n,top:r,bottom:s,height:l}=o,a=xT(t,i),{col:h,left:d,right:c,width:u}=a;return{row:n,col:h,rect:{left:d,right:c,top:r,bottom:s,width:u,height:l}}}(t,e,this)}getCellAtRelativePosition(t,e){return function(t,e,i){t-=i.tableX;let o=!1;(e-=i.tableY)>0&&e<i.getFrozenRowsHeight()&&(o=!0);let n=!1;t>0&&t<i.getFrozenColsWidth()&&(n=!0);let r=!1;e>i.tableNoFrameHeight-i.getBottomFrozenRowsHeight()&&e<i.tableNoFrameHeight&&e<=i.getAllRowsHeight()&&(r=!0);let s=!1;t>i.tableNoFrameWidth-i.getRightFrozenColsWidth()&&t<i.tableNoFrameWidth&&t<=i.getAllColsWidth()&&(s=!0);const l=AT(n||s?t:t+i.scrollLeft,s,i),a=RT(o||r?e:e+i.scrollTop,r,i);if(l&&a){const{row:t,top:e,bottom:i,height:o}=a,{col:n,left:r,right:s,width:h}=l;return{row:t,col:n,rect:{left:r,right:s,top:e,bottom:i,width:h,height:o}}}return{col:-1,row:-1}}(t,e,this)}_checkRowCol(t,e){return t>=0&&t<this.colCount&&e>=0&&e<this.rowCount}_makeVisibleCell(t,e){if(this._checkRowCol(t,e)){const i=this.isFrozenCell(t,e);if(i&&i.col&&i.row)return;const o=this.getCellRect(t,e),n=function(t){let e=0,i=0;t.frozenColCount>0&&(e=t.getFrozenColsWidth()),t.rightFrozenColCount>0&&(i=t.getRightFrozenColsWidth());let o=0,n=0;return t.frozenRowCount>0&&(o=t.getFrozenRowsHeight()),t.bottomFrozenRowCount>0&&(n=t.getBottomFrozenRowsHeight()),new Lw(t.scrollLeft+e,t.scrollTop+o,t.tableNoFrameWidth-e-i,t.tableNoFrameHeight-o-n)}(this);if(n.contains(o))return;i&&i.col||this.getColsWidth(0,this.frozenColCount-1)+o.width>this.canvas.width||(o.left<n.left?this.scrollLeft-=n.left-o.left:n.right<o.right&&(this.scrollLeft-=n.right-o.right)),i&&i.row||this.getRowsHeight(0,this.frozenRowCount-1)+o.height>this.canvas.height||(o.top<n.top?this.scrollTop-=n.top-o.top:n.bottom<o.bottom&&(this.scrollTop-=n.bottom-o.bottom))}}render(){this.scenegraph.renderSceneGraph()}renderAsync(){return this.scenegraph.updateNextFrame(),new Promise(((t,e)=>{setTimeout((()=>{t()}),0)}))}_toRelativeRect(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o,n,r,s;const l=t.copy(),a=this.getVisibleRect();return l.offsetLeft(this.tableX-(e?a.left:0)),l.offsetTop(this.tableY-(i?a.top:0)),l.offsetLeft(null!==(n=null===(o=this.options.viewBox)||void 0===o?void 0:o.x1)&&void 0!==n?n:0),l.offsetTop(null!==(s=null===(r=this.options.viewBox)||void 0===r?void 0:r.y1)&&void 0!==s?s:0),l}getVisibleRect(){const{scrollTop:t,scrollLeft:e}=this,i=this.tableNoFrameWidth,o=this.tableNoFrameHeight;return new Lw(e,t,i,o)}get visibleRowCount(){const{frozenRowCount:t}=this,e=this.getVisibleRect(),i=t>0?e.top+this.getRowsHeight(0,t-1):e.top,o=this.getTargetRowAt(i);if(!o)return 0;const n=Math.max(o.top>=i?o.row:o.row+1,t);let r=this.getRowsHeight(0,n-1),s=0;const{rowCount:l}=this;for(let t=n;t<l;t++){const i=r+this.getRowHeight(t);if(e.bottom<i)break;s++,r=i}return s}getBodyVisibleCellRange(){const{scrollTop:t,scrollLeft:e}=this,i=this.getFrozenRowsHeight(),o=this.getFrozenColsWidth(),n=this.getBottomFrozenRowsHeight(),r=this.getRightFrozenColsWidth(),{row:s}=this.getRowAt(t+i+1),{col:l}=this.getColAt(e+o+1),a=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-n).row:this.rowCount-1,h=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(e+this.tableNoFrameWidth-1-r).col:this.colCount-1;return h<0||a<0?null:{rowStart:s,colStart:l,rowEnd:a,colEnd:h}}getBodyVisibleRowRange(){const{scrollTop:t}=this,e=this.getFrozenRowsHeight(),i=this.getBottomFrozenRowsHeight(),{row:o}=this.getRowAt(t+e+1),n=this.getAllRowsHeight()>this.tableNoFrameHeight?this.getRowAt(t+this.tableNoFrameHeight-1-i).row:this.rowCount-1;return n<0?null:{rowStart:o,rowEnd:n}}getBodyVisibleColRange(){const{scrollLeft:t}=this,e=this.getFrozenColsWidth(),i=this.getRightFrozenColsWidth(),{col:o}=this.getColAt(t+e+1),n=this.getAllColsWidth()>this.tableNoFrameWidth?this.getColAt(t+this.tableNoFrameWidth-1-i).col:this.colCount-1;return n<0?null:{colStart:o,colEnd:n}}get visibleColCount(){const{frozenColCount:t}=this,e=this.getVisibleRect(),i=t>0?e.left+this.getColsWidth(0,t-1):e.left,o=this.getTargetColAt(i);if(!o)return 0;const n=Math.max(o.left>=i?o.col:o.col+1,t);let r=this.getColsWidth(0,n-1),s=0;const{colCount:l}=this;for(let t=n;t<l;t++){const i=r+this.getColWidth(t);if(e.right<i)break;s++,r=i}return s}get scrollTop(){return this.stateManager.scroll.verticalBarPos}set scrollTop(t){this.stateManager.setScrollTop(t)}get scrollLeft(){return this.stateManager.scroll.horizontalBarPos}set scrollLeft(t){this.stateManager.setScrollLeft(t)}getScrollLeft(){return this.scrollLeft}getScrollTop(){return this.scrollTop}setScrollLeft(t){this.scrollLeft=Math.ceil(t)}setScrollTop(t){this.scrollTop=Math.ceil(t)}getCellOverflowText(t,e){return this.scenegraph.getCellOverflowText(t,e)}addReleaseObj(t){if(!t||!t.release||"function"!=typeof t.release)throw new Error("not releaseObj!");(this.internalProps.releaseList=this.internalProps.releaseList||[]).push(t)}dispose(){this.release()}release(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f;const v=this.internalProps;if(this.isReleased)return;null===(e=null===(t=v.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),null===(o=null===(i=v.menuHandler)||void 0===i?void 0:i.release)||void 0===o||o.call(i),O_.clearAll(),null===(n=super.release)||void 0===n||n.call(this),null===(s=null===(r=v.handler)||void 0===r?void 0:r.release)||void 0===s||s.call(r),this.eventManager.release(),null===(a=null===(l=v.focusControl)||void 0===l?void 0:l.release)||void 0===a||a.call(l),null===(h=v.legends)||void 0===h||h.forEach((t=>{null==t||t.release()})),null===(d=v.title)||void 0===d||d.release(),v.title=null,null===(c=v.emptyTip)||void 0===c||c.release(),v.emptyTip=null,v.layoutMap.release(),v.releaseList&&(v.releaseList.forEach((t=>{var e;return null===(e=null==t?void 0:t.release)||void 0===e?void 0:e.call(t)})),v.releaseList=null),this.scenegraph.stage.release(),this.scenegraph.proxy.release(),v.focusControl.release();const{parentElement:m}=v.element;m&&!this.options.canvas&&m.removeChild(v.element),null===(p=null===(g=null===(u=this.editorManager)||void 0===u?void 0:u.editingEditor)||void 0===g?void 0:g.onEnd)||void 0===p||p.call(g),this.isReleased=!0,this.scenegraph=null,this.internalProps=null,null===(f=this.reactCustomLayout)||void 0===f||f.clearCache()}fireListeners(t,e){return super.fireListeners(t,e)}updateOption(t){var e,i,o,n,r,s,l,a,h,d,c,u;this.options=t,this._hasAutoImageColumn=void 0;const{frozenColCount:g=0,defaultRowHeight:p=40,defaultHeaderRowHeight:f,defaultColWidth:v=80,defaultHeaderColWidth:m=80,keyboardOptions:b,eventOptions:C,rowSeriesNumber:y,columnResizeMode:w,rowResizeMode:x="none",dragHeaderMode:_,showFrozenIcon:S,allowFrozenColCount:A,padding:R,hover:B,menu:M,select:T,pixelRatio:P,widthMode:E,heightMode:k,autoFillWidth:L,autoFillHeight:H,widthAdaptiveMode:F,heightAdaptiveMode:z,customRender:I,renderChartAsync:O,renderChartAsyncBatchCount:D,overscrollBehavior:W,limitMinWidth:N,limitMinHeight:G}=t;P&&P!==this.internalProps.pixelRatio&&(this.internalProps.pixelRatio=P),R&&("number"==typeof R?(this.padding.top=R,this.padding.left=R,this.padding.bottom=R,this.padding.right=R):(R.top&&(this.padding.top=R.top),R.bottom&&(this.padding.bottom=R.bottom),R.left&&(this.padding.left=R.left),R.right&&(this.padding.right=R.right))),this.showFrozenIcon="boolean"!=typeof S||S,"number"==typeof A&&A<=0&&(this.showFrozenIcon=!1),this.widthMode=null!=E?E:"standard",this.heightMode=null!=k?k:"standard",this._widthAdaptiveMode=null!=F?F:"only-body",this._heightAdaptiveMode=null!=z?z:"only-body",this.autoFillWidth=null!=L&&L,this.autoFillHeight=null!=H&&H,this.customRender=I;const j=this.internalProps;if("node"===Oy.mode||t.canvas||function(t,e){var i,o;t.style.margin=`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;const n=(t.offsetWidth||(null===(i=t.parentElement)||void 0===i?void 0:i.offsetWidth)||1)-1,r=(t.offsetHeight||(null===(o=t.parentElement)||void 0===o?void 0:o.offsetHeight)||1)-1;t.style.width=n&&n-e.left-e.right+"px"||"0px",t.style.height=r&&r-e.top-e.bottom+"px"||"0px"}(j.element,this.padding),this.columnWidthComputeMode=null!==(e=t.columnWidthComputeMode)&&void 0!==e?e:"normal",j.frozenColCount=g,j.defaultRowHeight=p,j.defaultHeaderRowHeight=null!=f?f:p,j.defaultColWidth=v,j.defaultHeaderColWidth=null!=m?m:v,j.keyboardOptions=b,j.eventOptions=C,j.rowSeriesNumber=y,j.columnResizeMode=w,j.rowResizeMode=x,j.dragHeaderMode=null!=_?_:"none",j.renderChartAsync=O,YA(D),j.overscrollBehavior=null!=W?W:"auto",j.cellTextOverflows={},j._rowHeightsMap=new pT(this),j._rowRangeHeightsMap=new Map,j._colRangeWidthsMap=new Map,j._widthResizedColMap=new Set,j._heightResizedRowMap=new Set,this.colWidthsMap=new kw,this.colContentWidthsMap=new kw,this.colWidthsLimit={},j.stick.changedCells.clear(),j.theme=ox.of(null!==(i=t.theme)&&void 0!==i?i:ox.DEFAULT),j.theme.isPivot=this.isPivotTable(),hS(j.theme.functionalIconsStyle),this.scenegraph.updateStageBackground(),j.autoWrapText=t.autoWrapText,j.enableLineBreak=t.enableLineBreak,j.allowFrozenColCount=null!==(o=t.allowFrozenColCount)&&void 0!==o?o:0,j.limitMaxAutoWidth=null!==(n=t.limitMaxAutoWidth)&&void 0!==n?n:450,j.limitMinWidth=null!=N?"number"==typeof N?N:N?10:0:10,j.limitMinHeight=null!=G?"number"==typeof G?G:G?10:0:10,null===(r=j.legends)||void 0===r||r.forEach((t=>{null==t||t.release()})),null===(s=j.title)||void 0===s||s.release(),j.title=null,null===(l=j.emptyTip)||void 0===l||l.release(),j.emptyTip=null,j.layoutMap.release(),this.scenegraph.clearCells(),this.scenegraph.updateComponent(),this.stateManager.updateOptionSetState(),this._updateSize(),this.eventManager.updateEventBinder(),t.legends){j.legends=[];const e=rx.getFunction("createLegend");if(Array.isArray(t.legends)){for(let i=0;i<t.legends.length;i++)j.legends.push(e(t.legends[i],this));this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}else j.legends.push(e(t.legends,this)),this.scenegraph.tableGroup.setAttributes({x:this.tableX,y:this.tableY})}if(j.tooltip=Object.assign({parentElement:this.getElement(),renderMode:"html",isShowOverflowTextTooltip:!1,confine:!0},t.tooltip),"html"===j.tooltip.renderMode&&!j.tooltipHandler){const t=rx.getComponent("tooltipHandler");j.tooltipHandler=new t(this,j.tooltip.confine)}if(j.menu=Object.assign({renderMode:"html"},t.menu),Array.isArray(null===(a=t.menu)||void 0===a?void 0:a.dropDownMenuHighlight)&&this.setDropDownMenuHighlight(null===(h=t.menu)||void 0===h?void 0:h.dropDownMenuHighlight),Array.isArray(null===(d=t.menu)||void 0===d?void 0:d.defaultHeaderMenuItems)&&(this.globalDropDownMenu=t.menu.defaultHeaderMenuItems),"html"===j.menu.renderMode&&!j.menuHandler){const t=rx.getComponent("menuHandler");j.menuHandler=new t(this)}this.clearCellStyleCache(),this.clearColWidthCache(),this.clearRowHeightCache(),j.customMergeCell=t.customMergeCell,this.customCellStylePlugin.updateCustomCell(null!==(c=t.customCellStyle)&&void 0!==c?c:[],null!==(u=t.customCellStyleArrangement)&&void 0!==u?u:[])}renderWithRecreateCells(){const t={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(t.col,t.row),this.render()}getFrozenRowsHeight(){return this.getRowsHeight(0,this.frozenRowCount-1)}getFrozenColsWidth(){return this.getColsWidth(0,this.frozenColCount-1)}getBottomFrozenRowsHeight(){if(this.bottomFrozenRowCount>0){let t=0;for(let e=this.rowCount-this.bottomFrozenRowCount;e<=this.rowCount-1;e++)t+=this.getRowHeight(e);return t}return 0}getRightFrozenColsWidth(){if(this.rightFrozenColCount>0){let t=0;for(let e=this.colCount-this.rightFrozenColCount;e<=this.colCount-1;e++)t+=this.getColWidth(e);return t}return 0}getDrawRange(){const t=Math.min(this.tableNoFrameWidth,this.getAllColsWidth()),e=Math.min(this.tableNoFrameHeight,this.getAllRowsHeight());return new Lw(this.tableX,this.tableY,t,e)}_getMouseAbstractPoint(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i,o,n,r;let s;if(!t)return{inTable:!1,x:void 0,y:void 0};s=VT(t)?t.changedTouches[0]:t;const l=s.clientX||s.pageX+window.scrollX,a=s.clientY||s.pageY+window.scrollY,h=this.internalProps.canvas.getBoundingClientRect();let d=!0;h.right<=l&&(d=!1),h.bottom<=a&&(d=!1);const c=h.width,u=c/(this.canvas.offsetWidth||c),g=h.height,p=g/(this.canvas.offsetHeight||g),f={x:(l-h.left)/u+(e?this.scrollLeft:0)-(null!==(o=null===(i=this.options.viewBox)||void 0===i?void 0:i.x1)&&void 0!==o?o:0),y:(a-h.top)/p+(e?this.scrollTop:0)-(null!==(r=null===(n=this.options.viewBox)||void 0===n?void 0:n.y1)&&void 0!==r?r:0),inTable:d};return this.internalProps.modifiedViewBoxTransform&&this.scenegraph.stage.window.getViewBoxTransform()&&this.scenegraph.stage.window.getViewBoxTransform().transformPoint(f,f),f}getTheme(){return this.internalProps.theme}getTargetColAt(t){return _T(t,this)}getTargetRowAt(t){const e=ST(t,this);return e&&(e.row=Math.min(e.row,this.rowCount-1)),e}getTargetColAtConsiderRightFrozen(t,e){return AT(t,e,this)}getTargetRowAtConsiderBottomFrozen(t,e){return RT(t,e,this)}clearSelected(){this.stateManager.updateSelectPos(-1,-1)}selectCell(t,e,i,o){let n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];var l;const a=!!(null===(l=this.stateManager.select.ranges)||void 0===l?void 0:l.length);this.stateManager.updateSelectPos(t,e,i,o,!1,!n,r,s),this.stateManager.endSelectCells(!0,a)}selectCells(t){const{scrollLeft:e,scrollTop:i}=this;t.forEach(((t,e)=>{t.start.col===t.end.col&&t.start.row===t.end.row?this.stateManager.updateSelectPos(t.start.col,t.start.row,!1,e>=1,!1,!1,!0):(this.stateManager.updateSelectPos(t.start.col,t.start.row,!1,e>=1,!1,!1,!0),this.stateManager.updateInteractionState(fy.grabing),this.stateManager.updateSelectPos(t.end.col,t.end.row,!1,e>=1,!1,!1,!0)),this.stateManager.endSelectCells(!1,!1),this.stateManager.updateInteractionState(fy.default)})),this.setScrollTop(i),this.setScrollLeft(e)}get recordsCount(){var t;return null===(t=this.records)||void 0===t?void 0:t.length}get allowFrozenColCount(){return this.internalProps.allowFrozenColCount}get rowHeaderLevelCount(){return this.internalProps.layoutMap.rowHeaderLevelCount}get columnHeaderLevelCount(){return this.internalProps.layoutMap.columnHeaderLevelCount}get records(){return this.internalProps.records}get dataSource(){return this.internalProps.dataSource}set dataSource(t){this.scenegraph.clearCells(),v_(this,t),this.refreshRowColCount(),this.scenegraph.createSceneGraph(),this.render()}get autoWrapText(){return this.internalProps.autoWrapText}set autoWrapText(t){this.internalProps.autoWrapText=t,this.options.autoWrapText=t}get enableLineBreak(){return this.internalProps.enableLineBreak}set enableLineBreak(t){this.internalProps.enableLineBreak=t,this.options.enableLineBreak=t}updateAutoWrapText(t){this.internalProps.autoWrapText!==t&&(this.internalProps.autoWrapText=t,this.options.autoWrapText=t,this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.render())}get theme(){return this.internalProps.theme}set theme(t){this.internalProps.theme=ox.of(null!=t?t:ox.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),this.options.theme=t,hS(this.internalProps.theme.functionalIconsStyle)}updateTheme(t){const e={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.theme=ox.of(null!=t?t:ox.DEFAULT),this.internalProps.theme.isPivot=this.isPivotTable(),hS(this.internalProps.theme.functionalIconsStyle),this.options.theme=t,this.scenegraph.updateComponent(),this.scenegraph.updateStageBackground(),this.scenegraph.clearCells(),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(e.col,e.row),this.render()}getBodyField(t,e){return this.internalProps.layoutMap.getBody(t,e).field}getBodyColumnDefine(t,e){const i=this.internalProps.layoutMap.getBody(t,e);return null==i?void 0:i.define}getBodyColumnType(t,e){var i,o;return fS("cellType",{cellType:null!==(o=null===(i=this.internalProps.layoutMap.getBody(t,e))||void 0===i?void 0:i.cellType)&&void 0!==o?o:"text"},t,e,this)}getCellType(t,e){let i;return this.isSeriesNumberInHeader(t,e)?this.internalProps.layoutMap.getSeriesNumberHeader(t,e).cellType:(i=this.isHeader(t,e)?this.internalProps.layoutMap.getHeader(t,e).headerType:this.internalProps.layoutMap.getBody(t,e).cellType,fS("cellType",{cellType:i},t,e,this))}getHeaderField(t,e){return this.internalProps.layoutMap.getHeaderField(t,e)}getHeaderDefine(t,e){const i=this.internalProps.layoutMap.getHeader(t,e);return null==i?void 0:i.define}getCellLocation(t,e){return this.internalProps.layoutMap.getCellLocation(t,e)}getCellHeaderPaths(t,e){return this.internalProps.layoutMap.getCellHeaderPaths(t,e)}getHeadersDefine(t,e){const i=[];for(;;){const o=this.getHeaderDefine(t,e);if(!o||!o.field&&!o.columns)break;i.push(o),e++}return i}_getHeaderLayoutMap(t,e){return this.internalProps.layoutMap.getHeader(t,e)}_getBodyLayoutMap(t,e){return this.internalProps.layoutMap.getBody(t,e)}getContext(){return this.internalProps.context}getRecordByCell(t,e){if(!this.internalProps.layoutMap.isHeader(t,e))return this.getCellOriginRecord(t,e)}getRecordByRowCol(t,e){return this.getRecordByCell(t,e)}getRecordStartRowByRecordIndex(t){return this.internalProps.layoutMap.getRecordStartRowByRecordIndex(t)}_getHeaderCellBySortState(t){const{layoutMap:e}=this.internalProps,i=e.headerObjects.find((e=>e&&e.field===t.field));if(i)return e.getHeaderCellAdressById(i.id)}getCellRange(t,e){var i;if(this.internalProps.customMergeCell){const i=this.internalProps.customMergeCell(t,e,this);if(i&&i.range&&(K(i.text)||i.customLayout||i.customRender))return i.range}return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.getCellRange(t,e)}hasCustomMerge(){return!!this.internalProps.customMergeCell}getCustomMerge(t,e){if(this.internalProps.customMergeCell){const i=this.internalProps.customMergeCell(t,e,this);if(i&&i.range&&(K(i.text)||i.customLayout||this.customRender)){if(i.style){const o=this.internalProps.bodyHelper.getStyleClass("text"),n=Iy(i.style,this.theme.bodyStyle,{col:t,row:e,table:this,value:i.text,dataValue:this.getCellOriginValue(t,e),cellHeaderPaths:this.getCellHeaderPaths(t,e)},o,this.options.autoWrapText,this.theme);i.style=n}return i}}}isCellRangeEqual(t,e,i,o){return this.internalProps.layoutMap.isCellRangeEqual(t,e,i,o)}_getLayoutCellId(t,e){return this.internalProps.layoutMap.getCellId(t,e)}getHeaderDescription(t,e){var i;const o=this._getHeaderLayoutMap(t,e),n=null==o?void 0:o.define,r=null!==(i=null==n?void 0:n.description)&&void 0!==i?i:null==o?void 0:o.description;return"function"==typeof r?r({col:t,row:e,value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e)}):r}setDropDownMenuHighlight(t){this.stateManager.setDropDownMenuHighlight(t)}_dropDownMenuIsHighlight(t,e,i){return this.stateManager.dropDownMenuIsHighlight(t,e,i)}isSeriesNumberInBody(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInBody(t,e)}isSeriesNumberInHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isSeriesNumberInHeader(t,e)}isHeader(t,e){return this.internalProps.layoutMap&&this.internalProps.layoutMap.isHeader(t,e)}isColumnHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isColumnHeader(t,e)}isRowHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isRowHeader(t,e)}isCornerHeader(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isCornerHeader(t,e)}isFrozenColumn(t,e){return this.isLeftFrozenColumn(t,e)||this.isRightFrozenColumn(t,e)}isLeftFrozenColumn(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isFrozenColumn(t,e)}isRightFrozenColumn(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isRightFrozenColumn(t,e)}isFrozenRow(t,e){return this.isTopFrozenRow(t,e)||this.isBottomFrozenRow(t,e)}isTopFrozenRow(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isFrozenRow(t,e)}isBottomFrozenRow(t,e){var i;return null===(i=this.internalProps.layoutMap)||void 0===i?void 0:i.isBottomFrozenRow(t,e)}getCellInfo(t,e){if(t>=0&&e>=0){const i=this.isHeader(t,e)?this.getHeaderDefine(t,e):this.getBodyColumnDefine(t,e);return{col:t,row:e,field:this.getHeaderField(t,e),cellHeaderPaths:this.internalProps.layoutMap.getCellHeaderPaths(t,e),title:null==i?void 0:i.title,cellType:this.getCellType(t,e),originData:this.getCellOriginRecord(t,e),cellRange:this.getCellRangeRelativeRect({col:t,row:e}),value:this.getCellValue(t,e),dataValue:this.getCellOriginValue(t,e),cellLocation:this.getCellLocation(t,e),scaleRatio:this.canvas.getBoundingClientRect().width/this.canvas.offsetWidth}}}_hasField(t,e,i){var o;if(null===t)return!1;if(this.internalProps.layoutMap.isHeader(e,i))return!1;const n=this.getRecordShowIndexByCell(e,i);return null===(o=this.internalProps.dataSource)||void 0===o?void 0:o.hasField(n,t)}_getCellStyle(t,e){return function(t,e,i){var o,n,r,s,l,a,h,d,c;const u=i.customCellStylePlugin.getCustomCellStyle(t,e),{layoutMap:g}=i.internalProps;if(g.isHeader(t,e)){let l;if(!i.isPivotTable()||i.isBottomFrozenRow(e)||i.isRightFrozenColumn(t))l=`${t}-${e}`;else{const o=i.getHeaderDefine(t,e),n=i.isCornerHeader(t,e);l=(null==o?void 0:o.dimensionKey)?n?`dim-cor-${o.dimensionKey}`:`dim-${o.dimensionKey}`:(null==o?void 0:o.indicatorKey)?`ind-${o.indicatorKey}`:`${t}-${e}`}let a=i.headerStyleCache.get(l);if(a)return u?bT(a,u):a;const h=g.getHeader(t,e);let d;if(i.isPivotChart()&&function(t,e,i){if(!i._table.isPivotChart())return!1;if(i.indicatorsAsCol){if(i.hasTwoIndicatorAxes&&e===i.columnHeaderLevelCount-1&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0;if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0}else if(e===i.rowCount-i.bottomFrozenRowCount&&t>=i.rowHeaderLevelCount&&t<i.colCount-i.rightFrozenColCount)return!0;return!1}(t,e,g)&&g.isAxisCell(t,e)?d=null!==(n=null===(o=g.getBody(t,i.rowHeaderLevelCount).style)||void 0===o?void 0:o.padding)&&void 0!==n?n:i.theme.bodyStyle.padding:i.isPivotChart()&&function(t,e,i){if(!i._table.isPivotChart())return!1;if(i.indicatorsAsCol){if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0}else{if(t===i.rowHeaderLevelCount-1&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0;if(t===i.colCount-i.rightFrozenColCount&&e>=i.columnHeaderLevelCount&&e<i.rowCount-i.bottomFrozenRowCount)return!0}return!1}(t,e,g)&&g.isAxisCell(t,e)&&(d=null!==(s=null===(r=g.getBody(i.columnHeaderLevelCount,e).style)||void 0===r?void 0:r.padding)&&void 0!==s?s:i.theme.bodyStyle.padding),(!h||h.isEmpty)&&(g.isLeftBottomCorner(t,e)||g.isRightBottomCorner(t,e)||g.isCornerHeader(t,e)||g.isRightTopCorner(t,e)))return NT;const c=i.internalProps.headerHelper.getStyleClass((null==h?void 0:h.headerType)||"text");if(g.isBottomFrozenRow(t,e)&&i.theme.bottomFrozenStyle)a=cT(d?{padding:d}:{},i.theme.bottomFrozenStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme);else if(g.isRightFrozenColumn(t,e)&&i.theme.rightFrozenStyle)a=cT(d?{padding:d}:{},i.theme.rightFrozenStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme);else{const o=(null==h?void 0:h.style)||{};d&&(o.padding=d),a=cT(o,g.isColumnHeader(t,e)||g.isBottomFrozenRow(t,e)?i.theme.headerStyle:g.isRowHeader(t,e)||g.isRightFrozenColumn(t,e)?i.theme.rowHeaderStyle:i.theme.cornerHeaderStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},c,i.options.autoWrapText,i.theme)}return i.headerStyleCache.set(l,a),u?bT(a,u):a}let p,f;(null===(a=null===(l=i.internalProps)||void 0===l?void 0:l.dataConfig)||void 0===a?void 0:a.mappingRules)&&!i.isHeader(t,e)&&(null===(c=null===(d=null===(h=i.internalProps)||void 0===h?void 0:h.dataConfig)||void 0===d?void 0:d.mappingRules)||void 0===c||c.forEach(((o,n)=>{o.bgColor&&i.internalProps.layoutMap.getIndicatorKey(t,e)===o.bgColor.indicatorKey&&(p=o.bgColor.mapping)})));const v=i.getCellType(t,e),m=i.getCellOriginRecord(t,e);let b;if(f=(null==m?void 0:m.vtableMerge)?"merge-title":i.isSeriesNumberInBody(t,e)?`${t}-series-`+v:i.isListTable()&&!i.transpose||i.isPivotTable()&&i.internalProps.layoutMap.indicatorsAsCol?t+v:e+v,b=(null==m?void 0:m.vtableMerge)?i.bodyMergeTitleCache.get(f):g.isBottomFrozenRow(e)?i.bodyBottomStyleCache.get(f):i.bodyStyleCache.get(f),b)return u?bT(b,u):b;const C=g.getBody(t,e),y=i.internalProps.bodyHelper.getStyleClass(i.getCellType(t,e)),w=null==C?void 0:C.style;return b=Iy(w,(null==m?void 0:m.vtableMerge)&&i.theme.groupTitleStyle?i.theme.groupTitleStyle:g.isBottomFrozenRow(e)&&i.theme.bottomFrozenStyle?i.theme.bottomFrozenStyle:g.isRightFrozenColumn(t)&&i.theme.rightFrozenStyle?i.theme.rightFrozenStyle:i.theme.bodyStyle,{col:t,row:e,table:i,value:i.getCellValue(t,e),dataValue:i.getCellOriginValue(t,e),cellHeaderPaths:i.getCellHeaderPaths(t,e)},y,i.options.autoWrapText,i.theme),p&&(b=bT(b,{bgColor:p})),Y(w)||(g.isBottomFrozenRow(e)?i.bodyBottomStyleCache.set(f,b):i.bodyStyleCache.set(f,b)),u?bT(b,u):b}(t,e,this)}clearCellStyleCache(){this.headerStyleCache.clear(),this.bodyStyleCache.clear(),this.bodyMergeTitleCache.clear(),this.bodyBottomStyleCache.clear()}clearRowHeightCache(){this.internalProps._rowHeightsMap.clear(),this._clearRowRangeHeightsMap()}clearColWidthCache(){this.internalProps._colWidthsMap.clear(),this._clearColRangeWidthsMap()}_canResizeColumn(t,e){if(!(t>=0&&e>=0))return!1;if(this.isCellRangeEqual(t,e,t+1,e))return!1;if("none"===this.internalProps.columnResizeMode)return!1;if("header"===this.internalProps.columnResizeMode){if(!this.isHeader(t,e))return!1}else if("body"===this.internalProps.columnResizeMode&&this.isHeader(t,e))return!1;const i=this.colWidthsLimit[t];return!(i&&i.min&&i.max)||i.max!==i.min}_canResizeRow(t,e){if(!(t>=0&&e>=0))return!1;if(this.isCellRangeEqual(t,e,t,e+1))return!1;if("none"===this.internalProps.rowResizeMode)return!1;if("header"===this.internalProps.rowResizeMode){if(!this.isHeader(t,e))return!1}else if("body"===this.internalProps.rowResizeMode&&this.isHeader(t,e))return!1;return!0}_canDragHeaderPosition(t,e){var i,o;if(this.isHeader(t,e)&&(this.stateManager.isSelected(t,e)||(null===(i=this.options.select)||void 0===i?void 0:i.disableHeaderSelect)||(null===(o=this.options.select)||void 0===o?void 0:o.disableSelect))){if("disabled"===this.internalProps.frozenColDragHeaderMode&&this.isFrozenColumn(t))return!1;if(this.stateManager.isSelected(t,e)){const i=this.stateManager.select.ranges[0];if(this.isColumnHeader(t,e)){if(i.end.row!==this.rowCount-1)return!1}else{if(!this.isRowHeader(t,e))return!1;if(i.end.col!==this.colCount-1)return!1}}const i=this.getHeaderDefine(t,e);if(!i)return!1;if(void 0===i.dragHeader){if("all"===this.internalProps.dragHeaderMode)return!0;if("column"===this.internalProps.dragHeaderMode){if(this.isColumnHeader(t,e))return!0}else if("row"===this.internalProps.dragHeaderMode&&this.isRowHeader(t,e))return!0;return!1}return i.dragHeader}return!1}getCellIcons(t,e){var i,o,n;let r;if(this.isHeader(t,e))r=this.internalProps.headerHelper.getIcons(t,e);else if(this.internalProps.layoutMap.isSeriesNumber(t,e)){this.options.groupBy&&(null===(i=this.getCellRawRecord(t,e))||void 0===i?void 0:i.vtableMerge)||(null===(n=null===(o=this.internalProps.layoutMap.getSeriesNumberBody(t,e))||void 0===o?void 0:o.define)||void 0===n?void 0:n.dragOrder)&&(r=this.internalProps.rowSeriesNumberHelper.getIcons(t,e));const s=this.getCellValue(t,e),l=this.getCellOriginValue(t,e),a=this.internalProps.context,h=this.internalProps.bodyHelper.getIcons(t,e,s,l,a);(null==r?void 0:r.length)>0?r=r.concat(h):(null==h?void 0:h.length)>0&&(r=h)}else{const i=this.getCellValue(t,e),o=this.getCellOriginValue(t,e),n=this.internalProps.context;r=this.internalProps.bodyHelper.getIcons(t,e,i,o,n)}return r}showDropDownMenu(t,e,i){let o="dropdown-menu";i&&(o=Array.isArray(i.content)?"dropdown-menu":"container"),"html"===this.internalProps.menu.renderMode&&(this.stateManager.menu.isShow=!0,this.internalProps.menuHandler._bindToCell(t,e,o,i))}showTooltip(t,e,i){"html"===this.internalProps.tooltip.renderMode&&this.internalProps.tooltipHandler._bindToCell(t,e,i)}getCellStyle(t,e){const i=this._getCellStyle(t,e),o=b_(i,this,t,e,fS).theme,{autoWrapText:n,lineClamp:r,textOverflow:s}=i;return{textAlign:o.text.textAlign,textBaseline:o.text.textBaseline,bgColor:$(o.group.fill)?fS("bgColor",i,t,e,this):o.group.fill,color:$(o.text.fill)?fS("color",i,t,e,this):o.text.fill,strokeColor:$(o.text.stroke)?fS("strokeColor",i,t,e,this):o.text.stroke,fontFamily:o.text.fontFamily,fontSize:o.text.fontSize,fontWeight:o.text.fontWeight,fontVariant:o.text.fontVariant,fontStyle:o.text.fontStyle,lineHeight:o.text.lineHeight,autoWrapText:null!=n&&n,lineClamp:null!=r?r:"auto",textOverflow:s,borderColor:$(o.group.stroke)?fS("borderColor",i,t,e,this):o.group.stroke,borderLineWidth:o.group.lineWidth,borderLineDash:o.group.lineDash,underline:!!o.text.underline,underlineDash:o.text.underlineDash,underlineOffset:o.text.underlineOffset,lineThrough:!!o.text.lineThrough,padding:o._vtable.padding,underlineWidth:o.text.underline,lineThroughLineWidth:o.text.lineThrough,_strokeArrayWidth:o.group.strokeArrayWidth,_strokeArrayColor:o.group.strokeArrayColor,_linkColor:fS("linkColor",i,t,e,this)}}getAllBodyCells(t,e){const i=this.rowHeaderLevelCount,o=this.columnHeaderLevelCount,n=this.colCount-1,r=this.rowCount-1;return Array(Math.min(null!=e?e:2e3,r-o+1,this.rowCount)).fill(0).map(((e,r)=>Array(Math.min(null!=t?t:2e3,n-i+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+i,r+o)))))}getAllCells(t,e){const i=this.colCount-1,o=this.rowCount-1;return Array(Math.min(null!=e?e:2e3,o-0+1,this.rowCount)).fill(0).map(((e,o)=>Array(Math.min(null!=t?t:2e3,i-0+1,this.colCount)).fill(0).map(((t,e)=>this.getCellInfo(e+0,o+0)))))}getAllColumnHeaderCells(){const t=this.rowHeaderLevelCount,e=this.colCount-1,i=this.columnHeaderLevelCount-1;return Array(i-0+1).fill(0).map(((i,o)=>Array(e-t+1).fill(0).map(((e,i)=>this.getCellInfo(i+t,o+0)))))}getAllRowHeaderCells(){const t=this.columnHeaderLevelCount,e=this.rowHeaderLevelCount-1,i=this.rowCount-1;return Array(i-t+1).fill(0).map(((i,o)=>Array(e-0+1).fill(0).map(((e,i)=>this.getCellInfo(i+0,o+t)))))}getCopyValue(){var t,e,i;if((null===(e=null===(t=this.stateManager.select)||void 0===t?void 0:t.ranges)||void 0===e?void 0:e.length)>0){const t=this.stateManager.select.ranges;let e=Math.min(t[0].start.col,t[0].end.col),o=Math.max(t[0].start.col,t[0].end.col),n=Math.min(t[0].start.row,t[0].end.row),r=Math.max(t[0].start.row,t[0].end.row);t.forEach((t=>{e=Math.min(e,t.start.col,t.end.col),o=Math.max(o,t.start.col,t.end.col),n=Math.min(n,t.start.row,t.end.row),r=Math.max(r,t.start.row,t.end.row)}));const s=e=>{let i=!1;return t.forEach((t=>{const o=Math.min(t.start.row,t.end.row),n=Math.max(t.start.row,t.end.row);o<=e&&n>=e&&(i=!0)})),i},l=e=>{let i=!1;return t.forEach((t=>{const o=Math.min(t.start.col,t.end.col),n=Math.max(t.start.col,t.end.col);o<=e&&n>=e&&(i=!0)})),i},a=(e,i)=>{let o;return t.forEach((t=>{const n=Math.min(t.start.row,t.end.row),r=Math.max(t.start.row,t.end.row),s=Math.min(t.start.col,t.end.col),l=Math.max(t.start.col,t.end.col);s<=e&&l>=e&&n<=i&&r>=i&&(o=t)})),o},h=(t,e,i)=>{const o=this.getCellRange(t,e);let n=o.start.col,r=o.start.row;if(i){const t=Math.min(i.start.col,i.end.col),e=Math.min(i.start.row,i.end.row);n=Math.max(t,o.start.col),r=Math.max(e,o.start.row)}return n!==t||r!==e?"":this.getCellValue(t,e)};let d="";for(let t=n;t<=r;t++)if(s(t)){for(let i=e;i<=o;i++)if(l(i)){const e=a(i,t);if(e){const n=h(i,t,e);if("undefined"!=typeof Promise&&n instanceof Promise);else{const t=K(n)?`${n}`:"";/^\[object .*\]$/.exec(t)||(d+=t)}(i<e.end.col||i<o)&&(d+="\t")}else d+="\t"}t<r&&(d+="\r\n")}return(null===(i=this.options)||void 0===i?void 0:i.formatCopyValue)&&(d=this.options.formatCopyValue(d)),d}return""}getSelectedCellInfos(){var t;if(!(null===(t=this.stateManager.select)||void 0===t?void 0:t.ranges))return null;const e=this.stateManager.select.ranges;if(!e.length)return[];let i=Math.min(e[0].start.col,e[0].end.col),o=Math.max(e[0].start.col,e[0].end.col),n=Math.min(e[0].start.row,e[0].end.row),r=Math.max(e[0].start.row,e[0].end.row);e.forEach((t=>{i=Math.min(i,t.start.col,t.end.col),o=Math.max(o,t.start.col,t.end.col),n=Math.min(n,t.start.row,t.end.row),r=Math.max(r,t.start.row,t.end.row)}));const s=t=>{let i=!1;return e.forEach((e=>{const o=Math.min(e.start.row,e.end.row),n=Math.max(e.start.row,e.end.row);o<=t&&n>=t&&(i=!0)})),i},l=t=>{let i=!1;return e.forEach((e=>{const o=Math.min(e.start.col,e.end.col),n=Math.max(e.start.col,e.end.col);o<=t&&n>=t&&(i=!0)})),i},a=(t,i)=>{let o;return e.forEach((e=>{const n=Math.min(e.start.row,e.end.row),r=Math.max(e.start.row,e.end.row),s=Math.min(e.start.col,e.end.col),l=Math.max(e.start.col,e.end.col);s<=t&&l>=t&&n<=i&&r>=i&&(o=e)})),o},h=[];for(let t=n;t<=r;t++)if(s(t)){const e=[];for(let n=i;n<=o;n++)if(l(n)&&a(n,t)){const i=this.getCellInfo(n,t);e.push(i)}h.push(e)}return h}getSelectedCellRanges(){const t=this.stateManager.select.ranges;return t.length?vt(t):[]}measureText(t,e){return JS.measureText(t,e)}measureTextBounds(t){return tA(t)}getCustomRender(t,e){let i;if("body"!==this.getCellLocation(t,e)){const o=this.getHeaderDefine(t,e);i=null==o?void 0:o.headerCustomRender}else{const o=this.getBodyColumnDefine(t,e);i=(null==o?void 0:o.customRender)||this.customRender}return i}getCustomLayout(t,e){let i;if("body"!==this.getCellLocation(t,e)){const o=this.getHeaderDefine(t,e);i=null==o?void 0:o.headerCustomLayout}else{const o=this.getBodyColumnDefine(t,e);i=null==o?void 0:o.customLayout}return i}hasAutoImageColumn(){return void 0===this._hasAutoImageColumn&&(this._hasAutoImageColumn=function(t){const{columns:e,rows:i,indicators:o}=t.options;if(t.isPivotTable()){if(et(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(!tt(i)&&("image"===i.headerType||"video"===i.headerType||"function"==typeof i.headerType)&&i.imageAutoSizing)return!0}if(et(i)&&i.length>0)for(let t=0;t<i.length;t++){const e=i[t];if(!tt(e)&&("image"===e.headerType||"video"===e.headerType||"function"==typeof e.headerType)&&e.imageAutoSizing)return!0}if(et(o)&&o.length>0)for(let t=0;t<o.length;t++){const e=o[t];if(!tt(e)&&(("image"===e.cellType||"video"===e.cellType||"function"==typeof e.cellType)&&e.imageAutoSizing||("image"===e.headerType||"video"===e.headerType||"function"==typeof e.headerType)&&e.imageAutoSizing))return!0}}else if(et(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(("image"===i.cellType||"video"===i.cellType||"function"==typeof i.cellType)&&i.imageAutoSizing||("image"===i.headerType||"video"===i.headerType||"function"==typeof i.headerType)&&i.imageAutoSizing)return!0}return!1}(this)),this._hasAutoImageColumn}_getActiveChartInstance(){var t,e,i,o,n,r;const s=this.scenegraph.getCell(null===(e=null===(t=this.stateManager.hover)||void 0===t?void 0:t.cellPos)||void 0===e?void 0:e.col,null===(o=null===(i=this.stateManager.hover)||void 0===i?void 0:i.cellPos)||void 0===o?void 0:o.row);return"chart"===(null===(r=null===(n=null==s?void 0:s.getChildren())||void 0===n?void 0:n[0])||void 0===r?void 0:r.type)?s.getChildren()[0].activeChartInstance:null}cellIsInVisualView(t,e){var i,o,n,r;const s=this.getDrawRange(),l=this.getCellRelativeRect(t,e);if(t<this.frozenColCount&&e<this.frozenRowCount)return!0;let a,h,d,c;if(this.frozenRowCount>=1&&(a=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.colCount-1,row:this.frozenRowCount-1}})),this.frozenColCount>=1&&(h=this.getCellRangeRelativeRect({start:{col:0,row:0},end:{col:this.frozenColCount-1,row:this.rowCount-1}})),this.bottomFrozenRowCount>=1&&(d=this.getCellRangeRelativeRect({start:{col:0,row:this.rowCount-this.bottomFrozenRowCount},end:{col:this.colCount-1,row:this.rowCount-1}})),this.rightFrozenColCount>=1&&(c=this.getCellRangeRelativeRect({start:{col:this.colCount-this.rightFrozenColCount,row:0},end:{col:this.colCount-1,row:this.rowCount-1}})),l.top>=s.top&&l.bottom<=s.bottom&&l.left>=s.left&&l.right<=s.right){if(this.isFrozenCell(t,e))return!0;if(l.top>=(null!==(i=null==a?void 0:a.bottom)&&void 0!==i?i:l.top)&&l.left>=(null!==(o=null==h?void 0:h.right)&&void 0!==o?o:l.left)&&l.bottom<=(null!==(n=null==d?void 0:d.top)&&void 0!==n?n:l.bottom)&&l.right<=(null!==(r=null==c?void 0:c.left)&&void 0!==r?r:l.right))return!0}return!1}getCustomMergeValue(t,e){if(this.internalProps.customMergeCell){const i=this.getCustomMerge(t,e);if(i){const{text:t}=i;return t}}}exportImg(){return this.scenegraph.stage.toCanvas().toDataURL()}exportCellImg(t,e,i){var o,n,r,s;const l=this.cellIsInVisualView(t,e),{scrollTop:a,scrollLeft:h}=this;l||this.scrollToCell({col:t,row:e});const d=this.getCellRelativeRect(t,e);(null===(n=null===(o=this.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===n?void 0:n.length)>0&&RB(this.scenegraph);const{col:c,row:u}=this.stateManager.hover.cellPos;let g,p;if(this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.tableGroup.border.setAttribute("visible",!1),null==i?void 0:i.disableBackground){const i=this.scenegraph.getCell(t,e);g=i.attribute.fill,i.setAttribute("fill","transparent")}if(null==i?void 0:i.disableBorder){const i=this.scenegraph.getCell(t,e);p=i.attribute.stroke,i.setAttribute("stroke",!1)}this.scenegraph.renderSceneGraph();let f=0;"bottom-right"===this.theme.cellBorderClipDirection&&(f=1);const v=this.scenegraph.stage.toCanvas(!1,(new Le).set(d.left+this.tableX+1,d.top+this.tableY+1,d.right+this.tableX-f,d.bottom+this.tableY-f));return l||(this.setScrollTop(a),this.setScrollLeft(h)),this.scenegraph.tableGroup.border.setAttribute("visible",!0),g&&this.scenegraph.getCell(t,e).setAttribute("fill",g),p&&this.scenegraph.getCell(t,e).setAttribute("stroke",p),(null===(s=null===(r=this.stateManager.select)||void 0===r?void 0:r.ranges)||void 0===s?void 0:s.length)>0&&BB(this.scenegraph),this.stateManager.updateHoverPos(c,u),this.scenegraph.updateNextFrame(),v.toDataURL()}exportCellRangeImg(t){var e,i,o,n;const{scrollTop:r,scrollLeft:s}=this,l=Math.min(t.start.col,t.end.col),a=Math.min(t.start.row,t.end.row),h=Math.max(t.start.col,t.end.col),d=Math.max(t.start.row,t.end.row),c=this.cellIsInVisualView(l,a),u=this.cellIsInVisualView(h,d);c&&u||this.scrollToCell({col:l,row:a});const g=this.getCellRangeRelativeRect({start:{col:l,row:a},end:{col:h,row:d}});(null===(i=null===(e=this.stateManager.select)||void 0===e?void 0:e.ranges)||void 0===i?void 0:i.length)>0&&RB(this.scenegraph);const{col:p,row:f}=this.stateManager.hover.cellPos;this.stateManager.updateHoverPos(-1,-1),this.scenegraph.component.hideVerticalScrollBar(),this.scenegraph.component.hideHorizontalScrollBar(),this.scenegraph.renderSceneGraph();const v=this.scenegraph.stage.toCanvas(!1,(new Le).set(g.left+this.tableX+1,g.top+this.tableY+1,g.right+this.tableX,g.bottom+this.tableY)).toDataURL();return c&&u||(this.setScrollTop(r),this.setScrollLeft(s)),(null===(n=null===(o=this.stateManager.select)||void 0===o?void 0:o.ranges)||void 0===n?void 0:n.length)>0&&BB(this.scenegraph),this.stateManager.updateHoverPos(p,f),v}exportCanvas(){return this.scenegraph.stage.toCanvas()}getImageBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png";if("node"!==this.options.mode)return;this.render();const e=this.scenegraph.stage;if(e){const i=this.tableX+this.getAllColsWidth(),o=this.tableY+this.getAllRowsHeight();return i>=this.canvasWidth&&o>=this.canvasHeight?(e.render(),e.window.getImageBuffer(t)):this.scenegraph.stage.toCanvas(!1,(new Le).set(0,0,Math.min(this.canvasWidth,i),Math.min(this.canvasHeight,o))).toBuffer(t)}return null}getBodyIndexByTableIndex(t,e){return{col:t-this.rowHeaderLevelCount,row:e-this.columnHeaderLevelCount}}getTableIndexByBodyIndex(t,e){return{col:t+this.rowHeaderLevelCount,row:e+this.columnHeaderLevelCount}}onVChartEvent(t,e,i){this._chartEventMap[t]||(this._chartEventMap[t]=[]),"function"==typeof e?this._chartEventMap[t].push({callback:e}):this._chartEventMap[t].push({callback:i,query:e})}offVChartEvent(t,e){this._chartEventMap[t]&&(this._chartEventMap[t]=e?this._chartEventMap[t].filter((t=>t.callback!==e)):[])}_bindChartEvent(t){if(t)for(const e in this._chartEventMap)(this._chartEventMap[e]||[]).forEach((i=>{i.query?t.on(e,i.query,i.callback):t.on(e,i.callback)}))}changeRecordOrder(t,e){}hasCustomCellStyle(t){return this.customCellStylePlugin.hasCustomCellStyle(t)}registerCustomCellStyle(t,e){this.customCellStylePlugin.registerCustomCellStyle(t,e)}arrangeCustomCellStyle(t,e){this.customCellStylePlugin.arrangeCustomCellStyle(t,e)}isSeriesNumber(t,e){return this.internalProps.layoutMap.isSeriesNumber(t,e)}isHasSeriesNumber(){var t;return(null===(t=this.internalProps.layoutMap)||void 0===t?void 0:t.leftRowSeriesNumberColumnCount)>0}get leftRowSeriesNumberCount(){var t,e;return null!==(e=null===(t=this.internalProps.layoutMap)||void 0===t?void 0:t.leftRowSeriesNumberColumnCount)&&void 0!==e?e:0}setMinMaxLimitWidth(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var e,i;const o=this.internalProps;for(let n=0;n<o.layoutMap.columnWidths.length;n++){if(this.internalProps._widthResizedColMap.has(n))continue;const{width:r,minWidth:s,maxWidth:l}=null!==(i=null===(e=o.layoutMap.columnWidths)||void 0===e?void 0:e[n])&&void 0!==i?i:{};t&&r&&("string"==typeof r&&"auto"!==r||"number"==typeof r&&r>0)&&this._setColWidth(n,r),s&&("number"==typeof s&&s>0||"string"==typeof s)&&this.setMinColWidth(n,s),l&&("number"==typeof l&&l>0||"string"==typeof l)&&this.setMaxColWidth(n,l)}}setSortedIndexMap(t,e){var i;null===(i=this.dataSource)||void 0===i||i.setSortedIndexMap(t,e)}checkReactCustomLayout(t){this.reactCustomLayout||(this.reactCustomLayout=new __(t,this))}get bodyDomContainer(){return this.internalProps.bodyDomContainer}get headerDomContainer(){return this.internalProps.headerDomContainer}get frozenBodyDomContainer(){return this.internalProps.frozenBodyDomContainer}get frozenHeaderDomContainer(){return this.internalProps.frozenHeaderDomContainer}get rightFrozenBodyDomContainer(){return this.internalProps.rightFrozenBodyDomContainer}get rightFrozenHeaderDomContainer(){return this.internalProps.rightFrozenHeaderDomContainer}get frozenBottomDomContainer(){return this.internalProps.frozenBottomDomContainer}get bottomDomContainer(){return this.internalProps.bottomDomContainer}get rightFrozenBottomDomContainer(){return this.internalProps.rightFrozenBottomDomContainer}showMoverLine(t,e){this.scenegraph.component.showMoveCol(t,e,0),this.scenegraph.renderSceneGraph()}hideMoverLine(t,e){this.scenegraph.component.hideMoveCol(),this.scenegraph.renderSceneGraph()}disableScroll(){this.eventManager.disableScroll()}enableScroll(){this.eventManager.enableScroll()}getGroupTitleLevel(t,e){}scrollToRow(t,e){e?this.animationManager.scrollTo({row:t},e):this.scrollToCell({row:t})}scrollToCol(t,e){e?this.animationManager.scrollTo({col:t},e):this.scrollToCell({col:t})}scrollToCell(t,e){if(e)return void this.animationManager.scrollTo(t,e);const i=this.getDrawRange();if(K(t.col)&&t.col>=this.frozenColCount){const e=this.getFrozenColsWidth(),o=this.getColsWidth(0,t.col-1);this.scrollLeft=Math.min(o-e,this.getAllColsWidth()-i.width)}if(K(t.row)&&t.row>=this.frozenRowCount){const e=this.getFrozenRowsHeight(),o=this.getRowsHeight(0,t.row-1);this.scrollTop=Math.min(o-e,this.getAllRowsHeight()-i.height)}this.render()}}const XT={},KT={};const ZT=(t,e)=>{var i,o;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const n=e.fields,r=t[0],s={},l=[];for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const a=n[e];if(!a.type){let o=r;e in r||(o=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),a.type="number"==typeof o[e]?"linear":"ordinal"}let h;if("number"==typeof a.sortIndex&&(h={key:e,type:a.type,index:a.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===a.sortReverse},l.push(h)),(null===(o=a.domain)||void 0===o?void 0:o.length)>0)if("ordinal"===a.type){a._domainCache={},s[e]=a;const t={};a.domain.forEach(((e,i)=>{t[e]=i,a._domainCache[e]=i})),h&&(h.sortIndex=t,h.sortIndexCount=a.domain.length)}else a.domain.length>=2&&(s[e]=a)}return Object.keys(s).length>0&&(t=t.filter((t=>{for(const e in s){const i=s[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]<t[e])return!1}return!0}))),l.sort(((t,e)=>t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let o=0;o<i.length;o++){const n=i[o];let r=0;if("ordinal"===n.type?(void 0===n.sortIndex[e[n.key]]&&(n.sortIndex[e[n.key]]=n.sortIndexCount++),void 0===n.sortIndex[t[n.key]]&&(n.sortIndex[t[n.key]]=n.sortIndexCount++),r=n.sortIndex[t[n.key]]-n.sortIndex[e[n.key]]):"linear"===n.type&&(r=t[n.key]-e[n.key]),n.sortReverse&&(r=-r),0!==r)return r}return 0}(t,e,l))),t};let qT=0;function JT(){return qT>1e8&&(qT=0),(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dataset")+"_"+qT++}class QT{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new U,i=(null==t?void 0:t.name)?t.name:JT("dataset"),this.name=i,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:It.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let o=this._callMap.get(i);o||(o=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,o)})),this._callMap.set(i,o)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const o=this._callMap.get(i);o&&t.forEach((t=>{t.target.removeListener(e,o)})),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.parseNewData(t.data,t.options)}))}multipleDataViewUpdateInRawData(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.updateRawData(t.data,t.options)}))}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}const tP="_data-view-diff-rank";class eP{constructor(t,e){var i=this;let o;this.dataSet=t,this.options=e,this.isDataView=!0,this.target=new U,this.parseOption=null,this.transformsArr=[],this.isRunning=!1,this.rawData={},this.history=!1,this.parserData={},this.latestData={},this._fields=null,this.reRunAllTransform=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{pushHistory:!0,emitMessage:!0};return i.isRunning=!0,i.resetTransformData(),i.transformsArr.forEach((e=>{i.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),i.isLastTransform(e)&&i.diffLastData()})),i.isRunning=!1,!1!==t.emitMessage&&i.target.emit("change",[]),i},this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},o=(null==e?void 0:e.name)?e.name:JT("dataview"),this.name=o,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(o,this),this.setFields(null==e?void 0:e.fields)}parse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var o;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const n=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(o=this.dataSet.getParser(e.type))&&void 0!==o?o:this.dataSet.getParser("bytejson"))(n,e.options,this);this.rawData=n,this.parserData=t,this.history&&this.historyData.push(n,t),this.latestData=t}else this.parserData=n,this.rawData=n,this.history&&this.historyData.push(n),this.latestData=n;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,o;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(o=e.level)&&void 0!==o?o:0)}))}executeTransform(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{pushHistory:!0,emitMessage:!0};const{pushHistory:i,emitMessage:o}=e,n=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(n),this.latestData=n,!1!==o&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData)return;if(!this.latestData.forEach)return;if(!(null===(t=this._diffKeys)||void 0===t?void 0:t.length))return;const e=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((t=>{t[tP]=e,this._diffMap.set(this._diffKeys.reduce(((e,i)=>e+t[i]),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let t;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((i=>{i[tP]=e,t=this._diffKeys.reduce(((t,e)=>t+i[e]),""),this._diffMap.get(t)?this.latestDataAUD.update.push(i):this.latestDataAUD.add.push(i),this._diffMap.set(t,i)})),this._diffMap.forEach(((t,i)=>{t[tP]<e&&(this.latestDataAUD.del.push(t),this._diffMap.delete(i))}))}this._diffRank=e}cloneParseData(t,e){let i=!1;return t instanceof eP||!0!==(null==e?void 0:e.clone)||(i=!0),i?vt(t):t}parseNewData(t,e){this.parse(t,e||this.parseOption),this.reRunAllTransform()}updateRawData(t,e){const i=this.cloneParseData(t,e);this.rawData=i,this.parserData=i,this.latestData=i,this.reRunAllTransform()}getFields(){var t;return this._fields?this._fields:"dataview"===(null===(t=this.parseOption)||void 0===t?void 0:t.type)&&1===this.rawData.length&&this.rawData[0].getFields?this.rawData[0].getFields():null}setFields(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._fields=t&&e?yt({},this._fields,t):t;const i=this.transformsArr.find((t=>"fields"===t.type));!X(this._fields)&&X(i)?(this.dataSet.registerTransform("fields",ZT),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}function iP(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["data"];const i=t;let o;if(!K(i)||"object"!=typeof i)return i;if(function(t){return t instanceof eP}(i)||function(t){try{return t instanceof Element}catch(e){const i=["children","innerHTML","classList","setAttribute","tagName","getBoundingClientRect"],o=Object.keys(t);return i.every((t=>o.includes(t)))}}(i))return i;const n=et(i),r=i.length;o=n?new Array(r):"object"==typeof i?{}:$(i)||nt(i)||tt(i)?i:ot(i)?new Date(+i):void 0;const s=n?void 0:Object.keys(Object(i));let l=-1;if(o)for(;++l<(s||i).length;){const t=s?s[l]:l,n=i[t];(null==e?void 0:e.includes(t.toString()))?o[t]=n:o[t]=iP(n,e)}return o}function oP(t){var e,i;const o=Object.assign({},t);return ut(t.style)||(o.textStyle=nP(t.style)),ut(t.textStyle)||yt(o.textStyle,nP(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&nP(o.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&nP(o.background.style),o}function nP(t){return ut(t)||t.angle&&(t.angle=fe(t.angle)),t}function rP(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ut(t.style)||(t.style=nP(t.style)),ut(t.state)||Object.keys(t.state).forEach((e=>{ut(t.state[e])||(t.state[e]=nP(t.state[e]))})),t}function sP(t){return ut(t)?null:(Object.keys(t).forEach((e=>{ut(t[e])||(t[e]=nP(t[e]))})),t)}const lP={left:{textAlign:"center",textBaseline:"bottom"},right:{textAlign:"center",textBaseline:"bottom"},radius:{},angle:{}},aP="PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol",hP=14,dP=14,cP=4,uP={domainLine:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},grid:{visible:!0,style:{lineWidth:1,stroke:"#EBEDF2",strokeOpacity:1,lineDash:[]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#EBEDF2",strokeOpacity:1,lineDash:[4,4]}},tick:{visible:!0,tickSize:cP,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,tickSize:cP/2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},label:{visible:!0,space:1,style:{fontSize:dP,fill:"#89909D",fontWeight:"normal",fillOpacity:1},autoLimit:!0},title:{space:10,style:{fontSize:dP,fill:"#333333",fontWeight:"normal",fillOpacity:1}}};function gP(t){var e,i,o,n,r,s,l,a,h,d,c,u,g;const p=yt({},t);let f,v=null!==(i=null===(e=p.title)||void 0===e?void 0:e.angle)&&void 0!==i?i:0;"left"!==p.orient&&"right"!==p.orient||(null===(o=p.title)||void 0===o?void 0:o.autoRotate)&&X(p.title.angle)&&(v="left"===p.orient?-90:90,f=lP[p.orient]);const m=function(t,e){if(!t||!J(t))return t;const i={};return Object.keys(t).forEach((o=>{const n=t[o];let r=!1;e.forEach((t=>{(tt(t)&&t===o||t instanceof RegExp&&o.match(t))&&(r=!0)})),r||(i[o]=n)})),i}(p.label,["style","formatMethod","state"]);return{orient:p.orient,select:p.select,hover:p.hover,line:(b=p.domainLine,rP(b),rP(b.startSymbol),rP(b.endSymbol),b),label:Object.assign({style:nP(p.label.style),formatMethod:p.label.formatMethod?(t,e,i)=>p.label.formatMethod(e.rawValue,e):null,state:sP(p.label.state)},m),tick:{visible:p.tick.visible,length:p.tick.tickSize,inside:p.tick.inside,alignWithLabel:p.tick.alignWithLabel,style:nP(p.tick.style),state:sP(p.tick.state),dataFilter:p.tick.dataFilter},subTick:{visible:p.subTick.visible,length:p.subTick.tickSize,inside:p.subTick.inside,count:p.subTick.tickCount,style:nP(p.subTick.style),state:sP(p.subTick.state)},grid:{type:"line",visible:p.grid.visible,alternateColor:p.grid.alternateColor,alignWithLabel:p.grid.alignWithLabel,style:nP(p.grid.style)},subGrid:{type:"line",visible:p.subGrid.visible,alternateColor:p.subGrid.alternateColor,style:nP(p.subGrid.style)},title:{visible:p.title.visible,position:p.title.position,space:p.title.space,autoRotate:!1,angle:v?fe(v):null,textStyle:yt({},f,nP(p.title.style)),padding:p.title.padding,shape:{visible:null===(n=p.title.shape)||void 0===n?void 0:n.visible,space:null===(r=p.title.shape)||void 0===r?void 0:r.space,style:nP(null===(s=p.title.shape)||void 0===s?void 0:s.style)},background:{visible:null===(l=p.title.background)||void 0===l?void 0:l.visible,style:nP(null===(a=p.title.background)||void 0===a?void 0:a.style)},state:{text:sP(p.title.state),shape:sP(null===(h=p.title.shape)||void 0===h?void 0:h.state),background:sP(null===(d=p.title.background)||void 0===d?void 0:d.state)}},panel:{visible:null===(c=p.background)||void 0===c?void 0:c.visible,style:nP(null===(u=p.background)||void 0===u?void 0:u.style),state:sP(null===(g=p.background)||void 0===g?void 0:g.state)}};var b}class pP{constructor(t,e,i,o){this.seqId=0,this.leftRowSeriesNumberColumnCount=0,this.rightRowSeriesNumberColumnCount=0,this.bodyRowSpanCount=1,this._transpose=!1,this._showHeader=!0,this._recordsCount=0,this._hasAggregation=!1,this._hasAggregationOnTopCount=0,this._hasAggregationOnBottomCount=0,this._cellRangeMap=new Map,this._showHeader=i,this._table=t,this._columns=[],this._columnsIncludeHided=[],this._headerCellIds=[],this.hierarchyIndent=null!=o?o:20,this.hierarchyTextStartAlignment=t.options.hierarchyTextStartAlignment,this.columnTree=new CT(e,{seqId:0}),this._headerObjectsIncludeHided=this._addHeaders(0,e,[]),this._headerObjects=this._headerObjectsIncludeHided.filter((t=>!0!==t.define.hide)),this._headerObjectMap=this._headerObjects.reduce(((t,e)=>(t[e.id]=e,t)),{}),this.rowHierarchyType=function(t){if(t._table.options.groupBy)return!0;const{columns:e}=t._table.options;if(et(e)&&e.length>0)for(let t=0;t<e.length;t++){const i=e[t];if(!tt(i)&&i.tree)return!0}return!1}(this)?"tree":"grid",this._hasAggregation=function(t){const e=t.columnObjects;for(let t=0;t<e.length;t++){const i=e[t];if(null==i?void 0:i.aggregation)return!0}return!1}(this),this._hasAggregationOnBottomCount=function(t){const e=t.columnObjects;let i=0;for(let t=0;t<e.length;t++){const o=e[t];(null==o?void 0:o.aggregation)&&(Array.isArray(null==o?void 0:o.aggregation)?i=Math.max(i,o.aggregation.filter((t=>!t.showOnTop)).length):o.aggregation.showOnTop||(i=Math.max(i,1)))}return i}(this),this._hasAggregationOnTopCount=function(t){const e=t.columnObjects;let i=0;for(let t=0;t<e.length;t++){const o=e[t];(null==o?void 0:o.aggregation)&&(Array.isArray(null==o?void 0:o.aggregation)?i=Math.max(i,o.aggregation.filter((t=>t.showOnTop)).length):o.aggregation.showOnTop&&(i=Math.max(i,1)))}return i}(this),this.handleRowSeriesNumber(t.internalProps.rowSeriesNumber)}handleRowSeriesNumber(t){var e,i;t&&(Array.isArray(t)?this.rowSeriesNumberColumn=t.map((e=>{var i,o;return{id:this.seqId++,title:e.title,define:e,cellType:null!==(i=e.cellType)&&void 0!==i?i:"text",headerType:null!==(o=t.cellType)&&void 0!==o?o:"text",style:e.style,width:e.width,format:e.format,field:e.field,icon:e.icon,headerIcon:e.headerIcon,isChildNode:!1}})):this.rowSeriesNumberColumn=[{id:this.seqId++,title:t.title,define:t,cellType:null!==(e=t.cellType)&&void 0!==e?e:"text",headerType:null!==(i=t.cellType)&&void 0!==i?i:"text",style:t.style,width:t.width,format:t.format,field:"",icon:t.icon,headerIcon:t.headerIcon,isChildNode:!1}],this.leftRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter((t=>!0)),this.rightRowSeriesNumberColumn=this.rowSeriesNumberColumn.filter((t=>!1)),this.leftRowSeriesNumberColumnCount=this.leftRowSeriesNumberColumn.length,this.rightRowSeriesNumberColumnCount=this.rightRowSeriesNumberColumn.length)}get transpose(){return this._transpose}set transpose(t){this._transpose=t}get showHeader(){return this._showHeader}set showHeader(t){this._showHeader=t}isSeriesNumberInHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return!1;if(e<this.headerLevelCount)return!0}if(this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return!1;if(e<this.headerLevelCount)return!0}return!1}isSeriesNumberInBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return!0;if(e>=this.headerLevelCount)return!0}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return!0;if(e>=this.headerLevelCount)return!0}return!1}isSeriesNumber(t,e){if(K(t)&&K(e)){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&e>=0&&t<this.leftRowSeriesNumberColumnCount)return!0;if(this.rightRowSeriesNumberColumnCount>0&&e>=0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount)return!0}return!1}getSeriesNumberHeader(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return;if(e<this.headerLevelCount)return Object.assign({},this.leftRowSeriesNumberColumn[t],{style:this._table.internalProps.rowSeriesNumber.headerStyle})}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount&&e<this.headerLevelCount){if(this.transpose)return;if(e<this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}getSeriesNumberBody(t,e){if(this.leftRowSeriesNumberColumnCount>0&&t>=0&&t<this.leftRowSeriesNumberColumnCount){if(this.transpose)return this.leftRowSeriesNumberColumn[t];if(e>=this.headerLevelCount)return this.leftRowSeriesNumberColumn[t]}if(this.rightRowSeriesNumberColumnCount>0&&t>=this.colCount-this.rightRowSeriesNumberColumnCount){if(this.transpose)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)];if(e>=this.headerLevelCount)return this.rightRowSeriesNumberColumn[t-(this.colCount-this.rightRowSeriesNumberColumnCount)]}}isHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)||!this.transpose&&e>=0&&e<this.headerLevelCount}isAggregation(t,e){if(this.hasAggregation){if(this.hasAggregationOnBottomCount)if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0;if(this.hasAggregationOnTopCount)if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0}return!1}isTopAggregation(t,e){if(this.hasAggregationOnTopCount)if(this.transpose){if(t>=this.rowHeaderLevelCount&&t<this.rowHeaderLevelCount+this.hasAggregationOnTopCount)return!0}else if(e>=this.columnHeaderLevelCount&&e<this.columnHeaderLevelCount+this.hasAggregationOnTopCount)return!0;return!1}isBottomAggregation(t,e){if(this.hasAggregationOnBottomCount)if(this.transpose){if(t>=this.colCount-this.hasAggregationOnBottomCount)return!0}else if(e>=this.rowCount-this.hasAggregationOnBottomCount)return!0;return!1}get hasAggregation(){return this._hasAggregation}get hasAggregationOnTopCount(){return this._hasAggregationOnTopCount}get hasAggregationOnBottomCount(){return this._hasAggregationOnBottomCount}getAggregatorsByCell(t,e){return this.getColumnDefine(t,e).vtable_aggregator}getAggregatorsByCellRange(t,e,i,o){let n=[];if(!this.transpose){for(let o=t;o<=i;o++){const t=this.getColumnDefine(o,e);t.vtable_aggregator&&(n=n.concat(Array.isArray(t.vtable_aggregator)?t.vtable_aggregator:[t.vtable_aggregator]))}return n}for(let i=e;i<=o;i++){const e=this.getColumnDefine(t,i);e.vtable_aggregator&&(n=n.concat(Array.isArray(e.vtable_aggregator)?e.vtable_aggregator:[e.vtable_aggregator]))}return[]}getAggregatorOnTop(t,e){const i=this.getColumnDefine(t,e),o=i.vtable_aggregator,n=i.aggregation;if(Array.isArray(n)){const i=n.reduce(((t,e,i)=>(e.showOnTop&&t.push(i),t)),[]).map((t=>o[t]));return this.transpose?i[t-this.rowHeaderLevelCount]:i[e-this.columnHeaderLevelCount]}return this.transpose&&t-this.rowHeaderLevelCount==0?(null==n?void 0:n.showOnTop)?o:null:this.transpose||e-this.columnHeaderLevelCount!=0?null:(null==n?void 0:n.showOnTop)?o:null}getAggregatorOnBottom(t,e){const i=this.getColumnDefine(t,e),o=i.vtable_aggregator,n=i.aggregation;if(Array.isArray(n)){const i=n.reduce(((t,e,i)=>(e.showOnTop||t.push(i),t)),[]).map((t=>o[t]));return this.transpose?i[t-(this.colCount-this.hasAggregationOnBottomCount)]:i[e-(this.rowCount-this.hasAggregationOnBottomCount)]}return this.transpose&&t-(this.colCount-this.hasAggregationOnBottomCount)==0?(null==n?void 0:n.showOnTop)?null:o:this.transpose||e-(this.rowCount-this.hasAggregationOnBottomCount)!=0||(null==n?void 0:n.showOnTop)?null:o}getAggregatorCellAddress(t,e,i,o){const n=[],r=this.hasAggregationOnTopCount,s=this.hasAggregationOnBottomCount;if(this.transpose){for(let i=e;i<=o;i++)if(this.getColumnDefine(t,i).vtable_aggregator){for(let t=0;t<r;t++)n.push({col:this.headerLevelCount+t,row:i});for(let t=0;t<s;t++)n.push({col:this.rowCount-s+t,row:i})}}else for(let o=t;o<=i;o++)if(this.getColumnDefine(o,e).vtable_aggregator){for(let t=0;t<r;t++)n.push({col:o,row:this.headerLevelCount+t});for(let t=0;t<s;t++)n.push({col:o,row:this.rowCount-s+t})}return n}getCellLocation(t,e){return this.isHeader(t,e)?this.transpose?"rowHeader":"columnHeader":"body"}isRowHeader(t,e){return!!(this.transpose&&t>=this.leftRowSeriesNumberColumnCount&&t<this.headerLevelCount+this.leftRowSeriesNumberColumnCount)}isColumnHeader(t,e){return!this.transpose&&e>=0&&e<=this.headerLevelCount-1&&t>=this.leftRowSeriesNumberColumnCount&&t<this.colCount-this.rightRowSeriesNumberColumnCount}isFrozenColumn(t,e){if(K(e)){if(t>=0&&t<this.frozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.frozenColCount>0&&t>=0&&t<this.frozenColCount)return!0;return!1}isRightFrozenColumn(t,e){if(K(e)){if(t>=this.colCount-this.rightFrozenColCount&&e>=this.frozenRowCount&&e<this.rowCount-this.bottomFrozenRowCount)return!0}else if(this.rightFrozenColCount>0&&t>=this.colCount-this.rightFrozenColCount)return!0;return!1}isFrozenRow(t,e){if(K(e)){if(e>=0&&e<this.frozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.frozenRowCount>0&&e>=0&&e<this.frozenRowCount)return!0;return!1}isBottomFrozenRow(t,e){if(K(e)){if(e>=this.rowCount-this.bottomFrozenRowCount&&t>=this.frozenColCount&&t<this.colCount-this.rightFrozenColCount)return!0}else if(e=t,this.bottomFrozenRowCount>0&&e>=this.rowCount-this.bottomFrozenRowCount)return!0;return!1}isLeftTopCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=0&&e<this.frozenRowCount}isLeftBottomCorner(t,e){return t>=0&&t<this.frozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isRightTopCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=0&&e<this.frozenRowCount}isRightBottomCorner(t,e){return t>=this.colCount-this.rightFrozenColCount&&e>=this.rowCount-this.bottomFrozenRowCount}isCornerHeader(t,e){return!1}getColumnHeaderRange(){var t,e;return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(null!==(t=this.rowCount)&&void 0!==t?t:0)-1}}:{start:{col:0,row:0},end:{col:(null!==(e=this.colCount)&&void 0!==e?e:0)-1,row:this._headerCellIds.length-1}}}getRowHeaderRange(){var t,e;return this.transpose?{start:{col:0,row:0},end:{col:this._headerCellIds.length-1,row:(null!==(t=this.rowCount)&&void 0!==t?t:0)-1}}:{start:{col:0,row:0},end:{col:(null!==(e=this.colCount)&&void 0!==e?e:0)-1,row:this._headerCellIds.length-1}}}getCornerHeaderRange(){}getBodyRange(){var t,e,i,o;return this.transpose?{start:{col:this.headerLevelCount,row:0},end:{col:(null!==(t=this.colCount)&&void 0!==t?t:0)-1,row:(null!==(e=this.rowCount)&&void 0!==e?e:0)-1}}:{start:{col:0,row:this.headerLevelCount},end:{col:(null!==(i=this.colCount)&&void 0!==i?i:0)-1,row:(null!==(o=this.rowCount)&&void 0!==o?o:0)-1}}}get headerLevelCount(){return this.showHeader?this._headerCellIds.length:0}get columnHeaderLevelCount(){return this.transpose?0:this.headerLevelCount}get rowHeaderLevelCount(){return this.transpose?this.headerLevelCount:0}get frozenColCount(){return this._table.internalProps.frozenColCount?this.colCount>this._table.internalProps.frozenColCount?this._table.internalProps.frozenColCount:this.colCount:0}get frozenRowCount(){return this._table.internalProps.frozenRowCount?this.rowCount>=this._table.internalProps.frozenRowCount?this._table.internalProps.frozenRowCount:this.rowCount:0}get bottomFrozenRowCount(){return this._table.internalProps.bottomFrozenRowCount?this.rowCount-this.headerLevelCount>=this._table.internalProps.bottomFrozenRowCount?this._table.internalProps.bottomFrozenRowCount:this.rowCount-this.headerLevelCount:0}get rightFrozenColCount(){return this._table.internalProps.rightFrozenColCount?this.colCount-this.frozenColCount>=this._table.internalProps.rightFrozenColCount?this._table.internalProps.rightFrozenColCount:Math.max(0,this.colCount-this.frozenColCount):0}get colCount(){return this.transpose?this.headerLevelCount+this.recordsCount+this.leftRowSeriesNumberColumnCount+this.rightRowSeriesNumberColumnCount:this._columns.length+this.leftRowSeriesNumberColumnCount+this.rightRowSeriesNumberColumnCount}get rowCount(){return this.transpose?this._columns.length:this.headerLevelCount+this.recordsCount}get bodyRowCount(){return this.transpose?this._columns.length:this.rowCount-this.bottomFrozenRowCount-this.headerLevelCount}get bodyColCount(){return this.transpose?this.colCount-this.rightFrozenColCount-this.rowHeaderLevelCount:this._columns.length}get recordsCount(){return this._recordsCount}set recordsCount(t){this._recordsCount=t}get headerObjects(){return this._headerObjects}get columnObjects(){return this._columns}get headerObjectsIncludeHided(){return this._headerObjectsIncludeHided}get columnWidths(){if(this.leftRowSeriesNumberColumnCount){const t=this.leftRowSeriesNumberColumn.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})));return t.push(...this._columns.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})))),t}return this._columns.map((t=>({width:t.width,minWidth:t.minWidth,maxWidth:t.maxWidth})))}getColumnWidthDefined(t){var e;if(t>=0){if(t<this.leftRowSeriesNumberColumnCount)return this.leftRowSeriesNumberColumn[t];if(this.transpose){let i,o,n=0;if(t>=this.rowHeaderLevelCount+this.leftRowSeriesNumberColumnCount){let t;return this.columnObjects.forEach(((e,r)=>{"number"==typeof e.width?n=Math.max(e.width,n):"auto"===e.width&&(t=!0),"number"==typeof e.minWidth&&(o=Math.max(e.minWidth,o)),"number"==typeof e.maxWidth&&(i=Math.max(e.maxWidth,i))})),n=n>0?n:t?"auto":void 0,{width:n,minWidth:o,maxWidth:i}}if(this.isRowHeader(t,0)){const i=Array.isArray(this._table.defaultHeaderColWidth)?null!==(e=this._table.defaultHeaderColWidth[t])&&void 0!==e?e:this._table.defaultColWidth:this._table.defaultHeaderColWidth;return"auto"===i?{width:"auto"}:{width:i}}}return this._columns[t-this.leftRowSeriesNumberColumnCount]}}getCellId(t,e){var i,o,n,r;return this.transpose?t>=this.headerLevelCount+this.leftRowSeriesNumberColumnCount?null===(i=this._columns[e])||void 0===i?void 0:i.id:this.isSeriesNumber(t,e)?e+"_series_number":null===(o=this._headerCellIds[t-this.leftRowSeriesNumberColumnCount])||void 0===o?void 0:o[e]:this.isSeriesNumber(t,e)?this.rowSeriesNumberColumn[t].id:this.headerLevelCount<=e?null===(n=this._columns[t-this.leftRowSeriesNumberColumnCount])||void 0===n?void 0:n.id:null===(r=this._headerCellIds[e])||void 0===r?void 0:r[t-this.leftRowSeriesNumberColumnCount]}getHeader(t,e){if(this.isSeriesNumberInHeader(t,e))return this.getSeriesNumberHeader(t,e);const i=this.getCellId(t,e);return this._headerObjectMap[i]}getHeaderField(t,e){var i;const o=this.getCellId(t,e);return(null===(i=this._headerObjectMap[o])||void 0===i?void 0:i.field)||(this.transpose?this._columns[e]&&this._columns[e].field:this._columns[t-this.leftRowSeriesNumberColumnCount]&&this._columns[t-this.leftRowSeriesNumberColumnCount].field)}getHeaderCellAdressById(t){for(let e=0;e<this._headerCellIds.length;e++){const i=this._headerCellIds[e];for(let o=0;o<i.length;o++)if(i[o]===t)return this.transpose?{col:e,row:o}:{col:o+this.leftRowSeriesNumberColumnCount,row:e}}}getHeaderCellAddressByField(t){const e=this.headerObjects.find((e=>e&&e.field===t));return e&&this.getHeaderCellAdressById(e.id)}getBody(t,e){return this.isSeriesNumber(t,e)?this.getSeriesNumberBody(t,e):this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]}getBodyLayoutRangeById(t){var e,i;if(this.transpose){for(let i=0;i<(null!==(e=this.rowCount)&&void 0!==e?e:0);i++)if(t===this._columns[i].id)return{start:{col:0,row:i},end:{col:0,row:i}}}else for(let e=this.leftRowSeriesNumberColumnCount;e<(null!==(i=this.colCount)&&void 0!==i?i:0);e++)if(t===this._columns[e-this.leftRowSeriesNumberColumnCount].id)return{start:{col:e,row:0},end:{col:e,row:0}};return{start:{col:-1,row:-1},end:{col:-1,row:-1}}}getCellRange(t,e){return function(t,e,i){var o,n,r;if(-1===t||-1===e)return{start:{col:t,row:e},end:{col:t,row:e}};if(i._cellRangeMap.has(`$${t}$${e}`))return i._cellRangeMap.get(`$${t}$${e}`);let s={start:{col:t,row:e},end:{col:t,row:e}};if(i.transpose)s=function(t,e,i){var o,n,r,s;const l={start:{col:t,row:e},end:{col:t,row:e}};if(i.headerLevelCount+i.leftRowSeriesNumberColumnCount<=t||-1===t&&-1===e){if(i.headerLevelCount+i.leftRowSeriesNumberColumnCount<=t&&(null===(n=null===(o=i.columnObjects[e])||void 0===o?void 0:o.define)||void 0===n?void 0:n.mergeCell)){const o=i._table.getCellValue(t,e);for(let n=t-1;n>=i.headerLevelCount+i.leftRowSeriesNumberColumnCount;n--){const t=i._table.getCellValue(n,e);if("boolean"==typeof i.columnObjects[e].define.mergeCell){if(o!==t)break}else if(!i.columnObjects[e].define.mergeCell(o,t))break;l.start.col=n}for(let n=t+1;n<(null!==(r=i.colCount)&&void 0!==r?r:0);n++){const t=i._table.getCellValue(n,e);if("boolean"==typeof i.columnObjects[e].define.mergeCell){if(o!==t)break}else if(!i.columnObjects[e].define.mergeCell(o,t))break;l.end.col=n}}return l}const a=i.getCellId(t,e);for(let o=e-1;o>=0&&a===i.getCellId(t,o);o--)l.start.row=o;for(let o=e+1;o<(null!==(s=i.rowCount)&&void 0!==s?s:0)&&a===i.getCellId(t,o);o++)l.end.row=o;for(let o=t-1;o>=0&&a===i.getCellId(o,e);o--)l.start.col=o;for(let o=t+1;o<i.headerLevelCount+i.leftRowSeriesNumberColumnCount&&a===i.getCellId(o,e);o++)l.end.col=o;return l}(t,e,i);else if(i.headerLevelCount<=e){if(i.headerLevelCount<=e&&(null===(n=null===(o=i.columnObjects[t-i.leftRowSeriesNumberColumnCount])||void 0===o?void 0:o.define)||void 0===n?void 0:n.mergeCell)){const o=i._table.getCellValue(t,e);for(let n=e-1;n>=i.headerLevelCount;n--){const e=i._table.getCellValue(t,n);if("boolean"==typeof i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell){if(o!==e)break}else if(!i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell(o,e))break;s.start.row=n}for(let n=e+1;n<i.rowCount;n++){const e=i._table.getCellValue(t,n);if("boolean"==typeof i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell){if(o!==e)break}else if(!i.columnObjects[t-i.leftRowSeriesNumberColumnCount].define.mergeCell(o,e))break;s.end.row=n}}!function(t,e,i,o){if("tree"!==o.rowHierarchyType)return;const n=o._table.getCellRawRecord(t,e);(null==n?void 0:n.vtableMerge)&&(i.start.col=o.rowHeaderLevelCount,i.end.col=o.colCount-1,i.start.row=i.end.row=e)}(t,e,s,i)}else{const o=i.getCellId(t,e);for(let n=t-1;n>=0&&o===i.getCellId(n,e);n--)s.start.col=n;for(let n=t+1;n<(null!==(r=i.colCount)&&void 0!==r?r:0)&&o===i.getCellId(n,e);n++)s.end.col=n;for(let n=e-1;n>=0&&o===i.getCellId(t,n);n--)s.start.row=n;for(let n=e+1;n<i.headerLevelCount&&o===i.getCellId(t,n);n++)s.end.row=n}return i._cellRangeMap.set(`$${t}$${e}`,s),s}(t,e,this)}isCellRangeEqual(t,e,i,o){const n=this.getCellRange(t,e),r=this.getCellRange(i,o);return n.start.col===r.start.col&&n.end.col===r.end.col&&n.start.row===r.start.row&&n.end.row===r.end.row}getRecordShowIndexByCell(t,e){const i=this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount;return this.transpose?t<i?-1:t-i:e<i?-1:e-i}getRecordStartRowByRecordIndex(t){return(this.hasAggregationOnTopCount?this.headerLevelCount+1:this.headerLevelCount)+t}_addHeaders(t,e,i,o){const n=[],r=this._newRow(t,o);return e.forEach((e=>{var s,l,a,h;const d=this._columns.length,c=this.seqId++,u={id:c,title:null!==(s=e.title)&&void 0!==s?s:e.caption,headerIcon:e.headerIcon,field:e.field,style:e.headerStyle,headerType:null!==(l=e.headerType)&&void 0!==l?l:"text",dropDownMenu:e.dropDownMenu,define:e,columnWidthComputeMode:e.columnWidthComputeMode};n[c]=u;for(let e=t-1;e>=0;e--)this._headerCellIds[e]&&(this._headerCellIds[e][d]=i[e]);if(o?this._headerCellIds[t-1]&&(r[d]=this._headerCellIds[t-1][d]):r[d]=c,e.columns)this._addHeaders(t+1,e.columns,[...i,c],e.hideColumnsSubHeader||o).forEach((t=>n.push(t)));else{const i={id:this.seqId++,field:e.field,fieldFormat:e.fieldFormat,width:e.width,minWidth:e.minWidth,maxWidth:e.maxWidth,icon:e.icon,cellType:null!==(h=null!==(a=e.cellType)&&void 0!==a?a:e.columnType)&&void 0!==h?h:"text",chartModule:"chartModule"in e?e.chartModule:null,chartSpec:"chartSpec"in e?e.chartSpec:null,sparklineSpec:"sparklineSpec"in e?e.sparklineSpec:Uw,style:e.style,define:e,columnWidthComputeMode:e.columnWidthComputeMode,disableColumnResize:null==e?void 0:e.disableColumnResize,aggregation:e.aggregation,isChildNode:t>=1};if(this._columnsIncludeHided.push(i),!0!==e.hide){this._columns.push(i);for(let e=t+1;e<this._headerCellIds.length;e++)this._headerCellIds[e][d]=c}}})),n}_newRow(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this._headerCellIds[t]){const e=this._headerCellIds[t-1];if(e.length>this._headerCellIds[t].length)for(let i=this._headerCellIds[t].length;i<e.length;i++)this._headerCellIds[t][i]=e[i];return this._headerCellIds[t]}if(e)return[];const i=this._headerCellIds[t]=[];if(!this._columns.length)return i;const o=this._headerCellIds[t-1];for(let t=0;t<o.length;t++)i[t]=o[t];return i}getCellHeaderPaths(t,e){if(this.isSeriesNumber(t,e))return;let i=[],o=[];return this.transpose?o=[{field:this._columns[e].field}]:i=[{field:this._columns[t-this.leftRowSeriesNumberColumnCount].field}],{colHeaderPaths:i,rowHeaderPaths:o,cellLocation:this.getCellLocation(t,e)}}getParentCellId(t,e){if(0!==e){if(this.isColumnHeader(t,e))return this.getCellId(t,e-1);if(this.isRowHeader(t,e)){if(this.isSeriesNumberInBody(t-1,e))return;return this.getCellId(t-1,e)}}}canMoveHeaderPosition(t,e){if(this.isSeriesNumberInHeader(e.col,e.row)||this.isSeriesNumberInHeader(t.col,t.row))return!1;if(!this.transpose&&this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)){const i=this.getRecordShowIndexByCell(0,t.row),o=this.getRecordShowIndexByCell(0,e.row);return this._table.dataSource.isCanExchangeOrder(i,o)}if(this.transpose&&this.isSeriesNumberInBody(e.col,e.row)&&this.isSeriesNumberInBody(t.col,t.row)&&(this.getBody(t.col+this.leftRowSeriesNumberColumnCount,t.row).isChildNode&&this.getBody(e.col+this.leftRowSeriesNumberColumnCount,e.row).isChildNode?(t.col=t.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1,e.col=e.col+this.leftRowSeriesNumberColumnCount+this.rowHeaderLevelCount-1):(t.col=t.col+this.leftRowSeriesNumberColumnCount,e.col=e.col+this.leftRowSeriesNumberColumnCount)),t.col<0||t.row<0||e.col<0||e.row<0)return!1;if("disabled"===this._table.internalProps.frozenColDragHeaderMode&&this._table.isFrozenColumn(e.col))return!1;const i=this.getCellRange(t.col,t.row);return this.isColumnHeader(t.col,t.row)?this.getParentCellId(t.col,i.start.row)===this.getParentCellId(e.col,i.start.row):!!this.isRowHeader(t.col,t.row)&&this.getParentCellId(i.start.col,t.row)===this.getParentCellId(i.start.col,e.row)}moveHeaderPosition(t,e){if(this.canMoveHeaderPosition(t,e)){let i=this.getCellRange(t.col,t.row);if(this.isColumnHeader(t.col,t.row)){const o=i.end.col-i.start.col+1;let n;const r=this.getCellRange(e.col,i.start.row);if(n=e.col>=t.col?r.end.col-o+1:r.start.col,n===i.start.col)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(i.start.col-this.leftRowSeriesNumberColumnCount,o);e.unshift(n-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const s=this._columns.splice(i.start.col-this.leftRowSeriesNumberColumnCount,o);return s.unshift(n-this.leftRowSeriesNumberColumnCount,0),Array.prototype.splice.apply(this._columns,s),this.columnTree.movePosition(i.start.row,i.start.col-this.leftRowSeriesNumberColumnCount,n-this.leftRowSeriesNumberColumnCount),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:i.start.col,targetIndex:n,sourceSize:o,targetSize:r.end.col-r.start.col+1,moveType:"column"}}if(this.isRowHeader(t.col,t.row)||this.isSeriesNumberInBody(t.col,t.row)&&this.transpose){this.isSeriesNumberInBody(t.col,t.row)&&(i=this.getCellRange(t.col+this.leftRowSeriesNumberColumnCount,t.row));const o=i.end.row-i.start.row+1;let n;const r=this.getCellRange(i.start.col,e.row);if(n=e.row>=t.row?r.end.row-o+1:r.start.row,n===i.start.row)return null;for(let t=0;t<this._headerCellIds.length;t++){const e=this._headerCellIds[t].splice(i.start.row,o);e.unshift(n,0),Array.prototype.splice.apply(this._headerCellIds[t],e)}const s=this._columns.splice(i.start.row,o);return s.unshift(n,0),Array.prototype.splice.apply(this._columns,s),this.columnTree.movePosition(i.start.col-this.leftRowSeriesNumberColumnCount,i.start.row,n+(e.row>t.row?i.end.row-i.start.row:0)),this.columnTree.reset(this.columnTree.tree.children,!0),this._cellRangeMap=new Map,{sourceIndex:i.start.row,targetIndex:n,sourceSize:o,targetSize:r.end.row-r.start.row+1,moveType:"row"}}if(this.isSeriesNumberInBody(t.col,t.row))return{sourceIndex:t.row,targetIndex:e.row,sourceSize:1,targetSize:1,moveType:"row"}}return null}toggleHierarchyState(t){return{addCellPositions:t.add.map((t=>({col:0,row:this._table.columnHeaderLevelCount+t}))),removeCellPositions:t.remove.map((t=>({col:0,row:this._table.columnHeaderLevelCount+t})))}}setChartInstance(t,e,i){const o=this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount];"function"!=typeof o.chartSpec&&(o.chartInstance=i)}getChartInstance(t,e){return(this.transpose?this._columns[e]:this._columns[t-this.leftRowSeriesNumberColumnCount]).chartInstance}checkHasChart(){return function(t){let e=!1;for(let i=0;i<t.columnObjects.length;i++)if(t.columnObjects[i].chartSpec){e=!0;break}return e}(this)}getAxisConfigInPivotChart(t,e){}isEmpty(t,e){return!1}isAxisCell(t,e){return!1}getChartAxes(t,e){return[]}isShareChartSpec(t,e){const i=this.getBody(t,e);return"function"!=typeof(null==i?void 0:i.chartSpec)}isNoChartDataRenderNothing(t,e){const i=this.getBody(t,e);return(null==i?void 0:i.define).noDataRenderNothing}getChartSpec(t,e){return this.getRawChartSpec(t,e)}getRawChartSpec(t,e){const i=this.getBody(t,e),o=null==i?void 0:i.chartSpec;return"function"==typeof o?o({col:t,row:e,dataValue:this._table.getCellOriginValue(t,e)||"",value:this._table.getCellValue(t,e)||"",rect:this._table.getCellRangeRelativeRect(this._table.getCellRange(t,e)),table:this._table}):o}getChartDataId(t,e){return function(t,e,i){var o;const n=i.getRawChartSpec(t,e);if(null==n?void 0:n.series){const t={};return(null===(o=n.data)||void 0===o?void 0:o.id)&&(t[n.data.id]=void 0),null==n||n.series.forEach((e=>{var i,o,r,s,l,a,h,d,c,u,g;if(!(null===(i=e.data)||void 0===i?void 0:i.fromDataId))if(null===(o=e.data)||void 0===o?void 0:o.transforms)t[null!==(g=null!==(c=null===(d=e.data)||void 0===d?void 0:d.id)&&void 0!==c?c:null===(u=n.data)||void 0===u?void 0:u.id)&&void 0!==g?g:"data"]=void 0;else{const i="horizontal"===e.direction?e.xField:e.yField;t[null!==(a=null!==(s=null===(r=e.data)||void 0===r?void 0:r.id)&&void 0!==s?s:null===(l=n.data)||void 0===l?void 0:l.id)&&void 0!==a?a:"data"]=(null===(h=e.data)||void 0===h?void 0:h.id)?i:void 0}})),t}return n.data.id}(t,e,this)}release(){const t=this._table._getActiveChartInstance();null==t||t.release(),this.columnObjects.forEach((t=>{var e;null===(e=t.chartInstance)||void 0===e||e.release()}))}clearCellRangeMap(){this._cellRangeMap.clear()}updateColumnTitle(t,e,i){const o=this._table.internalProps.layoutMap.getHeader(t,e);o.title=i,o.define.title=i}getColumnByField(t){var e;return null===(e=this.columnObjects)||void 0===e?void 0:e.reduce(((e,i,o)=>(i.field===t&&e.push({col:o,columnDefine:i}),e)),[])}getColumnDefine(t,e){if(t>=0)return t<this.leftRowSeriesNumberColumnCount?this.leftRowSeriesNumberColumn[t].define:this.transpose?this._columns[e].define:this._columns[t-this.leftRowSeriesNumberColumnCount].define}}class fP{constructor(t){this.table=t,this.bindEvent()}bindEvent(){this.table.internalProps.handler;const t=this.table.options.editCellTrigger;this.table.on(Aw.DBLCLICK_CELL,(e=>{var i;if(!t||"doubleclick"===t||Array.isArray(t)&&t.includes("doubleclick")){const{col:t,row:o}=e,n=S_(e.federatedEvent),r=this.table.scenegraph.getResizeColAt(n.abstractPos.x,n.abstractPos.y,null===(i=n.eventArgs)||void 0===i?void 0:i.targetCell);if(this.table._canResizeColumn(r.col,r.row)&&r.col>=0)return;this.startEditCell(t,o)}})),this.table.on(Aw.CLICK_CELL,(e=>{if("click"===t||Array.isArray(t)&&t.includes("click")){const{col:t,row:i}=e;this.startEditCell(t,i)}}))}startEditCell(t,e,i){var o,n,r,s,l;if(this.editingEditor)return;const a=this.table.getEditor(t,e);if(a){if(null===(n=null===(o=this.table.internalProps.layoutMap)||void 0===o?void 0:o.isAggregation)||void 0===n?void 0:n.call(o,t,e))return;this.editingEditor||(this.editCell={col:t,row:e}),this.editingEditor=a;const h=K(i)?i:this.table.getCellOriginValue(t,e),d=this.table.getCellRangeRelativeRect(this.table.getCellRange(t,e)),c={rect:{left:d.left,top:d.top,width:d.width,height:d.height}};a.beginEditing,null===(r=a.beginEditing)||void 0===r||r.call(a,this.table.getElement(),c,h),a.bindSuccessCallback,null===(s=a.bindSuccessCallback)||void 0===s||s.call(a,(()=>{this.completeEdit()})),null===(l=a.onStart)||void 0===l||l.call(a,{value:h,endEdit:()=>{this.completeEdit()},referencePosition:c,container:this.table.getElement(),col:t,row:e})}}completeEdit(t){var e,i;if(!this.editingEditor)return!0;const o=null==t?void 0:t.target,{editingEditor:n}=this;if(o)if(n.targetIsOnEditor){if(n.targetIsOnEditor(o))return!1}else if(!n.isEditorElement||n.isEditorElement(o))return!1;if(this.editingEditor.getValue,this.editingEditor.validateValue){const t=null===(i=(e=this.editingEditor).validateValue)||void 0===i?void 0:i.call(e);return gw(t)?new Promise(((e,i)=>{t.then((t=>{t?(this.doExit(),e(!0)):e(!1)})).catch((t=>{i(t)}))})):!!t&&(this.doExit(),!0)}return this.doExit(),!0}doExit(){var t,e,i,o,n,r;const s=null===(e=(t=this.editingEditor).getValue)||void 0===e?void 0:e.call(t),l=this.table.getCellRange(this.editCell.col,this.editCell.row),a=[];for(let t=l.start.row;t<=l.end.row;t++){const t=[];for(let e=l.start.col;e<=l.end.col;e++)t.push(s);a.push(t)}this.table.changeCellValues(l.start.col,l.start.row,a),this.editingEditor.exit,null===(o=(i=this.editingEditor).exit)||void 0===o||o.call(i),null===(r=(n=this.editingEditor).onEnd)||void 0===r||r.call(n),this.editingEditor=null}cancelEdit(){var t,e,i,o;this.editingEditor&&(null===(e=(t=this.editingEditor).exit)||void 0===e||e.call(t),null===(o=(i=this.editingEditor).onEnd)||void 0===o||o.call(i),this.editingEditor=null)}}function vP(t){return tt(t)?{groupByRules:[t]}:et(t)?{groupByRules:t.map((t=>tt(t)?t:t.key))}:{}}function mP(t,e,i,o){if("group"===o)return o;if("sort"===o&&!i.options.groupBy)return o;let n="normal";return i.options.groupBy?n="group":!i.isHeader(t,e)&&i.dataSource.lastOrderField&&i.getBodyField(t,e)===i.dataSource.lastOrderField&&(n="sort"),n}function bP(t){let e=t.sortState;e=!e||Array.isArray(e)?e:[e],e&&(e=e.map((e=>{var i;return e.orderFn=null!==(i=t._getSortFuncFromHeaderOption(void 0,e.field))&&void 0!==i?i:qy,e})),t.dataSource.sort(e))}class CP extends YT{constructor(t,e){var i,o,n,r;"node"===Oy.mode?(e=t,t=null):t instanceof HTMLElement||(e=t,t=t.container?t.container:null),super(t,e),this.showHeader=!0;const s=this.internalProps;if(s.frozenColDragHeaderMode=e.frozenColDragHeaderMode,this.pagination=e.pagination,s.sortState=e.sortState,s.multipleSort=!!e.multipleSort,s.dataConfig=e.groupBy?vP(e.groupBy):{},s.columns=e.columns?iP(e.columns,["children"]):e.header?iP(e.header,["children"]):[],y_(this),s.enableTreeNodeMerge=null!==(o=null!==(i=e.enableTreeNodeMerge)&&void 0!==i?i:K(e.groupBy))&&void 0!==o&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.showHeader=null===(n=e.showHeader)||void 0===n||n,this.transpose=null!==(r=e.transpose)&&void 0!==r&&r,"node"!==Oy.mode&&(this.editorManager=new fP(this)),this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,e.dataSource?v_(this,e.dataSource):e.records?this.setRecords(e.records,{sortState:s.sortState}):this.setRecords([]),e.title){const t=rx.getComponent("title");s.title=new t(e.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=rx.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}if(e.enableTreeStickCell){const t=rx.getComponent("listTreeStickCellPlugin");this.listTreeStickCellPlugin=new t(this)}setTimeout((()=>{this.fireListeners(Aw.INITIALIZED,null)}),0)}isListTable(){return!0}isPivotTable(){return!1}isPivotChart(){return!1}get sortState(){return this.internalProps.sortState}get records(){var t;return null===(t=this.dataSource)||void 0===t?void 0:t.records}get recordsCount(){return this.dataSource.records.length}updateColumns(t){var e,i,o,n;const r={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};this.internalProps.columns=iP(t,["children"]),y_(this),this.options.columns=t,this.internalProps.headerHelper.setTableColumnsEditor(),this._hasAutoImageColumn=void 0,this.refreshHeader(),null===(i=(e=this.dataSource).updateColumns)||void 0===i||i.call(e,this.internalProps.columns),this.records&&function(t){for(let e=0;e<t.length;e++)if(t[e].aggregation)return!0;return!1}(t)&&this.dataSource.processRecords(null!==(n=null===(o=this.dataSource.dataSourceObj)||void 0===o?void 0:o.records)&&void 0!==n?n:this.dataSource.dataSourceObj),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.headerStyleCache=new Map,this.bodyStyleCache=new Map,this.bodyBottomStyleCache=new Map,this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(r.col,r.row),this.renderAsync(),this.eventManager.updateEventBinder()}get columns(){return this.internalProps.layoutMap.columnTree.getCopiedTree()}get header(){return this.internalProps.columns}set header(t){this.internalProps.columns=t,y_(this),this.options.header=t,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,this.renderAsync()}get transpose(){var t;return null!==(t=this.internalProps.transpose)&&void 0!==t&&t}set transpose(t){this.internalProps.transpose!==t&&(this.internalProps.transpose=t,this.internalProps.layoutMap&&(this.internalProps.layoutMap.transpose=t,this.refreshRowColCount(),this._resetFrozenColCount(),this.renderAsync()))}getCellValue(t,e,i){if(-1===t||-1===e)return null;if(!i){const i=this.getCustomMergeValue(t,e);if(i)return i}const o=this;if(o.internalProps.layoutMap.isSeriesNumber(t,e)){if(o.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:i}=o.internalProps.layoutMap.getSeriesNumberHeader(t,e);return i}if(this.options.groupBy){const{vtableMerge:i}=o.getCellRawRecord(t,e);if(i)return"";const n=this.dataSource.currentIndexedData[e-this.columnHeaderLevelCount];return n[n.length-1]+1}const{format:i}=o.internalProps.layoutMap.getSeriesNumberBody(t,e);return"function"==typeof i?i(t,e,this):e-this.columnHeaderLevelCount+1}if(o.internalProps.layoutMap.isHeader(t,e)){const{title:i}=o.internalProps.layoutMap.getHeader(t,e);return"function"==typeof i?i():i}if(o.internalProps.layoutMap.isAggregation(t,e)){if(o.internalProps.layoutMap.isTopAggregation(t,e)){const i=o.internalProps.layoutMap.getAggregatorOnTop(t,e);return(null==i?void 0:i.formatValue)?i.formatValue(t,e,this):""}if(o.internalProps.layoutMap.isBottomAggregation(t,e)){const i=o.internalProps.layoutMap.getAggregatorOnBottom(t,e);return(null==i?void 0:i.formatValue)?i.formatValue(t,e,this):""}}const{field:n,fieldFormat:r}=o.internalProps.layoutMap.getBody(t,e);return o.getFieldData(r||n,t,e)}getCellOriginValue(t,e){if(-1===t||-1===e)return null;const i=this;if(i.internalProps.layoutMap.isSeriesNumber(t,e)){if(i.internalProps.layoutMap.isSeriesNumberInHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getSeriesNumberHeader(t,e);return o}const{format:o}=i.internalProps.layoutMap.getSeriesNumberBody(t,e);return"function"==typeof o?o(t,e,this):e-this.columnHeaderLevelCount}if(i.internalProps.layoutMap.isHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getHeader(t,e);return"function"==typeof o?o():o}if(i.internalProps.layoutMap.isAggregation(t,e)){if(i.internalProps.layoutMap.isTopAggregation(t,e)){const o=i.internalProps.layoutMap.getAggregatorOnTop(t,e);return null==o?void 0:o.value()}if(i.internalProps.layoutMap.isBottomAggregation(t,e)){const o=i.internalProps.layoutMap.getAggregatorOnBottom(t,e);return null==o?void 0:o.value()}}const{field:o}=i.internalProps.layoutMap.getBody(t,e);return i.getFieldData(o,t,e)}getCellRawValue(t,e){if(-1===t||-1===e)return null;const i=this;if(i.internalProps.layoutMap.isHeader(t,e)){const{title:o}=i.internalProps.layoutMap.getHeader(t,e);return"function"==typeof o?o():o}const{field:o}=i.internalProps.layoutMap.getBody(t,e);return i.getRawFieldData(o,t,e)}getRecordShowIndexByCell(t,e){const{layoutMap:i}=this.internalProps;return i.getRecordShowIndexByCell(t,e)}getRecordIndexByCell(t,e){const{layoutMap:i}=this.internalProps,o=i.getRecordShowIndexByCell(t,e);return this.dataSource.currentPagerIndexedData[o]}getTableIndexByRecordIndex(t){return this.transpose?this.dataSource.getTableIndex(t)+this.rowHeaderLevelCount:this.dataSource.getTableIndex(t)+this.columnHeaderLevelCount}getTableIndexByField(t){const e=this.internalProps.layoutMap.columnObjects.find((e=>e.field===t));if(!e)return-1;const i=this.internalProps.layoutMap.getBodyLayoutRangeById(e.id);return this.transpose?i.start.row:i.start.col}getCellAddrByFieldRecord(t,e){return this.transpose?{col:this.getTableIndexByRecordIndex(e),row:this.getTableIndexByField(t)}:{col:this.getTableIndexByField(t),row:this.getTableIndexByRecordIndex(e)}}getCellOriginRecord(t,e){const i=this.getRecordShowIndexByCell(t,e);if(i>-1)return this.dataSource.get(i)}getCellRawRecord(t,e){const i=this.getRecordShowIndexByCell(t,e);if(i>-1)return this.dataSource.getRaw(i)}_canResizeColumn(t,e){const i=super._canResizeColumn(t,e);if(i&&!this.transpose){const i=this.internalProps.layoutMap.getBody(t,this.columnHeaderLevelCount),o=this.internalProps.layoutMap.isSeriesNumber(t,e);if(null==i?void 0:i.disableColumnResize)return!1;if(o&&!0===this.internalProps.rowSeriesNumber.disableColumnResize)return!1}return i}updateOption(t){var e,i,o,n;const r=this.internalProps;if(super.updateOption(t),r.frozenColDragHeaderMode=t.frozenColDragHeaderMode,this.pagination=t.pagination,r.sortState=t.sortState,r.dataConfig=t.groupBy?vP(t.groupBy):{},this.showHeader=null===(e=t.showHeader)||void 0===e||e,r.columns=t.columns?iP(t.columns,["children"]):t.header?iP(t.header,["children"]):[],y_(this),r.enableTreeNodeMerge=null!==(o=null!==(i=t.enableTreeNodeMerge)&&void 0!==i?i:K(t.groupBy))&&void 0!==o&&o,this.internalProps.headerHelper.setTableColumnsEditor(),this.transpose=null!==(n=t.transpose)&&void 0!==n&&n,this.refreshHeader(),this.internalProps.useOneRowHeightFillAll=!1,r.releaseList&&(r.releaseList.forEach((t=>{var e;return null===(e=null==t?void 0:t.release)||void 0===e?void 0:e.call(t)})),r.releaseList=null),t.dataSource?v_(this,t.dataSource):t.records?this.setRecords(t.records,{sortState:t.sortState}):(this._resetFrozenColCount(),this.scenegraph.createSceneGraph(),this.render()),t.title){const e=rx.getComponent("title");r.title=new e(t.title,this),this.scenegraph.resize()}if(this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=rx.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}return new Promise((t=>{setTimeout(t,0)}))}updatePagination(t){this.pagination&&("number"==typeof t.currentPage&&t.currentPage>=0&&(this.pagination.currentPage=t.currentPage),t.perPageCount&&(this.pagination.perPageCount=t.perPageCount||this.pagination.perPageCount),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.clearCells(),this.dataSource.updatePagination(this.pagination),this.refreshRowColCount(),this.stateManager.initCheckedState(this.records),this.scenegraph.createSceneGraph(),this.renderAsync())}refreshHeader(){var t;const e=this.internalProps,i=this.transpose,o=this.showHeader;(e.layoutMap=new pP(this,null!==(t=e.columns)&&void 0!==t?t:[],o,this.options.hierarchyIndent)).transpose=i,i||this.setMinMaxLimitWidth(!0),this.refreshRowColCount()}refreshRowColCount(){var t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;const b=this,{layoutMap:C}=b.internalProps;if(!C)return;const y=null!==(e=null===(t=b.internalProps.dataSource)||void 0===t?void 0:t.length)&&void 0!==e?e:0;C.recordsCount=y+(y>0?C.hasAggregationOnTopCount+C.hasAggregationOnBottomCount:0),b.transpose?(b.rowCount=null!==(i=C.rowCount)&&void 0!==i?i:0,b.colCount=null!==(o=C.colCount)&&void 0!==o?o:0,this.internalProps.frozenColCount=Math.max((null!==(n=C.headerLevelCount)&&void 0!==n?n:0)+C.leftRowSeriesNumberColumnCount,null!==(r=this.options.frozenColCount)&&void 0!==r?r:0),this.internalProps.frozenRowCount=null!==(s=this.options.frozenRowCount)&&void 0!==s?s:0,b.bottomFrozenRowCount!==(null!==(l=this.options.bottomFrozenRowCount)&&void 0!==l?l:0)&&(b.bottomFrozenRowCount=null!==(a=this.options.bottomFrozenRowCount)&&void 0!==a?a:0),b.rightFrozenColCount!==(null!==(h=this.options.rightFrozenColCount)&&void 0!==h?h:0)&&(b.rightFrozenColCount=null!==(d=this.options.rightFrozenColCount)&&void 0!==d?d:0)):(b.colCount=null!==(c=C.colCount)&&void 0!==c?c:0,b.rowCount=C.recordsCount*C.bodyRowSpanCount+C.headerLevelCount,this.internalProps.frozenColCount=null!==(u=this.options.frozenColCount)&&void 0!==u?u:0,b.frozenRowCount=Math.max(C.headerLevelCount,null!==(g=this.options.frozenRowCount)&&void 0!==g?g:0),b.bottomFrozenRowCount!==(null!==(p=this.options.bottomFrozenRowCount)&&void 0!==p?p:0)&&(b.bottomFrozenRowCount=null!==(f=this.options.bottomFrozenRowCount)&&void 0!==f?f:0),b.rightFrozenColCount!==(null!==(v=this.options.rightFrozenColCount)&&void 0!==v?v:0)&&(b.rightFrozenColCount=null!==(m=this.options.rightFrozenColCount)&&void 0!==m?m:0)),this.stateManager.setFrozenCol(this.internalProps.frozenColCount)}getFieldData(t,e,i){if(null===t)return null;if(this.internalProps.layoutMap.isHeader(e,i))return null;const o=this.getRecordShowIndexByCell(this.transpose?e-this.internalProps.layoutMap.leftRowSeriesNumberColumnCount:e,i);return this.internalProps.dataSource.getField(o,t,e,i,this)}getRawFieldData(t,e,i){if(null===t)return null;if(this.internalProps.layoutMap.isHeader(e,i))return null;const o=this.getRecordShowIndexByCell(e,i);return this.internalProps.dataSource.getRawField(o,t,e,i,this)}_moveHeaderPosition(t,e){const i=this.getCellRange(t.col,t.row),o=this.getCellRange(e.col,e.row),n=this.internalProps.layoutMap.moveHeaderPosition(t,e);return n?("column"===n.moveType?(this.colWidthsMap.exchangeOrder(i.start.col,i.end.col-i.start.col+1,o.start.col,o.end.col-o.start.col+1,n.targetIndex),this.transpose||(this.colWidthsLimit={},this.setMinMaxLimitWidth())):n.targetIndex>n.sourceIndex?this.rowHeightsMap.exchangeOrder(n.sourceIndex,n.sourceSize,n.targetIndex+n.sourceSize-n.targetSize,n.targetSize,n.targetIndex):this.rowHeightsMap.exchangeOrder(n.sourceIndex,n.sourceSize,n.targetIndex,n.targetSize,n.targetIndex),n):null}changeRecordOrder(t,e){this.transpose?(t=this.getRecordShowIndexByCell(t,0),e=this.getRecordShowIndexByCell(e,0)):(t=this.getRecordShowIndexByCell(0,t),e=this.getRecordShowIndexByCell(0,e)),this.dataSource.reorderRecord(t,e)}getCellAddress(t,e){let i;for(let e=0;e<this.internalProps.records.length;e++){const o=this.internalProps.records[e];if("function"==typeof t)t(o)&&(i=e);else{let n=!0;for(const e in t)if(o[e]!==t[e]){n=!1;break}n&&(i=e)}if(K(i))break}const o=this.getCellRangeByField(e,i);if(o)return{row:o.start.row,col:o.start.col}}getCellRangeByField(t,e){const{layoutMap:i}=this.internalProps,o=i.columnObjects.find((e=>e.field===t));if(o){const t=i.getBodyLayoutRangeById(o.id);let n;return K(e)&&(n=i.getRecordStartRowByRecordIndex(e)),this.transpose?{start:{row:t.start.row,col:K(n)?n+t.start.col:void 0},end:{row:t.end.row,col:K(n)?n+t.end.col:void 0}}:{start:{col:t.start.col,row:K(n)?n+t.start.row:void 0},end:{col:t.end.col,row:K(n)?n+t.end.row:void 0}}}return null}getHierarchyState(t,e){if(!this.options.groupBy&&!this.getBodyColumnDefine(t,e).tree)return by.none;const i=this.getRecordShowIndexByCell(t,e);return this.dataSource.getHierarchyState(i)}toggleHierarchyState(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.stateManager.updateHoverIcon(t,e,void 0,void 0);const o=this.getHierarchyState(t,e);if(o===by.expand)this._refreshHierarchyState(t,e,i),this.fireListeners(Aw.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:by.collapse});else if(o===by.collapse){const o=this.getCellOriginRecord(t,e);Array.isArray(o.children)&&this._refreshHierarchyState(t,e,i),this.fireListeners(Aw.TREE_HIERARCHY_STATE_CHANGE,{col:t,row:e,hierarchyState:by.expand,originData:o})}}setLoadingHierarchyState(t,e){this.scenegraph.setLoadingHierarchyState(t,e)}_refreshHierarchyState(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];var o;let n=!1,r=!1;const s=this.internalProps.layoutMap.checkHasChart();s&&(this.autoFillWidth&&(n=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&(r=this.getAllRowsHeight()<=this.tableNoFrameHeight));const l=this.getRecordShowIndexByCell(t,e),a=this.dataSource.toggleHierarchyState(l,this.scenegraph.proxy.rowStart-this.columnHeaderLevelCount,Math.max(this.scenegraph.proxy.rowEnd-this.columnHeaderLevelCount,this.scenegraph.proxy.rowStart-this.columnHeaderLevelCount+this.scenegraph.proxy.rowLimit-1)),h=this.internalProps.layoutMap.toggleHierarchyState(a);this.refreshRowColCount();for(let t=this.rowCount-this.bottomFrozenRowCount;t<this.rowCount;t++){const e=oA(t,0,this.colCount-1,this);this._setRowHeight(t,e)}this.clearCellStyleCache(),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1;const d=[{col:t,row:e}];if((null===(o=h.removeCellPositions)||void 0===o?void 0:o.length)>0&&h.removeCellPositions[h.removeCellPositions.length-1].row>=this.scenegraph.proxy.rowEnd){for(let t=0;t<=h.removeCellPositions.length-1;t++)h.removeCellPositions[t].row<=this.scenegraph.proxy.rowEnd&&d.push({col:h.removeCellPositions[t].col,row:h.removeCellPositions[t].row});h.removeCellPositions=[],this.scenegraph.proxy.refreshRowCount()}this.scenegraph.updateRow(h.removeCellPositions,h.addCellPositions,d,i),s&&(this.autoFillWidth&&!n&&(n=this.getAllColsWidth()<=this.tableNoFrameWidth),this.autoFillHeight&&!r&&(r=this.getAllRowsHeight()<=this.tableNoFrameHeight),("adaptive"===this.widthMode||n||"adaptive"===this.heightMode||r)&&this.scenegraph.updateChartSizeForResizeColWidth(-1))}_hasHierarchyTreeHeader(){var t,e;return null===(e=null!==(t=this.options.columns)&&void 0!==t?t:this.options.header)||void 0===e?void 0:e.some(((t,e)=>t.tree))}getMenuInfo(t,e,i){return{field:this.getHeaderField(t,e),value:this.getCellValue(t,e),cellLocation:this.getCellLocation(t,e),event:void 0}}_getSortFuncFromHeaderOption(t,e,i){if(t||(t=this.internalProps.columns),e&&t&&t.length>0)for(let o=0;o<t.length;o++){const n=t[o];if((i&&i===n.fieldKey||!i&&n.field===e)&&n.sort&&"function"==typeof n.sort)return n.sort;if(n.columns){const t=this._getSortFuncFromHeaderOption(n.columns,e,i);if(t)return t}}}updateSortState(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i;if(t)this.internalProps.sortState=t;else if(this.internalProps.sortState)if(Array.isArray(this.internalProps.sortState))for(let e=0;e<this.internalProps.sortState.length;e++)(t=null===(i=this.internalProps.sortState)||void 0===i?void 0:i[e])&&(t.order="normal");else this.internalProps.sortState.order="normal",t=this.internalProps.sortState;(t=Array.isArray(t)?t:[t]).some((t=>t.field))&&e&&this.internalProps.layoutMap.headerObjects.some((t=>!1!==t.define.sort))&&(this.dataSource.sort(t.map((t=>{const e=this._getSortFuncFromHeaderOption(this.internalProps.columns,t.field);return this.internalProps.layoutMap.headerObjects.find((e=>e&&e.field===t.field)),{field:t.field,order:t.order,orderFn:e}}))),this.internalProps.layoutMap.clearCellRangeMap(),this.internalProps.useOneRowHeightFillAll=!1,this.scenegraph.sortCell()),t.length&&this.stateManager.updateSortState(t)}updateFilterRules(t){this.scenegraph.clearCells(),this.sortState?(this.dataSource.updateFilterRulesForSorted(t),bP(this)):this.dataSource.updateFilterRules(t),this.refreshRowColCount(),this.stateManager.initCheckedState(this.records),this.scenegraph.createSceneGraph()}getCheckboxState(t){if(this.stateManager.checkedState.length<this.rowCount-this.columnHeaderLevelCount&&this.stateManager.initLeftRecordsCheckState(this.records),K(t)){let e=this.stateManager.checkedState;return this.options.groupBy&&(e=function(t){const e=[],i=t.dataSource,o=i.dataConfig.groupByRules.length+1;return i.currentIndexedData.forEach(((n,r)=>{if(et(n)&&n.length===o){const{vtableOriginIndex:o}=i.getRawRecord(n);e[o]=t.stateManager.checkedState[n]}})),e}(this)),e.map((e=>e[t]))}return this.stateManager.checkedState}getCellCheckboxState(t,e){var i;const o=this.getBodyColumnDefine(t,e),n=null==o?void 0:o.field,r=this.getCellType(t,e);if(K(n)&&"checkbox"===r){const o=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e));return null===(i=this.stateManager.checkedState[o])||void 0===i?void 0:i[n]}}getRadioState(t){return K(t)?this.stateManager.radioState[t]:this.stateManager.radioState}getCellRadioState(t,e){return function(t,e,i){var o;const n=i.getBodyColumnDefine(t,e),r=null==n?void 0:n.field,s=i.getCellType(t,e);if(K(r)&&"checkbox"===s){const n=i.dataSource.getIndexKey(i.getRecordShowIndexByCell(t,e)),s=null===(o=i.stateManager.radioState)||void 0===o?void 0:o[r];if(nt(s)){if(s===n)return!0}else if(Z(s)){const t=s[n];if(nt(t))return t}}return!1}(t,e,this)}setCellCheckboxState(t,e,i){!function(t,e,i,o){const n=o.scenegraph.getCell(t,e),r=null==n?void 0:n.getChildByName("checkbox");if(!r)return;const{checked:s,indeterminate:l}=r.attribute;l?(i||r._handlePointerUp(),r._handlePointerUp()):s?i||r._handlePointerUp():i&&r._handlePointerUp()}(t,e,i,this)}setCellRadioState(t,e,i){!function(t,e,i,o){const n=o.scenegraph.getCell(t,e);if(n)if(nt(i)){const t=n.getChildAt(i);null==t||t._handlePointerUp()}else{const t=n.getChildByName("radio");null==t||t._handlePointerUp()}}(t,e,i,this)}setRecords(t,e){var i,o;let n;null===(i=this.internalProps.dataSource)||void 0===i||i.release(),this.internalProps.releaseList=null===(o=this.internalProps.releaseList)||void 0===o?void 0:o.filter((t=>!t.dataSourceObj)),this.internalProps.dataSource=null,Array.isArray(e)||(null==e?void 0:e.order)?n=e:e?n=e.sortState:null===e&&(n=null),"undefined"!=typeof window&&window.performance.now();const r={col:this.stateManager.hover.cellPos.col,row:this.stateManager.hover.cellPos.row};if(this.scenegraph.clearCells(),void 0!==n&&(null===n||!Array.isArray(n)&&K(n.field)||Array.isArray(n))&&(this.internalProps.sortState=this.internalProps.multipleSort?Array.isArray(n)?n:[n]:n,this.stateManager.setSortState(this.sortState)),t){if(f_(this,t),this.sortState){const t=Array.isArray(this.sortState)?this.sortState:[this.sortState];t.some((t=>t.order&&t.field&&"normal"!==t.order))&&this.internalProps.layoutMap.headerObjectsIncludeHided.some((t=>!1!==t.define.sort))&&this.dataSource.sort(t.map((t=>{const e=this._getSortFuncFromHeaderOption(void 0,t.field);return this.internalProps.layoutMap.headerObjectsIncludeHided.find((e=>e&&e.field===t.field)),{field:t.field,order:t.order||"asc",orderFn:null!=e?e:qy}})))}this.refreshRowColCount()}else f_(this,t);if(this.stateManager.initCheckedState(t),this.clearCellStyleCache(),this.scenegraph.createSceneGraph(),this.stateManager.updateHoverPos(r.col,r.row),this.internalProps.title&&!this.internalProps.title.isReleased&&(this._updateSize(),this.internalProps.title.resize(),this.scenegraph.resize()),this.options.emptyTip)if(this.internalProps.emptyTip)this.internalProps.emptyTip.resetVisible();else{const t=rx.getComponent("emptyTip");this.internalProps.emptyTip=new t(this.options.emptyTip,this),this.internalProps.emptyTip.resetVisible()}this.render(),K(r.col)&&K(r.row)&&r.col>=0&&r.row>=0&&setTimeout((()=>{var t;null===(t=this.internalProps)||void 0===t||t.tooltipHandler.showTooltip(r.col,r.row)}),0)}setRecordChildren(t,e,i){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const n=this.getCellOriginRecord(e,i);n.children=t;const r=this.getRecordShowIndexByCell(e,i);this.dataSource.setRecord(n,r),this._refreshHierarchyState(e,i,o)}startEditCell(t,e,i){var o;if(K(t)&&K(e))this.eventManager.isDraging=!1,this.selectCell(t,e),this.editorManager.startEditCell(t,e,i);else if(null===(o=this.stateManager.select)||void 0===o?void 0:o.cellPos){const{col:t,row:e}=this.stateManager.select.cellPos;K(t)&&K(e)&&this.editorManager.startEditCell(t,e,i)}}completeEditCell(){this.editorManager.completeEdit()}getEditor(t,e){var i,o;const n=this.getBodyColumnDefine(t,e);let r=this.isHeader(t,e)?null!==(i=null==n?void 0:n.headerEditor)&&void 0!==i?i:this.options.headerEditor:null!==(o=null==n?void 0:n.editor)&&void 0!==o?o:this.options.editor;return"function"==typeof r&&(r=r({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),"string"==typeof r?function(t){if(KT[t])return KT[t]}(r):r}isHasEditorDefine(t,e){var i,o;const n=this.getBodyColumnDefine(t,e);let r=this.isHeader(t,e)?null!==(i=null==n?void 0:n.headerEditor)&&void 0!==i?i:this.options.headerEditor:null!==(o=null==n?void 0:n.editor)&&void 0!==o?o:this.options.editor;return"function"==typeof r&&(r=r({col:t,row:e,dataValue:this.getCellOriginValue(t,e),value:this.getCellValue(t,e)||"",table:this})),K(r)}changeCellValue(t,e,i){return function(t,e,i,o,n){if(o&&n.isHasEditorDefine(t,e)||!1===o){const o=n.getRecordShowIndexByCell(t,e),{field:r}=n.internalProps.layoutMap.getBody(t,e),s=n.getCellRawValue(t,e),l=n.getCellOriginValue(t,e);n.isHeader(t,e)?n.internalProps.layoutMap.updateColumnTitle(t,e,i):n.dataSource.changeFieldValue(i,o,r,t,e,n);const a=n.getCellRange(t,e),h=n.internalProps.layoutMap.getAggregatorsByCell(t,e);if(h){if(Array.isArray(h))for(let t=0;t<(null==h?void 0:h.length);t++)h[t].recalculate();else h.recalculate();const t=n.internalProps.layoutMap.getAggregatorCellAddress(a.start.col,a.start.row,a.end.col,a.end.row);for(let e=0;e<t.length;e++){const i=n.getCellRange(t[e].col,t[e].row);for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)n.scenegraph.updateCellContent(t,e)}}for(let t=a.start.col;t<=a.end.col;t++)for(let e=a.start.row;e<=a.end.row;e++)n.scenegraph.updateCellContent(t,e);if("adaptive"===n.widthMode||n.autoFillWidth&&n.getAllColsWidth()<=n.tableNoFrameWidth)0===n.internalProps._widthResizedColMap.size&&n.scenegraph.recalculateColWidths();else if(!n.internalProps._widthResizedColMap.has(t)){const e=n.getColWidth(t),i=zR(t,0,n.rowCount-1,n,!1);i!==e&&n.scenegraph.updateColWidth(t,i-e)}if("adaptive"===n.heightMode||n.autoFillHeight&&n.getAllRowsHeight()<=n.tableNoFrameHeight)0===n.internalProps._heightResizedRowMap.size&&n.scenegraph.recalculateRowHeights();else if("autoHeight"===n.heightMode&&!n.internalProps._heightResizedRowMap.has(e)){const t=n.getRowHeight(e),i=oA(e,0,n.colCount-1,n);n.scenegraph.updateRowHeight(e,i-t)}n.fireListeners(Aw.CHANGE_CELL_VALUE,{col:t,row:e,rawValue:s,currentValue:l,changedValue:n.getCellOriginValue(t,e)}),n.scenegraph.updateNextFrame()}}(t,e,i,arguments.length>3&&void 0!==arguments[3]&&arguments[3],this)}changeCellValues(t,e,i){return function(t,e,i,o,n){var r,s;let l=t,a=e;const h=[],d=[];let c;for(let o=0;o<i.length&&!(e+o>n.rowCount-1);o++){const r=i[o],s=[],l=[];h.push(s),d.push(l);for(let i=0;i<r.length&&!(t+i>n.colCount-1);i++){c=mP(t+i,e+o,n,c);const r=n.getCellRawValue(t+i,e+o);s.push(r);const a=n.getCellOriginValue(t+i,e+o);l.push(a)}}for(let c=0;c<i.length&&!(e+c>n.rowCount-1);c++){a=e+c;const u=i[c];let g=t;for(let i=0;i<u.length&&!(t+i>n.colCount-1);i++){g=t+i;let l=!1;if(!1===o)l=!0;else if(n.isHasEditorDefine(t+i,e+c)){const o=n.getEditor(t+i,e+c),a=d[c][i],h=u[i],g=null===(s=null===(r=null==o?void 0:o.validateValue)||void 0===r?void 0:r.call(o,h,a))||void 0===s||s;l=!!gw(g)||g}if(l){const o=u[i],r=n.getRecordShowIndexByCell(t+i,e+c),{field:s}=n.internalProps.layoutMap.getBody(t+i,e+c),l=h[c][i],a=d[c][i];n.isHeader(t+i,e+c)?n.internalProps.layoutMap.updateColumnTitle(t+i,e+c,o):n.dataSource.changeFieldValue(o,r,s,t+i,e+c,n),n.fireListeners(Aw.CHANGE_CELL_VALUE,{col:t+i,row:e+c,rawValue:l,currentValue:a,changedValue:n.getCellOriginValue(t+i,e+c)})}}l=Math.max(l,g)}const u=n.getCellRange(t,e),g=n.getCellRange(l,a),p=n.internalProps.layoutMap.getAggregatorsByCellRange(u.start.col,u.start.row,g.end.col,g.end.row);if(p){for(let t=0;t<(null==p?void 0:p.length);t++)p[t].recalculate();if("normal"===c){const t=n.internalProps.layoutMap.getAggregatorCellAddress(u.start.col,u.start.row,g.end.col,g.end.row);for(let e=0;e<t.length;e++){const i=n.getCellRange(t[e].col,t[e].row);for(let t=i.start.col;t<=i.end.col;t++)for(let e=i.start.row;e<=i.end.row;e++)n.scenegraph.updateCellContent(t,e)}}}if("group"===c&&n.dataSource.updateRecordsForGroup([],[]),"sort"===c||"group"===c)return n.dataSource.sortedIndexMap.clear(),bP(n),n.refreshRowColCount(),n.internalProps.layoutMap.clearCellRangeMap(),n.scenegraph.clearCells(),void n.scenegraph.createSceneGraph();for(let t=u.start.col;t<=g.end.col;t++)for(let e=u.start.row;e<=g.end.row;e++)n.scenegraph.updateCellContent(t,e);if("adaptive"===n.widthMode||n.autoFillWidth&&n.getAllColsWidth()<=n.tableNoFrameWidth)0===n.internalProps._widthResizedColMap.size&&n.scenegraph.recalculateColWidths();else for(let e=t;e<=g.end.col;e++)if(!n.internalProps._widthResizedColMap.has(e)){const t=n.getColWidth(e),i=zR(e,0,n.rowCount-1,n,!1);i!==t&&n.scenegraph.updateColWidth(e,i-t)}if("adaptive"===n.heightMode||n.autoFillHeight&&n.getAllRowsHeight()<=n.tableNoFrameHeight)n.scenegraph.recalculateRowHeights();else if("autoHeight"===n.heightMode){const t=[],i=[];for(let o=e;o<=g.end.row;o++)if(n.rowHeightsMap.get(o)){const e=n.getRowHeight(o),r=oA(o,0,n.colCount-1,n);t.push(o),i.push(r-e)}n.scenegraph.updateRowsHeight(t,i)}n.scenegraph.updateNextFrame()}(t,e,i,arguments.length>3&&void 0!==arguments[3]&&arguments[3],this)}addRecord(t,e){!function(t,e,i){var o,n;if(i.options.groupBy)null===(n=(o=i.dataSource).addRecordsForGroup)||void 0===n||n.call(o,[t],e),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.addRecordForSorted(t),bP(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{(void 0===e||e>i.dataSource.sourceLength)&&(e=i.dataSource.sourceLength);const o=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount;i.dataSource.addRecord(t,e);const n=i.rowCount;if(i.refreshRowColCount(),0===i.scenegraph.proxy.totalActualBodyRowCount)return i.scenegraph.clearCells(),void i.scenegraph.createSceneGraph();const r=i.transpose?i.colCount:i.rowCount;if(i.pagination){const{perPageCount:t,currentPage:s}=i.pagination,l=t*(s||0)+t;if(e<l)if(e<l-t)i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const s=e-(l-t)+o;if(n-o===i.pagination.perPageCount){const t=[];for(let e=s;e<r;e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}else{const t=[];for(let e=s;e<Math.min(r,s+1);e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],t,[]):i.scenegraph.updateRow([],t,[])}}}else{const t=[];for(let n=e+o;n<e+o+1;n++)i.transpose?t.push({col:n,row:0}):t.push({col:0,row:n});const n=[],r=i.internalProps.layoutMap.hasAggregationOnTopCount,s=i.internalProps.layoutMap.hasAggregationOnBottomCount;for(let t=o;t<o+r;t++)i.transpose?n.push({col:t,row:0}):n.push({col:0,row:t});for(let t=(i.transpose?i.colCount:i.rowCount)-s;t<(i.transpose?i.colCount:i.rowCount);t++)i.transpose?n.push({col:t,row:0}):n.push({col:0,row:t});i.transpose?i.scenegraph.updateCol([],t,[]):i.scenegraph.updateRow([],t,[])}}}(t,e,this)}addRecords(t,e){!function(t,e,i){var o,n;if(i.options.groupBy)null===(n=(o=i.dataSource).addRecordsForGroup)||void 0===n||n.call(o,t,e),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.addRecordsForSorted(t),bP(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{void 0===e||e>i.dataSource.sourceLength?e=i.dataSource.sourceLength:e<0&&(e=0);const o=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount;i.dataSource.addRecords(t,e);const n=i.transpose?i.colCount:i.rowCount;if(i.refreshRowColCount(),0===i.scenegraph.proxy.totalActualBodyRowCount)return i.scenegraph.clearCells(),void i.scenegraph.createSceneGraph();const r=i.transpose?i.colCount:i.rowCount;if(i.pagination){const{perPageCount:s,currentPage:l}=i.pagination,a=s*(l||0)+s;if(e<a)if(e<a-s)i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const l=e-(a-s)+o;if(n-o===i.pagination.perPageCount){const t=[];for(let e=l;e<r;e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}else{const e=[];for(let o=l;o<Math.min(r,l+(Array.isArray(t)?t.length:1));o++)i.transpose?e.push({col:o,row:0}):e.push({col:0,row:o});i.transpose?i.scenegraph.updateCol([],e,[]):i.scenegraph.updateRow([],e,[])}}}else{const n=[];for(let r=e+o;r<e+o+(Array.isArray(t)?t.length:1);r++)i.transpose?n.push({col:r,row:0}):n.push({col:0,row:r});const r=i.internalProps.layoutMap.hasAggregationOnTopCount,s=i.internalProps.layoutMap.hasAggregationOnBottomCount,l=[];for(let t=o;t<o+r;t++)i.transpose?l.push({col:t,row:0}):l.push({col:0,row:t});for(let t=(i.transpose?i.colCount:i.rowCount)-s;t<(i.transpose?i.colCount:i.rowCount);t++)i.transpose?l.push({col:t,row:0}):l.push({col:0,row:t});i.transpose?i.scenegraph.updateCol([],n,l):i.scenegraph.updateRow([],n,l)}}}(t,e,this)}deleteRecords(t){!function(t,e){var i,o;if((null==t?void 0:t.length)>0)if(e.options.groupBy)null===(o=(i=e.dataSource).deleteRecordsForGroup)||void 0===o||o.call(i,t),e.refreshRowColCount(),e.internalProps.layoutMap.clearCellRangeMap(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else if(e.sortState)e.dataSource.deleteRecordsForSorted(t),bP(e),e.refreshRowColCount(),e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const i=e.dataSource.deleteRecords(t);if(0===i.length)return;const o=e.transpose?e.colCount:e.rowCount;e.refreshRowColCount();const n=e.transpose?e.colCount:e.rowCount,r=i.sort(((t,e)=>t-e)),s=r[0];if(e.pagination){const{perPageCount:t,currentPage:i}=e.pagination,r=t*(i||0)+t;if(s<r)if(s<r-t)e.scenegraph.clearCells(),e.scenegraph.createSceneGraph();else{const i=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount,l=e.internalProps.layoutMap.hasAggregationOnTopCount,a=[],h=[];for(let i=s-(r-t)+(e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount)+l;i<n;i++)e.transpose?a.push({col:i,row:0}):a.push({col:0,row:i});for(let t=i;t<i+l;t++)e.transpose?a.push({col:t,row:0}):a.push({col:0,row:t});if(n<o)for(let t=n;t<o;t++)e.transpose?h.push({col:t,row:0}):h.push({col:0,row:t});e.transpose?e.scenegraph.updateCol(h,[],a):e.scenegraph.updateRow(h,[],a)}}else{const t=[],i=e.transpose?e.rowHeaderLevelCount:e.columnHeaderLevelCount,o=e.internalProps.layoutMap.hasAggregationOnTopCount,n=e.internalProps.layoutMap.hasAggregationOnBottomCount;for(let n=0;n<r.length;n++){const s=r[n]+i+o;e.transpose?t.push({col:s,row:0}):t.push({col:0,row:s})}const s=[];for(let t=i;t<i+o;t++)e.transpose?s.push({col:t,row:0}):s.push({col:0,row:t});for(let t=(e.transpose?e.colCount:e.rowCount)-n;t<(e.transpose?e.colCount:e.rowCount);t++)e.transpose?s.push({col:t,row:0}):s.push({col:0,row:t});e.transpose?e.scenegraph.updateCol(t,[],s):e.scenegraph.updateRow(t,[],s)}}}(t,this)}updateRecords(t,e){!function(t,e,i){var o,n;if((null==e?void 0:e.length)>0)if(i.options.groupBy)null===(n=(o=i.dataSource).updateRecordsForGroup)||void 0===n||n.call(o,t,e),i.refreshRowColCount(),i.internalProps.layoutMap.clearCellRangeMap(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else if(i.sortState)i.dataSource.updateRecordsForSorted(t,e),bP(i),i.refreshRowColCount(),i.scenegraph.clearCells(),i.scenegraph.createSceneGraph();else{const o=i.dataSource.updateRecords(t,e);if(0===o.length)return;const n=o.map((t=>i.getBodyRowIndexByRecordIndex(t))).sort(((t,e)=>t-e));if(i.pagination){const{perPageCount:t,currentPage:e}=i.pagination,o=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount,r=i.internalProps.layoutMap.hasAggregationOnTopCount,s=t*(e||0)+t,l=[];for(let e=0;e<n.length;e++){const o=n[e];if(o<s&&o>=s-t){const e=o-(s-t)+(i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount)+r;l.push(e)}}if(l.length>=1){const t=[];for(let e=0;e<l.length;e++){const o=l[e];i.transpose?t.push({col:o,row:0}):t.push({col:0,row:o})}for(let e=o;e<o+r;e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}}else{const t=[],e=i.transpose?i.rowHeaderLevelCount:i.columnHeaderLevelCount,o=i.internalProps.layoutMap.hasAggregationOnTopCount,r=i.internalProps.layoutMap.hasAggregationOnBottomCount;for(let r=0;r<n.length;r++){const s=n[r]+e+o;i.transpose?t.push({col:s,row:0}):t.push({col:0,row:s})}for(let n=e;n<e+o;n++)i.transpose?t.push({col:n,row:0}):t.push({col:0,row:n});for(let e=(i.transpose?i.colCount:i.rowCount)-r;e<(i.transpose?i.colCount:i.rowCount);e++)i.transpose?t.push({col:e,row:0}):t.push({col:0,row:e});i.transpose?i.scenegraph.updateCol([],[],t):i.scenegraph.updateRow([],[],t)}}}(t,e,this)}_hasCustomRenderOrLayout(){var t,e,i,o;const{headerObjects:n}=this.internalProps.layoutMap;if(this.options.customRender)return!0;for(let r=0;r<n.length;r++){const s=n[r];if((null===(t=null==s?void 0:s.define)||void 0===t?void 0:t.customLayout)||(null===(e=null==s?void 0:s.define)||void 0===e?void 0:e.headerCustomLayout)||(null===(i=null==s?void 0:s.define)||void 0===i?void 0:i.customRender)||(null===(o=null==s?void 0:s.define)||void 0===o?void 0:o.headerCustomRender))return!0}return!1}getAggregateValuesByField(t){const e=this.internalProps.layoutMap.getColumnByField(t),i=[];for(let t=0;t<e.length;t++){const o=e[t].columnDefine.aggregator;if(delete e[t].columnDefine,o){const n={col:e[t].col,aggregateValue:null};if(n.aggregateValue=[],Array.isArray(o))for(let t=0;t<o.length;t++)n.aggregateValue.push({aggregationType:o[t].type,value:o[t].value()});else n.aggregateValue.push({aggregationType:o.type,value:o.value()});i.push(n)}}return i}isAggregation(t,e){return this.internalProps.layoutMap.isAggregation(t,e)}getGroupTitleLevel(t,e){var i;if(!this.options.groupBy)return;const o=this.dataSource.getIndexKey(this.getRecordShowIndexByCell(t,e)),n=null!==(i=this.dataSource.getGroupLength())&&void 0!==i?i:0;let r=et(o)?o.length-1:0;return n>0&&r===n&&(r=void 0),r}getBodyRowIndexByRecordIndex(t){return Array.isArray(t)&&1===t.length&&(t=t[0]),this.dataSource.getTableIndex(t)}}function yP(t){return"bottom"===t||"top"===t}class wP{constructor(){this._scale=new Gb,this._scales=[this._scale]}valueToPosition(t){return this._scale.scale(t)}getPosition(t){let e=0,i=this._scale;if(1===this._scales.length||1===t.length)e=this.valueToPosition(t[0]);else{const o=Math.min(t.length,this._scales.length);for(let i=0;i<o;i++)e+=this._scales[i].scale(t[i]);i=this._scales[o-1]}return{position:e,bandScale:i}}calcScales(t,e){var i,o;const{bandPadding:n,paddingInner:r,paddingOuter:s}=this,l=et(n),a=et(r),h=et(s);for(let d=0;d<this._scales.length;d++){const c=l?n[d]:n,u=a?r[d]:r,g=h?s[d]:s;this._scales[d].paddingInner(null!==(i=null!=u?u:c)&&void 0!==i?i:t,!0).paddingOuter(null!==(o=null!=g?g:c)&&void 0!==o?o:e)}}dataToPosition(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i;if(0===t.length||0===this._scales.length)return 0;const{position:o,bandScale:n}=this.getPosition(t);return o+n.bandwidth()*(null!==(i=e.bandPosition)&&void 0!==i?i:.5)}updateScaleDomain(t){for(let e=0;e<this._scales.length;e++)this._scales[e].domain(t)}updateRange(t){const[e,i]=this._scale.range();t[0]===e&&t[1]===i||this._scale.range(t)}}const xP=Math.sqrt(50),_P=Math.sqrt(10),SP=Math.sqrt(2);class AP{constructor(t){this._extend={},this.type=null!=t?t:"linear",this._scale="log"===t?new gC:"symlog"===t?new pC:new hC,this._scales=[this._scale]}setExtraAttrFromSpec(t,e,i,o,n,r){this.nice=!1,this.zero=e,this.zero&&(i.min=Math.min(i.min,0),i.max=Math.max(i.max,0)),this.domain=i,this.expand=o,"log"===this.type?this._scale.base(null!=n?n:10):"symlog"===this.type&&this._scale.constant(null!=r?r:10)}transformScaleDomain(){"symlog"===this.type||"log"===this.type||this.setScaleNice()}setScaleNice(){"log"===this.type?this.setLogScaleNice():this.setLinearScaleNice()}setLogScaleNice(){var t,e,i,o,n,r;X(null===(t=this.domain)||void 0===t?void 0:t.min)&&X(null===(e=this.domain)||void 0===e?void 0:e.max)?this.nice&&this._scale.nice():K(null===(i=this.domain)||void 0===i?void 0:i.min)&&X(null===(o=this.domain)||void 0===o?void 0:o.max)?this.nice&&this._scale.niceMax():X(null===(n=this.domain)||void 0===n?void 0:n.min)&&K(null===(r=this.domain)||void 0===r?void 0:r.max)&&this.nice&&this._scale.niceMin()}setLinearScaleNice(){var t,e,i,o,n,r,s,l;let a=null!==(e=null!==(t=this.forceTickCount)&&void 0!==t?t:this.tickCount)&&void 0!==e?e:10;"accurateFirst"===this.niceType&&(a=Math.max(10,a)),X(null===(i=this.domain)||void 0===i?void 0:i.min)&&X(null===(o=this.domain)||void 0===o?void 0:o.max)?this.nice&&this._scale.nice(a):K(null===(n=this.domain)||void 0===n?void 0:n.min)&&X(null===(r=this.domain)||void 0===r?void 0:r.max)?this.nice&&this._scale.niceMax(a):X(null===(s=this.domain)||void 0===s?void 0:s.min)&&K(null===(l=this.domain)||void 0===l?void 0:l.max)?this.nice&&this._scale.niceMin(a):this.nice&&this._scale.nice(a)}dataToPosition(t){return this.valueToPosition(t[0])}valueToPosition(t){return this._scale.scale(t)}computeLinearDomain(t){const e=[];return t.forEach((t=>{const{min:i,max:o}=t;e[0]=void 0===e[0]?i:Math.min(e[0],i),e[1]=void 0===e[1]?o:Math.max(e[1],o)})),this.expandDomain(e),this.includeZero(e),this.setDomainMinMax(e),e}expandDomain(t){if(!this.expand)return;const e=t[0],i=t[t.length-1];K(this.expand.min)&&(t[0]=e-(i-e)*this.expand.min),K(this.expand.max)&&(t[t.length-1]=i+(i-e)*this.expand.max)}niceDomain(t){if(K(t[0])||K(t[1])||"linear"!==this.type)return t;if(Math.abs(Tt(t)-Mt(t))<=1e-12){let e=t[0];const i=e>=0?1:-1;if(e=Math.abs(e),e<1)t[0]=0,t[1]=1;else{let i=e/5;const o=Math.floor(Math.log(i)/Math.LN10),n=i/Math.pow(10,o);i=(n>=xP?10:n>=_P?5:n>=SP?2:1)*Math.pow(10,o),t[0]=0,t[1]=10*i}i<0&&(t.reverse(),t[0]*=-1,t[1]*=-1)}return t}niceMinMax(){var t,e,i,o,n,r,s,l;if(this.nice){let a=null!==(e=null!==(t=this.forceTickCount)&&void 0!==t?t:this.tickCount)&&void 0!==e?e:10;"accurateFirst"===this.niceType&&(a=Math.max(10,a)),X(null===(i=this.domain)||void 0===i?void 0:i.min)&&X(null===(o=this.domain)||void 0===o?void 0:o.max)?this._scale.nice(a):K(null===(n=this.domain)||void 0===n?void 0:n.min)&&X(null===(r=this.domain)||void 0===r?void 0:r.max)?this._scale.niceMax(a):X(null===(s=this.domain)||void 0===s?void 0:s.min)&&K(null===(l=this.domain)||void 0===l?void 0:l.max)?this._scale.niceMin(a):this._scale.nice(a)}}includeZero(t){this.zero&&(t[0]=Math.min(t[0],0),t[t.length-1]=Math.max(t[t.length-1],0))}setExtendDomain(t,e){if(void 0===e)return void delete this._extend[t];this._extend[t]=e;const i=this._scale.domain();this.extendDomain(i),this.includeZero(i),this.setDomainMinMax(i),this.niceDomain(i),this._scale.domain(i,this.nice),this.niceMinMax()}extendDomain(t){let e;const i=t.length-1,o=t[0]-t[i]>0,n=o?i:0,r=o?0:i;for(const i in this._extend)e=this._extend[i],e>t[r]&&(t[r]=e),e<t[n]&&(t[n]=e)}setDomainMinMax(t){if(!this.domain)return;const{min:e,max:i}=this.domain;K(e)&&(t[0]=e),K(i)&&(t[1]=i)}setZero(t){this.zero!==t&&(this.zero=t,this.updateScaleDomain())}updateScaleDomain(){const t=this.computeDomain([this.domain]);this.updateScaleDomainByModel(t)}computeDomain(t){return this.computeLinearDomain(t)}updateScaleDomainByModel(t){t=null!=t?t:this._scale.domain(),this.extendDomain(t),this.includeZero(t),this.setDomainMinMax(t),this.niceDomain(t),this._scale.domain(t,this.nice),this.niceMinMax()}updateRange(t){const[e,i]=this._scale.range();t[0]===e&&t[1]===i||this._scale.range(t)}}function RP(t,e){var i;const o=e.option;ut(t)||(null===(i=null==o?void 0:o.label)||void 0===i?void 0:i.flush)&&function(t,e){const{width:i,height:o}=e.getLayoutRect(),n=yP(e.orient),r=!0===e.option.inverse,s=t[0],l=Bt(t);if(n)if(r){const t=i,e=0,o=s.AABBBounds.x2,n=l.AABBBounds.x1;o>t&&s.setAttributes({x:t,textAlign:"right"}),n<e&&l.setAttributes({x:e,textAlign:"left"})}else{const t=0,e=i,o=s.AABBBounds.x1,n=l.AABBBounds.x2;o<t&&s.setAttributes({x:t,textAlign:"left"}),n>e&&l.setAttributes({x:e,textAlign:"right"})}else if(r){const t=s.AABBBounds.y1,e=l.AABBBounds.y2,i=0,n=o;t<i&&s.setAttributes({y:i,textBaseline:"top"}),e>n&&l.setAttributes({y:n,textBaseline:"bottom"})}else{const t=o,e=0,i=s.AABBBounds.y2,n=l.AABBBounds.y1;i>t&&s.setAttributes({y:t,textBaseline:"bottom"}),n<e&&l.setAttributes({y:e,textBaseline:"top"})}}(t,e)}const BP=t=>t;class MP{constructor(t,e,i,o,n){var r,s,l;if(this.x=0,this.y=0,this.padding=o,this.table=n,this.orient=null!==(r=t.orient)&&void 0!==r?r:"left",this.type=null!==(s=t.type)&&void 0!==s?s:"band",this.option=yt({},function(t){var e,i;return(null===(i=null===(e=null==t?void 0:t.colorScheme)||void 0===e?void 0:e.default)||void 0===i?void 0:i.palette)?yt({},uP,{tick:{style:{stroke:t.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},subTick:{style:{stroke:t.colorScheme.default.palette.axisDomainColor||"#D9DDE4"}},label:{style:{fill:t.colorScheme.default.palette.axisLabelFontColor||"#89909D"}},title:{style:{fill:t.colorScheme.default.palette.secondaryFontColor||"#333333"}}}):uP}(t.__vtableChartTheme),function(t,e){let i;return"left"===t?i=e.axisStyle.leftAxisStyle:"right"===t?i=e.axisStyle.rightAxisStyle:"top"===t?i=e.axisStyle.topAxisStyle:"bottom"===t&&(i=e.axisStyle.bottomAxisStyle),yt({},e.axisStyle.defaultAxisStyle,i)}(this.orient,n.theme),function(t,e,i){if(!i)return{};const o=i.axis;let n,r;return"linear"===e||"log"===e||"symlog"===e?n=i.axisLinear:"band"===e&&(n=i.axisBand),"top"===t||"bottom"===t?r=i.axisX:"left"!==t&&"right"!==t||(r=i.axisY),yt({},o,n,r)}(this.orient,this.type,t.__vtableChartTheme),t),"left"===this.orient||"right"===this.orient){const t=0,n=0;this.width=e,this.height=i-o[0]-o[2]-n,this.y=o[0]+t}else if("top"===this.orient||"bottom"===this.orient){const t=0,n=0;this.width=e-o[1]-o[3]-n,this.height=i,this.x=o[3]+t}this.visible=null===(l=t.visible)||void 0===l||l,this.inverse="inverse"in t&&!!t.inverse,"band"===t.type&&(this.data=t.domain),this.initScale(),this.initData(),this.createComponent(),this.initEvent()}initScale(){const t=this.option;"band"===this.type||"point"===this.type?(this.scale=new wP,this.scale.bandPadding=t.bandPadding,this.scale.paddingInner=t.paddingInner,this.scale.paddingOuter=t.paddingOuter,this.scale.calcScales(.1,.3),this.scale.updateScaleDomain(this.data),this.updateScaleRange()):"linear"!==this.type&&"time"!==this.type&&"log"!==this.type&&"symlog"!==this.type||(this.scale=new AP(this.type),this.scale.setExtraAttrFromSpec(t.nice,t.zero,t.range,t.expand,t.base,t.constant),this.scale.transformScaleDomain(),this.scale.updateScaleDomain(),this.updateScaleRange())}initData(){var t,e,i;this.table._vDataSet||(this.table._vDataSet=new QT),function(t,e,i){t.getParser(e)||t.registerParser(e,i)}(this.table._vDataSet,"scale",BP),t=this.table._vDataSet,e="ticks",i=SC,t.getTransform(e)||t.registerTransform(e,i);const o=this.option.label||{},n=this.option.tick||{},r=new eP(this.table._vDataSet).parse(this.scale._scale,{type:"scale"}).transform({type:"ticks",options:{sampling:!1!==this.option.sampling,tickCount:n.tickCount,forceTickCount:n.forceTickCount,tickStep:n.tickStep,tickMode:n.tickMode,noDecimals:n.noDecimals,axisOrientType:this.orient,coordinateType:"cartesian",labelStyle:o.style,labelFormatter:o.formatMethod,labelGap:o.minGap,labelLastVisible:o.lastVisible,labelFlush:o.flush}},!1);this.tickData=r,this.computeData()}computeData(){this.tickData.reRunAllTransform()}initEvent(){}createComponent(){const t=gP(this.option),e=this.getUpdateAttribute();e.verticalFactor="top"===this.orient||"right"===this.orient?-1:1,this.component=new vb(yt({disableTriggerEvent:this.table.options.disableInteraction},t,e)),this.component.setAttributes(this.setLayoutStartPosition({x:this.x,y:this.y})),this.component.originAxis=this}resize(t,e){this.width=t-("top"===this.orient||"bottom"===this.orient?this.padding[1]+this.padding[3]:0),this.height=e-("left"===this.orient||"right"===this.orient?this.padding[2]+this.padding[0]:0),this.updateScaleRange(),this.computeData();const i=gP(this.option),o=this.getUpdateAttribute();o.verticalFactor="top"===this.orient||"right"===this.orient?-1:1,this.component.setAttributes(yt({},i,o)),this.component.setAttributes(this.setLayoutStartPosition({x:this.x,y:this.y})),this.overlap()}overlap(){!function(t,e){const i=t.find((t=>"axis-label-container-layer-0"===t.name),!0),o=t.find((t=>"axis-label-container-layer-1"===t.name),!0);RP(i?i.getChildren():[],e),RP(o?o.getChildren():[],e)}(this.component,this)}getLayoutRect(){return{width:this.width,height:this.height}}getUpdateAttribute(){this.table.tableNoFrameHeight,this.table.tableNoFrameWidth;const{width:t,height:e}=this.getLayoutRect(),i=yP(this.orient),o="left"===(n=this.orient)||"right"===n;var n;let r={x:0,y:0},s=0;i?(r={x:t,y:0},s=t):o&&(r={x:0,y:e},s=e);const l="top"===this.orient||"bottom"===this.orient?e:t;return{start:{x:0,y:0},end:r,title:{text:this.option.title.text,maxWidth:this._getTitleLimit(i)},items:this.getLabelItems(s),verticalLimitSize:l,verticalMinSize:l}}getLabelItems(t){return[this.tickData.latestData.map((e=>({id:e.value,label:e.value,value:0===t?0:this.scale.dataToPosition([e.value])/t,rawValue:e.value}))).filter((t=>t.value>=0&&t.value<=1))]}updateScaleRange(){var t,e,i,o,n,r,s,l;const a=null!==(e=null===(t=this.option.innerOffset)||void 0===t?void 0:t.right)&&void 0!==e?e:0,h=null!==(o=null===(i=this.option.innerOffset)||void 0===i?void 0:i.left)&&void 0!==o?o:0,d=null!==(r=null===(n=this.option.innerOffset)||void 0===n?void 0:n.top)&&void 0!==r?r:0,c=null!==(l=null===(s=this.option.innerOffset)||void 0===s?void 0:s.bottom)&&void 0!==l?l:0,{width:u,height:g}=this.getLayoutRect(),p=this.option.inverse||!1;let f=[0,0];yP(this.orient)?rt(u)&&(f=p?[u-a,h]:[h,u-a]):rt(g)&&(f=p?[d,g-c]:[g-c,d]),this.scale.updateRange(f)}setLayoutStartPosition(t){let{x:e,y:i}=t;return rt(e)&&(e+=Number("left"===this.orient)*this.getLayoutRect().width),rt(i)&&(i+=Number("top"===this.orient)*this.getLayoutRect().height),{x:e,y:i}}_getTitleLimit(t){var e,i,o;if(this.option.title.visible&&X(null===(e=this.option.title.style)||void 0===e?void 0:e.maxLineWidth)){let e=(null===(i=this.option.title.style)||void 0===i?void 0:i.angle)||0;if((null===(o=this.option.title)||void 0===o?void 0:o.autoRotate)&&X(this.option.title.angle)&&(e="left"===this.option.orient?-90:90),t){const t=this.getLayoutRect().width,i=Math.abs(Math.cos(fe(e)));return i<1e-6?1/0:t/i}const n=this.getLayoutRect().height,r=Math.abs(Math.sin(fe(e)));return r<1e-6?1/0:n/r}return null}getScale(){return this.scale._scale}getDomainSpec(){return this.scale.domain}}function TP(t,e){var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;const b=yt({},uP,t);let C=0;!1!==b.tick.visible&&(C=null!==(i=b.tick.width)&&void 0!==i?i:4);let y=0;if(b.label.visible){if("band"===b.type)b.domain.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;b.label.formatMethod&&(t=b.label.formatMethod(t));const{width:C,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=b.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:hP,fontWeight:null!==(l=null===(s=null===(r=b.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=b.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:aP}),x=(null===(u=null===(c=b.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(m=null===(v=b.label)||void 0===v?void 0:v.style)||void 0===m?void 0:m.direction)?90:0);y=Math.max(y,kP(Math.min(C,x),w,_).width)}));else{let i;if(et(t.__ticksForVTable))i=t.__ticksForVTable;else{const t=b.range,e=Math.abs(t.min)>1?Math.round(t.min):t.min,o=Math.abs(t.max)>1?Math.round(t.max):t.max;i=[EP(e),EP(o)]}i.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;b.label.formatMethod&&(t=b.label.formatMethod(t));const{width:C,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=b.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:hP,fontWeight:null!==(l=null===(s=null===(r=b.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=b.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:aP}),x=(null===(u=null===(c=b.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(m=null===(v=b.label)||void 0===v?void 0:v.style)||void 0===m?void 0:m.direction)?90:0);y=Math.max(y,kP(Math.min(C,x),w,_).width)}))}y+=null!==(o=b.label.space)&&void 0!==o?o:4}let w=0;if(b.title.visible&&tt(b.title.text)){const{width:i,height:o}=e.measureText(b.title.text,{fontSize:null!==(s=null===(r=null===(n=b.title)||void 0===n?void 0:n.style)||void 0===r?void 0:r.fontSize)&&void 0!==s?s:hP,fontWeight:null!==(h=null===(a=null===(l=b.title)||void 0===l?void 0:l.style)||void 0===a?void 0:a.fontWeight)&&void 0!==h?h:"normal",fontFamily:null!==(u=null===(c=null===(d=b.title)||void 0===d?void 0:d.style)||void 0===c?void 0:c.fontFamily)&&void 0!==u?u:aP}),C=(null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.maxLineWidth)||1/0,y=kP(Math.min(i,C),o,null===(v=null===(f=b.title)||void 0===f?void 0:f.style)||void 0===v?void 0:v.angle);w="left"!==t.orient&&"right"!==t.orient||!b.title.autoRotate?y.width:y.height,w+=null!==(m=b.title.space)&&void 0!==m?m:4}return C+y+w+1}function PP(t,e){var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;const b=yt({},uP,t);let C=0;!1!==b.tick.visible&&(C=null!==(i=b.tick.width)&&void 0!==i?i:4);let y=0;if(b.label.visible){if("band"===b.type)b.domain.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;b.label.formatMethod&&(t=b.label.formatMethod(t));const{width:C,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=b.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:hP,fontWeight:null!==(l=null===(s=null===(r=b.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=b.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:aP}),x=(null===(u=null===(c=b.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(m=null===(v=b.label)||void 0===v?void 0:v.style)||void 0===m?void 0:m.direction)?90:0);y=Math.max(y,kP(Math.min(C,x),w,_).height)}));else{let i;if(et(t.__ticksForVTable))i=t.__ticksForVTable;else{const t=b.range,e=Math.abs(t.min)>1?Math.round(t.min):t.min,o=Math.abs(t.max)>1?Math.round(t.max):t.max;i=[EP(e),EP(o)]}i.forEach((t=>{var i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m;b.label.formatMethod&&(t=b.label.formatMethod(t));const{width:C,height:w}=e.measureText(t,{fontSize:null!==(n=null===(o=null===(i=b.label)||void 0===i?void 0:i.style)||void 0===o?void 0:o.fontSize)&&void 0!==n?n:hP,fontWeight:null!==(l=null===(s=null===(r=b.label)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontWeight)&&void 0!==l?l:"normal",fontFamily:null!==(d=null===(h=null===(a=b.label)||void 0===a?void 0:a.style)||void 0===h?void 0:h.fontFamily)&&void 0!==d?d:aP}),x=(null===(u=null===(c=b.label)||void 0===c?void 0:c.style)||void 0===u?void 0:u.maxLineWidth)||1/0,_=(null!==(f=null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.angle)&&void 0!==f?f:0)+("vertical"===(null===(m=null===(v=b.label)||void 0===v?void 0:v.style)||void 0===m?void 0:m.direction)?90:0);y=Math.max(y,kP(Math.min(C,x),w,_).height)}))}y+=null!==(o=b.label.space)&&void 0!==o?o:4}let w=0;if(b.title.visible&&b.title.text){const{width:i,height:o}=e.measureText(b.title.text,{fontSize:null!==(s=null===(r=null===(n=b.title)||void 0===n?void 0:n.style)||void 0===r?void 0:r.fontSize)&&void 0!==s?s:hP,fontWeight:null!==(h=null===(a=null===(l=b.title)||void 0===l?void 0:l.style)||void 0===a?void 0:a.fontWeight)&&void 0!==h?h:"normal",fontFamily:null!==(u=null===(c=null===(d=b.title)||void 0===d?void 0:d.style)||void 0===c?void 0:c.fontFamily)&&void 0!==u?u:aP}),C=(null===(p=null===(g=b.label)||void 0===g?void 0:g.style)||void 0===p?void 0:p.maxLineWidth)||1/0,y=kP(Math.min(i,C),o,null===(v=null===(f=b.title)||void 0===f?void 0:f.style)||void 0===v?void 0:v.angle);w="bottom"!==t.orient&&"top"!==t.orient||!b.title.autoRotate?y.height:y.width,w+=null!==(m=b.title.space)&&void 0!==m?m:4}return C+y+w+1}function EP(t){return"number"!=typeof t&&(t=Number(t)),Number(t.toPrecision(1)).toString()}function kP(t,e){const i=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)*Math.PI/180,o=-t/2,n=-e/2,r=t/2,s=-e/2,l=t/2,a=e/2,h=-t/2,d=e/2,c={x:o*Math.cos(i)-n*Math.sin(i),y:o*Math.sin(i)+n*Math.cos(i)},u={x:r*Math.cos(i)-s*Math.sin(i),y:r*Math.sin(i)+s*Math.cos(i)},g={x:l*Math.cos(i)-a*Math.sin(i),y:l*Math.sin(i)+a*Math.cos(i)},p={x:h*Math.cos(i)-d*Math.sin(i),y:h*Math.sin(i)+d*Math.cos(i)},f=Math.min(c.x,u.x,g.x,p.x),v=Math.max(c.x,u.x,g.x,p.x),m=Math.min(c.y,u.y,g.y,p.y);return{width:v-f,height:Math.max(c.y,u.y,g.y,p.y)-m}}class LP{constructor(t,e){this._emptyTipOption={spaceBetweenTextAndIcon:20,text:"no data",textStyle:{fontSize:14,color:"#000"},icon:{image:'<svg t="1716726614852" class="icon" viewBox="0 0 1194 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2621" width="200" height="200"><path d="M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z" fill="#8a8a8a" p-id="2622"></path></svg>',width:100,height:100}},this.isReleased=!1,this.table=e,this._emptyTipOption=Object.assign(this._emptyTipOption,!0===t?{}:t),this._emptyTipComponent=this._createOrUpdateEmptyTipComponent(this._getEmptyTipAttrs())}_createOrUpdateEmptyTipComponent(t){if(this._emptyTipComponent)_t(t,this._cacheAttrs)||this._emptyTipComponent.setAttributes(t);else{const e=new ZC(t);e.name="emptyTip",this.table.scenegraph.stage.defaultLayer.appendChild(e),this._emptyTipComponent=e}return this._emptyTipComponent}resize(){var t;if(!this._emptyTipComponent)return;const e=this.table.transpose||!1===this.table.options.indicatorsAsCol?this.table.getFrozenColsWidth():0,i=!this.table.transpose||this.table.options.indicatorsAsCol?this.table.getFrozenRowsHeight():0,o=(this.table.columnHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().width:this.table.tableNoFrameWidth)-e-this.table.getTheme().scrollStyle.width,n=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-i-this.table.getTheme().scrollStyle.width;this._emptyTipComponent.setAttributes({spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+i,width:o,height:n,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:null===(t=this._emptyTipOption.textStyle)||void 0===t?void 0:t.color}),icon:Object.assign({},this._emptyTipOption.icon)})}release(){this._emptyTipComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent),this._emptyTipComponent=null,this.isReleased=!0}resetVisible(){(this.table.recordsCount&&0!==this.table.recordsCount||this.table.internalProps.layoutMap.rowCount!==this.table.internalProps.layoutMap.columnHeaderLevelCount)&&this.table.internalProps.layoutMap.colCount!==this.table.internalProps.layoutMap.rowHeaderLevelCount?this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)&&this.table.scenegraph.stage.defaultLayer.removeChild(this._emptyTipComponent):this.table.scenegraph.stage.defaultLayer.children.includes(this._emptyTipComponent)||this.table.scenegraph.stage.defaultLayer.appendChild(this._emptyTipComponent)}_getEmptyTipAttrs(){var t;const e=this.table.transpose||!1===this.table.options.indicatorsAsCol?this.table.getFrozenColsWidth():0,i=!this.table.transpose||this.table.options.indicatorsAsCol?this.table.getFrozenRowsHeight():0,o=(this.table.columnHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().width:this.table.tableNoFrameWidth)-e-this.table.getTheme().scrollStyle.width,n=(this.table.rowHeaderLevelCount>0&&this.table.isListTable()?this.table.getDrawRange().height:this.table.tableNoFrameHeight)-i-this.table.getTheme().scrollStyle.width;return{spaceBetweenTextAndIcon:this._emptyTipOption.spaceBetweenTextAndIcon,x:this.table.tableX+e,y:this.table.tableY+i,width:o,height:n,text:Object.assign(Object.assign({text:this._emptyTipOption.text},this._emptyTipOption.textStyle),{fill:null===(t=this._emptyTipOption.textStyle)||void 0===t?void 0:t.color}),icon:Object.assign({},this._emptyTipOption.icon)}}}var HP=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};const FP={orient:"bottom",position:"middle",padding:30,title:{visible:!1,padding:0,textStyle:{fontSize:14,fill:"#000000",fontWeight:"normal"},space:12},item:{visible:!0,spaceCol:10,spaceRow:10,padding:2,background:{state:{selectedHover:{fill:"gray",fillOpacity:.7},unSelectedHover:{fill:"gray",fillOpacity:.2}}},shape:{space:4,state:{unSelected:{fillOpacity:.5}}},label:{space:4,style:{fill:"#89909D",fontSize:14},state:{unSelected:{fillOpacity:.5}}}},allowAllCanceled:!0,visible:!0};class zP{constructor(t,e){var i,o,n,r;this.table=e,this.option=vt(t),this.orient=null!==(i=t.orient)&&void 0!==i?i:"left",this.visible=null===(o=t.visible)||void 0===o||o,this.position=null!==(n=t.position)&&void 0!==n?n:"middle",this.selectedData=null!==(r=t.defaultSelected)&&void 0!==r?r:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),e=new DC(yt({},t,{defaultSelected:this.selectedData,disableTriggerEvent:this.table.options.disableInteraction}));e.name="legend",this.legendComponent=e,!1===this.visible&&(e.setAttributes({maxWidth:0,width:0,maxHeight:0,height:0,clip:!0}),e.hideAll()),this.table.scenegraph.stage.defaultLayer.appendChild(e),this.adjustTableSize(t)}resize(){this.legendComponent&&(this.legendComponent.setAttributes({maxWidth:this.table.tableNoFrameWidth,maxHeight:this.table.tableNoFrameHeight}),this.adjustTableSize(this.legendComponent.attribute))}adjustTableSize(t){var e,i;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,n=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||n<=0)return;const r=this.table.tableNoFrameWidth,s=this.table.tableNoFrameHeight,l=Fx(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this.option.padding)&&void 0!==i?i:10);let a=0,h=0;"left"===this.orient?(a=l[3],h=0,o+=l[1]+l[3]):"top"===this.orient?(a=0,h=l[0],n+=l[0]+l[2]):"right"===this.orient?(a=r-o-l[1],h=0,o+=l[1]+l[3]):"bottom"===this.orient&&(a=0,h=s-n-l[2],n+=l[0]+l[2]);const d="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",c=this.position;let u=0,g=0;"horizontal"===d?u="middle"===c?(r-o)/2:"end"===c?r-o-l[1]:l[3]:g="middle"===c?(s-n)/2:"end"===c?s-n-l[2]:l[0],this.legendComponent.setAttributes({dx:u,dy:g,x:a,y:h}),"left"===this.orient?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):"top"===this.orient?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n),this.table.tableY+=Math.ceil(n)):"right"===this.orient?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):"bottom"===this.orient&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n))}getLegendAttributes(t){var e,i;const o="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",n=function(t,e){const i=yt({},FP,t),{title:o={},item:n={},pager:r={},background:s={},type:l,id:a,visible:h,orient:d,position:c,data:u,filter:g,regionId:p,regionIndex:f,seriesIndex:v,seriesId:m,padding:b}=i,C=HP(i,["title","item","pager","background","type","id","visible","orient","position","data","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return o.visible&&(C.title=oP(o)),ut(n.focusIconStyle)||nP(n.focusIconStyle),rP(n.shape),rP(n.label),rP(n.value),rP(n.background),g_(n.maxWidth)&&(n.maxWidth=Number(n.maxWidth.substring(0,n.maxWidth.length-1))*e.width/100),g_(n.width)&&(n.width=Number(n.width.substring(0,n.width.length-1))*e.width/100),g_(n.height)&&(n.height=Number(n.height.substring(0,n.height.length-1))*e.width/100),C.item=n,ut(r.textStyle)||nP(r.textStyle),rP(r.handler),C.pager=r,s.visible&&!ut(s.style)&&(yt(C,s.style),K(s.padding)&&(C.padding=s.padding)),C}(this.option,t),r=Fx(null!==(i=null!==(e=n.padding)&&void 0!==e?e:this.option.padding)&&void 0!==i?i:10);return Object.assign({layout:o,items:this.getLegendItems(),maxWidth:t.width-r[1]-r[3],maxHeight:t.height-r[0]-r[2]},n)}getLegendItems(){return this.option.data}initEvent(){this.legendComponent&&(this.legendComponent.addEventListener(kC.legendItemClick,(t=>{const e=gt(t,"detail.currentSelected");this.table.fireListeners(Aw.LEGEND_ITEM_CLICK,{model:this,value:e,event:t})})),this.legendComponent.addEventListener(kC.legendItemHover,(t=>{const e=gt(t,"detail");this.table.fireListeners(Aw.LEGEND_ITEM_HOVER,{model:this,value:e,event:t})})),this.legendComponent.addEventListener(kC.legendItemUnHover,(t=>{const e=gt(t,"detail");this.table.fireListeners(Aw.LEGEND_ITEM_UNHOVER,{model:this,value:e,event:t})})),this.legendComponent.addEventListener("legendItemAttributeUpdate",(t=>{this.table.scenegraph.updateNextFrame()})))}getLegendBounds(){return{width:isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,height:isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0}}release(){this.legendComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent),this.legendComponent=null}}var IP=function(t,e){var i={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(i[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(t);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(t,o[n])&&(i[o[n]]=t[o[n]])}return i};const OP={orient:"right",position:"middle",padding:30,title:{visible:!1,padding:0,textStyle:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"titleFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}},endText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}},handlerText:{style:{fontSize:14,fontWeight:"normal",fill:{type:"palette",key:"labelFontColor"}}}},DP={horizontal:Object.assign(Object.assign({},OP),{rail:{width:200,height:8,style:{fill:"rgba(0,0,0,0.04)"}}}),vertical:Object.assign(Object.assign({},OP),{rail:{width:8,height:200,style:{fill:"rgba(0,0,0,0.04)"}}})},WP={horizontal:Object.assign({sizeBackground:{fill:"#cdcdcd"},track:{style:{fill:"rgba(20,20,20,0.1)"}},rail:{width:200,height:4,style:{fill:"rgba(0,0,0,0.04)"}}},OP),vertical:Object.assign({sizeBackground:{fill:"#cdcdcd"},track:{style:{fill:"rgba(20,20,20,0.1)"}},rail:{width:4,height:200,style:{fill:"rgba(0,0,0,0.04)"}}},OP)};class NP{constructor(t,e){var i,o,n,r;this.table=e,this.option=vt(t),this.orient=null!==(i=t.orient)&&void 0!==i?i:"left",this.visible=null===(o=t.visible)||void 0===o||o,this.position=null!==(n=t.position)&&void 0!==n?n:"middle",this.selectedData=null!==(r=t.defaultSelected)&&void 0!==r?r:null,this.createComponent(),this.initEvent()}createComponent(){const t=this.getLegendAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight});let e;e="color"===this.option.type?new UC(yt({},t,{slidable:!0})):new $C(yt({},t,{slidable:!0})),e.name="legend",this.legendComponent=e,this.table.scenegraph.stage.defaultLayer.appendChild(e),this.adjustTableSize(t)}resize(){this.legendComponent&&(this.legendComponent.setAttributes({width:this.table.tableNoFrameWidth,height:this.table.tableNoFrameHeight}),this.adjustTableSize(this.legendComponent.attribute))}adjustTableSize(t){var e,i;let o=isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,n=isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0;if(o<=0||n<=0)return;const r=this.table.tableNoFrameWidth,s=this.table.tableNoFrameHeight,l=Fx(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this.option.padding)&&void 0!==i?i:10);let a=0,h=0;"left"===this.orient?(a=l[3],h=0,o+=l[1]+l[3]):"top"===this.orient?(a=0,h=l[0],n+=l[0]+l[2]):"right"===this.orient?(a=r-o-l[1],h=0,o+=l[1]+l[3]):"bottom"===this.orient&&(a=0,h=s-n-l[2],n+=l[0]+l[2]);const d="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",c=this.position;let u=0,g=0;"horizontal"===d?u="middle"===c?(r-o)/2:"end"===c?r-o-l[1]:l[3]:g="middle"===c?(s-n)/2:"end"===c?s-n-l[2]:l[0],this.legendComponent.setAttributes({dx:u,dy:g,x:a,y:h}),"left"===this.orient?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o),this.table.tableX+=Math.ceil(o)):"top"===this.orient?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n),this.table.tableY+=Math.ceil(n)):"right"===this.orient?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(o):"bottom"===this.orient&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(n))}getLegendAttributes(t){const e="bottom"===this.orient||"top"===this.orient?"horizontal":"vertical",i="horizontal"===e?"bottom":this.orient;return Object.assign(Object.assign({},function(t,e){const i=yt({},("color"===t.type?DP:WP)["bottom"===t.orient||"top"===t.orient?"horizontal":"vertical"],t),{title:o={},handler:n={},rail:r={},track:s={},startText:l,endText:a,handlerText:h,sizeBackground:d,background:c={},type:u,id:g,visible:p,orient:f,position:v,data:m,defaultSelected:b,field:C,filter:y,regionId:w,regionIndex:x,seriesIndex:_,seriesId:S,padding:A}=i,R=IP(i,["title","handler","rail","track","startText","endText","handlerText","sizeBackground","background","type","id","visible","orient","position","data","defaultSelected","field","filter","regionId","regionIndex","seriesIndex","seriesId","padding"]);return o.visible&&(R.title=oP(o)),R.showHandler=!1!==n.visible,ut(n.style)||(R.handlerStyle=nP(n.style)),K(r.width)&&(R.railWidth=r.width),K(r.height)&&(R.railHeight=r.height),ut(r.style)||(R.railStyle=nP(r.style)),ut(s.style)||(R.trackStyle=nP(s.style)),R.startText=rP(l),R.endText=rP(a),R.handlerText=rP(h),ut(d)||(R.sizeBackground=nP(d)),c.visible&&!ut(c.style)&&(yt(R,c.style),K(c.padding)&&(R.padding=c.padding)),R}(this.option)),{layout:e,align:i,min:this.option.min,max:this.option.max,value:this.option.value,["color"===this.option.type?"colors":"sizeRange"]:"color"===this.option.type?this.option.colors:this.option.sizeRange})}initEvent(){this.legendComponent&&this.legendComponent.addEventListener("change",(t=>{const e=gt(t,"detail.value");this.table.fireListeners(Aw.LEGEND_CHANGE,{model:this,value:e,event:t}),this.table.scenegraph.updateNextFrame()}))}getLegendBounds(){return{width:isFinite(this.legendComponent.AABBBounds.width())?this.legendComponent.AABBBounds.width():0,height:isFinite(this.legendComponent.AABBBounds.height())?this.legendComponent.AABBBounds.height():0}}release(){this.legendComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this.legendComponent),this.legendComponent=null}}function GP(t,e){return"color"===t.type||"size"===t.type?new NP(t,e):new zP(t,e)}class jP{constructor(t){this._table=t}release(){this.unbindMenuElement(),this._menuElement&&this._menuElement.release(),this._menuElement=void 0}_getMenuElement(){return this._menuElement||(this._menuElement=this.createMenuElementInternal()),this._menuElement}bindMenuElement(t,e,i){return this._getMenuElement().bindToCell(this._table,t,e,i)}unbindMenuElement(){this._getMenuElement().unbindFromCell()}pointInMenuElement(t,e){return this._getMenuElement().pointInMenuElement(t,e)}}const UP="vtable__menu-element",VP=`${UP}--hidden`,$P=`${UP}--shown`;class YP{constructor(t){var e,i,o;this._handler=new Pw,this._rootElement=OM("div",[UP,VP]),this._rootElement.addEventListener("wheel",(t=>{t.stopPropagation()})),null===(e=this._rootElement)||void 0===e||e.addEventListener("mousedown",(t=>{t.stopPropagation(),t.preventDefault()})),null===(i=this._rootElement)||void 0===i||i.addEventListener("click",(e=>{if(e.stopPropagation(),e.preventDefault(),this._rootElement.classList.contains(VP))return;const{col:i,row:o,dropDownIndex:n,menuKey:r,text:s,hasChildren:l}=e.target;if("number"!=typeof n||l)return void e.stopPropagation();const a=t.isPivotTable()?t.internalProps.layoutMap.getPivotDimensionInfo(i,o):t.getHeaderField(i,o),h=t._dropDownMenuIsHighlight(i,o,n);t.fireListeners(Aw.DROPDOWN_MENU_CLICK,{col:i,row:o,field:a,menuKey:r,text:s,highlight:h,cellLocation:t.getCellLocation(i,o),event:e}),t.fireListeners(Aw.DROPDOWN_MENU_CLEAR,null),t.fireListeners(Aw.HIDE_MENU,null),e.stopPropagation()})),null===(o=this._rootElement)||void 0===o||o.addEventListener("mousemove",(t=>{this._rootElement.classList.contains(VP)||t.stopPropagation()}))}get rootElement(){return this._rootElement}release(){this.unbindFromCell();const t=this._rootElement;(null==t?void 0:t.parentElement)&&t.parentElement.removeChild(t),this._handler.release(),delete this._rootElement}bindToCell(t,e,i,o){const n=this._rootElement;if(this._menuInstanceInfo=o,null==n||n.classList.remove($P),null==n||n.classList.add(VP),this._canBindToCell(t,e,i)){if(n.innerHTML="",n.appendChild(o.content),this._bindCell(t,e,i,o.position,o.referencePosition))return null==n||n.classList.add($P),null==n||n.classList.remove(VP),!0}else this.unbindFromCell();return!1}unbindFromCell(){const t=this._rootElement;this._menuInstanceInfo=void 0,(null==t?void 0:t.parentElement)&&(t.classList.remove($P),t.classList.add(VP))}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),n=t.getElement(),{top:r,bottom:s,left:l,right:a}=o;if(t.isFrozenCell(e,i))return!0;if(s<t.getFrozenRowsHeight()||a<t.getFrozenColsWidth()||l>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||r>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:h,offsetWidth:d}=n;return!(h<r||d<l)}_bindCell(t,e,i,o,n){const r=this._rootElement,s=t.getElement(),{width:l,height:a}=t.internalProps.element.getBoundingClientRect();if(r){r.parentElement!==s&&s.appendChild(r),r.style.left="0px";const t=.8*l;r.style.maxWidth=`${t}px`;const e=r.clientWidth,i=r.clientHeight;let h,d;return o&&(h=o.x,d=o.y),n&&(h=n.rect.right-e,d=n.rect.bottom),d+i>a&&(d=a-i,h+=e-2),d<0&&(d/=2),r.style.top=`${d}px`,h<0?h=0:h+e>l&&(h=l-e),r.style.left=`${h}px`,!0}return!1}pointInMenuElement(t,e){const i=this._rootElement,{x:o,y:n,width:r,height:s}=i.getBoundingClientRect();return t>o-5&&t<o+r+5&&e>n-5&&e<n+s+5}}class XP extends jP{createMenuElementInternal(){return new tT(this._table)}}class KP extends jP{createMenuElementInternal(){return new YP(this._table)}}const ZP={"dropdown-menu":function(t){return new XP(t)},"context-menu":function(t){return new XP(t)},container:t=>new KP(t)};class qP{constructor(t){this._table=t,this._menuInstances={},this._bindTableEvent(t)}release(){const t=this._menuInstances;for(const e in t)t[e].release();delete this._menuInstances,this._attachInfo=null}_bindToCell(t,e,i,o){var n;const r=this._attachInfo,s=this._getMenuInstanceInfo(t,e,i,o);if(!r||s&&r.instance===s.instance||(null===(n=r.instance)||void 0===n||n.unbindMenuElement(),this._attachInfo=null),!s)return;const{instance:l,info:a}=s;if(l&&l.bindMenuElement(t,e,a)){const i=this._table.getCellRange(t,e);this._attachInfo={range:i,instance:l}}}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;null==e||e.unbindMenuElement(),this._attachInfo=null}_isBindToCell(t,e){const i=this._attachInfo;return!!i&&vw(i.range,t,e)}pointInMenuElement(t,e){if(!this._attachInfo)return!1;const i=this._attachInfo,{instance:o}=i;return o.pointInMenuElement(t,e)}_bindTableEvent(t){t.on(Aw.DROPDOWN_ICON_CLICK,(t=>{this._attachInfo&&this._isBindToCell(t.col,t.row)?this._unbindFromCell():this._bindToCell(t.col,t.row,"dropdown-menu")})),t.on(Aw.DROPDOWN_MENU_CLEAR,(t=>{this._unbindFromCell()})),t.on(Aw.CONTEXTMENU_CELL,(e=>{var i,o,n,r;if("html"===(null===(i=t.internalProps.menu)||void 0===i?void 0:i.renderMode)){const i=t._getMouseAbstractPoint(e.event,!1);let s=null;i.inTable&&"function"==typeof(null===(o=t.internalProps.menu)||void 0===o?void 0:o.contextMenuItems)?s=t.internalProps.menu.contextMenuItems(t.getHeaderField(e.col,e.row),e.row,e.col,t):i.inTable&&Array.isArray(null===(n=t.internalProps.menu)||void 0===n?void 0:n.contextMenuItems)&&(s=null===(r=t.internalProps.menu)||void 0===r?void 0:r.contextMenuItems),this._bindToCell(e.col,e.row,"context-menu",{content:s,position:{x:i.x,y:i.y}})}}))}_getMenuInstanceInfo(t,e,i,o){const n=this._table,r=this._menuInstances,s=function(t,e,i,o,n){var r;const{lineHeight:s,textBaseline:l,textStick:a}=t._getCellStyle(e,i);let h=t.getCellRangeRelativeRect(t.getCellRange(e,i));a&&(h=t.getVisibleCellRangeRelativeRect({col:e,row:i}));let{left:d,right:c,bottom:u,top:g,width:p,height:f}=h;if(t.isHeader(e,i)&&({left:d,right:c,bottom:u,top:g,width:p,height:f}=t.internalProps.headerHelper.getDropDownIconRect(h,s,l||"middle")),null==n?void 0:n.content)return{type:o,position:n.position,referencePosition:null!==(r=n.referencePosition)&&void 0!==r?r:{rect:{left:d,right:c,top:g,bottom:u,width:p,height:f}},content:n.content};if("dropdown-menu"===o){const{dropDownMenu:n=t.globalDropDownMenu,pivotInfo:r}=t._getHeaderLayoutMap(e,i);return{type:o,referencePosition:{rect:{left:d,right:c,top:g,bottom:u,width:p,height:f}},content:n,pivotInfo:r}}return null}(n,t,e,i,o);return s?{instance:r&&r[i]||r&&(r[i]=ZP[i](n)),type:i,info:s}:null}}class JP{constructor(t,e){this.isReleased=!1,this.table=e,this._titleOption=yt({orient:"top"},t),!1!==t.visible&&(this._titleComponent=this._createOrUpdateTitleComponent(this._getTitleAttrs()))}_createOrUpdateTitleComponent(t){if(this._titleComponent)_t(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=new YC(t);e.name="title",this.table.scenegraph.stage.defaultLayer.appendChild(e),this._titleComponent=e}return this._adjustTableSize(this._titleComponent.attribute),this._titleComponent}resize(){var t,e,i,o,n;if(!this._titleComponent)return;const r=Fx(null!==(t=this._titleOption.padding)&&void 0!==t?t:10),s=null!==(e=this._titleOption.width)&&void 0!==e?e:("adaptive"===this.table.widthMode?this.table.tableNoFrameWidth:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width))-r[1]-r[3],l=null!==(i=this._titleOption.height)&&void 0!==i?i:("adaptive"===this.table.heightMode?this.table.tableNoFrameHeight:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height))-r[0]-r[2];this._titleComponent.setAttributes({x:(null!==(o=this._titleOption.x)&&void 0!==o?o:"right"===this._titleOption.orient)?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:(null!==(n=this._titleOption.y)&&void 0!==n?n:"bottom"===this._titleOption.orient)?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:"top"===this._titleOption.orient||"bottom"===this._titleOption.orient?s:this._titleOption.width,height:"left"===this._titleOption.orient||"right"===this._titleOption.orient?l:this._titleOption.height,textStyle:Object.assign({width:s},this._titleOption.textStyle),subtextStyle:Object.assign({width:s},this._titleOption.subtextStyle)}),this._adjustTableSize(this._titleComponent.attribute)}_adjustTableSize(t){var e,i,o,n;const r=isFinite(null===(e=this._titleComponent)||void 0===e?void 0:e.AABBBounds.width())?this._titleComponent.AABBBounds.width():0,s=isFinite(null===(i=this._titleComponent)||void 0===i?void 0:i.AABBBounds.height())?this._titleComponent.AABBBounds.height():0;"left"===this._titleOption.orient?(this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(r),this.table.tableX+=Math.ceil(r)):"top"===this._titleOption.orient?(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(s),this.table.tableY+=Math.ceil(s)):"right"===this._titleOption.orient?this.table.tableNoFrameWidth=this.table.tableNoFrameWidth-Math.ceil(r):"bottom"===this._titleOption.orient&&(this.table.tableNoFrameHeight=this.table.tableNoFrameHeight-Math.ceil(s)),this._cacheAttrs=t,"right"!==this._titleOption.orient&&"bottom"!==this._titleOption.orient||this._titleComponent.setAttributes({x:(null!==(o=this._titleOption.x)&&void 0!==o?o:"right"===this._titleOption.orient)?this.table.tableX+this.table.tableNoFrameWidth:this.table.tableX,y:(null!==(n=this._titleOption.y)&&void 0!==n?n:"bottom"===this._titleOption.orient)?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY})}release(){this._titleComponent&&this.table.scenegraph.stage.defaultLayer.removeChild(this._titleComponent),this._titleComponent=null,this.isReleased=!0}_getTitleAttrs(){var t,e,i,o,n,r,s,l,a,h,d;const c=this._titleOption.text||this._titleOption.subtext?10:0,u=Fx(null!==(t=this._titleOption.padding)&&void 0!==t?t:c),g=null!==(e=this._titleOption.width)&&void 0!==e?e:Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width)-u[1]-u[3],p=null!==(i=this._titleOption.height)&&void 0!==i?i:Math.min(this.table.tableNoFrameHeight,this.table.getDrawRange().height)-u[0]-u[2];return{text:null!==(o=this._titleOption.text)&&void 0!==o?o:"",subtext:null!==(n=this._titleOption.subtext)&&void 0!==n?n:"",x:(null!==(r=this._titleOption.x)&&void 0!==r?r:"right"===this._titleOption.orient)?this.table.tableX+Math.min(this.table.tableNoFrameWidth,this.table.getDrawRange().width):this.table.tableX,y:(null!==(s=this._titleOption.y)&&void 0!==s?s:"bottom"===this._titleOption.orient)?this.table.tableY+this.table.tableNoFrameHeight:this.table.tableY,width:"top"===this._titleOption.orient||"bottom"===this._titleOption.orient?g:this._titleOption.width,height:"left"===this._titleOption.orient||"right"===this._titleOption.orient?p:this._titleOption.height,minWidth:this._titleOption.minWidth,maxWidth:this._titleOption.maxWidth,minHeight:this._titleOption.minHeight,maxHeight:this._titleOption.maxHeight,padding:this._titleOption.padding,align:null!==(l=this._titleOption.align)&&void 0!==l?l:"left",verticalAlign:null!==(a=this._titleOption.verticalAlign)&&void 0!==a?a:"top",textStyle:Object.assign({width:g},this._titleOption.textStyle),subtextStyle:Object.assign({width:g},this._titleOption.subtextStyle),dx:null!==(h=this._titleOption.dx)&&void 0!==h?h:0,dy:null!==(d=this._titleOption.dy)&&void 0!==d?d:0}}getComponentGraphic(){return this._titleComponent}}class QP{constructor(t){this._table=t}release(){var t,e;this.unbindTooltipElement(),this._tooltipElement&&(null===(e=(t=this._tooltipElement).release)||void 0===e||e.call(t)),this._tooltipElement=void 0}_getTooltipElement(){return this._tooltipElement||(this._tooltipElement=this.createTooltipElementInternal()),this._tooltipElement}bindTooltipElement(t,e,i,o){return this._getTooltipElement().bindToCell(this._table,t,e,i,o)}moveTooltipElement(t,e,i,o){this._getTooltipElement().move(this._table,t,e,i,o)}unbindTooltipElement(){this._getTooltipElement().unbindFromCell()}locateTooltipElement(t,e,i,o,n){this._getTooltipElement()._locate(this._table,t,e,i,o,n)}}!function(){if("node"===Oy.mode)return;const t=document.createElement("style");t.id="vtable-tooltip-styleSheet",t.textContent="\n@keyframes vtable__bubble-tooltip-element--shown-animation {\n\t0% {\n\t\topacity: 0;\n\t}\n\t100% {\n\t\topacity: 1;\n\t}\n}\n.vtable__bubble-tooltip-element {\n\tposition: absolute;\n\t\n\t// pointer-events: none;\n\t//user-select: none;\n\tmax-width: 300px;\n\tz-index: 99999;\n\n\tbackground: #FFFFFF;\n border: 1px solid #E6E8ED;\n box-sizing: border-box;\n border-radius: 4px;\n box-shadow: 0px 2px 4px rgb(27 31 35 / 8%);\n color: #141414;\n font-size: 13px;\n}\n.vtable__bubble-tooltip-element--hidden {\n\topacity: 0;\n pointer-events: none;\n\tuser-select: none;\n\t/* transform: translate(-50%, -50%); */\n\ttransition: opacity 75ms linear;\n}\n.vtable__bubble-tooltip-element--shown {\n\topacity: 1;\n\t/* transform: translate(-50%, -50%); */\n\tanimation: vtable__bubble-tooltip-element--shown-animation 150ms ease-out;\n}\n.vtable__bubble-tooltip-element__content {\n\t/* font-size: .75rem; */\n\tpadding: 6px 8px;\n\tmin-height: 1em;\n\tline-height: 1.5;\n\twidth: 100%;\n\tdisplay: block;\n\twhite-space: pre-wrap;\n\tmargin: 0;\n\tbox-sizing: border-box;\n\toverflow: auto;\n\tword-wrap: break-word;\n\tposition: relative;\n\tbackground-color: #FFF;\n\tz-index: 2;\n\tborder-radius: 4px;\n}\n/* WebKit Microsoft Edge(新版): */\n.vtable__bubble-tooltip-element__content::-webkit-scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Opera Firefox */\n.vtable__bubble-tooltip-element__content > scrollbar-track {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n/* Internet Explorer 11 和 Microsoft Edge(旧版) */\n.vtable__bubble-tooltip-element__content > scrollbar {\n width: 0;\n height: 0;\n background-color: transparent;\n}\n.vtable__bubble-tooltip-element__triangle {\n\t/* font-size: .75rem; */\n\tposition: absolute;\n\twidth: 10px;\n\theight: 10px;\n\tdisplay: block;\n\ttransform: rotate(45deg);\n transform-origin: 50% 50% 0;\n\tz-index: 1;\n\tbackground-color: #FFF;\n\tborder: 1px solid #E6E8ED;\n}\n",document.head.appendChild(t)}();const tE="vtable__bubble-tooltip-element",eE=`${tE}__content`,iE=`${tE}__triangle`,oE=`${tE}--hidden`,nE=`${tE}--shown`;class rE{constructor(){this._handler=new Pw;const t=this._rootElement=OM("div",[tE,oE]),e=OM("div",[eE]),i=OM("span",[iE]);t.appendChild(i),t.appendChild(e),this._messageElement=t.querySelector(`.${eE}`)||void 0,this._triangleElement=t.querySelector(`.${iE}`)||void 0,t.addEventListener("mousemove",(()=>{this._disappearDelayId&&clearTimeout(this._disappearDelayId)})),t.addEventListener("mouseleave",(()=>{this._disappearDelay=void 0,this.unbindFromCell()})),e.addEventListener("wheel",(t=>{t.stopPropagation()})),e.addEventListener("copy",(t=>{(function(t){const e=window.getSelection();if(e.rangeCount){const i=e.getRangeAt(0);return i.endOffset>i.startOffset&&t.contains(i.commonAncestorContainer)}return!1})(e)&&t.stopPropagation()}))}bindToCell(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x,_;this._disappearDelay=null==o?void 0:o.disappearDelay,this._disappearDelayId&&clearTimeout(this._disappearDelayId);const S=this._rootElement,A=this._messageElement,R=this._triangleElement;if(null==S||S.classList.remove(nE),null==S||S.classList.add(oE),this._canBindToCell(t,e,i)){if(A.setAttribute("style",""),R.setAttribute("style",""),(null==o?void 0:o.className)&&S.classList.add(o.className),(null===(r=null==o?void 0:o.style)||void 0===r?void 0:r.bgColor)&&(A.style.backgroundColor=null===(s=null==o?void 0:o.style)||void 0===s?void 0:s.bgColor),(null===(l=null==o?void 0:o.style)||void 0===l?void 0:l.bgColor)&&(R.style.backgroundColor=null===(a=null==o?void 0:o.style)||void 0===a?void 0:a.bgColor),R.style.display=!0===(null===(h=null==o?void 0:o.style)||void 0===h?void 0:h.arrowMark)?"block":"none",(null===(d=null==o?void 0:o.style)||void 0===d?void 0:d.fontSize)&&(A.style.fontSize=(null!==(u=null===(c=null==o?void 0:o.style)||void 0===c?void 0:c.fontSize)&&void 0!==u?u:12)+"px"),(null===(g=null==o?void 0:o.style)||void 0===g?void 0:g.fontFamily)&&(A.style.fontFamily=null===(p=null==o?void 0:o.style)||void 0===p?void 0:p.fontFamily),(null===(f=null==o?void 0:o.style)||void 0===f?void 0:f.color)&&(A.style.color=null===(v=null==o?void 0:o.style)||void 0===v?void 0:v.color),(null===(m=null==o?void 0:o.style)||void 0===m?void 0:m.padding)&&(A.style.padding=`${null===(b=null==o?void 0:o.style)||void 0===b?void 0:b.padding.join("px ")}px`),(null===(C=null==o?void 0:o.style)||void 0===C?void 0:C.maxHeight)&&(A.style.maxHeight=`${null===(y=null==o?void 0:o.style)||void 0===y?void 0:y.maxHeight}px`),(null===(w=null==o?void 0:o.style)||void 0===w?void 0:w.maxWidth)&&(A.style.maxWidth=`${null===(x=null==o?void 0:o.style)||void 0===x?void 0:x.maxWidth}px`),A&&(A.textContent=null==o?void 0:o.content),this._bindToCell(t,e,i,null==o?void 0:o.position,null==o?void 0:o.referencePosition,n,null===(_=null==o?void 0:o.style)||void 0===_?void 0:_.arrowMark))return null==S||S.classList.add(nE),null==S||S.classList.remove(oE),!0}else this.unbindFromCell();return!1}release(){var t,e;this.unbindFromCell();const i=this._rootElement;(null==i?void 0:i.parentElement)&&i.parentElement.removeChild(i),null===(e=null===(t=this._handler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),delete this._rootElement,delete this._messageElement}move(t,e,i,o,n){const r=this._rootElement;this._canBindToCell(t,e,i)?(this._bindToCell(t,e,i,null==o?void 0:o.position,null==o?void 0:o.referencePosition,n),null==r||r.classList.add(nE),null==r||r.classList.remove(oE)):this.unbindFromCell()}unbindFromCell(){var t;if(this._disappearDelay)this._disappearDelayId=setTimeout((()=>{const t=this._rootElement;(null==t?void 0:t.parentElement)&&(t.classList.remove(nE),t.classList.add(oE))}),null!==(t=this._disappearDelay)&&void 0!==t?t:0);else{const t=this._rootElement;(null==t?void 0:t.parentElement)&&(t.classList.remove(nE),t.classList.add(oE))}}_canBindToCell(t,e,i){const o=t.getCellRangeRelativeRect({col:e,row:i}),n=t.getElement(),{bottom:r,left:s,right:l,top:a}=o;if(t.isFrozenCell(e,i))return!0;if(r<t.getFrozenRowsHeight()||l<t.getFrozenColsWidth()||s>t.tableNoFrameWidth-t.getRightFrozenColsWidth()||a>t.tableNoFrameHeight-t.getBottomFrozenRowsHeight())return!1;const{offsetHeight:h,offsetWidth:d}=n;return!(a>h||s>d)}_bindToCell(t,e,i,o,n,r,s){const l=this._rootElement,a=t.getCellRangeRelativeRect({col:e,row:i}),h=t.internalProps.tooltip.parentElement,d=t.internalProps.element.offsetWidth,{width:c}=a;if(l){let a,u;l.parentElement!==h&&h.appendChild(l),l.style.left="0px";const g=Math.min(.8*d,4*c);l.style.maxWidth=`${g}px`;const p=l.clientWidth,f=l.clientHeight;if(!o&&!n)return!1;{const l=this.getComputedPosition(t,e,i,o,n,r,s);u=l.x,a=l.y}l.style.left=`${u}px`,l.style.top=`${a}px`,Zy()&&(l.style.fontSize="11px");const{x1:v,x2:m,y1:b,y2:C}=t.stateManager.menu.bounds,y=u,w=y+p,x=a,_=y+f;return!(t.stateManager.menu.isShow&&v<w&&m>y&&C>x&&b<_)}return!1}getComputedPosition(t,e,i,o,n,r,s){var l;const a=this._rootElement,h=t.getCellRangeRelativeRect({col:e,row:i}),{x:d,y:c}=t.internalProps.tooltip.parentElement.getBoundingClientRect(),{width:u,height:g,x:p,y:f}=t.internalProps.element.getBoundingClientRect(),{width:v}=h;let m,b;const C=Math.min(.8*u,4*v);a.style.maxWidth=`${C}px`;const y=a.clientWidth,w=a.clientHeight,x=s?6:0;if(o)b=o.x,m=o.y+x,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px";else if(n){let t=null!==(l=n.placement)&&void 0!==l?l:my.bottom;const e=n.rect.left+n.rect.width/2,i=n.rect.top+n.rect.height/2,o=n.rect.top,s=n.rect.bottom,a=n.rect.left,h=n.rect.right;let d=0;const c=()=>{d++,d>=4||(this.removeStyleFromTriangle(),t===my.top?(b=e-y/2,m=o-w-x,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.bottom="-5px",r&&m<0&&(t=my.right,c())):t===my.bottom?(b=e-y/2,m=s+x,this._triangleElement.style.left="50%",this._triangleElement.style.marginLeft="-5px",this._triangleElement.style.top="-5px",r&&m+w>g&&(t=my.left,c())):t===my.left?(m=i-w/2,b=a-y-x,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.right="-5px",r&&b<0&&(t=my.top,c())):t===my.right&&(m=i-w/2,b=h+x,this._triangleElement.style.top="50%",this._triangleElement.style.marginTop="-5px",this._triangleElement.style.left="-5px",r&&b+y>u&&(t=my.bottom,c())))};c()}return r&&(b<0?b=0:b+a.offsetWidth>u&&(b=u-a.offsetWidth)),{x:b+p-d,y:m+f-c}}removeStyleFromTriangle(){this._triangleElement.style.left="",this._triangleElement.style.right="",this._triangleElement.style.top="",this._triangleElement.style.bottom="",this._triangleElement.style.marginLeft="",this._triangleElement.style.marginTop=""}_locate(t,e,i,o,n,r){const s=this.getComputedPosition(t,e,i,o,n,r),l=s.x,a=s.y;this._rootElement.style.left=`${l}px`,this._rootElement.style.top=`${a}px`}}class sE extends QP{createTooltipElementInternal(){return new rE}}const lE=function(t){return new sE(t)};class aE{constructor(t,e){this._table=t,this._tooltipInstances={},this._bindTableEvent(t),this.confine=e}release(){var t,e;const i=this._tooltipInstances;for(const o in i)null===(e=null===(t=i[o])||void 0===t?void 0:t.release)||void 0===e||e.call(t);delete this._tooltipInstances,this._attachInfo=null}_bindToCell(t,e,i){var o;const n=this._attachInfo,r=this._getTooltipInstanceInfo(t,e);if(!n||r&&n.instance===r||(null===(o=n.instance)||void 0===o||o.unbindTooltipElement(),this._attachInfo=null),r&&r&&r.bindTooltipElement(t,e,i,this.confine)){const o=this._table.getCellRange(t,e);this._attachInfo={range:o,instance:r,tooltipOptions:i}}}_move(t,e,i){const o=this._attachInfo;if(!o||!vw(o.range,t,e))return;const{instance:n}=o;null==n||n.moveTooltipElement(t,e,i,this.confine)}moveToPosition(t,e,i,o){const n=this._attachInfo;if(!n||!vw(n.range,t,e))return;const{instance:r}=n;this._attachInfo.tooltipOptions.position=i,this._attachInfo.tooltipOptions.referencePosition=o,null==r||r.locateTooltipElement(t,e,i,o,this.confine)}_unbindFromCell(){const t=this._attachInfo;if(!t)return;const{instance:e}=t;null==e||e.unbindTooltipElement(),this._attachInfo=null}_isBindCell(t,e){const i=this._attachInfo;return!!i&&vw(i.range,t,e)}_bindTableEvent(t){t.on(Aw.MOUSEENTER_CELL,(e=>{if(Zy())return;const{x1:i,x2:o,y1:n,y2:r}=t.stateManager.menu.bounds;if(t.stateManager.menu.isShow&&"number"==typeof e.x&&"number"==typeof e.y&&e.x>i&&e.x<o&&e.y>n&&e.y<r)return;const{col:s,row:l}=e;this.showTooltip(s,l)})),t.on(Aw.MOUSEMOVE_CELL,(e=>{var i,o;if(!Zy()){if(null===(o=null===(i=this._attachInfo)||void 0===i?void 0:i.tooltipOptions)||void 0===o?void 0:o.referencePosition){const i=this._attachInfo.tooltipOptions.referencePosition,{event:o}=e,{left:n,right:r,top:s,bottom:l}=i.rect,a=t._getMouseAbstractPoint(o,!1);a.inTable&&a.x>=n-5&&a.x<=r+5&&a.y>=s-5&&a.y<=l+5||this._unbindFromCell()}this._attachInfo&&t.stateManager.menu.isShow&&this._bindToCell(e.col,e.row)}})),t.on(Aw.MOUSELEAVE_CELL,(t=>{this._unbindFromCell()})),t.on(Aw.SELECTED_CELL,(t=>{this._isBindCell(t.col,t.row)&&this._unbindFromCell()})),t.on(Aw.MOUSELEAVE_TABLE,(t=>{this._unbindFromCell()})),t.on(Aw.SCROLL,(t=>{this._unbindFromCell()}))}showTooltip(t,e){var i,o,n;let r;const s=this._table,l=s.getHeaderDescription(t,e);if(l){const o=s.getCellRangeRelativeRect({col:t,row:e});r={content:l,referencePosition:{placement:my.bottom,rect:o},disappearDelay:null!==(i=s.internalProps.tooltip.overflowTextTooltipDisappearDelay)&&void 0!==i?i:0,style:s.theme.tooltipStyle}}else if(null===(o=s.internalProps.tooltip)||void 0===o?void 0:o.isShowOverflowTextTooltip){const i=s.getCellOverflowText(t,e),o=s.getCellRangeRelativeRect({col:t,row:e});i&&(r={content:l?`${l}\n ${i}`:i,referencePosition:{placement:my.bottom,rect:o},disappearDelay:null!==(n=s.internalProps.tooltip.overflowTextTooltipDisappearDelay)&&void 0!==n?n:0,style:s.theme.tooltipStyle})}r?this._bindToCell(t,e,r):this._unbindFromCell()}_getTooltipInstanceInfo(t,e){const i=this._table,o=this._tooltipInstances;return o&&o["bubble-tooltip"]||o&&(o["bubble-tooltip"]=lE(i))}isBinded(t){var e;return JSON.stringify(t)===JSON.stringify(null===(e=this._attachInfo)||void 0===e?void 0:e.tooltipOptions)}}class hE{constructor(t){this.titleRows=[],this.showedTitleRows=[],this.rowNow=-1,this.skipStartRow=-1,this.skipEndRow=-1,this.table=t,this.table.on("scroll",(t=>{"vertical"===t.scrollDirection&&this.updateGroupTitle()})),this.table.on("resize_column",(t=>{this.updateGroupTitle()}))}updateGroupTitle(){0===this.table.scrollTop?(this.titleRows=[],this.showedTitleRows=[]):-1!==this.skipStartRow&&-1!==this.skipEndRow&&this.skipStartRow!==this.table.scenegraph.proxy.bodyTopRow-1?(this.table.scenegraph.proxy.screenTopRow<=this.skipStartRow||this.table.scenegraph.proxy.screenTopRow>=this.skipEndRow)&&(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()):(this.skipStartRow=-1,this.skipEndRow=-1,this.updateGroupTitleInfo()),this.updateScenegraph()}updateGroupTitleInfo(){this.rowNow=this.table.scenegraph.proxy.screenTopRow+this.titleRows.length;const t=this.table.getRecordIndexByCell(0,this.rowNow),e=this.table.getRecordIndexByCell(0,this.rowNow+1);this.getTitleRowsByRecordIndex(t,e)}getTitleRowsByRecordIndex(t,e){et(t)||(t=[t]),et(e)||(e=[e]);for(let e=0;e<t.length;e++){const i=t.slice(0,e+1);this.table.dataSource.getRaw(i)}const i=[],o=e.length===t.length+1;let n=t.slice(0,o?t.length:t.length-1);const r=this.table.dataSource.currentIndexedData;for(let e=this.rowNow-this.table.columnHeaderLevelCount;e>=0;e--){const o=r[e];if(et(o)&&n.length===o.length){let t=!0;for(let e=0;e<o.length;e++)if(o[e]!==n[e]){t=!1;break}t&&(i.push(e+this.table.columnHeaderLevelCount),n=n.slice(0,n.length-1))}else if(o===t[0]){i.push(e+this.table.columnHeaderLevelCount);break}}this.titleRows=i.reverse()}updateScenegraph(){const{table:t}=this,{shadowGroup:e,shadowGroupFrozen:i}=function(t){const e=t.scenegraph.colHeaderGroup,i=t.scenegraph.cornerHeaderGroup;if(!e.border){const i=ic({x:0,y:0,width:0,height:0,cursor:"pointer"});e.add(i),e.border=i,i.attachShadow(i.shadowRoot),i.name="border-rect",i.addEventListener("click",(e=>{const i=t.listTreeStickCellPlugin.titleRows,{shadowTarget:o}=e.pickParams,n=A_(o),{col:r,row:s}=n;uE(s-i.indexOf(s),t)}))}if(!i.border){const e=ic({x:0,y:0,width:0,height:0,cursor:"pointer"});i.add(e),i.border=e,e.attachShadow(e.shadowRoot),e.name="border-rect",e.addEventListener("click",(e=>{const i=t.listTreeStickCellPlugin.titleRows,{shadowTarget:o}=e.pickParams,n=A_(o),{col:r,row:s}=n;uE(s-i.indexOf(s),t)}))}const o=e.border.shadowRoot,n=i.border.shadowRoot;return o.removeAllChild(),n.removeAllChild(),{shadowGroup:o,shadowGroupFrozen:n}}(t);this.showedTitleRows.length=0;let o=0;for(let n=0;n<t.colCount;n++){let r;n<t.frozenColCount?(r=new uS({x:t.getColsWidth(0,n-1),y:t.getFrozenRowsHeight()}),i.add(r)):(r=new uS({x:t.getColsWidth(t.frozenColCount,n-1),y:t.getFrozenRowsHeight()}),e.add(r)),r.col=n;for(let e=0;e<this.titleRows.length;e++){const i=this.titleRows[e];if(dE(i,this.rowNow,t.scenegraph.proxy.screenTopRow,this.titleRows)){0===n&&o++;continue}0===n&&this.showedTitleRows.push(i);const s=t.scenegraph.getCell(n,i);if("cell"===s.role){const t=cE(s);t.setAttributes({y:40*e}),r.add(t)}else{const o=IS(n,i,t,!0,!0);o.setAttributes({y:40*e}),r.add(o)}}}o>0&&-1===this.skipStartRow&&-1===this.skipEndRow&&(this.skipStartRow=t.scenegraph.proxy.screenTopRow-1,this.skipEndRow=t.scenegraph.proxy.screenTopRow+1)}}function dE(t,e,i,o){return t===e&&t!==i+o.length-1||t===i+o.indexOf(t)+1&&t<e}function cE(t){const e=t.clone();if(e.role=t.role,e.col=t.col,e.row=t.row,e.mergeStartCol=t.mergeStartCol,e.mergeStartRow=t.mergeStartRow,e.mergeEndCol=t.mergeEndCol,e.mergeEndRow=t.mergeEndRow,e.contentWidth=t.contentWidth,e.contentHeight=t.contentHeight,"cell"===e.role){const t=ic({x:0,y:0,width:e.attribute.width,height:e.attribute.height});e.add(t)}if("group"===t.type){const i=e;t.forEachChildren((t=>{const e=cE(t);i.add(e)}))}return e}function uE(t,e){const i=e.getDrawRange();if(K(t)&&t>=e.frozenRowCount){const o=e.getFrozenRowsHeight(),n=e.getRowsHeight(0,t-1);e.scrollTop=Math.min(n-o,e.getAllRowsHeight()-i.height)-1}e.scenegraph.updateNextFrame()}const gE={};function pE(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b){var C,y,w,x,_,S,A,R,B,M,T,P,E,k,L,H,F,z,I,O,D,W,N,G,j;const U=hw(gE,XT)[d],V=vS("padding",p._getCellStyle(n,r),n,r,p);if(K(V)&&(a=V),!t){const a=mS(n,r,f,p);m&&(t=p.scenegraph.highPerformanceGetCell(n,r,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:s,height:l,lineWidth:null!==(y=null===(C=null==f?void 0:f.group)||void 0===C?void 0:C.lineWidth)&&void 0!==y?y:void 0,fill:null!==(x=null===(w=null==f?void 0:f.group)||void 0===w?void 0:w.fill)&&void 0!==x?x:void 0,stroke:null!==(S=null===(_=null==f?void 0:f.group)||void 0===_?void 0:_.stroke)&&void 0!==S?S:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(R=null===(A=null==f?void 0:f.group)||void 0===A?void 0:A.strokeArrayColor)&&void 0!==R?R:void 0,cursor:null!==(M=null===(B=null==f?void 0:f.group)||void 0===B?void 0:B.cursor)&&void 0!==M?M:void 0,lineDash:null!==(P=null===(T=null==f?void 0:f.group)||void 0===T?void 0:T.lineDash)&&void 0!==P?P:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius}),t&&"cell"===t.role||((t=new uS({x:i,y:o,width:s,height:l,lineWidth:null!==(k=null===(E=null==f?void 0:f.group)||void 0===E?void 0:E.lineWidth)&&void 0!==k?k:void 0,fill:null!==(H=null===(L=null==f?void 0:f.group)||void 0===L?void 0:L.fill)&&void 0!==H?H:void 0,stroke:null!==(z=null===(F=null==f?void 0:f.group)||void 0===F?void 0:F.stroke)&&void 0!==z?z:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(O=null===(I=null==f?void 0:f.group)||void 0===I?void 0:I.strokeArrayColor)&&void 0!==O?O:void 0,cursor:null!==(W=null===(D=null==f?void 0:f.group)||void 0===D?void 0:D.cursor)&&void 0!==W?W:void 0,lineDash:null!==(G=null===(N=null==f?void 0:f.group)||void 0===N?void 0:N.lineDash)&&void 0!==G?G:void 0,lineCap:"butt",clip:!0,cornerRadius:f.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t))}if(t.AABBBounds.width(),b&&Array.isArray(p.getCellValue(n,r))||!b){const e=new GA(v,{stroke:!1,x:a[3],y:a[0],canvas:null!==(j=p.canvas)&&void 0!==j?j:p.scenegraph.stage.window.getContext().canvas,mode:p.options.mode,modeParams:p.options.modeParams,spec:c,ClassType:U,width:s-a[3]-a[1],height:l-a[2]-a[0],chartInstance:u,dataId:g,data:p.getCellValue(n,r)||[],cellPadding:a,dpr:p.internalProps.pixelRatio,axes:p.isPivotChart()?p.internalProps.layoutMap.getChartAxes(n,r):[],tableChartOption:p.options.chartOption});t.appendChild(e),p.internalProps.layoutMap.setChartInstance(n,r,e.chartInstance)}return t}function fE(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m){var b,C,y,w,x,_,S,A,R,B,M,T,P,E,k,L,H,F,z,I,O,D,W,N;if(!t){const s=mS(n,r,p,g);m&&(t=g.scenegraph.highPerformanceGetCell(n,r,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:l,height:a,lineWidth:null!==(C=null===(b=null==p?void 0:p.group)||void 0===b?void 0:b.lineWidth)&&void 0!==C?C:void 0,fill:null!==(w=null===(y=null==p?void 0:p.group)||void 0===y?void 0:y.fill)&&void 0!==w?w:void 0,stroke:null!==(_=null===(x=null==p?void 0:p.group)||void 0===x?void 0:x.stroke)&&void 0!==_?_:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(A=null===(S=null==p?void 0:p.group)||void 0===S?void 0:S.strokeArrayColor)&&void 0!==A?A:void 0,cursor:null!==(B=null===(R=null==p?void 0:p.group)||void 0===R?void 0:R.cursor)&&void 0!==B?B:void 0,lineDash:null!==(T=null===(M=null==p?void 0:p.group)||void 0===M?void 0:M.lineDash)&&void 0!==T?T:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),t&&"cell"===t.role||((t=new uS({x:i,y:o,width:l,height:a,lineWidth:null!==(E=null===(P=null==p?void 0:p.group)||void 0===P?void 0:P.lineWidth)&&void 0!==E?E:void 0,fill:null!==(L=null===(k=null==p?void 0:p.group)||void 0===k?void 0:k.fill)&&void 0!==L?L:void 0,stroke:null!==(F=null===(H=null==p?void 0:p.group)||void 0===H?void 0:H.stroke)&&void 0!==F?F:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(I=null===(z=null==p?void 0:p.group)||void 0===z?void 0:z.strokeArrayColor)&&void 0!==I?I:void 0,cursor:null!==(D=null===(O=null==p?void 0:p.group)||void 0===O?void 0:O.cursor)&&void 0!==D?D:void 0,lineDash:null!==(N=null===(W=null==p?void 0:p.group)||void 0===W?void 0:W.lineDash)&&void 0!==N?N:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t))}let G;if(u){let t=n,e=r;v&&(t=v.start.col,e=v.start.row),G=g.getCellIcons(t,e)}let j=0,U=0;if(Array.isArray(G)&&0!==G.length){const{leftIconWidth:e,rightIconWidth:i,absoluteLeftIconWidth:o,absoluteRightIconWidth:n}=AS(G,t,v,g);j=e+i,U=e,t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+l-i-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+l-n-h[1])})),t.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(a-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",a-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])}))}const V=function(t,e,i,o,n,r,s,l,a){var h,d,c,u;const g=a._getCellStyle(t,e),p=fS("size",g,t,e,a),f=fS("spaceBetweenTextAndIcon",g,t,e,a),v=fS("defaultFill",g,t,e,a),m=fS("defaultStroke",g,t,e,a),b=fS("disableFill",g,t,e,a),C=fS("checkedFill",g,t,e,a),y=fS("checkedStroke",g,t,e,a),w=fS("disableCheckedFill",g,t,e,a),x=fS("disableCheckedStroke",g,t,e,a),_=fS("checkIconImage",g,t,e,a),S=fS("indeterminateIconImage",g,t,e,a),A=a.getCellValue(t,e),R=a.getCellOriginValue(t,e);let B,M,T=null!==(h=A)&&void 0!==h?h:"";Z(A)?(B=A.checked,M=A.disable,T=null!==(d=A.text)&&void 0!==d?d:""):"boolean"==typeof A&&(B=A,T=""),B=a.stateManager.syncCheckedState(t,e,l.field,B);const P=CS(t,e,a),E=a._getCellStyle(t,e),k=null!==(c=E.autoWrapText)&&void 0!==c?c:a.internalProps.autoWrapText,{lineClamp:L}=E,{checked:H,disable:F}=l;if(null==B||"function"==typeof B){const i=uw(H,{col:t,row:e,table:a,context:null,value:A,dataValue:R});B=a.stateManager.syncCheckedState(t,e,l.field,i)}const z=uw(F,{col:t,row:e,table:a,context:null,value:A,dataValue:R}),I="auto"===i,O=a.isAutoRowHeight(e),D={text:1===T.length?T[0]:T,maxLineWidth:I?1/0:o-(r[1]+r[3]+P)-p-f,textBaseline:"top",autoWrapText:k,lineClamp:L,wordBreak:"break-word",heightLimit:O?-1:n-Math.floor(r[0]+r[2]),pickable:!1,dx:P,whiteSpace:1!==T.length||k?"normal":"no-wrap"},W={x:0,y:0,text:s.text?Object.assign({},s.text,D):D,icon:{width:Math.floor(p/1.4),height:Math.floor(p/1.4)},box:{width:p,height:p},spaceBetweenTextAndIcon:f,disabled:null!==(u=null!=M?M:z)&&void 0!==u&&u};"indeterminate"===B?(W.checked=void 0,W.indeterminate=!0):(W.checked=B,W.indeterminate=void 0),v&&(W.box.fill=v),m&&(W.box.stroke=m),b&&(W.box.disableFill=b),C&&(W.box.checkedFill=C),y&&(W.box.checkedStroke=y),w&&(W.box.disableCheckedFill=w),x&&(W.box.disableCheckedStroke=x),_&&(W.icon.checkIconImage=_),S&&(W.icon.indeterminateIconImage=S);const N=new XC(W);return N.name="checkbox",N}(n,r,s-j,l,a,h,p,f,g);return V&&t.appendChild(V),V.render(),l-=h[1]+h[3]+j,a-=h[0]+h[2],"center"===d?V.setAttribute("x",h[3]+U+(l-V.AABBBounds.width())/2):"right"===d?V.setAttribute("x",h[3]+U+l-V.AABBBounds.width()):V.setAttribute("x",h[3]+U),"middle"===c?V.setAttribute("y",h[0]+(a-V.AABBBounds.height())/2):"bottom"===c?V.setAttribute("y",h[0]+a-V.AABBBounds.height()):V.setAttribute("y",h[0]),t}function vE(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f,v,m,b,C,y,w,x,_,S,A,R;if(!t){const s=mS(n,r,g,u);(t=new uS({x:i,y:o,width:l,height:a,lineWidth:null!==(v=null===(f=null==g?void 0:g.group)||void 0===f?void 0:f.lineWidth)&&void 0!==v?v:void 0,fill:null!==(b=null===(m=null==g?void 0:g.group)||void 0===m?void 0:m.fill)&&void 0!==b?b:void 0,stroke:null!==(y=null===(C=null==g?void 0:g.group)||void 0===C?void 0:C.stroke)&&void 0!==y?y:void 0,strokeArrayWidth:s,strokeArrayColor:null!==(x=null===(w=null==g?void 0:g.group)||void 0===w?void 0:w.strokeArrayColor)&&void 0!==x?x:void 0,cursor:null!==(S=null===(_=null==g?void 0:g.group)||void 0===_?void 0:_.cursor)&&void 0!==S?S:void 0,lineDash:null!==(R=null===(A=null==g?void 0:g.group)||void 0===A?void 0:A.lineDash)&&void 0!==R?R:void 0,lineCap:"butt",clip:!0,cornerRadius:g.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t)}const{width:B,height:M}=function(t,e,i,o,n,r,s,l,a,h){var d,c;const u=h._getCellStyle(t,e);let g=fS("size",u,t,e,h),p=fS("innerRadius",u,t,e,h),f=fS("outerRadius",u,t,e,h);const v=fS("spaceBetweenTextAndIcon",u,t,e,h),m=fS("spaceBetweenRadio",u,t,e,h),b=fS("defaultFill",u,t,e,h),C=fS("defaultStroke",u,t,e,h),y=fS("disableFill",u,t,e,h),w=fS("checkedFill",u,t,e,h),x=fS("checkedStroke",u,t,e,h),_=fS("disableCheckedFill",u,t,e,h),S=fS("disableCheckedStroke",u,t,e,h);nt(f)?g=2*f:f=Math.round(g/2),(!nt(p)||p<0)&&(p=Math.round(f/7*3));const A=h.getCellValue(t,e),R=h.getCellOriginValue(t,e),B=CS(t,e,h),M=h._getCellStyle(t,e),T=null!==(d=M.autoWrapText)&&void 0!==d?d:h.internalProps.autoWrapText,{lineClamp:P}=M,E="auto"===i,k="autoHeight"===h.heightMode,L={maxLineWidth:E?1/0:o-(r[1]+r[3]+B)-g-v,textBaseline:"top",autoWrapText:T,lineClamp:P,wordBreak:"break-word",heightLimit:k?-1:n-Math.floor(r[0]+r[2]),pickable:!1,dx:B},H={x:0,y:0,text:s.text?Object.assign({},s.text,L):L,circle:{innerRadius:p,outerRadius:f},spaceBetweenTextAndIcon:v};b&&(H.circle.fill=b),C&&(H.circle.stroke=C),y&&(H.circle.disableFill=y),w&&(H.circle.checkedFill=w),x&&(H.circle.checkedStroke=x),_&&(H.circle.disableCheckedFill=_),S&&(H.circle.disableCheckedStroke=S);let F=0,z=0;const I=null!==(c=l.radioDirectionInCell)&&void 0!==c?c:"vertical";if(et(A))A.forEach(((i,o)=>{const n=mE(i,R,o,t,e,l,T,H,h);n&&a.appendChild(n),n.id=`radio-${t}-${e}-${o}`,n.render();const r=n.AABBBounds;"vertical"===I?(n.setAttribute("y",z),z+=r.height()+(o!==A.length-1?m:0),F=Math.max(F,r.width())):"horizontal"===I&&(n.setAttribute("x",F),F+=r.width()+(o!==A.length-1?m:0),z=Math.max(z,r.height()))}));else{const i=mE(A,R,void 0,t,e,l,T,H,h);i&&a.appendChild(i),i.id=`radio-${t}-${e}`,i.render();const o=i.AABBBounds;F=o.width(),z=o.height()}return{width:F,height:z}}(n,r,s,l,a,h,g,p,t,u);return l-=h[1]+h[3],a-=h[0]+h[2],t.forEachChildren((t=>{"center"===d?t.setAttribute("x",h[3]+t.attribute.x+(l-B)/2):"right"===d?t.setAttribute("x",h[3]+t.attribute.x+l-B):t.setAttribute("x",h[3]+t.attribute.x),"middle"===c?t.setAttribute("y",h[0]+t.attribute.y+(a-M)/2):"bottom"===c?t.setAttribute("y",h[0]+t.attribute.y+a-M):t.setAttribute("y",h[0]+t.attribute.y)})),t}function mE(t,e,i,o,n,r,s,l,a){const h=function(t,e,i,o,n,r,s){var l,a;const h=null!==(l=r.radioCheckType)&&void 0!==l?l:"column";let d,c;return Z(t)?d=t.checked:"boolean"==typeof t&&(d=t),d=s.stateManager.syncRadioState(o,n,r.field,h,i,d),null!=d&&"function"!=typeof d||(c=uw(r.checked,{col:o,row:n,table:s,context:null,value:t,dataValue:e}),d=s.stateManager.syncRadioState(o,n,r.field,h,i,c)),null!==(a=null!=d?d:c)&&void 0!==a&&a}(t,e,i,o,n,r,a),d=function(t,e,i,o,n,r){var s;let l;Z(t)&&(l=t.disable);const a=uw(n.disable,{col:i,row:o,table:r,context:null,value:t,dataValue:e});return null!==(s=null!=l?l:a)&&void 0!==s&&s}(t,e,o,n,r,a),c=Z(t)?t.text:$(t)?"":null!=t?t:"",u=yt({},l,{checked:h,disabled:d,text:{text:1===c.length?c[0]:c,whiteSpace:1!==c.length||s?"normal":"no-wrap"},boundsPadding:0}),g=new KC(u);return g.name="radio",g}const bE=new class extends Gb{constructor(t){super(!1),this.type=wb.Point,this._padding=0,this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}},CE=new hC;function yE(t,e,i,o,n,r,s,l,a,h,d,c){var u,g,p,f,v,m,b,C,y,w,x,_,S,A,R,B,M,T,P,E,k,L,H,F;if(!t){const a=mS(n,r,d,h);c&&(t=h.scenegraph.highPerformanceGetCell(n,r,!0))&&"cell"===t.role&&t.setAttributes({x:i,y:o,width:s,height:l,lineWidth:null!==(g=null===(u=null==d?void 0:d.group)||void 0===u?void 0:u.lineWidth)&&void 0!==g?g:void 0,fill:null!==(f=null===(p=null==d?void 0:d.group)||void 0===p?void 0:p.fill)&&void 0!==f?f:void 0,stroke:null!==(m=null===(v=null==d?void 0:d.group)||void 0===v?void 0:v.stroke)&&void 0!==m?m:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(C=null===(b=null==d?void 0:d.group)||void 0===b?void 0:b.strokeArrayColor)&&void 0!==C?C:void 0,cursor:null!==(w=null===(y=null==d?void 0:d.group)||void 0===y?void 0:y.cursor)&&void 0!==w?w:void 0,lineDash:null!==(_=null===(x=null==d?void 0:d.group)||void 0===x?void 0:x.lineDash)&&void 0!==_?_:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius}),t&&"cell"===t.role||((t=new uS({x:i,y:o,width:s,height:l,lineWidth:null!==(A=null===(S=null==d?void 0:d.group)||void 0===S?void 0:S.lineWidth)&&void 0!==A?A:void 0,fill:null!==(B=null===(R=null==d?void 0:d.group)||void 0===R?void 0:R.fill)&&void 0!==B?B:void 0,stroke:null!==(T=null===(M=null==d?void 0:d.group)||void 0===M?void 0:M.stroke)&&void 0!==T?T:void 0,strokeArrayWidth:a,strokeArrayColor:null!==(E=null===(P=null==d?void 0:d.group)||void 0===P?void 0:P.strokeArrayColor)&&void 0!==E?E:void 0,cursor:null!==(L=null===(k=null==d?void 0:d.group)||void 0===k?void 0:k.cursor)&&void 0!==L?L:void 0,lineDash:null!==(F=null===(H=null==d?void 0:d.group)||void 0===H?void 0:H.lineDash)&&void 0!==F?F:void 0,lineCap:"butt",clip:!0,cornerRadius:d.group.cornerRadius})).role="cell",t.col=n,t.row=r,null==e||e.addCellGroup(t))}const z=function(t,e,i,o,n,r){let s,l;const a=r.internalProps.layoutMap.getBody(t,e).sparklineSpec,h=r.getCellValue(t,e);if(!Array.isArray(h))return;const d=n[3],c=n[0];i-=n[1]+n[3];const u=o-=n[0]+n[2];if("function"==typeof a){const n={col:t,row:e,dataValue:r.getCellOriginValue(t,e)||"",value:r.getCellValue(t,e)||"",rect:r.getCellRangeRelativeRect(r.getCellRange(t,e)),table:r};s=a(n),l=wE(s,d,c,i,o)}else s=a,l=wE(a,d,c,i,o);const g=[],p=[];let f,v;if("object"==typeof s.xField)bE.domain(s.xField.domain),f=s.xField.field;else if("string"==typeof s.xField){const t=h.map((t=>t[s.xField]));bE.domain(t),f=s.xField}else Array.isArray(h)&&(bE.domain(Array.from({length:h.length},((t,e)=>e))),f=s.xField);if(bE.range([0,i]),"object"==typeof s.yField)CE.domain(s.yField.domain),v=s.yField.field;else if("string"==typeof s.yField){const t=xE(h,s.yField);CE.domain([Math.min(...t),Math.max(...t)]),v=s.yField}else if(Array.isArray(h)){const t=xE(h);CE.domain([Math.min(...t),Math.max(...t)]),v=s.yField}if(CE.range([0,o]),"object"==typeof s.xField&&Array.isArray(s.xField.domain)){const t=h.map((t=>t[s.xField.field])),e=s.xField.domain;for(let i=0;i<e.length;i++){let o=!1;for(let n=0;n<t.length;n++)if(e[i]===t[n]){const t=h[n];if(!K(t[f])||!K(t[v]))break;g.push({x:0+bE.scale(t[f]),y:u-CE.scale(t[v]),defined:K(t[v])}),p.push(t),o=!0;break}o||(g.push({x:0+bE.scale(e[i]),y:0,defined:!1}),p.push({[f]:e[i],[v]:null}))}}else for(let t=0;t<h.length;t++){const e=h[t];g.push({x:0+bE.scale(f?e[f]:t),y:u-CE.scale(v?e[v]:e),defined:K(v?e[v]:e),rawData:e}),p.push(e)}const m=l.getChildByName("sparkline-line");m&&m.setAttribute("points",g),m.bandwidth=bE.step(),m.min=CE.range()[0],m.max=CE.range()[1];const b=l.getChildByName("sparkline-symbol-group");if(b){const t="isolatedPoint"===s.pointShowRule;if("all"===s.pointShowRule)for(let t=0;t<g.length;t++){const{x:e,y:i,defined:o}=g[t];if(o){const t=Zd({x:e,y:i});b.appendChild(t)}}else if(t)for(let t=0;t<g.length;t++){const{x:e,y:i,defined:o}=g[t];if(o&&(!g[t-1]||!g[t-1].defined)&&(!g[t+1]||!g[t+1].defined)){const t=Zd({x:e,y:i});b.appendChild(t)}}}return l}(n,r,s,l,a,h);return z&&t.appendChild(z),t}function wE(t,e,i,o,n){var r,s,l,a,h,d,c,u,g,p,f,v,m,b,C,y,w,x,_,S,A,R;let B;B="function"==typeof t?t(null):t;const M=new uS({x:e,y:i,width:o,height:n,stroke:!1,fill:!1});if(M.name="sparkline","line"===B.type){const t=Qd({x:0,y:0,curveType:B.smooth?"monotoneX":"linear",stroke:null!==(l=null===(s=null===(r=B.line)||void 0===r?void 0:r.style)||void 0===s?void 0:s.stroke)&&void 0!==l?l:"blue",lineWidth:null!==(d=null===(h=null===(a=B.line)||void 0===a?void 0:a.style)||void 0===h?void 0:h.strokeWidth)&&void 0!==d?d:2});t.name="sparkline-line",M.addChild(t),B.crosshair&&(t.hover=null!==(u=null===(c=B.crosshair)||void 0===c?void 0:c.style)&&void 0!==u?u:{stroke:"#000",interpolate:"linear"});const e=new uS({x:0,y:0,width:o,height:n,stroke:!1,fill:!1});e.name="sparkline-symbol-group",e.setTheme({symbol:{stroke:null!==(f=null===(p=null===(g=B.point)||void 0===g?void 0:g.style)||void 0===p?void 0:p.stroke)&&void 0!==f?f:"#000",lineWidth:null!==(b=null===(m=null===(v=B.point)||void 0===v?void 0:v.style)||void 0===m?void 0:m.strokeWidth)&&void 0!==b?b:1,fill:null!==(w=null===(y=null===(C=B.point)||void 0===C?void 0:C.style)||void 0===y?void 0:y.fill)&&void 0!==w?w:"#000",size:2*(null!==(S=null===(_=null===(x=B.point)||void 0===x?void 0:x.style)||void 0===_?void 0:_.size)&&void 0!==S?S:3),symbolType:"circle"}}),M.addChild(e),e.hover=null!==(R=null===(A=B.point)||void 0===A?void 0:A.hover)&&void 0!==R&&R}return M}function xE(t,e){const i=[];for(let o=0;o<t.length;o++){const n=t[o];K(e)&&K(n[e])?i.push(n[e]):!K(e)&&K(n)&&i.push(n)}return i}const _E=cS();function SE(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v){var m,b,C,y,w,x,_,S,A,R,B,M,T,P,E,k,L,H,F,z,I,O,D,W,N,G,j,U,V,$;const Y=vS("padding",g._getCellStyle(o,n),o,n,g);(null===(m=g.options.customConfig)||void 0===m?void 0:m.imageMargin)?h=Fx(null===(b=g.options.customConfig)||void 0===b?void 0:b.imageMargin):K(Y)&&(h=Y),(null===(C=null==p?void 0:p.text)||void 0===C?void 0:C.textAlign)&&(d=null===(y=null==p?void 0:p.text)||void 0===y?void 0:y.textAlign),(null===(w=null==p?void 0:p.text)||void 0===w?void 0:w.textBaseline)&&(c=null===(x=null==p?void 0:p.text)||void 0===x?void 0:x.textBaseline);const X=mS(o,n,p,g);let Z,q;if(v&&(Z=g.scenegraph.highPerformanceGetCell(o,n,!0),Z&&"cell"===Z.role&&Z.setAttributes({x:e,y:i,width:r,height:s,lineWidth:null!==(S=null===(_=null==p?void 0:p.group)||void 0===_?void 0:_.lineWidth)&&void 0!==S?S:void 0,fill:null!==(R=null===(A=null==p?void 0:p.group)||void 0===A?void 0:A.fill)&&void 0!==R?R:void 0,stroke:null!==(M=null===(B=null==p?void 0:p.group)||void 0===B?void 0:B.stroke)&&void 0!==M?M:void 0,strokeArrayWidth:X,strokeArrayColor:null!==(P=null===(T=null==p?void 0:p.group)||void 0===T?void 0:T.strokeArrayColor)&&void 0!==P?P:void 0,cursor:null!==(k=null===(E=null==p?void 0:p.group)||void 0===E?void 0:E.cursor)&&void 0!==k?k:void 0,lineDash:null!==(H=null===(L=null==p?void 0:p.group)||void 0===L?void 0:L.lineDash)&&void 0!==H?H:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius})),Z&&"cell"===Z.role||(Z=new uS({x:e,y:i,width:r,height:s,lineWidth:null!==(z=null===(F=null==p?void 0:p.group)||void 0===F?void 0:F.lineWidth)&&void 0!==z?z:void 0,fill:null!==(O=null===(I=null==p?void 0:p.group)||void 0===I?void 0:I.fill)&&void 0!==O?O:void 0,stroke:null!==(W=null===(D=null==p?void 0:p.group)||void 0===D?void 0:D.stroke)&&void 0!==W?W:void 0,strokeArrayWidth:X,strokeArrayColor:null!==(G=null===(N=null==p?void 0:p.group)||void 0===N?void 0:N.strokeArrayColor)&&void 0!==G?G:void 0,cursor:null!==(U=null===(j=null==p?void 0:p.group)||void 0===j?void 0:j.cursor)&&void 0!==U?U:void 0,lineDash:null!==($=null===(V=null==p?void 0:p.group)||void 0===V?void 0:V.lineDash)&&void 0!==$?$:void 0,lineCap:"butt",clip:!0,cornerRadius:p.group.cornerRadius}),Z.role="cell",Z.col=o,Z.row=n,null==t||t.addCellGroup(Z)),u){let t=o,e=n;f&&(t=f.start.col,e=f.start.row),q=g.getCellIcons(t,e)}let J=0,Q=0;if(Array.isArray(q)&&0!==q.length){const{leftIconWidth:t,rightIconWidth:e,absoluteLeftIconWidth:i,absoluteRightIconWidth:o}=AS(q,Z,f,g);J=t,Q=e,Z.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+h[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+r-e-h[1]):"icon-absolute-right"===t.role&&t.setAttribute("x",t.attribute.x+r-o-h[1])})),Z.forEachChildren((t=>{"middle"===c?t.setAttribute("y",(s-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",s-t.AABBBounds.height()-h[2]):t.setAttribute("y",h[0])})),Z._cellLeftIconWidth=J,Z._cellRightIconWidth=Q}const tt=g.getCellValue(o,n),et=document.createElement("video");et.addEventListener("loadeddata",(()=>{a&&MS(o,n,et.videoWidth,et.videoHeight,g.scenegraph,h,Z);const{width:t,height:e,isMerge:i}=PS(Z,g);if(l){const{width:i,height:o}=gS(et.videoWidth,et.videoHeight,t-h[1]-h[3],e-h[0]-h[2]),n=pS(0,0,t,e,i,o,d,c,h);it.setAttributes({width:i,height:o,x:n.x,y:n.y,dx:0})}else it.setAttributes({x:h[3],y:h[0],width:t-h[1]-h[3],height:e-h[2]-h[0],dy:0});i&&ES(Z.mergeStartCol,Z.mergeEndCol,Z.mergeStartRow,Z.mergeEndRow,g);const{width:r,height:s}=PS(Z,g),u=Math.floor(Math.min(r-h[1]-h[3],s-h[2]-h[0])/2),p=0+(r>it.attribute.width?it.attribute.x-0+it.attribute.width/2:r/2),f=0+(s>it.attribute.height?it.attribute.y-0+it.attribute.height/2:s/2),v=new w_({x:p-u/2,y:f-u/2,width:u,height:u,image:_E.play.svg,cursor:_E.play.cursor});v.name="play-icon",Z.appendChild(v),g.scenegraph.updateNextFrame()})),et.onerror=()=>{it.image=_E.damage_pic.svg},et.src=tt,et.setAttribute("preload","auto");const it=lc({x:h[3],y:h[0],width:r-h[1]-h[3],height:s-h[2]-h[0],image:et,cursor:"pointer"});return it.name="image",it.keepAspectRatio=l,it.textAlign=d,it.textBaseline=c,Z.appendChild(it),Z}function AE(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p,f,v,m,b){var C,y,w,x,_,S,A,R,B,M,T,P,E,k,L,H,F,z,I,O,D,W,N,G,j,U,V,$,Y,X,Z,q;const J=t._getCellStyle(r,s),Q=vS("padding",J,r,s,t);K(Q)&&(d=Q),(null===(C=null==v?void 0:v.text)||void 0===C?void 0:C.textAlign)&&(c=null===(y=null==v?void 0:v.text)||void 0===y?void 0:y.textAlign),(null===(w=null==v?void 0:v.text)||void 0===w?void 0:w.textBaseline)&&(u=null===(x=null==v?void 0:v.text)||void 0===x?void 0:x.textBaseline);const tt=t.isAutoRowHeight(s),et="auto"===l,it=null!==(_=J.autoWrapText)&&void 0!==_?_:t.internalProps.autoWrapText,ot=J.lineClamp,rt=mS(r,s,v,t);let st;if(b&&(st=t.scenegraph.getCell(r,s,!0),st&&"cell"===st.role&&st.setAttributes({x:o,y:n,width:a,height:h,lineWidth:null!==(A=null===(S=null==v?void 0:v.group)||void 0===S?void 0:S.lineWidth)&&void 0!==A?A:void 0,fill:null!==(B=null===(R=null==v?void 0:v.group)||void 0===R?void 0:R.fill)&&void 0!==B?B:void 0,stroke:null!==(T=null===(M=null==v?void 0:v.group)||void 0===M?void 0:M.stroke)&&void 0!==T?T:void 0,strokeArrayWidth:null!=rt?rt:void 0,strokeArrayColor:null!==(E=null===(P=null==v?void 0:v.group)||void 0===P?void 0:P.strokeArrayColor)&&void 0!==E?E:void 0,cursor:null!==(L=null===(k=null==v?void 0:v.group)||void 0===k?void 0:k.cursor)&&void 0!==L?L:void 0,lineDash:null!==(F=null===(H=null==v?void 0:v.group)||void 0===H?void 0:H.lineDash)&&void 0!==F?F:void 0,lineCap:"butt",clip:!0,cornerRadius:v.group.cornerRadius})),st&&"cell"===st.role||(st=new uS({x:o,y:n,width:a,height:h,lineWidth:null!==(I=null===(z=null==v?void 0:v.group)||void 0===z?void 0:z.lineWidth)&&void 0!==I?I:void 0,fill:null!==(D=null===(O=null==v?void 0:v.group)||void 0===O?void 0:O.fill)&&void 0!==D?D:void 0,stroke:null!==(N=null===(W=null==v?void 0:v.group)||void 0===W?void 0:W.stroke)&&void 0!==N?N:void 0,strokeArrayWidth:null!=rt?rt:void 0,strokeArrayColor:null!==(j=null===(G=null==v?void 0:v.group)||void 0===G?void 0:G.strokeArrayColor)&&void 0!==j?j:void 0,cursor:null!==(V=null===(U=null==v?void 0:v.group)||void 0===U?void 0:U.cursor)&&void 0!==V?V:void 0,lineDash:null!==(Y=null===($=null==v?void 0:v.group)||void 0===$?void 0:$.lineDash)&&void 0!==Y?Y:void 0,lineCap:"butt",clip:!0,cornerRadius:v.group.cornerRadius}),st.role="cell",st.col=r,st.row=s,null==i||i.addCellGroup(st)),p&&st.appendChild(p),f){const i=e;let o;if(g){let e=r,i=s;m&&(e=m.start.col,i=m.start.row),o=t.getCellIcons(e,i)}if(function(t,e,i,o,n,r,s,l,a,h,d,c,u,g,p){var f,v,m,b,C,y,w,x,_;let S,A=0,R=0,B=0;if(Array.isArray(e)&&0!==e.length){const{inlineFrontIcons:f,inlineEndIcons:v,contentLeftIcons:m,contentRightIcons:M,leftIconWidth:T,rightIconWidth:P,absoluteRightIconWidth:E}=AS(e,t,p,u);let k;if(A=T,R=P,B=E,0===f.length&&0===v.length){let e=0;nt(u.theme._contentOffset)&&("left"===d?e=u.theme._contentOffset:"right"===d&&(e=-u.theme._contentOffset));const c=p?CS(p.start.col,p.start.row,u):CS(t.col,t.row,u),{text:f,moreThanMaxCharacters:v}=yS(i,u),w={text:1===f.length?f[0]:f,moreThanMaxCharacters:v,maxLineWidth:n?1/0:a-(o[1]+o[3])-A-R-c,textBaseline:"top",heightLimit:!1===(null===(b=u.options.customConfig)||void 0===b?void 0:b.limitContentHeight)||r&&!(null===(C=u.options.customConfig)||void 0===C?void 0:C.multilinesForXTable)?-1:h-Math.floor(o[0]+o[2]),pickable:!1,autoWrapText:s,lineClamp:l,wordBreak:"break-word",whiteSpace:!1===(null===(y=u.options.customConfig)||void 0===y?void 0:y.limitContentHeight)||1!==f.length||s?"normal":"no-wrap",dx:("left"===d?m.length?0:c:0)+e},x=new Ih(g.text?Object.assign({},g.text,w):w);x.name="text",k=x}else{const e=Object.assign({text:null==i?void 0:i.toString()},(null===(_=null===(x=null===(w=t.parent)||void 0===w?void 0:w.theme)||void 0===x?void 0:x.userTheme)||void 0===_?void 0:_.text)||{});g.text&&Object.assign(e,g.text),e.textBaseline="middle";const l=[...f.map((t=>xS(t))),e,...v.map((t=>xS(t)))];l[0].textAlign=d;const u=new uc({width:n?0:a-(o[1]+o[3])-A-R,height:r&&s?0:Math.ceil(h-(o[0]+o[2])),textConfig:l,verticalDirection:r&&s?"top":c,ellipsis:e.ellipsis});u.name="text",k=u,u.bindIconEvent(),!p||p.start.col===p.end.col&&p.start.row===p.end.row||(u.onBeforeAttributeUpdate=RS)}if(0!==m.length||0!==M.length){const e=new bS({x:0,y:0,fill:!1,stroke:!1,pickable:!1});e.name="content",e.setCellContentOption({autoWidth:n,autoHeight:r,cellWidth:a-(o[1]+o[3])-A-R,cellHeight:h-(o[0]+o[2]),align:d,baseline:c});const i={addedHierarchyOffset:0};m.forEach((o=>{const n=wS(o,void 0,t.col,t.row,p,u,i);n.role="icon-content-left",n.name=o.name,e.addLeftOccupyingIcon(n)})),M.forEach((o=>{const n=wS(o,void 0,t.col,t.row,p,u,i);n.role="icon-content-right",n.name=o.name,e.addRightOccupyingIcon(n)})),e.addContent(k),t.appendChild(e),e.layout(),S=e.AABBBounds.width(),e.AABBBounds.height()}else t.firstChild?t.insertBefore(k,t.firstChild):t.appendChild(k),S=k.AABBBounds.width(),k.AABBBounds.height()}else if(K(i)){const{text:e,moreThanMaxCharacters:b}=yS(i,u),C=p?CS(p.start.col,p.start.row,u):CS(t.col,t.row,u);let y=0;nt(u.theme._contentOffset)&&("left"===d?y=u.theme._contentOffset:"right"===d&&(y=-u.theme._contentOffset));const w={text:1===e.length?e[0]:e,moreThanMaxCharacters:b,maxLineWidth:n?1/0:a-(o[1]+o[3]+C),textBaseline:"top",autoWrapText:s,lineClamp:l,wordBreak:"break-word",heightLimit:!1===(null===(f=u.options.customConfig)||void 0===f?void 0:f.limitContentHeight)||r&&!(null===(v=u.options.customConfig)||void 0===v?void 0:v.multilinesForXTable)?-1:h-Math.floor(o[0]+o[2]),pickable:!1,dx:("left"===d?C:0)+y,whiteSpace:!1===(null===(m=u.options.customConfig)||void 0===m?void 0:m.limitContentHeight)||1!==e.length||s?"normal":"no-wrap"},x=new Ih(g.text?Object.assign({},g.text,w):w);x.name="text",x.textBaseline=c,t.appendChild(x),S=x.AABBBounds.width(),x.AABBBounds.height()}const M=n?A+S+R:a-(o[1]+o[3]),T=h-(o[0]+o[2]);t.forEachChildren((t=>{"icon-left"===t.role?t.setAttribute("x",t.attribute.x+o[3]):"icon-right"===t.role?t.setAttribute("x",t.attribute.x+M-R+o[3]):"icon-absolute-right"===t.role?t.setAttribute("x",t.attribute.x+M-B+o[3]+o[1]):"content"!==t.name&&"text"!==t.name||("center"===d&&"richtext"!==t.type?t.setAttribute("x",o[3]+A+(M-A-R)/2):"right"===d&&"richtext"!==t.type?t.setAttribute("x",o[3]+M-R):t.setAttribute("x",o[3]+A))})),t.forEachChildren((t=>{t.name!==T_&&("middle"===c?t.setAttribute("y",o[0]+(T-t.AABBBounds.height())/2):"bottom"===c?t.setAttribute("y",o[0]+T-t.AABBBounds.height()):t.setAttribute("y",o[0]))})),t.setAttributes({width:M+o[1]+o[3],height:T+o[0]+o[2]})}(st,o,i,d,et,tt,it,"number"==typeof ot?ot:void 0,st.attribute.width,st.attribute.height,c,u,t,v,m),null===(X=null==v?void 0:v._vtable)||void 0===X?void 0:X.marked){const t=Cc({x:st.attribute.width,y:0,startAngle:Math.PI/2,endAngle:Math.PI,outerRadius:6,fill:"#3073F2",pickable:!1});t.name="mark",st.appendChild(t)}}return p&&st.setAttributes({width:Math.max(st.attribute.width,null!==(Z=p.attribute.width)&&void 0!==Z?Z:0),height:Math.max(st.attribute.height,null!==(q=p.attribute.height)&&void 0!==q?q:0)}),st}function RE(t,e,i,o,n,r,s,l,a,h){var d,c,u,g,p,f;t.dependField&&(n=null!==(c=null===(d=a.getCellOriginRecord(r,s))||void 0===d?void 0:d[t.dependField])&&void 0!==c?c:n),t.barType=null!==(u=t.barType)&&void 0!==u?u:"default",t.min=null!==(g=uw(t.min,{col:r,row:s,table:a,value:o,dataValue:n,cellHeaderPaths:void 0}))&&void 0!==g?g:0,t.max=null!==(p=uw(t.max,{col:r,row:s,table:a,value:o,dataValue:n,cellHeaderPaths:void 0}))&&void 0!==p?p:t.min+100;let v=0;v=h?a.getRowsHeight(h.start.row,h.end.row):a.getRowHeight(s);let m=i,b=v,C=0;nt(a.theme._contentOffset)&&(C=a.theme._contentOffset);const y=new uS({x:-C,y:-C,width:m,height:b});y.name="progress-bar";const{showBar:w,barColor:x,barBgColor:_,barPositiveColor:S,barNegativeColor:A,barAxisColor:R,barRightToLeft:B,showBarMark:M,barMarkPositiveColor:T,barMarkNegativeColor:P,barMarkWidth:E,barMarkPosition:k}=e;let{barHeight:L,barBottom:H,barPadding:F}=e;1===F.length?F=[F[0],F[0],F[0],F[0]]:2===F.length?F=[F[0],F[1],F[0],F[1]]:3===F.length&&(F=[F[0],F[1],F[2],F[1]]),F=F.map(((t,e)=>{if("string"==typeof t&&ww.endsWith(t,"%")){const o=Number(t.substr(0,t.length-1));return 0===e||2===e?v*o/100:i*o/100}return Number(t)}));const z=Fx(fS("borderLineWidth",e,r,s,a)),I=Math.max(F[0],Math.ceil(z[0]/2)),O=Math.max(F[1],Math.floor(z[1]/2)),D=Math.max(F[2],Math.floor(z[2]/2)),W=Math.max(F[3],Math.ceil(z[3]/2));m-=O+W,b-=D+I,s===a.rowCount-1&&[0,"0"].includes(H)&&(b-=1);const N=I,G=W,j=m;if("string"==typeof L&&ww.endsWith(L,"%")?(L=Number(L.substr(0,L.length-1)),L=b*L/100):L=Number(L),"string"==typeof H&&ww.endsWith(H,"%")?(H=Number(H.substr(0,H.length-1)),H=b*H/100):H=Number(H),uw(w,{col:r,row:s,table:a,context:null,value:o,dataValue:n})){let e=`${n}`;ww.endsWith(e,"%")&&(e=e.substr(0,e.length-1));const i=Number(e);if(isNaN(i))return y;if("default"===(null!==(f=t.barType)&&void 0!==f?f:"default")){const e=i<t.min?0:i>t.max?1:(i-t.min)/(t.max-t.min),l=m,h=N+b-L-H;let d=Math.min(l*e,l);const c=B?G+j-d:G;r!==a.colCount-1||1!==e||B||(d-=1);const u=uw(_,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:e});if(u){const t=ic({x:c,y:h,width:l,height:L,fill:u});y.addChild(t)}const g=ic({x:c,y:h,width:d,height:L,fill:uw(x,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:e})||"#20a8d8"});y.addChild(g)}else if("negative"===t.barType){const e=t.min<0?-t.min:0,l=t.max>0?t.max:0,h=e/(e+l),d=1-h,c=i>0?i/l:0,u=i<0?-i/e:0,g=m,p=N+b-L-H,f=G,C=uw(_,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c});if(C){const t=ic({x:f,y:p,width:g,height:L,fill:C});y.addChild(t)}const w=B?d*g:h*g,x=Math.min(g*h*u,g),F=B?{left:f+w,top:p,width:x,height:L}:{left:f+w-x,top:p,width:x,height:L},z=uw(A,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:u})||"#20a8d8",I=ic({x:F.left,y:F.top,width:F.width,height:F.height,fill:z});y.addChild(I);let O=Math.min(g*d*c,g);r!==a.colCount-1||1!==c||B||(O-=1);const D=B?{left:f+w-O,top:p,width:O,height:L}:{left:f+w,top:p,width:O,height:L},W=uw(S,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c})||"#20a8d8",j=ic({x:D.left,y:D.top,width:D.width,height:D.height,fill:W});y.addChild(j);const U=B?F.left:D.left,V=Qd({x:0,y:0,stroke:uw(R,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c}),lineWidth:1,lineDash:[2,2],points:[{x:U,y:0},{x:U,y:v}]});if(y.addChild(V),M&&(c||u)){const t=E,e=[];let i;if(c>0)if(i=uw(T,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:c})||"#20a8d8","right"===k){const t=B?D.left+E/2:D.left+D.width-E/2;e.push({x:t,y:D.top}),e.push({x:t,y:D.top+D.height})}else"bottom"===k&&(e.push({x:D.left,y:D.top+D.height-E/2}),e.push({x:D.left+D.width,y:D.top+D.height-E/2}));else if(u>0)if(i=uw(P,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:u})||"#20a8d8","right"===k){const t=B?F.left+F.width-E/2:F.left+E/2;e.push({x:t,y:F.top}),e.push({x:t,y:F.top+F.height})}else"bottom"===k&&(e.push({x:F.left,y:F.top+F.height-E/2}),e.push({x:F.left+F.width,y:F.top+F.height-E/2}));const l=Qd({x:0,y:0,stroke:i,lineWidth:t,points:e});y.addChild(l)}}else if("negative_no_axis"===t.barType){const e=t.min<0?-t.min:0,l=t.max>0?t.max:0,h=Math.max(e,l),d=0===h?0:Math.abs(i)/h,c=m;let u=Math.min(c*d,c);r!==a.colCount-1||1!==d||B||(u-=1);const g=N+b-L-H,p=B?G+j-u:G,f=uw(_,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d});if(f){const t=ic({x:p,y:g,width:c,height:L,fill:f});y.addChild(t)}const v={left:p,top:g,width:u,height:L};let C;C=i>=0?uw(S,{col:r,row:s,table:a,context:null,value:o,percentile:d,dataValue:n})||"#20a8d8":uw(A,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d})||"#20a8d8";const w=ic({x:v.left,y:v.top,width:v.width,height:v.height,fill:C});if(y.addChild(w),M&&i){const t=E,e=[];let l;if(l=i>=0?uw(T,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d})||"#20a8d8":uw(P,{col:r,row:s,table:a,context:null,value:o,dataValue:n,percentile:d})||"#20a8d8","right"===k){const t=B?v.left+E/2:v.left+v.width-E/2;e.push({x:t,y:v.top}),e.push({x:t,y:v.top+v.height})}else"bottom"===k&&(e.push({x:v.left,y:v.top+v.height-E/2}),e.push({x:v.left+v.width,y:v.top+v.height-E/2}));const h=Qd({x:0,y:0,stroke:l,lineWidth:t,points:e});y.addChild(h)}}}return y}function BE(t,e,i,o,n,r){var s,l,a,h,d,c,u,g,p;if((null==i?void 0:i.zero)&&(t=Math.min(t,0),e=Math.max(e,0)),null==i?void 0:i.expand){const o=t,n=e;K(i.expand.min)&&(t=o-(n-o)*i.expand.min),K(i.expand.max)&&(e=n+(n-o)*i.expand.max)}let f,v;if(nt(null==i?void 0:i.min)&&(t=i.min),nt(null==i?void 0:i.max)&&(e=i.max),"log"===(null==i?void 0:i.type)?(f=new gC,f.base(null!==(s=null==i?void 0:i.base)&&void 0!==s?s:10)):"symlog"===(null==i?void 0:i.type)?(f=new pC,f.constant(null!==(l=null==i?void 0:i.constant)&&void 0!==l?l:10)):f=new hC,f.domain([t,e],!!(null==i?void 0:i.nice)),null==i?void 0:i.nice){let t=null!==(c=null!==(h=null===(a=i.tick)||void 0===a?void 0:a.forceTickCount)&&void 0!==h?h:null===(d=i.tick)||void 0===d?void 0:d.tickCount)&&void 0!==c?c:10;Y(t)&&(t=t({axisLength:n,labelStyle:null!==(g=null===(u=null==i?void 0:i.label)||void 0===u?void 0:u.style)&&void 0!==g?g:{fontSize:dP}})),"accurateFirst"===i.niceType&&(t=Math.max(10,t)),X(i.min)&&X(i.max)?f.nice(t):K(i.min)&&X(i.max)?f.niceMax(t):X(i.min)&&K(i.max)&&f.niceMin(t)}return delete f._niceType,r||(v=f.ticks(nt(null==i?void 0:i.tickCount)?null==i?void 0:i.tickCount:5,{noDecimals:null===(p=null==i?void 0:i.tick)||void 0===p?void 0:p.noDecimals})),{range:f.domain(),ticks:v}}rx.registerComponent("axis",MP),rx.registerFunction("computeAxisComponentWidth",TP),rx.registerFunction("computeAxisComponentHeight",PP),rx.registerFunction("getAxisConfigInPivotChart",HT),rx.registerComponent("emptyTip",LP),rx.registerFunction("createLegend",GP),rx.registerComponent("menuHandler",qP),rx.registerComponent("title",JP),rx.registerComponent("tooltipHandler",aE),rx.registerComponent("listTreeStickCellPlugin",hE),rx.registerFunction("createChartCellGroup",pE),rx.registerFunction("getAxisDomainRangeAndLabels",BE),rx.registerFunction("createCheckboxCellGroup",fE),rx.registerFunction("createImageCellGroup",BS),rx.registerFunction("createProgressBarCell",RE),rx.registerFunction("createRadioCellGroup",vE),rx.registerFunction("createSparkLineCellGroup",yE),rx.registerFunction("createTextCellGroup",AE),rx.registerFunction("createVideoCellGroup",SE);class ME extends CP{}function TE(t){const e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new t.constructor(+t):"number"==typeof t||"[object Number]"===e||"string"==typeof t||"[object String]"===e?new Date(t):new Date(NaN)}function PE(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function EE(t,e){const i=TE(t);return isNaN(e)?PE(t,NaN):e?(i.setDate(i.getDate()+e),i):i}function kE(t,e){const{years:i=0,months:o=0,weeks:n=0,days:r=0,hours:s=0,minutes:l=0,seconds:a=0}=e,h=TE(t),d=o||i?function(t,e){const i=TE(t);if(isNaN(e))return PE(t,NaN);if(!e)return i;const o=i.getDate(),n=PE(t,i.getTime());return n.setMonth(i.getMonth()+e+1,0),o>=n.getDate()?n:(i.setFullYear(n.getFullYear(),n.getMonth(),o),i)}(h,o+12*i):h,c=1e3*(a+60*(l+60*s));return PE(t,(r||n?EE(d,r+7*n):d).getTime()+c)}py();const LE=864e5;function HE(t){const e=TE(t);return e.setHours(0,0,0,0),e}function FE(t){const e=TE(t),i=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return i.setUTCFullYear(e.getFullYear()),+t-+i}function zE(t){let e;return t.forEach((function(t){const i=TE(t);(void 0===e||e<i||isNaN(Number(i)))&&(e=i)})),e||new Date(NaN)}function IE(t){let e;return t.forEach((t=>{const i=TE(t);(!e||e>i||isNaN(+i))&&(e=i)})),e||new Date(NaN)}function OE(t,e){const i=TE(t),o=TE(e),n=DE(i,o),r=Math.abs(function(t,e){const i=HE(t),o=HE(e),n=+i-FE(i),r=+o-FE(o);return Math.round((n-r)/LE)}(i,o));i.setDate(i.getDate()-n*r);const s=n*(r-Number(DE(i,o)===-n));return 0===s?0:s}function DE(t,e){const i=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return i<0?-1:i>0?1:i}function WE(t){const e=TE(t),i=e.getFullYear(),o=e.getMonth(),n=PE(t,0);return n.setFullYear(i,o+1,0),n.setHours(0,0,0,0),n.getDate()}function NE(t){const e=TE(t),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(0,0,0,0),e}function GE(t,e){let i=function(t){return TE(t).getDay()}(t)-e;return i<=0&&(i+=7),function(t,e){return EE(t,-e)}(t,i)}const jE=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function UE(t,e){const i=[];if(function(t,e){const i=TE(t),o=TE(e);return i.getTime()>o.getTime()}(t,e)){const i=t;t=e,e=i}const o=t.getFullYear(),n=t.getMonth(),r=e.getFullYear(),s=e.getMonth();let l=o,a=n;for(;l!==r||a<=s;){const t=new Date(l,a,1),e=WE(t);let o,n=t.getDay();0===i.length?0===n?(o={year:l,month:a},i.push(o)):0===a?(o={year:l-1,month:11},i.push(o)):(o={year:l,month:a-1},i.push(o)):0===n?(o={year:l,month:a},i.push(o)):o=i[i.length-1];for(let t=1;t<=e;t++)7===n&&(n=0,o={year:l,month:a},i.push(o)),VE(o,n,t),n+=1;a+=1,12===a&&(a=0,l+=1)}return i}function VE(t,e,i){switch(e){case 0:t.Sun=i;break;case 1:t.Mon=i;break;case 2:t.Tue=i;break;case 3:t.Wed=i;break;case 4:t.Thu=i;break;case 5:t.Fri=i;break;case 6:t.Sat=i}}const $E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function YE(t){return $E[t%$E.length]}const XE=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function KE(t){const{table:e,row:i,col:o,rect:n}=t,r=e.options._calendar,{height:s,width:l}=n??e.getCellRect(o,i),a=r.getCellDate(o,i),h=r.customHandler.getCellCustomEvent(o,i),{contentHeight:d,barHeight:c,fontSize:u,contentPadding:g,barCornerRadius:p,circleRadius:f}=r.customHandler.customEventOptions;if(!h)return;const v=e.theme.bodyStyle.fontSize+10,m=new cs({x:0,y:v,height:s-v,width:l}),{keys:b,values:C}=h,y=b[b.length-1];let w=0;for(let t=0;t<=y;t++){const e=C[t];if(e)if("list"===e.type){const t=new cs({x:0,y:w,width:l,height:d,fill:!1,stroke:!1,clip:!0,cursor:"pointer"});m.add(t),t._role="calendar-custom-event",t._customEvent=e;const i=new Lh({radius:f,fill:e.color,x:g+f,y:d/2,pickable:!1});t.add(i);const o=new Ih({x:g+2*f+g,y:d/2,text:e.text,fontSize:u,fill:e.color,textAlign:"left",textBaseline:"middle",pickable:!1});t.add(o)}else{const{startDate:t,endDate:i}=e,o=new cs({x:0,y:w,width:l,height:d,fill:!1,stroke:!1,clip:!0,cursor:"pointer"});m.add(o),o._role="calendar-custom-event",o._customEvent=e;const n=new ec({x:0,y:(d-c)/2,width:l,height:c,fill:e.bgColor,cornerRadius:ZE(t,i,a,p),pickable:!1});o.add(n);const r=OE(HE(t),HE(a)),s=new Ih({x:g,y:d/2,dx:r*l,text:e.text,fontSize:u,fill:e.color,textAlign:"left",textBaseline:"middle",pickable:!1});o.add(s)}else{const t=new cs({x:0,y:w,width:l,height:d,fill:!1,stroke:!1,clip:!0});m.add(t)}w+=d}return{rootContainer:m,renderDefault:!0}}function ZE(t,e,i,o){return t.getDate()===e.getDate()?o:t.getDate()===i.getDate()?[o,0,0,o]:e.getDate()===i.getDate()?[0,o,o,0]:0}const qE="custom-container";class JE{calendar;cellEvents=new Map;events=[];customEventOptions;constructor(t,e){this.calendar=t,this.customEventOptions=yt({contentHeight:24,barHeight:18,fontSize:14,contentPadding:5,barCornerRadius:5,circleRadius:5},e)}getCellCustomEvent(t,e){return this.cellEvents.get(`${t}-${e}`)}setCellCustomEvent(t,e,i){this.cellEvents.set(`${t}-${e}`,i)}addEvent(t){const{date:e,startDate:i,endDate:o}=t;if(e||i&&o){if("list"===t.type){const i=this.calendar.getCellLocation(e);if(!i)return;const{col:o,row:n}=i,r={...t,col:o,row:n,index:0},s=this.getCellCustomEvent(o,n);if(!s){const e={keys:[0],values:{0:r}};return this.setCellCustomEvent(o,n,e),this.calendar.table.scenegraph.updateCellContent(o,n),void this.events.push(t)}const l=s.keys;if(0===l.length)return s.keys.push(0),s.values[0]=r,this.calendar.table.scenegraph.updateCellContent(o,n),void this.events.push(t);let a=!1;for(let t=0;t<l[l.length-1];t++)if(!s.values[t]){r.index=t,l.push(t),l.sort(((t,e)=>t-e)),s.values[t]=r,a=!0;break}if(!a){const t=l[l.length-1]+1;r.index=t,s.keys.push(t),s.values[t]=r}this.calendar.table.scenegraph.updateCellContent(o,n)}else{const e=this.calendar.getCellLocation(zE([i,this.calendar.startDate])),n=this.calendar.getCellLocation(IE([o,this.calendar.endDate]));if(!e||!n)return;let r=e.col,s=e.row,l=-1;for(;s<n.row||r<=n.col&&s===n.row;){const t=this.getCellCustomEvent(r,s);if(t){const e=t.keys,i=e[e.length-1];i>l&&(l=i)}r++,r>this.calendar.maxCol&&(r=this.calendar.minCol,s++)}for(r=e.col,s=e.row;s<n.row||r<=n.col&&s===n.row;){const e=this.getCellCustomEvent(r,s),i={...t,col:r,row:s,index:l+1};if(e){const t=e.keys;t.push(l+1),t.sort(((t,e)=>t-e)),e.values[l+1]=i}else{const t={keys:[l+1],values:{[l+1]:i}};this.setCellCustomEvent(r,s,t)}this.calendar.table.scenegraph.updateCellContent(r,s),r++,r>this.calendar.maxCol&&(r=this.calendar.minCol,s++)}}this.events.push(t)}}addEvents(t){t.forEach((t=>{this.addEvent(t)}))}removeEvents(t){t.forEach((t=>{this._removeEvent(t)}));const e=this.events.filter((e=>!e.id||!t.includes(e.id)));this.events.length=0,this.cellEvents.clear(),e.forEach((t=>{this.addEvent(t)}))}_removeEvent(t){if(!t)return;const e=this.events.find((e=>e.id===t));if(!e)return;const{date:i,startDate:o,endDate:n}=e;if("list"===e.type){const{col:t,row:e}=this.calendar.getCellLocation(i),o=this.calendar.table.scenegraph.getCell(t,e),n=o.getChildByName(qE);n&&o.removeChild(n)}else{const t=this.calendar.getCellLocation(zE([o,this.calendar.startDate])),e=this.calendar.getCellLocation(IE([n,this.calendar.endDate]));let i=t.col,r=t.row;for(;r<e.row||i<=e.col&&r===e.row;){const t=this.calendar.table.scenegraph.getCell(i,r),e=t.getChildByName(qE);e&&t.removeChild(e),i++,i>this.calendar.maxCol&&(i=this.calendar.minCol,r++)}}}updateEvents(t){t.forEach((t=>{this._removeEvent(t.id);yt(this.events.find((e=>e.id===t.id)),t)}));const e=this.events;this.events=[],this.cellEvents.clear(),e.forEach((t=>{this.addEvent(t)}))}}const QE={CALENDAR_DATE_CLICK:"calendar_date_click",SELECTED_DATE:"selected_date",SELECTED_DATE_CLEAR:"selected_date_clear",DRAG_SELECT_DATE_END:"drag_select_date_end",CALENDAR_CUSTOM_EVENT_CLICK:"calendar_custom_event_click"};t.CALENDAR_EVENT_TYPE=QE,t.Calendar=class extends Ry{container;options;table;startDate;endDate;currentDate;rangeDays;tableStartDate;records;currentMonthCellRanges;currentMonth;currentYear;titleClickHandler;maxCol;minCol=0;customHandler;constructor(t,e){super(),this.container=t,this.options=e??{};const{startDate:i,endDate:o,currentDate:n,rangeDays:r}=this.options;if(this.currentDate=n??new Date,this.rangeDays=r??90,i&&o)this.startDate=i,this.endDate=o;else{const{startDate:t,endDate:e}=function(t,e){const i=EE(t,-e);return i.setDate(1),{startDate:i,endDate:NE(EE(t,e))}}(this.currentDate,this.rangeDays);this.startDate=i??t,this.endDate=o??e}this.tableStartDate=0===this.startDate.getDay()?this.startDate:GE(this.startDate,0),this.customHandler=new JE(this,e?.customEventOptions),this._createTable(),this._bindEvent(),this.options.customEvents&&this.addCustomEvents(this.options.customEvents)}_createTable(){const{dayTitles:t}=this.options,e=UE(this.startDate,this.endDate);this.records=e;const i=t??jE;this.maxCol=i.length-1;const o=function(t,e,i){const o=t.map(((t,i)=>({field:jE[i],title:t,fieldFormat:i=>{if(i.year===e.getFullYear()&&i.month===e.getMonth()&&i[t]===e.getDate())return`${i[t]}\nToday`;if(1===i[t]){const e=YE("Sun"===t?i.month:i.month+1);return`${i[t]}\n${e}`}return i[t]},customLayout:KE}))),n=Math.floor((i.containerHeight-((i.tableOptions?.title?.textStyle?.fontSize??20)+(i.tableOptions?.title?.subtextStyle?.fontSize??16)+1)-(i.tableOptions?.defaultHeaderRowHeight??40))/5);var r;return{...i.tableOptions??{},columns:o,defaultRowHeight:n??120,defaultHeaderRowHeight:i.tableOptions?.defaultHeaderRowHeight??40,widthMode:"adaptive",columnResizeMode:"none",theme:Qw.extends(yt({headerStyle:{textAlign:"center"},bodyStyle:{bgColor:t=>{const{col:i,row:o,dataValue:n,table:r}=t,s=r.getCellRawRecord(i,o),l=n,a=s.Sun>n?s.month+1:s.month;return(11===s.month&&s.Sun>n?s.year+1:s.year)===e.getFullYear()&&a===e.getMonth()&&l===e.getDate()?"#f0f0f0":"#fff"},textAlign:"right",textBaseline:"top",color:"#999"}},i.tableOptions?.theme)),title:{...i.tableOptions?.title??{},orient:"top",text:`${r=e.getDay(),XE[r%XE.length]}, ${YE(e.getMonth())} ${e.getDate()}`,subtext:e.getFullYear()},enableLineBreak:!0,customCellStyle:[{id:"current-month",style:{color:"#000"}}]}}(i,this.currentDate,{tableOptions:this.options.tableOptions,containerWidth:this.container.clientWidth,containerHeight:this.container.clientHeight});o.records=e,o.container=this.container,o._calendar=this;const n=new ME(o);this.table=n,n.addEventListener("scroll",(()=>{const t=this.getYearAndMonth();if(!t.Sun)return void this._updateMonthCustomStyle(this.startDate.getFullYear(),this.startDate.getMonth());const e=kE(new Date(t.year,t.month,t.Sun),{days:13});this._updateMonthCustomStyle(e.getFullYear(),e.getMonth())})),n.addEventListener("scroll_vertical_end",(()=>{this._updateMonthCustomStyle(this.endDate.getFullYear(),this.endDate.getMonth())})),this.jumpToCurrentMonth()}getYearAndMonth(){const t=this.table.tableX+10,e=this.table.tableY+this.table.getFrozenRowsHeight()+10,i=this.table.getCellAtRelativePosition(t,e),{row:o}=i;return this.table.getCellRawRecord(0,o)}jumpToDate(t,e){t=HE(t);const i=Math.floor((OE(t,this.tableStartDate)+1)/7);this.table.scrollToCell({col:0,row:i+1},e),this._updateMonthCustomStyle(t.getFullYear(),t.getMonth())}jumpToCurrentMonth(t){const e=new Date(this.currentDate.getTime());e.setDate(1),this.jumpToDate(e,t)}_updateMonthCustomStyle(t,e){this.currentMonth===e&&this.currentYear===t||(this.currentMonthCellRanges?.forEach((t=>{this.table.arrangeCustomCellStyle(t,null)})),this.currentMonth=e,this.currentYear=t,this.currentMonthCellRanges=function(t,e,i,o){const n=new Date(t,e,1),r=Math.floor((OE(n,i)+1)/7),s=o[r],l=NE(n),a=Math.floor((OE(l,i)+1)/7),h=o[a],d=[{range:{start:{col:0,row:r+1+1},end:{col:6,row:a}}}];let c,u;1===s.Sun?c=0:1===s.Mon?c=1:1===s.Tue?c=2:1===s.Wed?c=3:1===s.Thu?c=4:1===s.Fri?c=5:1===s.Sat&&(c=6),d.push({range:{start:{col:c,row:r+1},end:{col:6,row:r+1}}});const g=l.getDate();return h.Sun===g?u=0:h.Mon===g?u=1:h.Tue===g?u=2:h.Wed===g?u=3:h.Thu===g?u=4:h.Fri===g?u=5:h.Sat===g&&(u=6),d.push({range:{start:{col:0,row:a+1},end:{col:u,row:a+1}}}),d}(t,e,this.tableStartDate,this.records),this.currentMonthCellRanges.forEach((t=>{this.table.arrangeCustomCellStyle(t,"current-month")})))}fireListeners(t,e){return super.fireListeners(t,e)}on(t,e){return super.on(t,e)}_bindEvent(){const t=this.table.internalProps.title.getComponentGraphic();t.setAttributes({cursor:"pointer",childrenPickable:!1}),this.titleClickHandler=(()=>{this.jumpToCurrentMonth({duration:500})}).bind(this),t.addEventListener("click",this.titleClickHandler),this.table.on("click_cell",(t=>{const{target:e}=t;"calendar-custom-event"===e._role?this.fireListeners(QE.CALENDAR_CUSTOM_EVENT_CLICK,{tableEvent:t,date:this.getCellDate(t.col,t.row),customEvent:e._customEvent}):this.table.isHeader(t.col,t.row)||this.fireListeners(QE.CALENDAR_DATE_CLICK,{tableEvent:t,date:this.getCellDate(t.col,t.row)})})),this.table.on("selected_cell",(t=>{this.table.isHeader(t.col,t.row)||this.fireListeners(QE.SELECTED_DATE,{tableEvent:t,date:this.getCellDate(t.col,t.row)})})),this.table.on("selected_clear",(()=>{this.fireListeners(QE.SELECTED_DATE_CLEAR,void 0)})),this.table.on("drag_select_end",(t=>{const{cells:e}=t,i=[];e.map((t=>{t.map((t=>{this.table.isHeader(t.col,t.row)||i.push(this.getCellDate(t.col,t.row))}))})),this.fireListeners(QE.DRAG_SELECT_DATE_END,{tableEvent:t,dates:i})}))}release(){this.table.release()}getCellLocation(t){t=HE(t);return{row:Math.floor((OE(t,this.tableStartDate)+1)/7)+1,col:t.getDay()}}getCellDate(t,e){return kE(this.tableStartDate,{days:7*(e-1)+t})}get selectedDate(){const t=this.table.getSelectedCellInfos();if(!et(t)||0===t.length)return[];const e=[];return t.map((t=>{t.map((t=>{this.table.isHeader(t.col,t.row)||e.push({date:this.getCellDate(t.col,t.row),col:t.col,row:t.row})}))})),e}addCustomEvent(t){this.customHandler.addEvent(t),this.table.scenegraph.updateNextFrame()}removeCustomEvent(t){this.customHandler.removeEvents([t]),this.table.scenegraph.updateNextFrame()}updateCustomEvent(t){this.customHandler.updateEvents([t]),this.table.scenegraph.updateNextFrame()}addCustomEvents(t){this.customHandler.addEvents(t),this.table.scenegraph.updateNextFrame()}removeCustomEvents(t){this.customHandler.removeEvents(t),this.table.scenegraph.updateNextFrame()}updateCustomEvents(t){this.customHandler.updateEvents(t),this.table.scenegraph.updateNextFrame()}getCellCustomEventByDate(t){const e=this.getCellLocation(t);return this.getCellCustomEventByLocation(e.col,e.row)}getCellCustomEventByLocation(t,e){const i=this.customHandler.getCellCustomEvent(t,e),o=[];return i?.keys.forEach((t=>{o.push(i.values[t])})),o}}}));
|